Skip to content

$clear

$clear will delete the amount of given messages in a channel.

Usage

$clear[channelID;amount;filter?;returnCount?]

Parameters

FieldTypeDescriptionRequired
channelIDnumberIn which channel the permissions shall be deleted.true
amountnumberAmount of messages to delete.true
filter?stringFilter of messages which are to delete.
1. everyone (default)
2. unpinned
3. bots
4. user:id
false
returnCount?booleanReturn the count of deleted messages.
1. false (default)
2. true
false

Example(s)

This will delete the most recent fifty messages which are not pinned:

1
client.command({
2
name: "clear",
3
code: `
4
$clear[$channelID;50;unpinned;false]
5
`
6
});

This will delete the most recent fifty messages which are sent by the command author:

1
client.command({
2
name: "clear",
3
code: `
4
$clear[$channelID;50;user:$authorId;false]
5
`
6
});