Shenron is a Discord Bot designed to interact with users on Discord by answering commands and questions relating to the popular Dragon Ball franchise. In the Dragon Ball series, Shenron is a magical wish-granting dragon. The name of this Discord Bot comes from Shenron's ability to answer questions pertaining to almost anything within the Dragon Ball universe. The Shenron Discord Bot allows users to perform various actions within Discord such as adding or removing roles, in addition to allowing users to make use of additional Dragon Ball themed commands.
All commands require the "$" symbol before the command name to be recognized as a command by the Shenron Discord Bot.
- $roles command
- This command displays all roles available in the Discord server.
- $set_role command
- This command sets the user's role to the specified role.
- $rmv_role command
- This command removes the user's specified role.
- $db_fact command
- This command returns a random interesting fact about Dragon Ball.
- $chars command
- This command returns a list of characters in Dragon Ball.
- $db_character command
- This command returns a description of the specified character.
- Responding to Messages
- The Shenron Discord Bot is able to respond to messages regarding any questions about Dragon Ball.
Ensure that you have Python 3
or higher installed on your device. Note that Python 3.5.3
or higher is required for the discord.py API wrapper. Additionally, ensure you have added Python to your PATH variable on your operating system to be able to use Python commands in the terminal.
- First, create a Discord Bot account by logging in to the Discord website and then navigating to the application page.
- Create a new application and then go to the "Bot" tab and click "Add Bot" to create a new bot with default settings. After this has been done, copy the token which you will later have to enter in the Python bot code.
- Next, in order to invite your bot to join your Discord Server, go to the "OAuth2" tab and under the "scopes" section, check the box next to "Bot". Under the "permissions" section, give the bot the following permissions:
- View Channels
- Manage Channels
- Manage Roles
- Manage Emojis
- View Audit Log
- Manage Webhooks
- Manage Server
- Send Messages
- Embed Links
- Attach Files
- Add Reactions
- Use External Emoji
- Manage Messages
- Read Message History
- Manage Messages
- Mention Everyone
- After adding the necessary permissions, click the "copy" button above the "permissions" section and paste this link into a web browser. This will allow you to connect your bot to your Discord server. Note that your Discord account will need "Manage Server" permissions in order to add your bot to your Discord server.
Now you will need to install the discord.py API wrapper for Python in order to run the code for the bot.
- For macOS/Linux, use the following command:
python3 -m pip install -U discord.py
- For Windows, use the following command:
py -3 -m pip install -U discord.py
Next, git clone
this repostiory.
- If you plan to use a
.env
to store the token for the bot, follow the steps listed under (1.).- If you are going to use a
.env
file to store your token, make sure the.env
file is stored in the same directory as themain.py
file. - If you are using a
.env
file, install thePython-dotenv
package using the following command:pip install python-dotenv
. Note thatPython 3.4
or higher already comes with an installation of the pip package installer. - Open the main.py file and enter the token you previously copied where it says 'TOKEN':
- If you are going to use a
- If you don't plan to use a
.env
file to store your token, follow the steps listed under (2.).- Remove the following lines of code from
main.py
which include support for the use of a.env
file:
... from dotenv import load_dotenv # Remove this line ... load_dotenv() # Remove this line ... client.run(os.getenv('TOKEN')) # Change this line to --> client.run('TOKEN') # <-- Enter your token where it says TOKEN ...
- Remove the following lines of code from
Now use the cd
command on Command Prompt for Windows or Terminal for macOS/Linux to change the current directory to the location of the main.py
file.
Use the following command to run main.py
on Windows: py -3 main.py
Use the following command to run main.py
on macOS/Linux: python3 main.py
YOUR_BOT_USERNAME#XXXX
" which indicates that your bot is ready to be used.
The Shenron Discord Bot was developed in Python3 using the discord.py API wrapper and VSCode.
The entirety of this project was coded and developed by Harman Khehara.
This Discord Bot does not run forever, it runs for a continuous period of time when the associated Python script is run.