MyRespect is a Discord bot that allows users to give respect to others, track their respect points, and display leaderboards of the most respected users in a server. The bot can be configured to store data in either a MySQL database or locally in a JSON file.
- Give Respect: Users can give respect to other members once every 24 hours.
- Respect Leaderboard: Displays the top respected users in the server.
- View Your Respect: Users can view how many respect points they have received.
- MySQL and Local Storage Support: Data can be stored in a MySQL database or locally, depending on your configuration.
- Python 3.10+
- Discord.py (version 2.0+)
- MySQL Connector (for MySQL support)
git clone https://github.com/mtp-dev/MyRespectBot.git
cd MyRespectBot
Use the following command to install the required dependencies from the requirements.txt
file:
pip install -r requirements.txt
You need to configure the bot by setting up either MySQL or local storage.
-
In the bot's source code, set the
USE_MYSQL
flag toTrue
:USE_MYSQL = True
-
Update the MySQL credentials in the following part of the code:
db = mysql.connector.connect( host="your_mysql_host", port=3306, user="your_mysql_user", password="your_mysql_password", database="your_mysql_database" )
-
If you prefer to store the respect data locally, set the
USE_MYSQL
flag toFalse
:USE_MYSQL = False
-
The bot will automatically create and store data in a
local_respect_data.json
file.
Replace "your_bot_token"
in the client.run()
line with your actual Discord bot token:
client.run("your_bot_token")
To start the bot, run the following command:
python app.py
The bot will sync all commands globally and be ready to use in your server.
Give respect to another user in the server. You can only give respect to a user once every 24 hours.
Usage:
/respect @user
Displays the top users with the most respect points in the server.
Usage:
/leaderboard
Displays your current respect points.
Usage:
/myrespect
The bot stores respect data either in a MySQL database or locally, depending on the USE_MYSQL
flag:
- MySQL: Respect data is stored in a table that is created for each guild.
- Local Storage: Respect data is stored in the
local_respect_data.json
file, where each guild's data is stored separately.
All commands are automatically synced globally when the bot starts. If you want to ensure all commands are available across all servers where the bot is present, simply start the bot, and the commands will sync globally.
This project is licensed under the MIT License.