A Discord bot for vSPARC 2020.
@shardulc wants to eventually set this up such that pushing to master
automatically deploys the updated bot to the server where it's running and it becomes live. So, meanwhile, it's a good idea to do all development work in other branches and merge via PR. Ask @shardulc if you want write access to this repository and also if you want access to a testing server where you can test experimental changes without fear.
- Make sure you have Python 3.6+ installed, and then:
pip3 install -U google-api-python-client google-auth-httplib2 google-auth-oauthlib \
oauth2client discord.py python-dateutil humanize tabulate
- Clone this repository and in the same directory, make a file called
auth.json
which is a JSON file with the following structure:
{
"discord_auth_token": "<obtained in step 3>",
"google_api_auth": "<obtained in step 4>"
}
Don't make this file public! This file is in .gitignore
to reduce the chances of pushing it to GitHub by accident.
-
Go to https://discord.com/developers/applications and make a new application.
- Go to "Bot" settings and make a bot account.
- The "token" under the Bot page is what is stored in
auth.json
, under the keydiscord_auth_token
. This is different from the "client secret" in the main page. - Go to "OAuth2" settings and select the "bot" scope. Then, add the appropriate permissions: I think "Manage Roles", "View Channels", "Send Messages", "Embed Links", "Use External Emojis", and "Add Reactions" are needed right now. Then open the link that starts with
https://discord.com/api/oauth2/authorize
(right below the scopes box) and add the bot to a Discord server (ask @shardulc for access to a pre-existing testing server!).
-
(Remind @shardulc to fill this in later. You can leave it blank in
auth.json
for now.) -
Remember to make a new branch if you are working on new features:
git checkout -b new-branch-name
- Run the bot with
python3 SPARCbot.py
.
- Some functioning code already exists for a Google Calendar integration. Iron it out and make sure it does what people want it to do.
- Automatically keep track of bets! Will probably need a form of persistent storage that doesn't reset when the bot is restarted. Even better if this persistent storage is actually a Google Spreadsheet also accessible to humans.
- Checking whether roles exist on the server and whether a member has certain roles is a little befuddled right now, and there is code duplication / code is not well-organized. Come up with a better way to do this. Maybe using bot-, cog-, and command-level checks.
- Add Easter eggs? Or rather, secular diet-inclusive surprises.