I have a Discord bot I want to use so I can ban a user from all of the servers the bot is in, aka the Network I own.
I need this command as I have other projects and stuff to work on and this seems to be the one that is giving me the most trouble. It would only need to work in the main guild or I switch it to role ID instead of name.
if(command === "sban") {
// this is the role of the moderator which would be used in the main guild to ban from all guilds,
if(!message.member.roles.some(r=>["Moderator"].includes(r.name)) )
return message.reply("Sorry, you don't have permissions to use this!");
let member = message.mentions.members.first();
if(!member)
return message.reply("Please mention a valid member of this server");
if(!member.bannable)
return message.reply("I cannot ban this user! Do they have a higher role? Do I have ban permissions?");
let reason = args.slice(1).join(' ');
if(!reason) reason = "No reason provided";
await member.ban(reason)
.catch(error => message.reply(`Sorry ${message.author} I couldn't ban because of : ${error}`));
message.reply(`${member.user.tag} has been banned by ${message.author.tag} because: ${reason}`);
I know the command itself has worked, I just need a way for it to work in at least 8+ Guilds at a time when I need to ban someone.