public static string GetString(Emotes emote) { var attribute = typeof(Emotes).GetMember(emote.ToString()).FirstOrDefault()?.GetCustomAttributes(typeof(EmoteValueAttribute), false).FirstOrDefault(); if (attribute != null && attribute is EmoteValueAttribute emoteValueAttribute) { return(emoteValueAttribute.Value); } return(null); }
public static string GetEmojiName(Emotes emote) { return(Globals.RegularExpression.SqlUnderscore.Replace(emote.ToString(), @"_$1$2").ToLower()); }