feat(bot): Case insensitive proxy tags matching (#490)

This commit is contained in:
Katrix
2022-11-23 09:48:24 +01:00
committed by GitHub
parent 09ac002d26
commit 4f0236d766
14 changed files with 89 additions and 19 deletions

View File

@@ -78,7 +78,7 @@ public class ProxyService
members = (await _repo.GetProxyMembers(message.Author.Id, message.GuildId!.Value)).ToList();
if (!_matcher.TryMatch(ctx, autoproxySettings, members, out var match, message.Content, message.Attachments.Length > 0,
allowAutoproxy)) return false;
allowAutoproxy, ctx.CaseSensitiveProxyTags)) return false;
// this is hopefully temporary, so not putting it into a separate method
if (message.Content != null && message.Content.Length > 2000)
@@ -208,8 +208,9 @@ public class ProxyService
"Proxying was disabled in this channel by a server administrator (via the proxy blacklist).");
var autoproxySettings = await _repo.GetAutoproxySettings(ctx.SystemId.Value, msg.Guild!.Value, null);
var config = await _repo.GetSystemConfig(ctx.SystemId.Value);
var prevMatched = _matcher.TryMatch(ctx, autoproxySettings, members, out var prevMatch, originalMsg.Content,
originalMsg.Attachments.Length > 0, false);
originalMsg.Attachments.Length > 0, false, ctx.CaseSensitiveProxyTags);
var match = new ProxyMatch
{