Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require("discord.js"); // Discord Module Required
- exports.run = async (client, message, args) => { // if your cmd handler has different things than client, message etc change it
- let logs = message.guild.channels.find("name", "logs");
- if(!logs) return message.channel.send("Could not find a logs channel.");
- let user = message.mentions.users.first();
- if(!user) return message.reply("Please mention a user");
- let reason = args.join(" ");
- if(!reason) reason = "No reason given";
- message.guild.user(user).ban(reason);
- let logsEmbed = new Discord.RichEmbed() // Master is MessageEmbed
- .setTitle("User Banned")
- .setFooter("User Ban Logs")
- .setColor("#ff0000")
- .setTimestamp()
- .addField("Banned User:", `${user}, ID: ${user.id}`)
- .addField("Reason:", reason)
- .addField("Moderator:", `${message.author}, ID: ${message.author.id}`)
- .addField("Time:", message.createdAt)
- .addField("Channel:", message.channel)
- logs.send(logsEmbed);
- }
- exports.help = {
- name: "ban"
- }
Add Comment
Please, Sign In to add comment