mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Finish preliminary rework, ready to test
This commit is contained in:
parent
57893e7f76
commit
d0a1beb809
177 changed files with 854 additions and 707 deletions
|
@ -9,6 +9,7 @@ import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
|
|||
import { kickMember } from "./kickMember";
|
||||
import { ignoreEvent } from "./ignoreEvent";
|
||||
import { isBanned } from "./isBanned";
|
||||
import { GuildMember, TextChannel } from "discord.js";
|
||||
|
||||
export async function actualKickMemberCmd(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
|
@ -16,7 +17,7 @@ export async function actualKickMemberCmd(
|
|||
args: {
|
||||
user: string;
|
||||
reason: string;
|
||||
mod: Member;
|
||||
mod: GuildMember;
|
||||
notify?: string;
|
||||
"notify-channel"?: TextChannel;
|
||||
clean?: boolean;
|
||||
|
@ -81,7 +82,7 @@ export async function actualKickMemberCmd(
|
|||
ignoreEvent(pluginData, IgnoredEventType.Ban, memberToKick.id);
|
||||
|
||||
try {
|
||||
await memberToKick.ban(1, encodeURIComponent("kick -clean"));
|
||||
await memberToKick.ban({ days: 1, reason: encodeURIComponent("kick -clean") });
|
||||
} catch {
|
||||
sendErrorMessage(pluginData, msg.channel, "Failed to ban the user to clean messages (-clean)");
|
||||
}
|
||||
|
@ -90,14 +91,14 @@ export async function actualKickMemberCmd(
|
|||
ignoreEvent(pluginData, IgnoredEventType.Unban, memberToKick.id);
|
||||
|
||||
try {
|
||||
await pluginData.guild.unbanMember(memberToKick.id, encodeURIComponent("kick -clean"));
|
||||
await pluginData.guild.bans.remove(memberToKick.id, encodeURIComponent("kick -clean"));
|
||||
} catch {
|
||||
sendErrorMessage(pluginData, msg.channel, "Failed to unban the user after banning them (-clean)");
|
||||
}
|
||||
}
|
||||
|
||||
if (kickResult.status === "failed") {
|
||||
msg.channel.createMessage(errorMessage(`Failed to kick user`));
|
||||
msg.channel.send(errorMessage(`Failed to kick user`));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue