fix: extended fix for emotes being cut off in replies to all mentions
This commit is contained in:
parent
b156f6a9cb
commit
2aac97d2a0
@ -177,13 +177,12 @@ namespace PluralKit.Bot
|
||||
if (msg.Length > 100)
|
||||
{
|
||||
msg = repliedTo.Content.Substring(0, 100);
|
||||
var openedEmotesInTruncatedString = Regex.Matches(msg, @"<a?:").Count;
|
||||
var fullEmotesInTruncatedString = Regex.Matches(msg, @"<a?:\w+:\d+>").Count;
|
||||
if (openedEmotesInTruncatedString != fullEmotesInTruncatedString)
|
||||
var endsWithOpenMention = Regex.IsMatch(msg, @"<[at]?[@#:][!&]?(\w+:)?(\d+)?(:[tTdDfFR])?$");
|
||||
if (endsWithOpenMention)
|
||||
{
|
||||
var emoteTail = repliedTo.Content.Substring(100).Split(">")[0];
|
||||
if (Regex.IsMatch(msg + emoteTail, @"<a?:\w+:\d+$"))
|
||||
msg += emoteTail + ">";
|
||||
var mentionTail = repliedTo.Content.Substring(100).Split(">")[0];
|
||||
if (Regex.IsMatch(msg + mentionTail, @"<[at]?[@#:][!&]?(\w+:)?\d+(:[tTdDfFR])?$"))
|
||||
msg += mentionTail + ">";
|
||||
}
|
||||
|
||||
var spoilersInOriginalString = Regex.Matches(repliedTo.Content, @"\|\|").Count;
|
||||
|
Loading…
Reference in New Issue
Block a user