示例#1
0
        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);
        }
示例#2
0
 public static string GetEmojiName(Emotes emote)
 {
     return(Globals.RegularExpression.SqlUnderscore.Replace(emote.ToString(), @"_$1$2").ToLower());
 }