A high-performance Shiritori management Discord bot using Gemini API and Discord.py.
- 🤖 AI Word Validation: Gemini AI automatically validates word appropriateness
- 👥 Multiplayer: Supports multiplayer shiritori games
- 📜 Complete Rule Implementation: Used word checking, "n" ending detection, etc.
- 🎮 Slash Commands: Intuitive command interface
- 📊 Game Status Display: Real-time game status monitoring
- Python 3.8 or higher
- Discord Bot Token
- Google Gemini API Key
# Clone the repository
git clone https://github.com/paraccoli/shiritori.ai.git
cd shiritori.ai
# Install dependencies
pip install -r requirements.txtCreate a .env file and configure the following:
# Discord Bot Token
DISCORD_BOT_TOKEN=your_discord_bot_token_here
# Gemini API Key
GEMINI_API_KEY=your_gemini_api_key_here
# Discord Channel ID (Channel ID for shiritori)
SHIRITORI_CHANNEL_ID=your_channel_id_here
# Debug Mode (True/False)
DEBUG_MODE=Truepython main.py- Start Game:
/shiritori start- Start recruiting participants - Join:
/shiritori join- Join the game - Begin Game:
/shiritori go [first word]- Start the actual game - Word Input: Post words in chat following turn order
- End Game: Automatic end or
/shiritori end
| Command | Description |
|---|---|
/shiritori start |
Start game (recruit participants) |
/shiritori join |
Join the game |
/shiritori go [word] |
Begin actual game |
/shiritori end |
End game |
/shiritori status |
Check current status |
/shiritori help |
Display basic help |
/help |
Display detailed bot description |
- Answer with a word that starts with the last character of the previous word
- Cannot use words that have already been used
- Lose if you end with "ん" (n)
- Only valid common nouns are allowed (judged by Gemini AI)
- Follow turn order for responses
shiritori-bot/
├── .env # Environment variables file
├── .gitignore # Git ignore settings
├── requirements.txt # Dependency libraries
├── main.py # Main file
├── README.md # This file
│
├── cogs/ # Discord.py Cogs
│ ├── __init__.py
│ └── shiritori_cog.py # Shiritori command implementation
│
├── game/ # Game logic
│ ├── __init__.py
│ └── shiritori_game.py # Game state management
│
└── utils/ # Utilities
├── __init__.py
└── gemini_client.py # Gemini API client
- Create a bot on Discord Developer Portal
- Configure required permissions:
Send MessagesUse Slash CommandsRead Message HistoryAdd Reactions
- Get an API key from Google AI Studio
- Configure in
.envfile
- Fork this 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) - Create a Pull Request
This project is released under the MIT License.
Q: Bot doesn't respond
- Check if Discord Bot Token is correctly configured
- Check if bot has joined the server
- Check if appropriate permissions are granted
Q: Gemini API errors occur
- Check if API key is correctly configured
- Check if API usage limits are exceeded
Q: Slash commands don't appear
- Check if command sync completed during bot startup
- Try restarting the Discord app
If you encounter issues, please report them in Issues.