$afkChannelID
Returns the servers AFK channel ID (returns an error if there isn’t such a channel).
An AFK channel on Discord is a voice channel where inactive users are automatically moved after being idle for a set time (Can be returned via $afkTimeout
). It keeps active channels clear of idle users.
Syntax
$afkChannelID
Example
$nomention
AFK channel ID: $afkChannelID
The $afkChannelID
function as said in above returns an error if there isn’t any AFK channel set on the server and there is a way to stop that.
$nomention
$try
AFK channel ID: $afkChannelID
$catch
No AFK channel found!
$endtry
- Without try block:
$afkChannelID
at 3:31
returned an error: No AFK channel set in this server!
- With try block:
For more information, read the Error Handling guide.