How Reply Channels Work
Reply channels are stored per-server with an associated reply chance percentage:- Each reply channel starts with a 6% reply chance
- The chance increases by 1% with each message until a reply triggers
- Multiple channels can be configured per server
- Each channel maintains its own independent reply chance counter
src/events/messageCreate.js:149-165:
Messages sent in channels NOT configured as reply channels are logged with a red “0%” indicator and completely bypass the auto-reply logic.
Adding Reply Channels
Use the/addreplychannel command to enable auto-replies in a channel:
Command Details
| Parameter | Type | Required | Description |
|---|---|---|---|
channel | Channel | Yes | The text channel to enable auto-replies in |
Select a channel
Use the channel selector to pick a text channel. Only Guild Text channels can be selected.
Implementation
Fromcommands/slash/addReplyChannel.js:44-58:
Permissions Required
- Manage Channels permission is required
- This ensures only server moderators can control where the bot operates
Removing Reply Channels
Use the/removereplychannel command to disable auto-replies in a channel:
Command Details
| Parameter | Type | Required | Description |
|---|---|---|---|
channel | Channel | Yes | The text channel to remove from auto-replies |
Removing a reply channel immediately stops all auto-reply activity in that channel. The current reply chance percentage is deleted from the database.
commands/slash/removeReplyChannel.js:43-63:
Permissions Required
- Manage Channels permission is required
Channel-Specific Reply Chances
Each reply channel maintains its own independent reply chance counter:Independent Tracking
If you have multiple reply channels, each one progresses through the 6%-100% cycle independently. A reply in #general doesn’t affect the chance counter in #memes.
Database Structure
Reply channels are stored per-server in individual SQLite databases:Storage Location
- Path:
data/{serverId}.db - Table:
replyChannels - Schema:
(id TEXT PRIMARY KEY, chance INTEGER)
commands/slash/addReplyChannel.js:13-16:
Schema Details
| Column | Type | Description |
|---|---|---|
id | TEXT | Discord channel ID (primary key) |
chance | INTEGER | Current reply chance percentage (6-100) |
Reply Channel Settings Loading
When a message is created, the bot loads the server’s settings: Fromsrc/events/messageCreate.js:149-152:
getSettings utility function:
- Queries the
replyChannelstable for all configured channels - Returns an object with a
replyChannelsarray - Each array element contains
{ id: "channelId", chance: 6-100 }
Non-Reply Channel Behavior
Messages sent in channels that are NOT configured as reply channels:- Are logged with a red “0%” indicator
- Skip all auto-reply logic completely
- Don’t trigger leaderboard updates
- Don’t consume bot resources beyond basic logging
src/events/messageCreate.js:250-252:
This allows the bot to be present in all server channels for monitoring without auto-replying everywhere.
Channel Type Restrictions
Only Guild Text channels can be configured as reply channels:- Voice channels
- Announcement channels
- Forum channels
- Stage channels
- Category channels
- DM channels
Best Practices
Start with one channel
Start with one channel
When first setting up AutoResponse, configure just one casual/social channel as a reply channel. Monitor the bot’s behavior before expanding to additional channels.
Avoid important channels
Avoid important channels
Don’t enable auto-replies in:
- Announcement channels
- Rules/info channels
- Support ticket channels
- Staff-only channels
Consider channel activity
Consider channel activity
High-activity channels will trigger replies more frequently (chance increases faster). Low-activity channels may go days without a reply. Balance your selections accordingly.
Monitor the logs
Monitor the logs
Watch the console output to see how quickly reply chances increase in different channels. This helps you understand the bot’s behavior patterns.
Communicate with your community
Communicate with your community
Let server members know which channels have auto-replies enabled and remind them about the
/optout command if they prefer not to be replied to.Chance Persistence
Reply chance percentages are persisted to the database after every message:- Chance values survive bot restarts
- Each channel’s progression is never lost
- The system can resume exactly where it left off
Viewing Configured Channels
There is no built-in command to list all reply channels. To view your configured channels, you have two options:Option 1: Check the logs
Watch console output when messages are sent. Configured channels show a green percentage, non-configured show red “0%”.Option 2: Direct database query
You can convert channel IDs to channel mentions in Discord by formatting them as
<#123456789012345678>.Troubleshooting
Bot not replying in configured channel
Bot not replying in configured channel
Check:
- Does the server have phrases configured? (
/listphrases) - Is the bot rate-limited or in cooldown?
- Are messages coming from bots/webhooks? (Bot ignores these)
- Is the user opted out? (Check opt-out list)
- Is the chance very low? (May take many messages before reply)
Can't add channel
Can't add channel
Verify:
- You have Manage Channels permission
- The channel isn’t already configured (run the command again to see the error)
- You’re selecting a text channel, not a voice/forum channel
Chance not increasing
Chance not increasing
Ensure:
- Messages are from real users (not bots)
- Users aren’t opted out
- No cooldown is active
- Check console logs for the percentage indicator
Bot replying in wrong channels
Bot replying in wrong channels
Review your reply channel configuration. The bot should only reply in explicitly configured channels. If it’s replying elsewhere, check for:
- Accidentally configured channels
- Multiple bot instances running
- Database corruption (rare)
Advanced: Multi-Server Setup
Each Discord server (guild) has its own:- Independent database file:
data/{serverId}.db - Separate reply channel configuration
- Isolated chance progression counters
Full Isolation
If your bot is in multiple servers, each server’s channel configuration is completely independent. Adding a reply channel in Server A doesn’t affect Server B in any way.
Technical Details
Channel Lookup Performance
Channel lookups are optimized:- All reply channels are loaded once per message
- Lookup is O(n) where n = number of reply channels
- Typically very fast (most servers have 1-5 reply channels)
Database Initialization
CREATE TABLE IF NOT EXISTS pattern ensures the table is created on first use, making setup seamless.