Required Discord Permissions
AutoResponse requires specific permissions to function properly. These permissions allow the bot to read messages, send replies, and interact with users.Bot Permissions
The following Discord permissions are required:| Permission | Purpose |
|---|---|
| Read Messages/View Channels | Read channel content and messages |
| Send Messages | Send auto-replies to users |
| Send Messages in Threads | Reply in thread channels |
| Embed Links | Send rich embed messages |
| Attach Files | Send attachments in replies |
| Read Message History | Access message history for context |
| Add Reactions | React to messages |
| Use Slash Commands | Enable slash command functionality |
The permission integer for all required permissions is
534723951680.Gateway Intents
AutoResponse uses Discord’s Gateway API with the following intents configured insrc/intents.js:1:
Privileged Intents (Require Manual Activation)
- GuildMembers - Access to member events and information
- GuildPresences - Access to user presence updates
- MessageContent - Required to read message content
Standard Intents
- Guilds - Basic guild information
- GuildMessages - Receive guild message events
- GuildMessageReactions - Track message reactions
- GuildMessageTyping - Monitor typing indicators
- DirectMessages - Handle direct messages
- DirectMessageReactions - Track DM reactions
- DirectMessageTyping - Monitor DM typing
- GuildEmojisAndStickers - Access custom emojis
- GuildIntegrations - Integration information
- GuildWebhooks - Webhook events
- GuildInvites - Invite tracking
- GuildVoiceStates - Voice channel states
- GuildModeration - Moderation events
- GuildScheduledEvents - Scheduled event information
- AutoModerationConfiguration - Auto-mod config access
- AutoModerationExecution - Auto-mod execution events
- GuildMessagePolls - Poll functionality
- DirectMessagePolls - DM polls
Partial Events
AutoResponse also uses Discord partials (configured insrc/partials.js:1) to handle uncached data:
- Channel - Handle uncached channels
- GuildMember - Handle uncached members
- GuildScheduledEvent - Handle uncached events
- Message - Handle uncached messages
- Reaction - Handle uncached reactions
- ThreadMember - Handle uncached thread members
- User - Handle uncached users
User Privacy Controls
AutoResponse includes a built-in opt-in/opt-out system to respect user privacy.Opt-Out System
Users can control whether they receive auto-replies from the bot:Opt Out
Users can use
/optout to stop receiving auto-replies from the bot.Their username is added to the opt-out database (optoutlist.db).Opt In
Users can use
/optin to resume receiving auto-replies.Their username is removed from the opt-out database.How Opt-Out Works
When a user opts out:- Their Discord user ID and username are stored in
data/optoutlist.db - The bot checks this database before sending any auto-reply
- If the user is found in the opt-out list, the message is logged but no reply is sent
- Users can opt back in at any time using
/optin
The opt-out check occurs in
src/events/messageCreate.js:153 before any reply is sent.Privacy Database Structure
The opt-out database contains a single table:- userId - Discord user ID (primary key)
- userTag - Discord username (unique)
Server-Level Permissions
Certain commands require specific Discord permissions:Manage Channels Permission
Required for:/addphrase- Add trigger phrases/removephrase- Remove trigger phrases/addreplychannel- Add reply channels/removereplychannel- Remove reply channels/setlogschannel- Configure logging channel
Send Messages Permission
Required for:/optin- Opt in to replies/optout- Opt out of replies/leaderboard- View leaderboard/stats- View bot statistics/ping- Check bot latency
Owner-Only Commands
Some commands are restricted to the bot owner (specified byOWNERID in environment variables):
- Message-based commands using the configured prefix (see
src/events/messageCreate.js:123) - Owner commands are processed before regular auto-reply logic
Best Practices
Principle of Least Privilege
Principle of Least Privilege
Only grant the bot permissions it absolutely needs. Avoid giving Administrator permission.
Regular Permission Audits
Regular Permission Audits
Periodically review the bot’s permissions in each server to ensure they’re still appropriate.
Respect User Privacy
Respect User Privacy
Always inform users about the opt-out system and respect their privacy choices.
Channel-Specific Permissions
Channel-Specific Permissions
Use Discord’s channel permission overrides to restrict the bot to specific channels if needed.