Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. client.on('message', message => {
  2. if (message.author.bot) return;
  3. let args = message.content.split(" ");
  4.  
  5. const mention = message.mentions.members.first() || message.author
  6.  
  7. let command = args[0];
  8.  
  9. let user = message.mentions.users.first();
  10.  
  11. let bantime = args[2];
  12.  
  13. let reasonban = message.content.split(" ").slice(3).join(" ");
  14.  
  15. let timefilter;
  16.  
  17. if (command == prefix + "ban") {
  18.  
  19. if(!message.channel.guild){
  20. message.channel.send("**You Cant this command in private**");
  21. }
  22. if(!message.member.hasPermission("BAN_MEMBERS")) {
  23. message.channel.send("**You Need to have Permmison `BAN_MEMBERS`**");
  24. }
  25. if(!message.guild.member(client.user).hasPermission("BAN_MEMBERS")) {
  26. message.channel.send("**Bot dosent have permission `BAN_MEMBERS`**");
  27. }
  28.  
  29. if (!user){
  30. message.channel.send("**Mention Member !!**");
  31. }else if (!bantime){
  32. message.channel.send(`**
  33. choose time
  34. 15m
  35. 30m
  36. 1h
  37. 3h
  38. 1d
  39. 3d
  40. 1w
  41. 1mon
  42. **`);
  43. }else if (!reasonban){
  44. message.channel.send("**You need to put ban reason**");
  45. }
  46. if (!message.mention.hasPermission("BAN_MEMBERS")){
  47. message.channel.send("**cant ban this member he is from staff**");
  48. } else {
  49. if (bantime = "15m") {
  50. timefilter = 150000;
  51. } else if (bantime = "30m") {
  52. timefilter = 300000;
  53. } else if (bantime = "1h") {
  54. timefilter = 600000;
  55. } else if (bantime = "3h") {
  56. timefilter = 1800000;
  57. } else if (bantime = "1d") {
  58. timefilter = 14400000;
  59. } else if (bantime = "3d") {
  60. timefilter = 43200000;
  61. } else if (bantime = "1w") {
  62. timefilter = 100800000;
  63. } else if (bantime = "1mon"){
  64. timefilter = 432000000;
  65. }
  66. message.guild.member(user).ban()
  67. message.channel.send("**The Member Was Banned **" + user.tag + " **By** : " + message.author.tag);
  68. message.channel.send("**Reason : __" + reasonban + "__**");
  69.  
  70. user.send("**You are Banned By** : " + message.author.tag);
  71. user.send("**Reason : __" + reasonban + "__**");
  72. setTimeout(() => {
  73.  
  74. message.guild.unban(bannedman);
  75.  
  76. }, timefilter);
  77. }
  78. }
  79.  
  80. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement