fix: encode reason
This commit is contained in:
parent
d4f12ca1c8
commit
ecc25bd2e3
5 changed files with 5 additions and 5 deletions
|
@ -64,7 +64,7 @@ export const ForcebanCmd = modActionsCommand({
|
|||
pluginData.state.serverLogs.ignoreLog(LogType.MEMBER_BAN, user.id);
|
||||
|
||||
try {
|
||||
await pluginData.guild.banMember(user.id, 1, reason);
|
||||
await pluginData.guild.banMember(user.id, 1, encodeURIComponent(reason));
|
||||
} catch (e) {
|
||||
sendErrorMessage(pluginData, msg.channel, "Failed to forceban member");
|
||||
return;
|
||||
|
|
|
@ -66,7 +66,7 @@ export const MassbanCmd = modActionsCommand({
|
|||
const casesPlugin = pluginData.getPlugin(CasesPlugin);
|
||||
for (const userId of args.userIds) {
|
||||
try {
|
||||
await pluginData.guild.banMember(userId, 1, banReason);
|
||||
await pluginData.guild.banMember(userId, 1, encodeURIComponent(banReason));
|
||||
|
||||
await casesPlugin.createCase({
|
||||
userId,
|
||||
|
|
|
@ -46,7 +46,7 @@ export const UnbanCmd = modActionsCommand({
|
|||
|
||||
try {
|
||||
ignoreEvent(pluginData, IgnoredEventType.Unban, user.id);
|
||||
await pluginData.guild.unbanMember(user.id, reason);
|
||||
await pluginData.guild.unbanMember(user.id, encodeURIComponent(reason));
|
||||
} catch (e) {
|
||||
sendErrorMessage(pluginData, msg.channel, "Failed to unban member; are you sure they're banned?");
|
||||
return;
|
||||
|
|
|
@ -88,7 +88,7 @@ export async function actualKickMemberCmd(
|
|||
ignoreEvent(pluginData, IgnoredEventType.Unban, memberToKick.id);
|
||||
|
||||
try {
|
||||
await pluginData.guild.unbanMember(memberToKick.id, reason);
|
||||
await pluginData.guild.unbanMember(memberToKick.id, encodeURIComponent(reason));
|
||||
} catch (e) {
|
||||
sendErrorMessage(pluginData, msg.channel, "Failed to unban the user after banning them (-clean)");
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ export async function banUserId(
|
|||
ignoreEvent(pluginData, IgnoredEventType.Ban, userId);
|
||||
try {
|
||||
const deleteMessageDays = Math.min(30, Math.max(0, banOptions.deleteMessageDays ?? 1));
|
||||
await pluginData.guild.banMember(userId, deleteMessageDays, reason);
|
||||
await pluginData.guild.banMember(userId, deleteMessageDays, encodeURIComponent(reason));
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "failed",
|
||||
|
|
Loading…
Add table
Reference in a new issue