$clear
Delete messages in bulk with options to delete messages from users and in specific channels.

FUNCTION USAGE

  • $clear[amount]
  • $clear[amount;userID/everyone]
  • $clear[amount;userID/everyone;channelID]

Properties:

amount - The amount of messages to delete. userID/everyone - Define a userID in this field to delete messages from a specific user. everyone will delete all messages to the amount. channelID - Define a channelID to delete messages in a specific channel.
Maximum of 99 messages can be cleared per command execution and only 1 $clear function can be used per command. Discord bots can not delete messages older than 2 weeks!

Example 1: Clearing a number of messages from the current channel

1
bot.Command({
2
name: "clear",
3
code: `Cleared $message[] messages
4
$clear[$message[]]`
5
})
Copied!

Example 2: Clearing a number of messages sent by a user

1
bot.Command({
2
name: "clear",
3
code: `Cleared $message[1] messages from <@$mentioned[1]>
4
$clear[$message[1];$mentioned[1]]`
5
})
Copied!

Example 3: Clearing a number of messages in a specific channel

1
bot.Command({
2
name: "clear",
3
code: `Cleared $message[1] messages in <#$mentionedChannels[1]>
4
$clear[$message[1];;$mentionedChannels[1]]`
5
})
Copied!
Last modified 5mo ago
Copy link
Contents
Properties: