The AFK system gives members a simple way to communicate that they are temporarily unavailable. When a member sets their AFK status, SudoBot records it in the database and caches it in memory. Any subsequent mention of that user triggers a reply explaining they are AFK and, if provided, why. As soon as the AFK member sends any message in the server, the bot clears their status and replies with a summary of how many times they were mentioned and by whom.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 it works
AFKService maintains an in-memory Collection keyed by guildId::userId (or global::userId for global AFK entries). On every message, the service checks two things:
- Whether the author of the message is currently AFK — if so, their status is cleared and a summary is sent.
- Whether any mentioned users are AFK — if so, a reply lists each AFK user with their reason and how long ago they went AFK.
Using the /afk command
| Option | Type | Required | Description |
|---|---|---|---|
reason | string | No | Why you are AFK. Shown to anyone who mentions you. Maximum 1024 characters. |
global | boolean | No | When true, your AFK status applies across all servers SudoBot is in, not just the current one. |
gafk sets a global AFK status by default.
Your
reason is validated against the server’s active message rules. If the text triggers an automod rule, the command fails and your status is not set.Setting an AFK status
Receive mention notifications
While you are AFK, anyone who mentions you sees a reply like:
@You is AFK, for reason: Working on a project, back in 2 hours — 5 minutes ago.Each mention is recorded with the mentioner’s ID, channel, message, and timestamp.
Return and get your summary
The next time you send a message, SudoBot automatically removes your AFK status and replies with a summary embed:
- Total mention count across guild and global records.
- Up to 25 recent mentions, each with a “Navigate” link to the original message.
- The total duration you were AFK.
AFK scope: guild vs global
- Guild-scoped AFK
- Global AFK
The default behavior. Your status is recorded for the current server only. Mentions in other servers do not trigger notifications.Internally the entry is stored with
guildId set to the current guild’s snowflake.Switching AFK context
If you already have an AFK entry set and run/afk again with the opposite global setting, SudoBot does not create a duplicate entry — it switches the context of your existing record between guild-local and global, and confirms the switch.
Mention tracking details
The service stores up to 25 mention records per AFK entry. When the cap is reached, the oldest mention is discarded to make room for the new one. Each record captures:- The ID of the user who mentioned you.
- The guild, channel, and message IDs.
- An ISO timestamp.
Re-invoking /afk while already AFK
If you are already AFK and run /afk again, the service clears your status immediately and shows the mention summary. This gives you an explicit way to mark yourself back without waiting to send a regular message.
Queue & Scheduling
Schedule commands and reminders for a future time.
Fun Commands
Lighten the mood with cat images, jokes, and emoji mixing.
