Moderation
clearMessages
$clearMessages — Deletes recent messages of a channel (1000 at most, in batches of 100) and returns how many were removed. Pinned messages are kept unless deletePinned is yes; messages of bots are removed too.
Deletes recent messages of a channel (1000 at most, in batches of 100) and returns how many were removed. Pinned messages are kept unless deletePinned is yes…
Syntax
$clearMessages[channelID;amount;(deletePinned);(deleteBots)]
Parameters
- channelID (String, required) — Channel ID
- amount (Number, required) — Amount (1 to 1000)
- deletePinned (Boolean, optional) — Delete pinned messages
- deleteBots (Boolean, optional) — Ignored
Return Value
- Number.
Usage
$clearMessages[channelID;amount;deletePinned;deleteBots] → result
Example
$sendMessage[$clearMessages[channelID;amount;deletePinned;deleteBots]]
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.