Advertisement
End3rDNZ

Iokc

Jun 17th, 2019
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.16 KB | None | 0 0
  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. if(message.content.indexOf(config.prefix) !== 0) return;
  13. const args = message.content.slice(config.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 (command === "ban") {
  46. const buser = message.mentions.users.first()
  47. let breason = args.join(" ");
  48. if (!buser) return message.channel.send("Menciona a alguien")
  49. if (!breason) return message.channel.send("Dime La razon");
  50. if (!message.member.hasPermission("BAN_MEMBERS")) return message.channel.send("Estas sin permisos")
  51.  
  52. const bembed = new Discord.RichEmbed()
  53. .setAuthor("Bans")
  54. .setThumbnail(buser.avatarURL)
  55. .setColor("RANDOM")
  56. .addField("User Baneado", buser.username)
  57. .addField("ID", buser.id)
  58. .addField("Motivo", breason)
  59. .addField("Staff", message.author.username)
  60. message.guild.member(buser).ban(breason).reason
  61. buser.send(bembed)
  62. message.channel.send(bembed)
  63. }
  64.  
  65. else if (command == "userinfo") {
  66. let estados = {
  67. "online": "Conectado",
  68. "offline": "Desconectado",
  69. "idle": "Ocupado",
  70. "dnd": "No molestar"
  71. }
  72.  
  73. let usuario = message.mentions.members.first() || message.member
  74. let embed = new Discord.RichEmbed()
  75. embed.setColor("RANDOM")
  76. embed.setDescription(`Informacion del usuario ${usuario.user.username}`)
  77. embed.setThumbnail(usuario.user.displayAvatarURL)
  78. embed.addField(`Nombre completo`,`${usuario.user.tag}`)
  79. embed.addField(`ID`,`${usuario.id}`)
  80. embed.addField(`Estado`,`${estados[usuario.presence.status]}`)
  81. embed.addField(`Roles que tiene`,`${usuario.roles.map(m => m).join(" **|** ")}`)
  82. embed.addField(`Nickname`,`${usuario.displayname }`)
  83. return message.channel.send(embed)
  84. }
  85.  
  86. if (command == "comandos") {
  87. let embed = new Discord.RichEmbed()
  88. embed.setColor("RANDOM")
  89. embed.setDescription(`Lista de comandos del bot`)
  90. embed.addField("!Ban", "Con este comando puedes patear a un usuario")
  91. embed.addField("!Userinfo", "Con este comando podras ver la informacion de un usuario")
  92. embed.addField("!Reporte", "Para reportar algun bug del server o discord.")
  93. return message.channel.send(embed)
  94. }
  95.  
  96. else if (command == "clear"){
  97. if(!message.guild.me.hasPermission("MANAGE_MESSAGES")) return message.channel.send("No tengo los permisos necesario.")
  98. if(!args[0]) return message.channel.send("Necesitas colocar una cantidad de mensajes que quiere eliminar tiene que ser menor a 100.")
  99. let number = args [0]
  100. if(isNaN(number)) return message.channel.send("Necesitas colocar un numero no letras ni simbolos.")
  101. number = parseInt(number)
  102. if(number >= 100 || number <= 0) return message.channel.send("El valor es invalido")
  103. message.channel.bulkDelete(number +1 ). then( () => {
  104. message.channel.send(`Se elimino ${number} mensajes.`)
  105. }).catch(error => {
  106. message.channel.send(`Ocurrio un error: ${error.message}`)
  107. })
  108.  
  109. }
  110.  
  111. if(message.content === "*reportar") {
  112. let channel = client.channels.get('538351570715148309');
  113. let user = message.author;
  114. let reporte = args.join(' ');
  115. if(!reporte) return message.channel.send(`:grey_exclamation: | **Envia un reporte o dudas**`)
  116.  
  117. const embed = new Discord.RichEmbed()
  118. .setTitle(':e_mail: | **Reporte**')
  119. .setDescription('`Tu reporte se ha enviado al buzón del bot.`')
  120. .setDescription(reporte)
  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. }
  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