A discord bot for playing, and creating your own madlibs that others can play!
- Play MadLibs: Choose from available templates or get a random one
- Create Custom Templates: Make your own MadLib stories for others to enjoy
- Template Management: Browse all available MadLibs with paged lists
- Interactive Gameplay: Bot guides players through each word prompt
- Persistent Storage: All custom templates are saved and persist between bot restarts
- User-Friendly Interface: Rich Discord embeds for better user experience
| Command | Description | Usage |
|---|---|---|
&play [title] |
Play a MadLib (random if no title specified) | &play or &play wedding vows |
&new |
Create a new MadLib template | &new |
&list |
View all available MadLib titles | &list |
&cancel |
Cancel any running MadLib operations | &cancel |
&help |
Display help message with all commands | &help |
- Python 3.8 or higher
- A Discord Bot Token
git clone https://github.com/ninasproule/madlibs_bot.git
cd madlibs_botpip install -r requirements.txt-
Create a
.envfile in the project root: -
Add your Discord bot token to the
.envfile:
DISCORD_TOKEN=your_bot_token_here
- Go to the Discord Developer Portal
- Create a new application
- Go to the "Bot" section
- Create a bot and copy the token
- Paste the token in your
.envfile
- In the Discord Developer Portal, go to "OAuth2" > "URL Generator"
- Select scopes:
bot - Select bot permissions:
- Send Messages
- Add Reactions
- Read Message History
- Embed Links
- Use the generated URL to invite the bot to your server
python bot.py- Use
&playfor a random MadLib or&play [title]for a specific one - The bot will prompt you for different types of words (nouns, verbs, adjectives, etc.)
- Type your word when prompted
- Enjoy the hilarious results!
- Use
&newto start creating a template - Choose option 1️⃣ to create or 2️⃣ to view instructions
- Write your story, using
<word type>for blanks (e.g.,<noun>,<adjective>,<body part>) - Example:
"The <adjective> cat <verb (past-tense)> over the <noun>" - Confirm your template and give it a title
madlibs_bot/
├── bot.py # Main bot application
├── default_templates.py # Pre-made MadLib templates
├── storage.py # JSON storage management
├── requirements.txt # Python dependencies
├── .env.example # Example environment variables
├── .env # Environment variables (you create this)
├── madlibs.json # Stored templates (auto-generated)
└── README.md # This file
- Framework: discord.py
- Python Version: 3.8+
- Command Prefix:
& - Timeout: 60 seconds for user responses
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Bot doesn't respond: Check if the bot has the necessary permissions in your server
- Token errors: Verify your
DISCORD_TOKENin the.envfile - Import errors: Make sure all dependencies are installed with
pip install -r requirements.txt
- Check the console output for error messages
- Ensure the bot has proper permissions in your Discord server
- Verify all files are in the correct directory structure
This project is open source and available under the MIT License.
If you encounter any issues or have questions, feel free to:
- Open an issue on GitHub
- Check the troubleshooting section above
- Review the command documentation
Made with ❤️ for Discordians who love word games!