# Afk

This module manages AFK players and can kick them.

## Configuration

### `config.yml`

{% code fullWidth="true" %}

```yaml
########################################################################################################################
#
# ░█████╗░███████╗██╗░░██╗
# ██╔══██╗██╔════╝██║░██╔╝
# ███████║█████╗░░█████═╝░
# ██╔══██║██╔══╝░░██╔═██╗░
# ██║░░██║██║░░░░░██║░╚██╗
# ╚═╝░░╚═╝╚═╝░░░░░╚═╝░░╚═╝
#
# Documentation: https://zessentials.groupez.dev/modules/afk
#
########################################################################################################################

enable: true

check-interval: 20 # in ticks

# Allows kicking the player with the spigot method, this avoids using a kick command and that your sanction plugin log the kick
soft-kick: true

soft-kick-message: "<red>You have been kicked for being AFK"

kick-actions:
  - type: message
    messages:
      - "&cYou have been kicked for being AFK"
  # - type: console command
  #  commands:
  #    - "kick %player% AFK"

permissions:
  - priority: 0
    permission: "zessentials.afk.player"
    start-afk-time: 20
    max-afk-time: 60 # in seconds
    kick: true
    message-on-start-afk: "&cYou are now AFK, we have only &f40&c seconds left before being expelled from the server."
    message-on-end-afk: "&aYou are no longer AFK. You have been afk for &f%duration%&a."
  - priority: 1
    permission: "zessentials.afk.vip"
    start-afk-time: 30
    max-afk-time: 120 # in seconds
    message-on-start-afk: "&cYou are now AFK, we have only &f90&c seconds left before being expelled from the server."
    message-on-end-afk: "&aYou are no longer AFK. You have been afk for &f%duration%&a."
    kick: true
  - priority: 2
    permission: "zessentials.afk.admin"
    start-afk-time: 60
    max-afk-time: 300 # in seconds
    # message-on-start-afk: "&cYou are now AFK, we have only &f240&c seconds left before being expelled from the server."
    # message-on-end-afk: "&aYou are no longer AFK. You have been afk for &f%duration%&a."
    kick: true

```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zessentials.groupez.dev/modules/afk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
