Skip to content
Snippets Groups Projects
Commit 79b048ec authored by Levatax's avatar Levatax
Browse files

Update ban.js

parent 0c03bf96
Branches
No related tags found
No related merge requests found
const Discord = require('discord.js');
const Discord = require("discord.js");
const client = new Discord.Client();
exports.run = (client, message, args) => {
let guild = message.guild
let reason = args.slice(1).join(' ');
let guild = message.guild;
let reason = args.slice(1).join(" ");
let user = message.mentions.users.first();
if (reason.length < 1) return message.reply('Can You Try Again And Write A Reason?');
if (message.mentions.users.size < 1) return message.reply('Can You Mention Who I Will Ban?').catch(console.error);
if (!message.guild.member(user).bannable) return message.reply('You Dont Have Permission To Ban This User');
if (reason.length < 1)
return message.reply("Try again and write a reason.");
if (message.mentions.users.size < 1)
return message
.reply("No User Mention")
.catch(console.error);
if (!message.guild.member(user).bannable)
return message.reply("You don't have permission to ban this user");
message.guild.member(user).ban();
message.channel.send('The User' + user + 'Banned From This Guild. Reason:' + reason)
message.channel.send(
"User" + user + "banned from this guild. Reason:" + reason
);
};
exports.conf = {
enabled: true,
guildOnly: true,
......@@ -23,7 +27,7 @@ exports.conf = {
};
exports.help = {
name: 'ban',
description: 'Bans User From Guild',
usage: '*ban @user reason'
name: "ban",
description: "Bans User From Guild",
usage: "*ban @user reason"
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment