What Are Custom Triggers?
Custom triggers allow you to configure automatic responses when users send specific messages. When someone types a keyword that matches a trigger, the bot instantly responds with your configured text or image. Use cases:- Server in-jokes and memes
- Quick reference responses (server rules, links, FAQs)
- Welcome messages for specific keywords
- Easter eggs and community engagement
Triggers are stored per-server in the database and cached for 60 seconds for optimal performance.
Creating Triggers
Text Triggers
Create a text-based auto-response:Image Triggers
Create an image-based response:Case-Sensitive Triggers
By default, triggers ignore case. Enable strict matching:strict:true, only “CEO” (exact case) triggers the response. “ceo” or “Ceo” will not match.
Command Options
The/trigger add command accepts:
| Option | Type | Required | Description |
|---|---|---|---|
keyword | String | Yes | The phrase to listen for |
text | String | No* | Text response to send |
image | Attachment | No* | Image file to send |
strict | Boolean | No | Enable case-sensitive matching (default: false) |
commands/trigger.js:44-49:
Managing Triggers
List All Triggers
View all configured triggers:- 📝 Text triggers
- 🖼️ Image triggers
- Case sensitivity mode (Normal/Strict)
commands/trigger.js:245-249:
Delete a Trigger
- Removes the trigger from the database
- Deletes associated image files from Supabase storage (if applicable)
- Clears the trigger cache for immediate effect
commands/trigger.js:174-201:
The delete command includes autocomplete - start typing a keyword and Discord will suggest matching triggers from your server.
How Triggers Work
Message Processing
Triggers are processed by thetriggerHandler event listener:
From events/triggerHandler.js:4-69:
Performance Optimization
The trigger system uses several optimizations:- Caching - Triggers are cached in memory for 60 seconds
- Early returns - Bots and DMs are ignored immediately
- Single query - All server triggers loaded in one database call
- Exact matching only - No regex or partial matches (fast string comparison)
Database Schema
Triggers are stored with this structure:- One trigger per keyword per server
- Overwriting a trigger updates the existing entry
- No duplicate keywords in the same server
Permissions
Fromcommands/trigger.js:80-83 and utils/default.js:133-138:
- Adding triggers: Requires
Manage Messagespermission - Deleting triggers: Requires
Manage Messagespermission - Listing triggers: Available to everyone
- Triggering responses: Available to everyone (no permission needed to use triggers)
/config permission command:trigger.
Advanced Usage
Overwriting Existing Triggers
Simply use/trigger add with an existing keyword:
ON CONFLICT to update:
Cache Invalidation
After adding or deleting triggers, the cache is immediately cleared:Image Storage Structure
Images are organized by server:commands/trigger.js:112-113:
Examples
Best Practices
Use clear, unique keywords
Use clear, unique keywords
Avoid common words like “hi” or “ok” that appear in normal conversation. Use specific phrases or uncommon words to prevent unintended triggers.
Keep responses concise
Keep responses concise
Short, punchy responses work best. Long messages may feel spammy or interrupt conversation flow.
Optimize image file sizes
Optimize image file sizes
While the bot accepts images, keep file sizes reasonable (under 2MB) for faster loading and storage efficiency.
Document your triggers
Document your triggers
Use
/trigger list regularly to audit what triggers exist. Remove outdated ones to keep the list manageable.Test in a private channel first
Test in a private channel first
Before adding triggers server-wide, test them in a staff channel to ensure they work as expected.
Use strict mode sparingly
Use strict mode sparingly
Case-sensitive triggers are harder for users to remember. Reserve
strict:true for acronyms or proper nouns only.Troubleshooting
Trigger Not Responding
Possible causes:-
Exact match required - Triggers match the entire message content only
- “hello there” will NOT trigger “hello”
- User must type exactly “hello” with nothing else
-
Case sensitivity - Check if trigger was created with
strict:true- Use
/trigger listto see the mode
- Use
- Cache delay - Wait up to 60 seconds for cache to refresh after adding
- Bot permissions - Ensure bot can send messages in that channel
Image Not Displaying
Check these:- Supabase configuration - Verify
SUPABASE_URLandSUPABASE_KEYare set - Storage bucket - Ensure
triggersbucket exists in Supabase with public access - File upload success - Check bot logs for upload errors
- Image format - Discord supports PNG, JPG, GIF, WebP
”Text or Image Required” Error
This happens when:Autocomplete Not Showing Triggers
The delete command uses database autocomplete:- No triggers exist in your server yet
- Database connection issue (check bot logs)
- You haven’t started typing (Discord needs input to trigger autocomplete)
Limitations
Related Features
- Use
/configto adjust who can manage triggers - Triggers work alongside other bot features without conflicts
- Consider using
/customcommand for pre-built VA-11 HALL-A content
Server Setup
Initial bot configuration and role setup
Permissions
Control who can create and manage triggers