pi-Bot is a Discord bot that manages dice rolls with many customization options. Built on Py-Cord, it supports multiple languages and offers several commands to make life easier for both players and game masters.
- Flexible dice rolling: expressions like
2d6+3with modifiers and an optional target name. - Custom colors: each user can choose the bot's message color (
!setcolor red). - Configurable prefix: adjust the command prefix per server (
!setprefix ?). - Default roll: define a default roll used when no expression is provided (
!defaultRoll 1d20). - Multilanguage support: English, French, German and Spanish via
!setlang. - Automatic saving: preferences and statistics stored in JSON files and cached in memory.
- Clone this repository.
- Install the dependencies:
pip install -r requirements.txt
- Create a
config.jsonfile with the following content:{ "token": "YOUR_DISCORD_TOKEN", "prefix": "!" } - Start the bot:
python main.py
- Roll a single die:
!roll 1d20 - Add modifiers:
!roll 1d20+5or!r 1d6+1d4-2 - Shortcut:
!ris the same as!roll - Default roll: if a roll is set via
!defaultRoll, calling!rwith no arguments uses it - Change message color:
!setcolor red - View the current color:
!getcolor
- Change the language:
!setlang fr - Set a default roll:
!defaultRoll 1d20+5 - Modify the prefix:
!setprefix ?
Only those with the "Manage Server" permission can change the language, default roll, or prefix.
- The files
user_stats.json,user_preferences.jsonandserver_preferences.jsonare generated automatically and ignored by git. - Audit logs are saved in
audit.log.
Contributions are welcome! Feel free to open an issue or pull request to suggest improvements.