16 lines
736 B
C#
16 lines
736 B
C#
using EmojiCSharp;
|
|
using TwitchLib.Client.Models;
|
|
|
|
namespace TTSMe;
|
|
|
|
public static class ExtensionMethods {
|
|
internal static string? GetStoredVoice(this ChatMessage chatMessage) => Voices.Instance().GetVoice(chatMessage.Username);
|
|
internal static bool HasStoredVoice(this ChatMessage chatMessage) => Voices.Instance().HasVoice(chatMessage.Username);
|
|
// parse out all emojis into their full names
|
|
internal static string GetMessageText(this ChatMessage chatMessage) =>
|
|
EmojiParser.ParseToAliases(chatMessage.Message)
|
|
.Replace(":", " colon ")
|
|
.Replace("_", " underscore ");
|
|
|
|
internal static TextToSpeechRequest ToTTSRequest(this ChatMessage chatMessage) => new(chatMessage.GetMessageText(), chatMessage.GetStoredVoice()!);
|
|
} |