Snippets are named, reusable responses that SudoBot delivers when a member triggers them by name. Each snippet can contain text (including full embed directives), file attachments, a list of aliases, and fine-grained access controls covering specific channels, users, roles, and Discord permissions or permission levels. You can maintain a library of FAQs, rule summaries, link collections, or any other content you want to surface on demand without copying and pasting it each time.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/onesoft-sudo/sudobot/llms.txt
Use this file to discover all available pages before exploring further.
How snippets work
SnippetManagerService loads every snippet from the database on startup and caches them in memory keyed by guildId_name (and additionally by each alias). When a message matches a snippet name or alias, the service checks whether the author meets the snippet’s requirements, processes the content through the directive parser to resolve embed blocks, appends any stored attachments, and sends the result. The files are stored on disk under storage/snippets/<guildId>/.
Managing snippets
Use thesnippet command group (or its subcommands) to create, update, list, rename, and delete snippets.
Creating a snippet
| Parameter | Description |
|---|---|
name | A unique name for the snippet within the server. |
content | The text to send. Supports embed directives. |
| Attachments | Any files attached to the command message. |
Deleting a snippet
Renaming a snippet
Listing snippets
Updating snippet attributes
| Attribute | Values | Description |
|---|---|---|
content | Any string | Replaces the snippet’s text content. |
randomize | true / false / 1 / 0 / enabled | When enabled, picks a random content entry or attachment on each trigger. |
level | Integer | Minimum permission level required to trigger the snippet (only when permissions.mode is levels). |
perm / permission | Space-separated permission names | Discord or system permissions required to trigger the snippet. |
pmode / permission_mode | AND / OR | Whether all listed permissions are required (AND) or at least one (OR). |
Access control
Every snippet supports multiple layers of access gating. All conditions must pass for the snippet to be delivered.- Channel restrictions
- User restrictions
- Role restrictions
- Permission restrictions
- Permission level
Specify which channels can trigger a snippet. When the
channels list is non-empty, the snippet only fires from those channels.Randomization
When you setrandomize: true on a snippet that has multiple content entries or multiple attachments, SudoBot selects one at random each time the snippet is triggered. This is useful for rotating welcome tips, fun facts, or random quotes.
A snippet with
randomize enabled picks one content entry and one attachment at random per trigger. Non-randomized snippets send all attachments at once.Mentions in snippets
If the message that triggers a snippet @-mentions any users (other than the replied-to user), SudoBot prepends those mentions to the snippet response. This lets members direct the snippet answer at someone specific.Embed directives in snippet content
Snippet content is passed through the directive parser before sending, so you can embed rich Discord embeds using the bot’s directive syntax.Adding attachments to existing snippets
Use thesnippet push-attachment subcommand to add new files to an existing snippet without overwriting its current attachments. Attach the files to the command message before running it.
Reaction Roles
Assign roles automatically when members react to a message.
Queues & Scheduling
Schedule snippet posts or other commands for a later time.
