v5.0.0
$clear
Clears up to 100 messages newer than 2 weeks. Clears more than 100 only if user filter is used.
This function clears the specified amount of messages from the given channel

Fields

This function has 1 required field and three optional fields:
  1. 1.
    Amount (Required)
  2. 2.
    User Filter (Optional)
  3. 3.
    Channel ID (Optional)
  4. 4.
    Return amount (Optional)
Raw Usage: $clear[amount;userFilter (optional);channelID (optional);return amount (optional)]

Options

  • Amount - The amount of messages the bot will delete
  • User Filter - The user the bot is deleting messages from (User ID/everyone)
  • Channel ID - The channel the bot is deleting messages from
  • Return amount - Returns the amount of deleted messages (yes/no)

Usage

Without Optional Fields
1
bot.command({
2
name: "clear",
3
code: `$clear[50]`
4
//This will delete 50 latest messages from the current channel
5
});
Copied!
With Optional Fields
1
bot.command({
2
name: "clear",
3
code: `$clear[50;$authorID;$channelID;yes]`
4
//This will search in the latest 50 messages and will delete those from the author and returns the amount of deleted messages.
5
});
Copied!
Last modified 1mo ago
Copy link
Edit on GitHub