Advertisement
WoLF_UsA

تعديل مع اضافة

Mar 17th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. client.on('message', message => {
  2. if (message.author.bot) return;
  3. if (!message.content.startsWith(prefix)) return;
  4. let command = message.content.split(" ")[0];
  5. command = command.slice(prefix.length);
  6. let args = message.content.split(" ").slice(1);
  7. if(command === "clear") {
  8. const nos = new Discord.RichEmbed()
  9. .setDescription("**:x: | هذا الأمر فقط للسيرفرات**")
  10. .setColor(000000)
  11. .setAuthor(`${message.author.tag}`, message.author.avatarURL)
  12. .setFooter(`Requested By ${message.author.username}` , message.author.avatarURL)
  13. .setTimestamp();
  14. if(!message.channel.guild) return message.channel.send(nos).then(m => m.delete(5000));
  15. let perms = message.member.hasPermission(`MANAGE_MESSAGES`)
  16. const nopermission = new Discord.RichEmbed()
  17. .setDescription("**:x: | MANAGE_MESSAGES للأسف لا ... تمتلك صلاحية**")
  18. .setColor(000000)
  19. .setAuthor(`${message.author.tag}`, message.author.avatarURL)
  20. .setFooter(`Requested By ${message.author.username}` , message.author.avatarURL)
  21. .setTimestamp();
  22. if(!perms) return message.channel.send(nopermission)
  23. const nopermissionme = new Discord.RichEmbed()
  24. .setDescription("**:x: | MANAGE_MESSAGES للأسف أنا لا ... أملك صلاحية*")
  25. .setColor(000000)
  26. .setAuthor(`${message.author.tag}`, message.author.avatarURL)
  27. .setFooter(`Requested By ${message.author.username}` , message.author.avatarURL)
  28. .setTimestamp();
  29. if(!message.guild.member(client.user).hasPermissions(['MANAGE_MESSAGES'])) return message.channel.send(nopermissionme);
  30. const emoji = client.emojis.find("name", "wastebasket")
  31. let deleted = args.slice(0).join("");
  32. if (deleted == "") {
  33. message.delete().then
  34. message.channel.bulkDelete(1000).then(m => m.delete(3000));
  35. } else {
  36. message.delete().then
  37. message.delete().then
  38. message.channel.bulkDelete(deleted);
  39. message.channel.send("```php\nعدد الرسائل التي تم مسحها: " + deleted + "\n```").then(m => m.delete(3000));
  40. }
  41. }
  42. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement