- This discord bot uses python version 3
- You can install
requirements.txt
or - The following libraries need to be installed for the bot to function, via pip
pip install discord
pip install -U discord-py-slash-command
pip install --upgrade Pillow
- Head to the discord developer portal and create a new application
- On the
Bot
side page, enable intents - On the
OAuth2
side page, specify scopes corresponding to the scope required by the bot- If the administrator permission cannot be enabled (may need discord server owner permissions) then only check the respective permissions used by the bot
- Copy the link and invite to created Scunt discord
- (optional) On the
Bot
side page change theICON
andUSERNAME
- On the
Bot
side page copy theTOKEN
for thekeys.json
- Create a
keys.json
file in the root of the repository using the template below - Add the
MONGOURI
to access the registration database, and add all server IDs where the bot would connect to in theguildIDs
list - Get server ID by right clicking the server name,
Copy ID
SERVERID
: intTOKEN
andMONGOURI
: str- Ensure this is added to
.gitignore
{ "clientToken": "TOKEN", "guildIDs":[SERVERID, SERVERID], "mongoURI": "MONGOURI" }
- Create a
-
Add the following roles to the discord channel
Add:
Team 1
,Team 2
,Team 3
,Team 4
,Team 5
,Team 6
,Team 7
,Team 8
roles - As defined underteamRoles
inconstants.json
Add:
Logged In
role - As defined under theloggedInRole
inconstants.json
Create a
#welcome
text channel - As defined under thewelcomeChannel
inconstants.json
All invites to the Scunt server should redirect to this text channel
-
Manage permissions manually in the Discord server settings, for access to specific team text/audio channels
-
Ensure the permission
BOTNAME
automatically created by discord is at the top of the hierarchy within the server... otherwise setting nickname and roles may return403 Forbidden (error code: 50013): Missing Permissions
(see image below - ensure Bot role is above other roles otherwise it may not be able to assign the roles higher than itself) -
Users with the
Logged In
role should not have access to type messages in the#welcome
channel
/login <email>
- Adds a user to the respective team roles within the server, sets theLogged In
role, and sets nickname to preferred name and appends pronouns/status <number>
- Retrieves and displays the status of a challenge. Can be submitted, not submitted, pending, or completed. When completed, judges comments, points earned etc. will return./help
- DMs the user with commands the bot can do/leaderboard
- DMs the user with the current score of all the teams (in a nice generated image)/missions
- DMs the user with the list of challenges, or provides a link to the website/pdf (supplied inconstants.json
)
- Accesses the registration database to retrieve information on a user after login to the discord. Retrieves users name, pronouns, Scunt team, etc.
- Submissions and status updates on challenges
- Challenges get forwarded to the judges automatically
- the bot can only send DMs to people who have shared server DMs setting enabled in their profile (is there a way to check if this is the case, and send an error message in the server instead of failing)
- Implement automatic feedback functionality (below)
- Status updates - DMs the user the status command if the status of a challenge they submitted changes. Usually updated the submitter with info on points rewarded and judge comments.
- Upload updates - DMs the user with information on the content they just submitted, as a confirmation