Advertisement
Guest User

Pastazo

a guest
Jun 17th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require('discord.js');
  2. const client = new Discord.Client();
  3. const config = require("./config.json");
  4.  
  5. client.on('ready', () => {
  6.         console.log(`Estoy listo as ${client.user.tag}`);
  7. });
  8.  
  9. const newLocal = 'gilipollas';
  10. client.on("message", async message => {
  11.     if(message.author.bot) return;
  12.     const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
  13.     const command = args.shift().toLowerCase();
  14.     // Reciving the message
  15.     console.log(message.content);
  16.     if (message.content === 'Ping') {
  17.         message.reply('Pong');
  18.     }
  19.    
  20.     if (message.content === '*ayuda') {
  21.         message.reply('¿Que necesitas?, si no te respondo llama a un staff');
  22.     }
  23.        
  24.     if (message.content === 'hola') {
  25.         message.reply('Hola Como estas?');
  26.     }
  27.    
  28.     if (message.content.includes('bug')) {
  29.         message.reply('Ve al canal de BUGS hay un admin te atendera');
  30.     }
  31.        
  32.     if (message.content === 'Hola') {
  33.         message.reply('Hola como estas?');
  34.     }
  35.        
  36.     if (message.content === 'bien') {
  37.         message.reply('Me alegro <3');
  38.     }
  39.        
  40.     if (message.content === 'Bien') {
  41.         message.reply('Me alegro');
  42.     }
  43.    
  44.    if(!message.content.startsWith(prefix)) return;
  45.  
  46.     if (command === "ban") {
  47.     const buser = message.mentions.users.first()
  48.     let breason = args.join(" ");
  49.     if (!buser) return message.channel.send("Menciona a alguien")
  50.     if (!breason) return message.channel.send("Dime La razon");
  51.     if (!message.member.hasPermission("BAN_MEMBERS")) return message.channel.send("Estas sin permisos")
  52.  
  53.     const bembed = new Discord.RichEmbed()
  54.     .setAuthor("Bans")
  55.     .setThumbnail(buser.avatarURL)
  56.     .setColor("RANDOM")
  57.     .addField("User Baneado", buser.username)
  58.     .addField("ID", buser.id)
  59.     .addField("Motivo", breason)
  60.     .addField("Staff", message.author.username)
  61.     message.guild.member(buser).ban(breason)
  62.     buser.send(bembed)
  63.     message.channel.send(bembed)
  64.     }
  65.    
  66.     if (command == "userinfo") {
  67.        let estados = {
  68.         "online": "Conectado",
  69.         "offline": "Desconectado",
  70.         "idle": "Ocupado",
  71.         "dnd": "No molestar"  
  72.      }
  73.    
  74. let usuario = message.mentions.members.first() || message.member
  75. let embed = new Discord.RichEmbed()
  76. embed.setColor("RANDOM")
  77. embed.setDescription(`Informacion del usuario ${usuario.user.username}`)
  78. embed.setThumbnail(usuario.user.displayAvatarURL)
  79. embed.addField(`Nombre completo`,`${usuario.user.tag}`)
  80. embed.addField(`ID`,`${usuario.id}`)
  81. embed.addField(`Estado`,`${estados[usuario.presence.status]}`)
  82. embed.addField(`Roles que tiene`,`${usuario.roles.map(m => m).join(" **|** ")}`)
  83. embed.addField(`Nickname`,`${usuario.displayname }`)
  84. return message.channel.send(embed)
  85.     }
  86.  
  87.      if (command == "comandos") {
  88.         let embed = new Discord.RichEmbed()
  89.         embed.setColor("RANDOM")
  90.         embed.setDescription(`Lista de comandos del bot`)
  91.         embed.addField("!Ban", "Con este comando puedes patear a un usuario")
  92.         embed.addField("!Userinfo", "Con este comando podras ver la informacion de un usuario")
  93.         embed.addField("!Reporte", "Para reportar algun bug del server o discord.")
  94.         return message.channel.send(embed)
  95.     }
  96.  
  97.      if (command == "clear"){
  98.         if(!message.guild.me.hasPermission("MANAGE_MESSAGES")) return message.channel.send("No tengo los permisos necesario.")
  99.         if(!args[0]) return message.channel.send("Necesitas colocar una cantidad de mensajes que quiere eliminar tiene que ser menor a 100.")
  100.         let number = args [0]
  101.         if(isNaN(number)) return message.channel.send("Necesitas colocar un numero no letras ni simbolos.")
  102.         number = parseInt(number)
  103.         if(number >= 100 || number <= 0) return message.channel.send("El valor es invalido")
  104.         message.channel.bulkDelete(number +1 ).then(() => {
  105.             message.channel.send(`Se elimino ${number} mensajes.`)
  106.         }).catch(error => {
  107.             message.channel.send(`Ocurrio un error: ${error.message}`)
  108.         })
  109.        
  110.     }
  111.    
  112.     if(message.content === "*reportar") {
  113.     let channel = client.channels.get('538351570715148309');
  114.     let user = message.author;
  115.     let reporte = args.join(' ');
  116.     if(!reporte) return message.channel.send(`:grey_exclamation: | **Envia un reporte o dudas**`)
  117.    
  118.     const embed = new Discord.RichEmbed()
  119.      .setTitle(':e_mail: | **Reporte**')
  120.      .setDescription('`Tu reporte se ha enviado al buzón del bot.`')
  121.      .setThumbnail(`https://cdn.discordapp.com/attachments/589602211689136181/590366071647895552/giphy.gif`)
  122.      .setColor(0x77AEFF)
  123.      .setFooter('Reporte enviado por '+ message.author.username)
  124.    
  125.     channel.send(embed)
  126.     message.channel.send(":white_check_mark: | **Reporte enviado**")
  127.            
  128.     message.channel.send(embed).then(m => m.react("\u2709"))
  129. return;
  130.     }      
  131.      if(message.content === "*decir") {
  132.         console.log(args)
  133.     let msg = args.join(" ");
  134.     if(!msg) return message.reply("Escribe algo");
  135.     message.channel.send(msg)
  136.     message.delete()
  137.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement