Reimplement autoproxy escape character
This commit is contained in:
		| @@ -9,6 +9,7 @@ namespace PluralKit.Bot | |||||||
| { | { | ||||||
|     public class ProxyMatcher |     public class ProxyMatcher | ||||||
|     { |     { | ||||||
|  |         private static readonly char AutoproxyEscapeCharacter = '\\'; | ||||||
|         private static readonly Duration LatchExpiryTime = Duration.FromHours(6); |         private static readonly Duration LatchExpiryTime = Duration.FromHours(6); | ||||||
|  |  | ||||||
|         private readonly IClock _clock; |         private readonly IClock _clock; | ||||||
| @@ -42,6 +43,10 @@ namespace PluralKit.Bot | |||||||
|         { |         { | ||||||
|             match = default; |             match = default; | ||||||
|  |  | ||||||
|  |             // Skip autoproxy match if we hit the escape character | ||||||
|  |             if (messageContent.StartsWith(AutoproxyEscapeCharacter)) | ||||||
|  |                 return false; | ||||||
|  |  | ||||||
|             // Find the member we should autoproxy (null if none) |             // Find the member we should autoproxy (null if none) | ||||||
|             var member = ctx.AutoproxyMode switch |             var member = ctx.AutoproxyMode switch | ||||||
|             { |             { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user