Skip to content
Entity Info channelCount

$channelCount

The $channelCount function returns the number of channels on the Discord server.

Syntax

$channelCount

Parameters

None. The function takes no argument ($channelCount[...] with an argument is refused).

Return value

Type Description
integer The number of channels of the server.

Examples

Total number of channels

$sendMessage[This server has $channelCount channels.]

Comparison

$if[$channelCount>50]
  $sendMessage[This server is huge! ($channelCount channels)]
$else
  $sendMessage[This server has $channelCount channels.]
$endif

Notes

  • Counts every channel returned for the server, categories included.
  • When the server has forum channels, their active (non-archived) posts are counted too.
  • Requires a server context; the function raises an error outside a guild.
  • To count categories only, use $categoryCount. To count the channels of one category, use $categoryChannels[categoryID;separator;count].

Try it

Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.