示例#1
0
        public Task <ActionResult> BigEmojiAsync(IEmote emoteIn)
        {
            string url;

            try
            {
                url = $"https://i.kuro.mu/emoji/512x512/{emoteIn.Cast<Emoji>()?.ToString().GetUnicodePoints().Select(x => x.ToString("x2")).Join('-')}.png";
            }
            catch (ArgumentNullException)
            {
                url = emoteIn.Cast <Emote>().Url;
            }

            return(Ok(Context.CreateEmbedBuilder(url).WithImageUrl(url)));
        }
示例#2
0
        public Task <ActionResult> BigEmojiAsync(IEmote emoteIn)
        {
            string url = null;

            try
            {
                url =
                    $"https://i.kuro.mu/emoji/512x512/{emoteIn.Cast<Emoji>()?.ToString().GetUnicodePoints().Select(x => x.ToString("x2")).Join('-')}.png";
            }
            catch (ArgumentNullException)
            { }

            return(emoteIn switch
            {
                Emote emote => Ok(Context.CreateEmbedBuilder(emote.Url).WithImageUrl(emote.Url)),
                Emoji _ => Ok(Context.CreateEmbedBuilder(url).WithImageUrl(url)),
                _ => None() //should never be reached
            });