mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Fix various bugs and regressions
This commit is contained in:
parent
8785354a2b
commit
80c572f594
11 changed files with 60 additions and 57 deletions
|
|
@ -87,7 +87,7 @@ namespace PluralKit.Bot
|
|||
|
||||
var webhookReq = new ExecuteWebhookRequest
|
||||
{
|
||||
Username = FixClyde(req.Name).Truncate(80),
|
||||
Username = FixProxyName(req.Name).Truncate(80),
|
||||
Content = content,
|
||||
AllowedMentions = allowedMentions,
|
||||
AvatarUrl = !string.IsNullOrWhiteSpace(req.AvatarUrl) ? req.AvatarUrl : null,
|
||||
|
|
@ -185,6 +185,8 @@ namespace PluralKit.Bot
|
|||
return chunks;
|
||||
}
|
||||
|
||||
private string FixProxyName(string name) => FixSingleCharacterName(FixClyde(name));
|
||||
|
||||
private string FixClyde(string name)
|
||||
{
|
||||
static string Replacement(Match m) => m.Groups[1].Value + "\u200A" + m.Groups[2].Value;
|
||||
|
|
@ -193,5 +195,12 @@ namespace PluralKit.Bot
|
|||
// since Discord blocks webhooks containing the word "Clyde"... for some reason. /shrug
|
||||
return Regex.Replace(name, "(c)(lyde)", Replacement, RegexOptions.IgnoreCase);
|
||||
}
|
||||
|
||||
private string FixSingleCharacterName(string proxyName)
|
||||
{
|
||||
if (proxyName.Length == 1)
|
||||
return proxyName + "\u17b5";
|
||||
return proxyName;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue