Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- const client = new Discord.Client();
- const config = require("./config.json");
- client.on('ready', () => {
- console.log(`Estoy listo as ${client.user.tag}`);
- });
- const newLocal = 'gilipollas';
- client.on("message", async message => {
- if(message.author.bot) return;
- if(message.content.indexOf(config.prefix) !== 0) return;
- const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
- const command = args.shift().toLowerCase();
- // Reciving the message
- console.log(message.content);
- if (message.content === 'Ping') {
- message.reply('Pong');
- }
- if (message.content === '*ayuda') {
- message.reply('¿Que necesitas?, si no te respondo llama a un staff');
- }
- if (message.content === 'hola') {
- message.reply('Hola Como estas?');
- }
- if (message.content.includes('bug')) {
- message.reply('Ve al canal de BUGS hay un admin te atendera');
- }
- if (message.content === 'Hola') {
- message.reply('Hola como estas?');
- }
- if (message.content === 'bien') {
- message.reply('Me alegro <3');
- }
- if (message.content === 'Bien') {
- message.reply('Me alegro');
- }
- if (command === "ban") {
- const buser = message.mentions.users.first()
- let breason = args.join(" ");
- if (!buser) return message.channel.send("Menciona a alguien")
- if (!breason) return message.channel.send("Dime La razon");
- if (!message.member.hasPermission("BAN_MEMBERS")) return message.channel.send("Estas sin permisos")
- const bembed = new Discord.RichEmbed()
- .setAuthor("Bans")
- .setThumbnail(buser.avatarURL)
- .setColor("RANDOM")
- .addField("User Baneado", buser.username)
- .addField("ID", buser.id)
- .addField("Motivo", breason)
- .addField("Staff", message.author.username)
- message.guild.member(buser).ban(breason).reason
- buser.send(bembed)
- message.channel.send(bembed)
- }
- else if (command == "userinfo") {
- let estados = {
- "online": "Conectado",
- "offline": "Desconectado",
- "idle": "Ocupado",
- "dnd": "No molestar"
- }
- let usuario = message.mentions.members.first() || message.member
- let embed = new Discord.RichEmbed()
- embed.setColor("RANDOM")
- embed.setDescription(`Informacion del usuario ${usuario.user.username}`)
- embed.setThumbnail(usuario.user.displayAvatarURL)
- embed.addField(`Nombre completo`,`${usuario.user.tag}`)
- embed.addField(`ID`,`${usuario.id}`)
- embed.addField(`Estado`,`${estados[usuario.presence.status]}`)
- embed.addField(`Roles que tiene`,`${usuario.roles.map(m => m).join(" **|** ")}`)
- embed.addField(`Nickname`,`${usuario.displayname }`)
- return message.channel.send(embed)
- }
- if (command == "comandos") {
- let embed = new Discord.RichEmbed()
- embed.setColor("RANDOM")
- embed.setDescription(`Lista de comandos del bot`)
- embed.addField("!Ban", "Con este comando puedes patear a un usuario")
- embed.addField("!Userinfo", "Con este comando podras ver la informacion de un usuario")
- embed.addField("!Reporte", "Para reportar algun bug del server o discord.")
- return message.channel.send(embed)
- }
- else if (command == "clear"){
- if(!message.guild.me.hasPermission("MANAGE_MESSAGES")) return message.channel.send("No tengo los permisos necesario.")
- if(!args[0]) return message.channel.send("Necesitas colocar una cantidad de mensajes que quiere eliminar tiene que ser menor a 100.")
- let number = args [0]
- if(isNaN(number)) return message.channel.send("Necesitas colocar un numero no letras ni simbolos.")
- number = parseInt(number)
- if(number >= 100 || number <= 0) return message.channel.send("El valor es invalido")
- message.channel.bulkDelete(number +1 ). then( () => {
- message.channel.send(`Se elimino ${number} mensajes.`)
- }).catch(error => {
- message.channel.send(`Ocurrio un error: ${error.message}`)
- })
- }
- if(message.content === "*reportar") {
- let channel = client.channels.get('538351570715148309');
- let user = message.author;
- let reporte = args.join(' ');
- if(!reporte) return message.channel.send(`:grey_exclamation: | **Envia un reporte o dudas**`)
- const embed = new Discord.RichEmbed()
- .setTitle(':e_mail: | **Reporte**')
- .setDescription('`Tu reporte se ha enviado al buzón del bot.`')
- .setDescription(reporte)
- .setThumbnail(`https://cdn.discordapp.com/attachments/589602211689136181/590366071647895552/giphy.gif`)
- .setColor(0x77AEFF)
- .setFooter('Reporte enviado por '+ message.author.username)
- channel.send(embed)
- message.channel.send(":white_check_mark: | **Reporte enviado**")
- message.channel.send(embed).then(m => m.react("\u2709"))
- }
- if(message.content === "*decir") {
- console.log(args)
- let msg = args.join(" ");
- if(!msg) return message.reply("Escribe algo");
- message.channel.send(msg)
- message.delete()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement