IUFI is a Discord bot designed for card collecting and mini-games specifically for the IU community. Built entirely with Python, this bot offers an engaging experience for users to collect cards and participate in fun mini-games.
- Python 3.11 or above
- A
.env
file with the following variables:
TOKEN=DISCORD_BOT_TOKEN
MONGODB_URL=MONGODB_URL
MONGODB_NAME=MONGODB_NAME
- A
settings.json
file containing the bot settings. This file is pre-filled with values based on the IUCord server but can be modified as needed.
- Clone this repository:
git clone https://github.com/ChocoMeow/IUFI.git
- Navigate to the project directory:
cd IUFI
- Install the required Python packages. It is recommended to use a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
pip install -r requirements.txt
- Create a .env file in the root directory and add your Discord bot token and MongoDB details.
- Modify the settings.json file as needed to customize your bot settings.
To enable the music quiz feature in the bot, you must install ffmpeg
in your environment. You can specify the path for the OPUS library in your settings.json
file as follows:
{
"OPUS_PATH": "path/to/your/opus/library"
}
If you do not provide the OPUS_PATH, the program will attempt to auto-detect the OPUS library. If detection fails, you will need to manually specify the path in the settings.json file.
To start the bot, run the following command:
python main.py
Upon starting the bot, the following folders will be automatically created in the root directory:
- images: This folder stores card images. Inside, you should create your own category folders that match the configuration in your
settings.json
. - newImages: Place any new card images you want to add to the bot in this folder. The bot will automatically update the database and move the images to the correct category folder in the images folder. Ensure that new card images follow the naming format category#.webp (e.g., common1.webp, common2.webp, rare1.webp, etc.).
- musicTracks: This folder will automatically download music tracks using
ytlib
when players are participating in the music quiz.
Contributions are welcome! If you have suggestions for improvements or features, feel free to submit a pull request.