Skip to content

Commit

Permalink
add emoji support
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyGalbreath committed Oct 18, 2023
1 parent 7688c34 commit 196221b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions DiscordBot.csproj
Expand Up @@ -49,6 +49,7 @@

<ItemGroup>
<PackageReference Include="Discord.Net" Version="3.12.0"/>
<PackageReference Include="EmojiOne" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Release'">
Expand Down
6 changes: 5 additions & 1 deletion src/Util/StringHelper.cs
Expand Up @@ -54,6 +54,10 @@ public static class StringHelper {
}
}

return msg;
foreach (Match match in Regex.Matches(msg, "<:(.+):\\d+>")) {
msg = msg.Replace(match.Value, $":{match.Groups[1].Value}:");
}

return EmojiOne.EmojiOne.ToShort(msg);
}
}

0 comments on commit 196221b

Please sign in to comment.