A Discord bot that enforces silly rules on April Fools' Day using OpenAI's API.
- Enforce random silly rules in Discord channels for a specified duration
- Create custom rules with the
/custom_rule
command - Uses OpenAI to check if messages follow the rules
- Automatically ends rules after the specified time has passed
- Supports per-channel rules (different channels can have different active rules)
- Clone this repository
- Install the required dependencies:
pip install -r requirements.txt
- Create a
.env
file based on the.env.example
template and add:- Your Discord bot token
- Your OpenAI API key
- Invite the bot to your server with the necessary permissions (Send Messages, Read Message History, Use Slash Commands)
- Run the bot:
python main.py
/ai_mod [duration]
- Activate a random funny rule for the specified duration (in minutes, default 15)/custom_rule [rule] [duration]
- Create and enforce a custom rule for the specified duration/end_rule
- End the active rule in the current channel
- When a rule is activated, the bot announces the rule in the channel
- For every message sent in that channel, the bot uses OpenAI to check if the message follows the rule
- If the message violates the rule, the bot will reply with a humorous explanation
- After the specified duration, the rule automatically ends
- This bot is designed for fun on April Fools' Day
- Keep rule durations reasonable (1-60 minutes)
- Remember to use your OpenAI API credits responsibly