BozoBot is a Discord bot designed to manage and display parley picks from server members. It allows users to lock in their parley picks using a simple slash command and retrieves them later in a nicely formatted table. The bot saves these picks externally to a JSON file to ensure persistence and easy access even if the bot restarts.
/mylock "Place your pick here"- Allows users to save their parley picks. The response is visible to everyone in the channel./show_picks- Displays a nicely formatted table of all saved picks, showing server nicknames for users./lockfor- If any users struggle to lock in their own bet you can lock it in for them. Just use /lockfor @theirUsername.
- Picks are saved to a JSON file (
parley_picks.json) for persistence. - If the bot restarts or crashes, the saved data will remain intact.
- Uses
tabulateto present picks in a readable table format. - Fetches and displays users' server nicknames for more personalized output. This may change as it looks terrible on mobile.
- Python 3.8+
- The following Python packages:
discord.pypython-dotenvtabulate
pip install discord.py python-dotenv tabulategit clone <your-repository-url>
cd BozoBotpython -m venv BozoVenv
BozoVenv\Scripts\activate # Windows
source BozoVenv/bin/activate # macOS/LinuxIn the Assets directory, create a file named Key.env with the following content:
TOKEN=your_discord_bot_token_here
CHANNEL_ID=your_channel_id_hereReplace your_discord_bot_token_here and your_channel_id_here with the actual token and ID.
- Make sure the bot has
applications.commandsandadministratorpermissions. You likely can turn the privileges down, but it will take some tweaking of the bot intents. - Enable SERVER MEMBERS INTENT in the Discord Developer Portal.
python Main.py- Description: Allows users to save their parley pick. The response will be visible to everyone in the channel.
- Example:
Response:
/lock "Team A Moneyline!"BobBuilder has locked in their parley pick: "Team A wins with 10 points!"
- Description: Displays all saved parley picks in a formatted table. (May change, looks terrible on mobile.)
- Example:
Response:
/show_picks
| Nickname | Parley Pick | |---------------|--------------------------------| | BobDylan | Team A wins with 10 points! | | JohnDoe | Team B scores over 20 |
- Description: Allows users to save a parley pick on behalf of another specified user by mentioning them. The response will be visible to everyone in the channel, showing the parley pick under the mentioned user's nickname.
- Example:
Response:
/lockfor @BobBuilder "Team A wins by over 10 points!"BobBuilder has locked in their parley pick: "Team A wins with 10 points!"
- Description: Sends a reminder ping to all users who haven’t submitted their parley pick yet. This is useful to ensure everyone gets a chance to contribute before the deadline.
- Usage: Only available to admins to avoid excessive notifications.
- Example:
Response:
/remind
@BobDylan @JohnDoe Reminder: You haven’t locked in your parley pick yet! Don’t miss out on this week’s action!
This command checks the list of members and pings only those who haven't submitted their pick. If everyone has submitted a pick, it responds with a message indicating all picks are in.
lock_parley_pick(): Saves the parley pick toparley_picks.jsonusing user ID as the key, and announces the pick publicly in the channel.show_parley_picks(): Fetches data from the JSON file and displays it in a readable format usingtabulate.format_parley_picks(client, guild_id): Fetches user nicknames based on IDs to provide more personalized output.
save_parley_pick(user_id, parley_pick): Saves data toparley_picks.json.load_parley_picks(): Loads saved data fromparley_picks.json.
- Ensure that the bot has
applications.commandspermissions. - Make sure the correct intents are enabled (presence, members, message content) in the Discord Developer Portal.
- Check if the bot has permissions to view members.
- Make sure SERVER MEMBERS INTENT is enabled in the Developer Portal.
- Ensure the
parley_picks.jsonfile exists and is accessible by the bot. If the file is missing, the bot will create a new one.
This README was generated with the assistance of AI. While it has been carefully reviewed, please verify the instructions and configurations to ensure they meet your specific needs.