3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-07 11:07:19 +00:00

Global unban for main server

This commit is contained in:
iamshoXy 2024-01-18 23:50:27 +01:00
parent e0b4f18403
commit 788eb98a50
3 changed files with 12 additions and 1 deletions

View file

@ -47,12 +47,21 @@ export const UnbanCmd = modActionsCmd({
mod = args.mod;
}
const config = pluginData.config.get();
const guild = pluginData.client.guilds.cache.get(config.main_guild as Snowflake);
if (!guild) {
return {
status: "failed",
error: "Guild not found!",
};
}
pluginData.state.serverLogs.ignoreLog(LogType.MEMBER_UNBAN, user.id);
const reason = formatReasonWithAttachments(args.reason, [...msg.attachments.values()]);
try {
ignoreEvent(pluginData, IgnoredEventType.Unban, user.id);
await pluginData.guild.bans.remove(user.id as Snowflake, reason ?? undefined);
await guild.bans.remove(user.id as Snowflake, reason ?? undefined);
} catch {
sendErrorMessage(pluginData, msg.channel, "Failed to unban member; are you sure they're banned?");
return;