mirror of
https://github.com/PluralKit/PluralKit.git
synced 2025-12-19 14:06:48 +00:00
feat: disable autoproxy with 3 backslashes
Some checks failed
Build and push Docker image / .net docker build (push) Has been cancelled
.net checks / run .net tests (push) Has been cancelled
.net checks / dotnet-format (push) Has been cancelled
Build and push Rust service Docker images / rust docker build (push) Has been cancelled
rust checks / cargo fmt (push) Has been cancelled
Some checks failed
Build and push Docker image / .net docker build (push) Has been cancelled
.net checks / run .net tests (push) Has been cancelled
.net checks / dotnet-format (push) Has been cancelled
Build and push Rust service Docker images / rust docker build (push) Has been cancelled
rust checks / cargo fmt (push) Has been cancelled
This commit is contained in:
parent
a4defbe13e
commit
8ee128e6de
1 changed files with 12 additions and 0 deletions
|
|
@ -66,6 +66,15 @@ public class ProxyService
|
|||
|
||||
var autoproxySettings = await _repo.GetAutoproxySettings(ctx.SystemId.Value, guild.Id, null);
|
||||
|
||||
if (IsDisableAutoproxy(message))
|
||||
{
|
||||
await _repo.UpdateAutoproxy(ctx.SystemId.Value, guild.Id, null, new()
|
||||
{
|
||||
AutoproxyMode = AutoproxyMode.Off
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (autoproxySettings.AutoproxyMode == AutoproxyMode.Latch && IsUnlatch(message))
|
||||
{
|
||||
// "unlatch"
|
||||
|
|
@ -495,6 +504,9 @@ public class ProxyService
|
|||
public static bool IsUnlatch(Message message)
|
||||
=> message.Content.StartsWith(@"\\") || message.Content.StartsWith("\\\u200b\\");
|
||||
|
||||
public static bool IsDisableAutoproxy(Message message)
|
||||
=> message.Content.StartsWith(@"\\\") || message.Content.StartsWith("\\\u200b\\\u200b\\");
|
||||
|
||||
private async Task HandleProxyExecutedActions(MessageContext ctx, AutoproxySettings autoproxySettings,
|
||||
Message triggerMessage, Message proxyMessage, ProxyMatch match,
|
||||
bool deletePrevious = true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue