Skip to content

Python bot to manage your servers and play mini-games, with slash commands.

License

Notifications You must be signed in to change notification settings

LeandreAZ/discord_bot

Repository files navigation

Discord Bot

About

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.


Table of Contents


Requirements

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

Installation

If you wish to reuse the bot

  1. Clone the repository.
git clone https://github.com/LeandreAZ/discord_bot.git
cd discord_bot
  1. Install dependencies.
pip install -r requirements.txt
  1. Create a .env file containing your configuration.
DISCORD_TOKEN=your_discord_token
DB_HOST=your_host
DB_USER=your_user
DB_PASSWORD=your_password
DB_NAME=your_database
  1. Set up the MySQL database.
    You can use either:

    • a local MySQL server (default: localhost with XAMPP for example)
    • a remote MySQL database (for production or deployment).

    Import the provided schema.sql file to create the necessary tables.

  2. Run the bot:

bin/start.bat

or

py bot.py

Usage

Once 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

Commands

/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.


Documentation

License This project is licensed under the MIT License. See the license file for details.

Author: RIBEIRO GONCALVES Léandre

About

Python bot to manage your servers and play mini-games, with slash commands.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published