fix: percentage signs in mod action reasons causing crashes
This is an issue with audit log reasons that are sent as an HTML header. Eris tries to decodeURI these before sending them, which throws an error if you have an invalid percent encoding in the reason (e.g. "100%"). See eris/issues/276 and RequestHandler.js#L74
This commit is contained in:
parent
fb5c29a827
commit
f77e70d4d2
1 changed files with 3 additions and 3 deletions
|
@ -308,7 +308,7 @@ export class ModActionsPlugin extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async muteMember(member: Member, muteTime: number = null, reason: string = null) {
|
public async muteMember(member: Member, muteTime: number = null, reason: string = null) {
|
||||||
await member.addRole(this.configValue("mute_role"), reason);
|
await member.addRole(this.configValue("mute_role"));
|
||||||
await this.mutes.addOrUpdateMute(member.id, muteTime);
|
await this.mutes.addOrUpdateMute(member.id, muteTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,7 +404,7 @@ export class ModActionsPlugin extends Plugin {
|
||||||
|
|
||||||
// Remove "muted" role
|
// Remove "muted" role
|
||||||
this.serverLogs.ignoreLog(LogType.MEMBER_ROLE_REMOVE, args.member.id);
|
this.serverLogs.ignoreLog(LogType.MEMBER_ROLE_REMOVE, args.member.id);
|
||||||
await args.member.removeRole(this.configValue("mute_role"), args.reason);
|
await args.member.removeRole(this.configValue("mute_role"));
|
||||||
await this.mutes.clear(args.member.id);
|
await this.mutes.clear(args.member.id);
|
||||||
|
|
||||||
// Confirm the action to the moderator
|
// Confirm the action to the moderator
|
||||||
|
@ -517,7 +517,7 @@ export class ModActionsPlugin extends Plugin {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.ignoreEvent(IgnoredEventType.Unban, args.userId);
|
this.ignoreEvent(IgnoredEventType.Unban, args.userId);
|
||||||
await this.guild.unbanMember(args.userId, args.reason);
|
await this.guild.unbanMember(args.userId);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
msg.channel.createMessage(errorMessage("Failed to unban member"));
|
msg.channel.createMessage(errorMessage("Failed to unban member"));
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue