Entity Info
channelNames
$channelNames
Returns a list of all channel names on the server, separated by a customizable separator.
Syntax
$channelNames[(separator)]
$channelNames
The $channelNames function returns the complete list of names of all channels on the server, separated by a customizable delimiter.
Syntax
$channelNames[(separator)]
Parameters
| Parameter | Description |
|---|---|
separator |
Optional. The separator between each channel name. Default: , (comma + space). |
Return value
| Type | Description |
|---|---|
string |
All channel names concatenated with the chosen separator. |
Examples
Simple list
$sendMessage[**Server channels:** $channelNames]
List with newlines
$sendMessage[**List of channels:**
$channelNames[
]]
List with custom separator
$sendMessage[Channels: $channelNames[ | ]]
Count channels by name
$sendMessage[The server has $channelCount channels: $channelNames[, ]]
Notes
- Only channels visible to the bot are listed.
- Categories are included in the list.
- To get IDs instead of names, use a loop with
$findChannelinstead.