Fix overly escaped data

This commit is contained in:
Noi 2020-08-11 18:22:41 -07:00
parent a3988a22ed
commit 057f7937fe
3 changed files with 2 additions and 6 deletions

View file

@ -43,8 +43,7 @@ namespace Noikoio.RegexBot.Module.AutoMod.Responses
public override async Task Invoke(SocketMessage msg) public override async Task Invoke(SocketMessage msg)
{ {
var target = (SocketGuildUser)msg.Author; var target = (SocketGuildUser)msg.Author;
await target.Guild.AddBanAsync(target, _purgeDays, Uri.EscapeDataString($"Rule '{Rule.Label}'")); await target.Guild.AddBanAsync(target, _purgeDays, $"Rule '{Rule.Label}'");
#warning Remove EscapeDataString call on next Discord.Net update
} }
} }
} }

View file

@ -21,8 +21,7 @@ namespace Noikoio.RegexBot.Module.AutoMod.Responses
public override async Task Invoke(SocketMessage msg) public override async Task Invoke(SocketMessage msg)
{ {
var target = (SocketGuildUser)msg.Author; var target = (SocketGuildUser)msg.Author;
await target.KickAsync(Uri.EscapeDataString($"Rule '{Rule.Label}'")); await target.KickAsync($"Rule '{Rule.Label}'");
#warning Remove EscapeDataString call on next Discord.Net update
} }
} }
} }

View file

@ -132,9 +132,7 @@ namespace Noikoio.RegexBot.Module.ModCommands.Commands
{ {
string reasonlog = $"Invoked by {msg.Author.ToString()}."; string reasonlog = $"Invoked by {msg.Author.ToString()}.";
if (reason != null) reasonlog += $" Reason: {reason}"; if (reason != null) reasonlog += $" Reason: {reason}";
reasonlog = Uri.EscapeDataString(reasonlog);
await notifyTask; await notifyTask;
#warning Remove EscapeDataString call on next Discord.Net update
#if !DEBUG #if !DEBUG
if (_mode == CommandMode.Ban) await g.AddBanAsync(targetId, _purgeDays, reasonlog); if (_mode == CommandMode.Ban) await g.AddBanAsync(targetId, _purgeDays, reasonlog);
else await targetobj.KickAsync(reasonlog); else await targetobj.KickAsync(reasonlog);