3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-18 23:55:02 +00:00

feat(Bans): added reason to api call

This commit is contained in:
Almeeida 2020-06-08 19:39:24 +01:00
parent c19fd847e7
commit 234686b1cf

View file

@ -524,7 +524,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
this.ignoreEvent(IgnoredEventType.Ban, userId); this.ignoreEvent(IgnoredEventType.Ban, userId);
try { try {
const deleteMessageDays = Math.min(30, Math.max(0, banOptions.deleteMessageDays ?? 1)); const deleteMessageDays = Math.min(30, Math.max(0, banOptions.deleteMessageDays ?? 1));
await this.guild.banMember(userId, deleteMessageDays); await this.guild.banMember(userId, deleteMessageDays, reason);
} catch (e) { } catch (e) {
return { return {
status: "failed", status: "failed",
@ -1201,7 +1201,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
this.ignoreEvent(IgnoredEventType.Unban, memberToKick.id); this.ignoreEvent(IgnoredEventType.Unban, memberToKick.id);
try { try {
await this.guild.unbanMember(memberToKick.id); await this.guild.unbanMember(memberToKick.id, reason);
} catch (e) { } catch (e) {
this.sendErrorMessage(msg.channel, "Failed to unban the user after banning them (-clean)"); this.sendErrorMessage(msg.channel, "Failed to unban the user after banning them (-clean)");
} }
@ -1375,7 +1375,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
try { try {
this.ignoreEvent(IgnoredEventType.Unban, user.id); this.ignoreEvent(IgnoredEventType.Unban, user.id);
await this.guild.unbanMember(user.id); await this.guild.unbanMember(user.id, reason);
} catch (e) { } catch (e) {
this.sendErrorMessage(msg.channel, "Failed to unban member; are you sure they're banned?"); this.sendErrorMessage(msg.channel, "Failed to unban member; are you sure they're banned?");
return; return;
@ -1448,7 +1448,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
this.serverLogs.ignoreLog(LogType.MEMBER_BAN, user.id); this.serverLogs.ignoreLog(LogType.MEMBER_BAN, user.id);
try { try {
await this.guild.banMember(user.id, 1); await this.guild.banMember(user.id, 1, reason);
} catch (e) { } catch (e) {
this.sendErrorMessage(msg.channel, "Failed to forceban member"); this.sendErrorMessage(msg.channel, "Failed to forceban member");
return; return;