Skip to main content

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:
PermissionPurpose
Read Messages/View ChannelsRead channel content and messages
Send MessagesSend auto-replies to users
Send Messages in ThreadsReply in thread channels
Embed LinksSend rich embed messages
Attach FilesSend attachments in replies
Read Message HistoryAccess message history for context
Add ReactionsReact to messages
Use Slash CommandsEnable 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 in src/intents.js:1:

Privileged Intents (Require Manual Activation)

These intents must be manually enabled in the Discord Developer Portal under Bot > Privileged Gateway Intents.
  • 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 in src/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:
  1. Their Discord user ID and username are stored in data/optoutlist.db
  2. The bot checks this database before sending any auto-reply
  3. If the user is found in the opt-out list, the message is logged but no reply is sent
  4. 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:
CREATE TABLE IF NOT EXISTS OptOutList (
    userId TEXT PRIMARY KEY,
    userTag TEXT UNIQUE
)
  • 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
Server administrators can control who can configure the bot by managing Discord role permissions.

Owner-Only Commands

Some commands are restricted to the bot owner (specified by OWNERID 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
Keep your OWNERID secure and never share it publicly.

Best Practices

Only grant the bot permissions it absolutely needs. Avoid giving Administrator permission.
Periodically review the bot’s permissions in each server to ensure they’re still appropriate.
Always inform users about the opt-out system and respect their privacy choices.
Use Discord’s channel permission overrides to restrict the bot to specific channels if needed.

Build docs developers (and LLMs) love