Public · MITPythondiscord.pyOpenRouterDiscord
Rei-kun-Bot
A Discord AI bot with a persistent persona. A modular Python Discord bot that combines AI chat, a study-resource hub, custom emoji tools, code diagnostics and admin controls. Its persona stays consistent when the underlying model changes.
ModelsMulti-model fallback
MemoryPer-channel history
StackPython 3.13, discord.py
LicenceMIT
What it does
Conversation
- Routes chat through several models with automatic fallback.
- A protected identity prompt keeps the Rei-kun persona recognisable across models.
- Tracks recent messages per channel and can store notes on request.
Community tools
- Study-resource hub: look up notes, mind maps, audio, quizzes and revision links by code or topic, with a wizard for adding and editing.
- Custom emoji catalogue with named placeholders, plus list, rename and add commands.
Admin and safety
- Code Doctor analyses Python errors and suggests or applies fixes with interactive buttons.
- Hot-reload command modules without restarting the bot.
- Terms-of-service acceptance, owner and admin roles, user blocking and DM gating.
Getting it running
Create the appMake a Discord application and bot, then copy .env.example.
ConfigureSet DISCORD_TOKEN, the AI provider key, admin IDs and resource roles.
StartRun python app.py and complete the onboarding prompt.
ChatUse ?ai for conversation and ?resource for study material.
Commands
?ai <prompt>Chat with the AI persona.?resource <code>Fetch a study resource.?doctor [target]Diagnose and suggest fixes for Python errors.?emojisync / ?emojilistSync and browse the emoji catalogue.?reload <module>Reload a command module.?helpList commands.Setup
- Python 3.13 and discord.py 2.6.4 or newer.
- OPENROUTER_MODELS is a comma-separated fallback list.
- Keep .env and any encryption keys out of Git.
Boundaries
- Rei-kun is a fictional persona, not a real person.
- Model availability depends on provider quotas and the configured list.
- Code patching and reload are privileged. Restrict them to trusted admins.
- The README documents prefix commands. Check the deployed version for slash commands.