mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(proxy): correctly apply Discord webhook name restrictions (part 2)
This commit is contained in:
parent
a441c00d94
commit
48bb46bdfa
1 changed files with 5 additions and 1 deletions
|
|
@ -251,6 +251,7 @@ public static class ProxyNameExt
|
||||||
.FixClyde()
|
.FixClyde()
|
||||||
.FixHere()
|
.FixHere()
|
||||||
.FixEveryone()
|
.FixEveryone()
|
||||||
|
.FixDiscord()
|
||||||
.FixBackticks()
|
.FixBackticks()
|
||||||
.FixSingleCharacterName()
|
.FixSingleCharacterName()
|
||||||
.ThrowOnInvalidCharacters();
|
.ThrowOnInvalidCharacters();
|
||||||
|
|
@ -271,7 +272,10 @@ public static class ProxyNameExt
|
||||||
=> Regex.Replace(name, "(e)(veryone)", Replacement, RegexOptions.IgnoreCase);
|
=> Regex.Replace(name, "(e)(veryone)", Replacement, RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
static string FixBackticks(this string name)
|
static string FixBackticks(this string name)
|
||||||
=> Regex.Replace(name, "(e)(veryone)", Replacement, RegexOptions.IgnoreCase);
|
=> Regex.Replace(name, "(`)(``)", Replacement, RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
|
static string FixDiscord(this string name)
|
||||||
|
=> Regex.Replace(name, "(d)(iscord)", Replacement, RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
// Adds a Unicode hair space (\u200A) between the "c" and the "lyde" to avoid Discord matching it
|
// Adds a Unicode hair space (\u200A) between the "c" and the "lyde" to avoid Discord matching it
|
||||||
// since Discord blocks webhooks containing the word "Clyde"... for some reason. /shrug
|
// since Discord blocks webhooks containing the word "Clyde"... for some reason. /shrug
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue