Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         if (args[0] === "ban") {
  2.             if (userPex.has("BAN_MEMBERS")) {
  3.                 if (pex.has("BAN_MEMBERS")) {
  4.                     if (args[1] != null) {
  5.                         if (
  6.                             args[1].includes(message.mentions.members.first())
  7.                         ) {
  8.                             var userToBan = message.mentions.members.first();
  9.  
  10.                             if (
  11.                                 args[2] === null ||
  12.                                 args[2] === undefined ||
  13.                                 args[2] === " "
  14.                             ) {
  15.                                 message.reply(
  16.                                     "❓ **Vuoi procedere al ban senza provvedere una motivazione?**\n*(si, no)*"
  17.                                 );
  18.                                 message.channel
  19.                                     .awaitMessages(filter, {
  20.                                         max: 1,
  21.                                         time: 10000
  22.                                     })
  23.                                     .then(collected => {
  24.                                         if (
  25.                                             collected.first().content === "si"
  26.                                         ) {
  27.                                             var banReason = args[2];
  28.  
  29.                                             if (userToBan.bannable) {
  30.                                                 userToBan.ban({
  31.                                                     days: 7,
  32.                                                     reason: banReason
  33.                                                 });
  34.                                             } else {
  35.                                                 message.channel.send(
  36.                                                     ":x: **Non ho abbastanza permessi per bannare l'utente selezionato!"
  37.                                                 );
  38.                                             }
  39.                                         } else {
  40.                                             return message.reply(
  41.                                                 "✅ **Operazione annullata con successo!**"
  42.                                             );
  43.                                         }
  44.                                     });
  45.                             }
  46.                         } else {
  47.                             message
  48.                                 .reply(
  49.                                     ":x: **Devi specificare l'utente da bannare!**"
  50.                                 )
  51.                                 .then(msg => {
  52.                                     msg.delete(4000).catch(err =>
  53.                                         console.log(err)
  54.                                     );
  55.                                 });
  56.                         }
  57.                     } else {
  58.                         message
  59.                             .reply(
  60.                                 ":x: **Devi specificare l'utente da bannare!**"
  61.                             )
  62.                             .then(msg => {
  63.                                 msg.delete(4000).catch(err => console.log(err));
  64.                             });
  65.                     }
  66.                 } else {
  67.                     message
  68.                         .reply(
  69.                             ":x: **Attualmente non ho il permesso di bannare questo utente!**"
  70.                         )
  71.                         .then(msg => {
  72.                             msg.delete(4000).catch(err => console.log(err));
  73.                         });
  74.                 }
  75.             } else {
  76.                 message
  77.                     .reply(
  78.                         ":x: **Non hai il permesso di eseguire questo comando!**"
  79.                     )
  80.                     .then(msg => {
  81.                         msg.delete(4000).catch(err => console.log(err));
  82.                     });
  83.             }
  84.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement