fix: show correct error in 'pk;debug proxy' when autoproxy is disabled for discord account
This commit is contained in:
parent
b30e2a01e3
commit
9dd3fba7e6
@ -268,8 +268,7 @@ public class Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
_proxy.ShouldProxy(channel, msg, context);
|
_proxy.ShouldProxy(channel, msg, context);
|
||||||
_matcher.TryMatch(context, autoproxySettings, members, out var match, msg.Content, msg.Attachments.Length > 0,
|
_matcher.TryMatch(context, autoproxySettings, members, out var match, msg.Content, msg.Attachments.Length > 0, true);
|
||||||
context.AllowAutoproxy);
|
|
||||||
|
|
||||||
await ctx.Reply("I'm not sure why this message was not proxied, sorry.");
|
await ctx.Reply("I'm not sure why this message was not proxied, sorry.");
|
||||||
}
|
}
|
||||||
|
@ -178,8 +178,7 @@ public class MessageCreated: IEventHandler<MessageCreateEvent>
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return await _proxy.HandleIncomingMessage(evt, ctx, guild, channel, ctx.AllowAutoproxy,
|
return await _proxy.HandleIncomingMessage(evt, ctx, guild, channel, true, botPermissions);
|
||||||
botPermissions);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Catch any failed proxy checks so they get ignored in the global error handler
|
// Catch any failed proxy checks so they get ignored in the global error handler
|
||||||
|
@ -43,6 +43,10 @@ public class ProxyMatcher
|
|||||||
{
|
{
|
||||||
match = default;
|
match = default;
|
||||||
|
|
||||||
|
if (!ctx.AllowAutoproxy)
|
||||||
|
throw new ProxyService.ProxyChecksFailedException(
|
||||||
|
"Autoproxy is disabled for your account. Type `pk;cfg autoproxy account enable` to re-enable it.");
|
||||||
|
|
||||||
// Skip autoproxy match if we hit the escape character
|
// Skip autoproxy match if we hit the escape character
|
||||||
if (messageContent.StartsWith(AutoproxyEscapeCharacter))
|
if (messageContent.StartsWith(AutoproxyEscapeCharacter))
|
||||||
throw new ProxyService.ProxyChecksFailedException(
|
throw new ProxyService.ProxyChecksFailedException(
|
||||||
|
Loading…
Reference in New Issue
Block a user