Back to marketplace

AFK with a reason

Curated
Message sentUtilityBy FlaviBot · 20 · 0

Description

Members mark themselves away with a command and a reason. The next message they send clears it and says how long they were gone, and anyone who pings them meanwhile gets told they are AFK and since when. Reading another member's AFK state is what the third rule demonstrates. Note: a returning message that itself contains the AFK command is not treated as a return.

What it does

The trigger and the actions it runs. Values in grey are what you'll pick when installing.

Rule 1 · When
Message sent
Messagestarts with AFK command
Rule 1 · Then · step 1
Build a value
Rule 1 · Then · step 2
Store data
Variableafk_reason
Storedper member
Rule 1 · Then · step 3
Store data
Variableafk_since
Storedper member
Rule 1 · Then · step 4
Send a message
Channelthe trigger channel
Message💤 {user.mention} is now AFK: {vars.reason}
Rule 2 · When
Message sent
Matchesany message
Rule 2 · Then · step 1
Only if {message.content} does not contain AFK command — otherwise the rule stops here
Read data
Variableafk_since
Storedper member
Rule 2 · Then · step 2
Read data
Variableafk_reason
Storedper member
Rule 2 · Then · step 3
If {vars.afk.exists} is true
Delete data
Variableafk_since
Storedper member
Rule 2 · Then · step 4
Delete data
Variableafk_reason
Storedper member
Rule 2 · Then · step 5
Send a message
Channelthe trigger channel
Message👋 Welcome back {user.mention} — you were away {vars.afk.value:relative}
Rule 3 · When
Message sent
Matchesany message
Rule 3 · Then · step 1
Only if {mentions.first.id} is set — otherwise the rule stops here
Read data
Variableafk_reason
Storedper member
For{mentions.first.id}
Rule 3 · Then · step 2
Read data
Variableafk_since
Storedper member
For{mentions.first.id}
Rule 3 · Then · step 3
If {vars.their_reason.exists} is true
Send a message
Channelthe trigger channel
Message💤 {mentions.first.mention} is AFK: {vars.their_reason.value} — since {vars.their_since.value:relative}

You'll configure

  • AFK commandtext Required

    What members type to go AFK. Keep it short and unlikely to appear in normal chat.

Version history