This is a Discord bot written in Python using discord.py that features various commands listed here. The commands are written as cogs found in the modules folder and can be easily implemented into an existing bot.
- Python 3.6+
- discord.py
- requests
- wikipedia
- translate
- python-dotenv
Download or clone the respository
git clone https://github.com/gkvong/Discord-Bot
To install any required dependencies:
pip install -r requirements.txt
- Create an account for the Discord developer portal.
- Create a new application.
- Navigate to Bot on the left sidebar and add a bot.
- Navigate to the OAuth2 tab on the left sidebar and select the
bot
box in the SCOPES section. - In the BOT PERMISSIONS section select the permissions you want the bot to have. Recommended minimum permissions are all the boxes under TEXT PERMISSIONS and
View Channels
.
- In the Discord developer portal navigate to Bot.
- Copy the token and replace
[PASTE YOUR DISCORD BOT TOKEN HERE]
in .env with the token.
- Create an account and sign in at openweathermap.org.
- On the top navigation bar, click on your username and go to My API keys.
- Copy the key and replace
[PASTE YOUR OPENWEATHERMAP API ID HERE]
in .env with the token.
To run the bot, execute main.py:
python main.py
Command | Description |
---|---|
$help | Provides a brief description of the bot commands. |
$ping | Get the latency of the bot. |
$minesweeper | Play a game of minesweeper. |
$trivia | Start a game of trivia. |
$define <query> | Search for a definition from Google Dictionary. |
$wiki <query> | Get the first few sentences of a Wikipedia page. |
$translate <to> <from> <text> | Translate a message. |
$weather <city> | Get the current weather in a city. |
$forecast | Get the 7-day Sydney weather forecast. |
Thanks to DeCoded-Void for Minesweeper_discord.py where a large portion of the code in the minesweeper module was taken from.