Skip to content

$clear

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

Usage

$clear[channelID;amount;returnCount?;deleteBots?;deletePinned?;wordsFilter?;...usersFilter?]

Parameters

FieldTypeDescriptionRequired
channelIDnumberIn which channel the permissions shall be deleted.true
amountnumberAmount of messages to delete.true
returnCount?booleanReturn the count of deleted messages.
1. false (default)
2. true
false
deleteBots?booleanInclude bot messages.
1. false (default)
2. true
false
deletePinned?booleanInclude pinned messages.
1. false (default)
2. true
false
wordsFilter?stringWords to include, split by : colons.false
…usersFilter?stringUsers to include.false

Example(s)

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

1
client.command({
2
name: "clear",
3
code: `
4
$clear[$channelID;50;false;false;true]
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;false;false;false;;$authorId]
5
`,
6
});