mirror of https://github.com/oliverbooth/VPLink
feat: add support for custom discord emotes
This commit is contained in:
parent
67a5f9777a
commit
f3d035d67b
|
@ -24,6 +24,11 @@ public static class MentionUtility
|
||||||
else
|
else
|
||||||
switch (contents[0])
|
switch (contents[0])
|
||||||
{
|
{
|
||||||
|
// custom emote
|
||||||
|
case ':':
|
||||||
|
ParseCustomEmote(contents, ref builder, whitespaceTrivia);
|
||||||
|
break;
|
||||||
|
|
||||||
// user mention
|
// user mention
|
||||||
case '@':
|
case '@':
|
||||||
ParseUserMention(guild, contents, ref builder, whitespaceTrivia);
|
ParseUserMention(guild, contents, ref builder, whitespaceTrivia);
|
||||||
|
@ -71,6 +76,15 @@ public static class MentionUtility
|
||||||
whitespaceTrivia);
|
whitespaceTrivia);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void ParseCustomEmote(ReadOnlySpan<char> contents,
|
||||||
|
ref PlainTextMessageBuilder builder,
|
||||||
|
char whitespaceTrivia)
|
||||||
|
{
|
||||||
|
contents = contents[1..];
|
||||||
|
ReadOnlySpan<char> name = contents[..contents.IndexOf(':')];
|
||||||
|
builder.AddWord($":{name.ToString()}:", whitespaceTrivia);
|
||||||
|
}
|
||||||
|
|
||||||
private static void ParseTimestamp(ReadOnlySpan<char> contents,
|
private static void ParseTimestamp(ReadOnlySpan<char> contents,
|
||||||
ref PlainTextMessageBuilder builder,
|
ref PlainTextMessageBuilder builder,
|
||||||
char whitespaceTrivia)
|
char whitespaceTrivia)
|
||||||
|
|
Loading…
Reference in New Issue