This project is a Discord bot developed in Python using discord.py and a MySQL database.
This bot allows you to create alerts and manage moderation by deleting the latest messages from the server, or even banning or muting members if you have the appropriate roles. This bot is primarily a Memory game with several types of game boards, a leaderboard system, and the ability to view past games.
Before running the project, make sure you have the following installed:
- Python 3.10+ → Python Downloads
- MySQL Server → for the database (can be local with XAMPP/WAMP or remote via Railway, PlanetScale, etc.)
- Discord Developer Account (for your bot token) → Create a Discord Bot
- Clone the repository.
git clone https://github.com/LeandreAZ/discord_bot.git
cd discord_bot- Install dependencies.
pip install -r requirements.txt- Create a
.envfile containing your configuration.
DISCORD_TOKEN=your_discord_token
DB_HOST=your_host
DB_USER=your_user
DB_PASSWORD=your_password
DB_NAME=your_database-
Set up the MySQL database.
You can use either:- a local MySQL server (default:
localhostwith XAMPP for example) - a remote MySQL database (for production or deployment).
Import the provided
schema.sqlfile to create the necessary tables. - a local MySQL server (default:
-
Run the bot:
bin/start.bator
py bot.pyOnce the bot is running, it will automatically connect to Discord and listen for commands and background tasks.
You can also add this bot on your server via this hyperlink : https://leandre-ribeiro-goncalves.com/memora
/tempban @user duration:120s reason:"Spam"
Temporarily bans a member. The duration is only in seconds.
/unban @user
Unbans a member.
/tempmute @user duration:10s
Temporarily mutes a member. The duration is only in seconds.
/unmute @user
Unmutes a member.
/clear 10
Deletes a number of messages in a channel.
/alert 3600
Set an alert with a duration in seconds.
/alerts
Shows all alerts of the user.
/removealert 12
Removes a specific alert by ID.
/clearalerts
Removes all user alerts.
/help-memora
Shows all bot commands.
/memory_start
Starts a Memory game.
/memory_stop
Stops your current Memory game.
/leaderboard 1
Shows the top players of the day on the server. The board type is 1 for 4x4, 2 for 5x4 and 3 for 5x5.
/memory_games
Shows all games of the player.
License
This project is licensed under the MIT License.
See the license file for details.
Author: RIBEIRO GONCALVES Léandre