$usersInChannel
Retrieves a list of users present in a specified voice or text channel.
Usage:
$usersInChannel[channelID;option;separator]
Parameters:
channelID
: The ID of the channel you want to retrieve the users from. Use$channelID
for the current channel.option
(Optional): Determines what information about each user to return. Accepts the following values:id
: Returns the user's ID.mention
: Returns the user's mention.username
: Returns the user's username.count
: Returns the number of users in the channel (ignoresseparator
).- If omitted, defaults to returning the user's mention.
separator
(Optional): The string used to separate the list of users. If omitted, no separator is used.
Example:
!!exec $usersInChannel[$channelID;username;, ]
This command will return a comma-separated list of usernames of all users in the current channel.
Related Functions
- $usersWithRole: Get a list of users with a specific role.
Warning
The data for this function is pulled from the bot's cache. This means the information may not be completely up-to-date if guild members are not fully cached. Full caching is typically achieved at tier 5 bot verification.