Beispiel #1
0
        public override async Task <TypeReaderResult> ReadAsync(ICommandContext context, string input, IServiceProvider services)
        {
            if (EmoteUtils.TryParse(input, out var result))
            {
                return(TypeReaderResult.FromSuccess(result));
            }

            return(TypeReaderResult.FromError(CommandError.ParseFailed, $"Unable to parse emote `{input}`."));
        }
        public bool TryGetEmote(EmoteType emoteType, out IEmote emote)
        {
            emote = null;

            return(emotes != null && emotes.TryGetValue(emoteType, out string emoteStr) && EmoteUtils.TryParse(emoteStr, out emote));
        }