예제 #1
0
        public static bool GetByName(string name, out CreatureCard result)
        {
            bool exists = List.SearchCard(name, out CreatureCard _result);

            result = _result;
            return(exists);
        }
예제 #2
0
        public async Task GetCreatureCard(CommandContext ctx, [Description("Name of the creature.")] params string[] name)
        {
            string _name = Util.ReconstructArgument(name);

            if (CreatureCard.GetByName(_name, out CreatureCard creature))
            {
                // Found name
                // Respond with embed
                await ctx.RespondAsync(embed : creature.ToDiscordEmbed(ctx));
            }
            else
            {
                // Didn't find name
                // Notify user
                await ctx.RespondAsync($"We don't know a creature named {_name}.");
            }
        }