Advertisement
Guest User

Untitled

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