AFK system
The AFK System in OneeChan allows users to set themselves as AFK (Away From Keyboard) and provides notifications when they are mentioned. When an AFK user returns and sends a message, their AFK status
Features
AFK Status Tracking – Users can set their AFK status along with an optional message.
Mention Notifications – When an AFK user is mentioned, the bot responds with their AFK message and timestamp.
Automated AFK Role Handling – If an AFK role is configured, it is added when the user goes AFK and removed when they return.
AFK Mention Logging – Mentions are stored and shown to the user when they return.
Multiple Command Support – AFK can be set using both the slash command and a message command.
AFK System Behavior
Setting AFK Status
Users can set their AFK status using either:
Slash Command:
Message Command:
If an AFK role is available, it will be assigned automatically. If the user already has the AFK role but is not marked in the database, the system will sync their status.
AFK messages cannot contain
@everyone
,@here
, or role mentions to prevent abuse.
Mentioning an AFK User
When an AFK user is mentioned, the bot automatically responds with their AFK message.
Example:
The bot will log the mention so that the AFK user can review it later.
Mentions are stored for 72 hours and removed afterward.
Returning from AFK
Once an AFK user sends a message, their AFK status is removed. The bot will:
Remove the AFK role (if assigned).
Clear their AFK status from the database.
Send a summary of any mentions received while they were AFK.
Example Output:
If no mentions were received, the bot will notify the user accordingly.
AFK System Configuration
AFK Role Handling – If an AFK role is set in server configurations, it will be used when a user goes AFK.
Redis-Based Mention Storage – Mentions are stored in Redis and automatically expire after 72 hours.
Server-Wide AFK Tracking – The system ensures that AFK statuses persist even if the bot restarts.
AFK Status Syncing – If a user already has the AFK role but isn't marked in the database, the system will automatically sync their status.
Last updated