forked from amanv8060/DSCKIIT-BOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
purge.js
35 lines (34 loc) · 1.07 KB
/
purge.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
Copyright 2021 Aman Verma. All rights reserved.
Use of this source code is governed by a MIT license that can be
found in the LICENSE file.
*/
module.exports = {
name: "purge",
run: async (client, message, args) => {
if (!message.member.permissions.has("MANAGE_MESSAGES"))
message.channel.send(
"You don't have permission to use that command."
);
else {
let num = parseInt(args);
if (isNaN(num)) {
message.channel.send(`${typeof num}`);
} else {
// message.channel.send("ok");
await message.channel
.bulkDelete(num, true)
.then((messages) => {
message.channel.send(
`Bulk deleted ${messages.size} messages`
);
})
.catch((er) => {
console.log(er);
});
}
}
},
aliases: [],
description: "Bulk Deletes Message"
};