Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client.on('message', message => {
- if (message.author.bot) return;
- if (!message.content.startsWith(prefix)) return;
- let command = message.content.split(" ")[0];
- command = command.slice(prefix.length);
- let args = message.content.split(" ").slice(1);
- if(command === "clear") {
- const nos = new Discord.RichEmbed()
- .setDescription("**:x: | هذا الأمر فقط للسيرفرات**")
- .setColor(000000)
- .setAuthor(`${message.author.tag}`, message.author.avatarURL)
- .setFooter(`Requested By ${message.author.username}` , message.author.avatarURL)
- .setTimestamp();
- if(!message.channel.guild) return message.channel.send(nos).then(m => m.delete(5000));
- let perms = message.member.hasPermission(`MANAGE_MESSAGES`)
- const nopermission = new Discord.RichEmbed()
- .setDescription("**:x: | MANAGE_MESSAGES للأسف لا ... تمتلك صلاحية**")
- .setColor(000000)
- .setAuthor(`${message.author.tag}`, message.author.avatarURL)
- .setFooter(`Requested By ${message.author.username}` , message.author.avatarURL)
- .setTimestamp();
- if(!perms) return message.channel.send(nopermission)
- const nopermissionme = new Discord.RichEmbed()
- .setDescription("**:x: | MANAGE_MESSAGES للأسف أنا لا ... أملك صلاحية*")
- .setColor(000000)
- .setAuthor(`${message.author.tag}`, message.author.avatarURL)
- .setFooter(`Requested By ${message.author.username}` , message.author.avatarURL)
- .setTimestamp();
- if(!message.guild.member(client.user).hasPermissions(['MANAGE_MESSAGES'])) return message.channel.send(nopermissionme);
- const emoji = client.emojis.find("name", "wastebasket")
- let deleted = args.slice(0).join("");
- if (deleted == "") {
- message.delete().then
- message.channel.bulkDelete(1000).then(m => m.delete(3000));
- } else {
- message.delete().then
- message.delete().then
- message.channel.bulkDelete(deleted);
- message.channel.send("```php\nعدد الرسائل التي تم مسحها: " + deleted + "\n```").then(m => m.delete(3000));
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement