DISCORD.PY
TRIVIA GAME BOT!!!
Gamers are y’all ready?
acmcsuf.com/discord-workshop
01
02
03
04
GAME PLAN
SETTING UP
TESTING
CODE-ALONG
REVIEW
Getting some bot code up
Writing the bot commands
See if the bot works!
Go over what we learned
acmcsuf.com/discord-workshop
SETTING UP
01
Let’s set up our Discord Bot together!
acmcsuf.com/discord-workshop
Setup Steps
Write a discord.py bot!
Create a bot token and�a test server
Install discord.py and�the bot token
DISCORD
CODE
PYTHON
acmcsuf.com/discord-workshop
acmcsuf.com/discord-workshop
Bot Template
To save time, let’s grab the bot template!
acmcsuf.com/discord-workshop
Installing Python
Nix ❄️
|
Replit ⠕ Fork acmcsuf.com/discord-workshop-replit (template included) |
Locally 💻 Clone the template, then enter the Python virtualenv, then run pip install. Local installation will not be covered. Use Nix ❄️ if you don’t already know this! |
acmcsuf.com/discord-workshop
CODE-ALONG
02
Let’s being coding up our bot!
acmcsuf.com/discord-workshop
TESTING
03
Let’s see if our bot really works now!
acmcsuf.com/discord-workshop
REVIEW
04
What have we learned so far?
acmcsuf.com/discord-workshop
Creating A Command Tree
.
├── /join
├── /start
│ ├── amount
│ ├── category
│ └── difficulty
├── /answer
└── answer
acmcsuf.com/discord-workshop
Sending Embed Messages
acmcsuf.com/discord-workshop
Ideas to Further your Bot
/restart
/leaderboard
/hint
Restart your game using a slash command instead of restarting your bot everytime!
Create a nice looking embed showcasing the leaderboard throughout the game!
Allow users to have only one hint throughout the game!
acmcsuf.com/discord-workshop
THANKS!
Please ask us questions!
Also join our Discord!
acmcsuf.com/discord @ #dev-chat
Workshop by acmDev
CREDITS: This presentation template was created by Slidesgo, including icons by Flaticon, and infographics & images by Freepik
Please mark your attendance!
acmcsuf.com/dev-attendance