Skip to content
Moderation channelMessageCount

$channelMessageCount

Counts the messages sent in a channel recently, without reading their text.

Syntax

$channelMessageCount[channelID;(minutes);(humansOnly)]

Parameters

Parameter Description
channelID ID of the channel.
minutes Optional. Window in minutes, 60 by default, 1440 at most.
humansOnly Optional. yes ignores bots and webhooks; default no.

Return Value

  • string.

Usage

$channelMessageCount[123;10] → "42"

Example

$if[$channelMessageCount[$getGuildVar[town_channel];10;yes]>=20]A monster appears!$endif

Notes

The bot never reads the text, so the Message Content intent is not needed. Counting starts when the bot starts and is kept in memory. JavaScript: bc.activity.messageCount(channelId, minutes, humansOnly).

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.