public static bool GetByName(string name, out SpellCard result) { bool exists = List.SearchCard(name, out SpellCard _result); result = _result; return(exists); }
public async Task Spell(CommandContext ctx, [Description("Name of the spell.")] params string[] name) { string _name = Util.ReconstructArgument(name); if (SpellCard.GetByName(_name, out SpellCard spell)) { // Found name // Respond with embed await ctx.RespondAsync(embed : spell.ToDiscordEmbed(ctx)); } else { // Didn't find name // Notify user await ctx.RespondAsync($"We don't know a spell named {_name}."); } }