Disturbed Docs
Disturbed Docs
  • Overview
  • Command List
  • SETTINGS
    • Getting Started
      • Currency / Economy
      • Currency Drop + Pick
      • greet / leave / boost messages
    • Configuration keys
  • AUTORESPONDER
    • Quick-start
    • Guides
      • Beginner I: Using Simple Placeholders
      • Beginner II: Using Simple Functions
      • Intermediate I: Ranges and Making Choices
      • Intermediate II: Locked Choices
    • Resources
      • Variables, Placeholders & Functions
      • Examples
        • .bake command
      • Utility commands / Examples
        • Self-Verification System
        • Antiswear/Blacklisted Words
        • Anti Link/Advertising
        • Click to Disable Pings (e.g. Partner Pings)
        • Say Command
        • Invite Reward System
  • Modules
    • Basic Features
      • AFK system
      • Ping On Join (POJ)
      • Giveaway System
    • Advanced Modules
      • On Duty System
      • Invite & Promo Tracking
Powered by GitBook
On this page
  • Features
  • AFK System Behavior
  • Setting AFK Status
  • Mentioning an AFK User
  • Returning from AFK
  • AFK System Configuration
  1. Modules
  2. Basic Features

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

The AFK system supports both slash commands (/afk) and message commands (onee AFK [reason]). If an AFK role is configured, it will be assigned automatically.

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:

  1. Slash Command:

    /afk message:"Busy, will be back later"
  2. Message Command:

    onee AFK Busy, will be back later

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:

User1: @User2
Bot: User2 is AFK since 2 hours ago: "Out for lunch."
  • 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:

  1. Remove the AFK role (if assigned).

  2. Clear their AFK status from the database.

  3. Send a summary of any mentions received while they were AFK.

Example Output:

Welcome back, User2. Your AFK status has been removed.
Mentions received while AFK:
- User3 mentioned you in #general 1 hour ago
- User4 mentioned you in #support 45 minutes ago

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 3 months ago