Changed some stuff in reason section of ban

This commit is contained in:
= 2021-11-25 13:29:34 +01:00
parent 73f681b294
commit 77ace4109f

View file

@ -191,9 +191,9 @@ client.on("interactionCreate", (int) => {
var mem = int.guild.members.cache.get(int.user.id); var mem = int.guild.members.cache.get(int.user.id);
if(!mem.permissions.has("BAN_MEMBERS")) return int.reply(":x: You do not have the permissions to ban users."); if(!mem.permissions.has("BAN_MEMBERS")) return int.reply(":x: You do not have the permissions to ban users.");
var mem2 = int.guild.members.cache.get(int.options.getUser("user").id); var mem2 = int.guild.members.cache.get(int.options.getUser("user").id);
mem2.ban(int.options.getString("reason")).then(() => { var reason = "No reason specified.";
var reason = "No reason specified."; if(int.options.getString("reason") !== null) reason = int.options.getString("reason");
if(int.options.getString("reason") !== null) reason = int.options.getString("reason"); mem2.ban(reason).then(() => {
int.reply("Successfully banned <@!" + int.options.getUser("user").id + "> with reason `" + reason + "`."); int.reply("Successfully banned <@!" + int.options.getUser("user").id + "> with reason `" + reason + "`.");
}).catch(e => { }).catch(e => {
int.reply("An error occured with my code, please report this to " + Eco.tag + " or " + Helixu.tag + ": ```js\n" + e.stack + "```"); int.reply("An error occured with my code, please report this to " + Eco.tag + " or " + Helixu.tag + ": ```js\n" + e.stack + "```");