Skip to content

prepas-mp2i/mp2i-discord-bot

Repository files navigation

MP2I

A Discord bot for MP2I server

OverviewSoftwareInstallation

GitHub top language: Python   Python3.9   discord.py   GitHub repo size   License   GitHub last commit (branch)  

Overview

MP2I is a Discord bot adapted from PyBoss bot created by Adridri.

It provides some features like:

  • Roles selection
  • Suggestion automation
  • Custom commands (clear, profile ...)
  • Moderation

Software

Python
It's required to have python 3.9 or more installed on your system. Download Python

Docker
You can also use Docker to deploy the environment in one command. Get started with Docker

Git LFS
This project uses Git LFS to store large files like images and sounds. Download Git LFS

Installation

Clone the repository

git clone https://github.com/prepas-mp2i/mp2i-discord-bot.git
cd mp2i-discord-bot
git lfs install && git lfs pull  # Download large files

Configuration

First set variables in .env file:

DISCORD_TOKEN = <discord_bot_token>
# Can be development (More logs)
ENVIRONMENT = production
# Optional, a SQLite database will be created otherwise.
DATABASE_URL = mysql+mysqlconnector://user:password@host:port/database
#Optional
COMPOSE_PROJECT_NAME = mp2i
# Timezone
TZ = Europe/Paris
#For email, optional
SMTP_SERVER = <smtp_server>

EMAIL_USER = <email_user>

EMAIL_PASSWORD = <password>

Create a bot-config.toml file based on the bot-config.yaml.example file.

Using Pipenv

Install pipenv dependencies:

python3 -m pip install pipenv

Now, you can create an empty .venv directory and running pipenv It will install packages in the virtual environment (recommended).

pipenv install

Run the command python3 -m mp2i on Linux or py -m mp2i on Windows to start the bot.

Using Docker

docker compose up --build

Now, the bot should be running. After modifying the code, you can update the bot using the command docker compose up.

License

This project is licensed under the Mozilla Public License 2.0 - see the LICENSE file for details.