Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. var Discord = require("discord.js");
  2. var config = require("../config.json");
  3.  
  4. module.exports.run = async(client, message, args) =>{
  5. if(!message.guild.member(message.author).hasPermission("MANAGE_MESSAGES")) return message.channel.send({
  6. embed: {
  7. color: config.colorEmbed,
  8. title: config.errorTitle,
  9. description: config.permissionRequired + "MANAGE_MESSAGES !",
  10. footer: {
  11. icon_url: message.author.displayAvatarURL,
  12. text: config.footerMessage + message.author.username
  13. }
  14. }
  15. });
  16.  
  17. if(!message.guild.member(client.user).hasPermission("MANAGE_MESSAGES")) return message.channel.send({
  18. embed: {
  19. color: config.colorEmbed,
  20. title: config.errorTitle,
  21. description: config.botPermissionRequired + "MANAGE_MESSAGES !",
  22. footer: {
  23. icon_url: message.author.displayAvatarURL,
  24. text: config.footerMessage + message.author.username
  25. }
  26. }
  27. });
  28.  
  29. if(!args[0] || isNaN(args[0]) || args[0] === 0) return message.channel.send({
  30. embed: {
  31. color: config.colorEmbed,
  32. title: config.errorTitle,
  33. description: config.numberRequired,
  34. footer: {
  35. icon_url: message.author.displayAvatarURL,
  36. text: config.footerMessage + message.author.username
  37. }
  38. }
  39. });
  40.  
  41. message.channel.bulkDelete(args[0]).catch(e =>{
  42. message.channel.send({
  43. embed: {
  44. color: config.colorEmbed,
  45. title: config.errorTitle,
  46. description: "Une erreur est survenue: " + "```" + e + "```",
  47. footer: {
  48. icon_url: message.author.displayAvatarURL,
  49. text: config.footerMessage + message.author.username
  50. }
  51. }
  52. });
  53. });
  54.  
  55. if(args[0] > 1){
  56. message.channel.send({
  57. embed: {
  58. color: config.colorEmbed,
  59. title: config.successTitle,
  60. description: `${args[0]} ont été supprimés !`,
  61. footer: {
  62. icon_url: message.author.displayAvatarURL,
  63. text: config.footerMessage + message.author.username
  64. }
  65. }
  66. });
  67. }
  68.  
  69. if(args[0] === 1){
  70. message.channel.send({
  71. embed: {
  72. color: config.colorEmbed,
  73. title: config.successTitle,
  74. description: `${args[0]} message à été supprimé !`,
  75. footer: {
  76. icon_url: message.author.displayAvatarURL,
  77. text: config.footerMessage + message.author.username
  78. }
  79. }
  80. });
  81. }
  82. }
  83.  
  84. module.exports.help ={
  85. name: "clear"
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement