Discord
Mudabbir integrates with Discord via discord.py. It supports slash commands, direct messages, and @mention in channels.
Setup
Create a Discord application
- Go to the Discord Developer Portal
- Click “New Application” and name it
- Go to the “Bot” section and create a bot
- Copy the bot token
Set permissions
Under OAuth2 → URL Generator, select:
- Scopes:
bot,applications.commands - Permissions:
Send Messages,Read Message History,Use Slash Commands
Invite to server
Use the generated URL to invite the bot to your Discord server.
Configure
export MUDABBIR_DISCORD_BOT_TOKEN="your-discord-token"Start
mudabbir --discordConfiguration
| Setting | Env Variable | Description |
|---|---|---|
| Bot token | MUDABBIR_DISCORD_BOT_TOKEN | Discord bot token |
| Allowed guilds | MUDABBIR_DISCORD_ALLOWED_GUILD_IDS | Comma-separated guild IDs |
| Allowed users | MUDABBIR_DISCORD_ALLOWED_USER_IDS | Comma-separated user IDs |
Features
Slash Command
The bot registers a /mudabbir slash command. Users can interact with:
/mudabbir What files are in the home directory?DM and Mention Support
- Direct messages — Send a DM to the bot for private conversations
- @mention — Mention the bot in any channel where it’s present
Streaming
Discord supports edit-in-place streaming with a 1.5-second rate limit. The bot sends an initial message and edits it as tokens arrive, batching updates to respect Discord’s rate limits.
Access Control
# Restrict to specific serversexport MUDABBIR_DISCORD_ALLOWED_GUILD_IDS="111222333,444555666"
# Restrict to specific usersexport MUDABBIR_DISCORD_ALLOWED_USER_IDS="777888999"Installation
curl -fsSL https://mudabbir.fly.dev/install.sh | sh
# Or add the Discord extra manuallypip install mudabbir[discord]This installs discord.py as an optional dependency.
Was this page helpful?