A Simple Discord Bot with an User Stats System (Level, EXP and Ranks) using the discord.py libary and a MySQL-Databse. It can be easily expanded with the Discord Stats Web Panel , which I also developed.
While this is easy to use, I recommend it as a base for a Discord Bot rather than a finished bot.
- Download the source and upload it on your Linux Server.
- Then install the discord.py libary:
python3 -m pip install -U discord.py
If you are using Windows, then the following should be used instead:
py -3 -m pip install -U discord.py
- Set up your MySQL database and create a database.
- Go to the uploaded folder in config.py and enter your MySQL data.
# MySQL Database
host = "localhost" # Or your host
user = "root" # Or your username
password = "password" # Or your password
database = "dcstats" # Or your name
# Discord
token = ""
- It is also important that you provide a bot token. If you don't know how to create a bot on Discord, this video might help you.
- Invite your discord bot on your server
- Paste the Bot Token in config.py and save it
- And now finally start the bot with the following commands (Linux):
cd /home/your-folder/
python3 bot.py
You can modify the bot as you want.
Download the Discord Stats Web for free and have a good visualization of the statistics with a ranking system.