A simple Discord bot written in Python, which speaks like my cat and also provides random boba drink recommendations.
- A Discord Bot - you can create one for free through the developer portal by creating a new application
- A Discord Server which you are an admin of
- python3
- virtualenv
- (optional) A Google Cloud VM instance to host the bot on
├── bot.py -> main entrypoint for the bot
├── lib/ -> contains additional files to support commands
│ ├── __init__.py
│ ├── teatime.cfg -> Context Free Grammar (CFG) file to define potential boba drinks
│ ├── cfg.py -> defines classes for defining a CFG
│ ├── random_cfg_deriver.py -> contains logic to randomly derive a string from the cfg
├── requirements.txt -> list of dependencies
├── README.md
├── sample.jpg -> sample of what the bot looks like in Discord
└── .gitignore
- SSH into your VM instance
- Install tmux or a terminal multiplexer of your choice
- Clone this repository and follow the rest of the instructions to set up
- Ensure to run the last step (python bot.py) while you are in a terminal multiplexer session
python3 -m venv /path/to/venv
source /path/to/venv/bin/activate
pip install -r requirements.txt
The .env file should contain your guild ID and your super secret Discord bot token.
.env has already been added to the .gitignore file in this repo.
GUILD_ID=<Your_Guild_ID>
DISCORD_TOKEN=<Your_DiscordBot_Token>
Ensure your bot has the "Send Messages" text permission enabled when you invite it to your server.
If you don't have a Discord bot yet, follow their instructions here up until you complete the "Installing your App" section.
python bot.py