How Phrases Work
When AutoResponse decides to send a reply, it:- Queries all phrases from the server’s database
- Randomly selects one phrase from the collection
- Sends that phrase as a reply to the user’s message
utils/reply.js:33-42:
If your server has no phrases configured, the bot will not be able to send replies even if the auto-reply chance triggers.
Adding Phrases
Use the/addphrase command to add new reply phrases to your server:
Command Details
| Parameter | Type | Required | Description |
|---|---|---|---|
phrase | String | Yes | The text to add as a reply phrase |
Duplicate Prevention
Fromcommands/slash/addPhrase.js:37-50:
Permissions Required
- Manage Channels permission is required to add phrases
- This ensures only trusted moderators can control the bot’s responses
Removing Phrases
Use the/removephrase command to delete phrases from your server:
Command Details
| Parameter | Type | Required | Description |
|---|---|---|---|
phrase | String | Yes | The exact phrase text to remove |
You must provide the exact phrase text as it appears in the database. The phrase must match exactly, including capitalization and punctuation.
commands/slash/removePhrase.js:36-47:
Permissions Required
- Manage Channels permission is required to remove phrases
Listing Phrases
Use the/listphrases command to view all phrases configured for your server:
Display Format
Fromcommands/slash/listPhrases.js:45-48:
Unlike
/addphrase and /removephrase, the /listphrases response is NOT ephemeral by default. Everyone in the channel can see the phrase list.Empty Phrase List
If your server has no phrases:Database Structure
Phrases are stored per-server in individual SQLite databases:Storage Location
- Path:
data/{serverId}.db - Table:
phrases - Schema:
phrase TEXT PRIMARY KEY
commands/slash/addPhrase.js:12-14:
Primary Key Constraint
Phrase Uniqueness
The
phrase column is the primary key, which enforces uniqueness at the database level. This prevents duplicate phrases even if the application-level check fails.Best Practices
Build a diverse phrase library
Build a diverse phrase library
Add 20-50 varied phrases to keep bot responses interesting and unpredictable. Mix greeting styles, lengths, and tones.
Keep phrases appropriate
Keep phrases appropriate
Remember that phrases are sent as replies to user messages. Ensure all phrases are appropriate for your server’s audience and follow Discord’s Terms of Service.
Test new phrases
Test new phrases
After adding phrases, monitor the bot’s responses to ensure they sound natural in context. Remove any that seem awkward or problematic.
Regular maintenance
Regular maintenance
Periodically run
/listphrases to review your phrase collection. Remove outdated or seasonal phrases that no longer fit.Avoid mentioning specific users
Avoid mentioning specific users
Don’t include @mentions or user-specific content in phrases, as they’ll be used randomly for any user. Keep phrases generic and universally applicable.
Phrase Guidelines
What Makes a Good Phrase
✅ Good phrases:- Short and casual: “Hey there!”
- Friendly acknowledgments: “Thanks for sharing!”
- Neutral responses: “Interesting point”
- Fun reactions: “That’s pretty cool”
- Questions requiring answers (creates confusion)
- User-specific content (“@John, check this out”)
- Controversial or political statements
- Very long paragraphs (seems unnatural)
- Phrases with formatting that might break (complex markdown)
Advanced: Direct Database Access
For bulk operations, you can directly access the SQLite database:Bulk Insert Example
View All Phrases
Delete All Phrases
Troubleshooting
Command not responding
Command not responding
Ensure your Discord role has the Manage Channels permission. Phrase management commands require this permission to execute.
Bot not using new phrases
Bot not using new phrases
Phrases are loaded fresh from the database with each reply. New phrases should be available immediately after adding them. Check that auto-replies are actually triggering by monitoring the console logs.
Can't remove a phrase
Can't remove a phrase
Ensure you’re typing the phrase exactly as it appears in
/listphrases, including all punctuation, spacing, and capitalization. Copy-paste from the list to guarantee accuracy.Database locked errors
Database locked errors
SQLite databases can only have one writer at a time. If you see lock errors, wait a moment and try again. This is rare but can happen during high-activity periods.
Technical Details
Database Initialization
Each phrase management command initializes the database connection:Error Handling
All phrase commands include comprehensive error handling:- Database connection failures
- Query execution errors
- Duplicate key violations
- Empty result sets