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)
|
if (msg.Length > 100)
|
||||||
{
|
{
|
||||||
msg = repliedTo.Content.Substring(0, 100);
|
msg = repliedTo.Content.Substring(0, 100);
|
||||||
var openedEmotesInTruncatedString = Regex.Matches(msg, @"<a?:").Count;
|
var endsWithOpenMention = Regex.IsMatch(msg, @"<[at]?[@#:][!&]?(\w+:)?(\d+)?(:[tTdDfFR])?$");
|
||||||
var fullEmotesInTruncatedString = Regex.Matches(msg, @"<a?:\w+:\d+>").Count;
|
if (endsWithOpenMention)
|
||||||
if (openedEmotesInTruncatedString != fullEmotesInTruncatedString)
|
|
||||||
{
|
{
|
||||||
var emoteTail = repliedTo.Content.Substring(100).Split(">")[0];
|
var mentionTail = repliedTo.Content.Substring(100).Split(">")[0];
|
||||||
if (Regex.IsMatch(msg + emoteTail, @"<a?:\w+:\d+$"))
|
if (Regex.IsMatch(msg + mentionTail, @"<[at]?[@#:][!&]?(\w+:)?\d+(:[tTdDfFR])?$"))
|
||||||
msg += emoteTail + ">";
|
msg += mentionTail + ">";
|
||||||
}
|
}
|
||||||
|
|
||||||
var spoilersInOriginalString = Regex.Matches(repliedTo.Content, @"\|\|").Count;
|
var spoilersInOriginalString = Regex.Matches(repliedTo.Content, @"\|\|").Count;
|
||||||
|
Loading…
Reference in New Issue
Block a user