move message length check *after* proxy members check
This commit is contained in:
parent
6409c76f10
commit
272a3430a6
@ -54,9 +54,6 @@ namespace PluralKit.Bot
|
|||||||
if (!ShouldProxy(channel, message, ctx))
|
if (!ShouldProxy(channel, message, ctx))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// this is hopefully temporary, so not putting it into a separate method
|
|
||||||
if (message.Content != null && message.Content.Length > 2000) throw new PKError("PluralKit cannot proxy messages over 2000 characters in length.");
|
|
||||||
|
|
||||||
// Fetch members and try to match to a specific member
|
// Fetch members and try to match to a specific member
|
||||||
await using var conn = await _db.Obtain();
|
await using var conn = await _db.Obtain();
|
||||||
|
|
||||||
@ -67,6 +64,9 @@ namespace PluralKit.Bot
|
|||||||
if (!_matcher.TryMatch(ctx, members, out var match, message.Content, message.Attachments.Length > 0,
|
if (!_matcher.TryMatch(ctx, members, out var match, message.Content, message.Attachments.Length > 0,
|
||||||
allowAutoproxy)) return false;
|
allowAutoproxy)) return false;
|
||||||
|
|
||||||
|
// this is hopefully temporary, so not putting it into a separate method
|
||||||
|
if (message.Content != null && message.Content.Length > 2000) throw new PKError("PluralKit cannot proxy messages over 2000 characters in length.");
|
||||||
|
|
||||||
// Permission check after proxy match so we don't get spammed when not actually proxying
|
// Permission check after proxy match so we don't get spammed when not actually proxying
|
||||||
if (!await CheckBotPermissionsOrError(botPermissions, message.ChannelId))
|
if (!await CheckBotPermissionsOrError(botPermissions, message.ChannelId))
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user