Skip to content

Shenron is a Discord Bot designed to interact with users on Discord by answering commands and questions relating to the popular Dragon Ball franchise.

Notifications You must be signed in to change notification settings

harman-khehara/Shenron-Discord-Bot

Repository files navigation

Shenron - Discord Bot 🤖

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.

Table of Contents

Features & Functionality

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.

Installation Requirements

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.

  1. First, create a Discord Bot account by logging in to the Discord website and then navigating to the application page.
  2. 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.
  3. 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
  4. 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.

  1. 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 the main.py file.
    • If you are using a .env file, install the Python-dotenv package using the following command: pip install python-dotenv. Note that Python 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':
  2. 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
      
      ...
    

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

When the above commands are complete, you should see "Successfully logged in as YOUR_BOT_USERNAME#XXXX" which indicates that your bot is ready to be used.

Technical Framework

The Shenron Discord Bot was developed in Python3 using the discord.py API wrapper and VSCode.

Contributors

The entirety of this project was coded and developed by Harman Khehara.

Notes

This Discord Bot does not run forever, it runs for a continuous period of time when the associated Python script is run.

About

Shenron is a Discord Bot designed to interact with users on Discord by answering commands and questions relating to the popular Dragon Ball franchise.

Topics

Resources

Stars

Watchers

Forks

Languages