A multilingual Discord chatbot built on. Mention Miku or reply to one of her messages and she'll chat back in over 100 languages.
- 💬 Chat by mentioning the bot or replying to one of its messages
- 🌐 Per-server language selection (
/setlanguage) across 100+ languages - 🔇 Toggle auto-chat on/off per server (
/togglechat) - 🎤 A configurable "Miku" persona (see
src/config/persona.js) - 📊 Simple stats tracking per server
- No database required — settings persist to a local JSON file
-
Clone and install
git clone https://github.com/<your-username>/miku-ai.git cd miku-ai npm install
-
Get your credentials
- Discord bot token + client ID: Discord Developer Portal — create an application, add a bot, and enable the Message Content Intent under Bot settings.
- SmartestChatBot API token: api.lebyy.me/dashboard
-
Configure environment variables
cp .env.example .env
Fill in
DISCORD_TOKEN,CLIENT_ID, andMIKU_API_TOKENat minimum.GUILD_IDis optional — set it during development so slash commands register instantly to one server instead of waiting up to an hour for a global rollout. -
Deploy slash commands
npm run deploy
-
Start the bot
npm start
| Command | Description | Permission |
|---|---|---|
/chat <message> |
Talk to Miku directly | Everyone |
/setlanguage <code> |
Set Miku's reply language for this server | Manage Server |
/togglechat <enabled> |
Turn mention/reply auto-responses on or off | Manage Server |
/stats |
View this server's Miku stats | Everyone |
/ping |
Check latency | Everyone |
/help |
List all commands | Everyone |
You can also just @mention Miku or reply to one of her messages anywhere in a server to chat, without a slash command.
src/
├── commands/ # Slash commands (one file per command)
├── config/ # Env config, persona traits, supported language list
├── events/ # Discord.js event handlers (ready, messageCreate, interactionCreate)
├── utils/ # SmartestChatBot wrapper + JSON-backed guild settings storage
├── deploy-commands.js
└── index.js # Entry point — loads commands/events and logs in
data/
└── guildSettings.json # Auto-created; per-guild language/toggle/message-count
src/config/persona.js maps directly onto the optional persona fields SmartestChatBot accepts (favorite color, hobbies, appearance, etc). Edit that file to reshape how Miku talks about herself — no code changes needed elsewhere.
- This bot is server-only (no DMs) by design; strip the guild check in
src/events/messageCreate.jsif you want DM support. - Settings are stored in a flat
data/guildSettings.jsonfile. Fine for small-to-medium bots; swap in SQLite/Mongo insrc/utils/storage.jsif you outgrow it. - Miku is an entertainment-purpose chatbot API, not a general-purpose LLM. Expect fun, personality-driven replies rather than factual accuracy.
MIT — see LICENSE.