Skip to main content

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.

SudoBot’s queue system lets you defer any supported action until a future point in time. You can schedule a command to run automatically, post a message to a channel after a delay, or have the bot send you a personal reminder via DM. All queued jobs are stored persistently so they survive bot restarts, and every job gets a numeric ID you can use to inspect or cancel it before it fires.

Queue concepts

Every deferred action is a queue job. Each job has:
  • A unique integer ID.
  • A type (e.g., CommandExecutionQueue, MessageScheduleQueue, ReminderQueue).
  • A runs-at timestamp that determines when the job executes.
  • An optional created-by user reference.
The QueueService holds all active jobs in memory and schedules them with Node.js timers. On startup, it reloads pending jobs from the database so nothing is lost between restarts.

The queue command

The queue command (aliases: queues, q) is the main interface for managing jobs. It requires the Manage Guild permission.

Subcommands

queue add

Schedule a command to run after a specified duration.

queue list

View all pending jobs in the server with pagination.

queue view

Inspect details of a single job by ID.

queue cancel

Cancel a pending job before it executes.

queue add

Queues any bot command to run automatically after a duration you specify.
/queue add run_after:<duration> command:<command-string>
OptionRequiredDescription
run_afterYesHow long to wait before executing. Accepts duration strings like 2h, 30m, 1d12h.
commandYesThe full command string to execute, including the command name and all arguments.
Example — ban a user in 10 minutes:
/queue add run_after:10m command:ban 987654321098765432 Repeated spam
SudoBot replies with the job ID so you can track or cancel it later.
The command name in the command string must be a valid, recognized command. SudoBot validates this at queue creation time and rejects unknown commands immediately.

queue list

Lists all queued jobs for the current server in a paginated embed (5 jobs per page). Each entry shows:
  • Job ID and type.
  • The user who created it and when.
  • The scheduled execution time (relative and absolute).
/queue list

queue view

Shows detailed information about a single job by its numeric ID.
/queue view id:<job-id>
For CommandExecutionQueue jobs, the output also includes the command string that will be executed.

queue cancel

Cancels a pending job. You cannot cancel a job that is already executing.
/queue cancel id:<job-id>
Aliases for the subcommand: queue remove, queue delete.

The schedule command

Schedule a message to be posted in a channel after a delay. Requires the Manage Messages permission.
/schedule content:<message> time:<duration> [channel:<channel>] [delete_after:<duration>]
OptionRequiredDescription
contentYesThe message to send. Supports embed directives. Maximum 4096 characters.
timeYesHow long to wait before sending.
channelNoTarget channel. Defaults to the current channel.
delete_afterNoDuration after which the sent message is automatically deleted (relative to send time).
Example — announce maintenance in 2 hours:
/schedule content:Scheduled maintenance starting now. time:2h channel:#announcements delete_after:1d
schedule uses the MessageScheduleQueue internally, so it benefits from the same persistence guarantees as other queued jobs.

The remind command

Set a personal reminder that SudoBot delivers to you via direct message after a specified time. No special permissions are required.
/remind after:<duration> message:<reminder-text>
OptionRequiredDescription
afterYesHow long to wait before sending the reminder.
messageYesThe reminder text. Maximum 2000 characters.
Example:
/remind after:3h message:Review the PR before end of day
SudoBot confirms the scheduled time using a Discord relative timestamp so you can verify the duration is correct.
Reminders are delivered as a DM. If you have DMs disabled from server members, you will not receive the reminder. Make sure your privacy settings allow DMs from bots.

Duration format

All duration arguments across queue add, schedule, and remind accept the same flexible format:
30s         → 30 seconds
10m         → 10 minutes
2h          → 2 hours
1d          → 1 day
1d12h30m    → 1 day, 12 hours, 30 minutes

Persistence across restarts

All queue jobs are stored in the database before the bot returns a success response. If SudoBot restarts before a job fires, the job is reloaded on next startup and rescheduled. Jobs that were due to run during the downtime are executed immediately on restart.

Permissions summary

CommandRequired permission
queue addManage Guild
queue listManage Guild
queue viewManage Guild
queue cancelManage Guild
scheduleManage Messages
remindNone

Build docs developers (and LLMs) love