Example #1
0
        public async Task GetInfo(string name)
        {
            // Prioritize species first.

            Species[] species = await BotUtils.GetSpeciesFromDb("", name);

            if (species.Count() > 0)
            {
                if (await BotUtils.ReplyValidateSpeciesAsync(Context, species))
                {
                    await SpeciesCommands.ShowSpeciesInfoAsync(Context, species[0]);
                }
            }
            else
            {
                // Otherwise, show other taxon.

                Taxon[] taxa = await BotUtils.GetTaxaFromDb(name);

                if (taxa.Count() <= 0)
                {
                    // This command was traditionally used with species, so show the user species suggestions in the event of no matches.
                    await BotUtils.ReplyAsync_SpeciesSuggestions(Context, "", name, async (BotUtils.ConfirmSuggestionArgs args) => await GetInfo(args.Suggestion));
                }
                else if (await BotUtils.ReplyAsync_ValidateTaxa(Context, taxa))
                {
                    await BotUtils.Command_ShowTaxon(Context, taxa[0].type, name);
                }
            }
        }
Example #2
0
 public async Task Genus(string name = "")
 {
     await BotUtils.Command_ShowTaxon(Context, TaxonRank.Genus, name);
 }
Example #3
0
 public async Task Domain(string name = "")
 {
     await BotUtils.Command_ShowTaxon(Context, TaxonRank.Domain, name);
 }
Example #4
0
 public async Task Kingdom(string name = "")
 {
     await BotUtils.Command_ShowTaxon(Context, TaxonRank.Kingdom, name);
 }
Example #5
0
 public async Task Order(string name = "")
 {
     await BotUtils.Command_ShowTaxon(Context, TaxonRank.Order, name);
 }
Example #6
0
 public async Task Family(string name = "")
 {
     await BotUtils.Command_ShowTaxon(Context, TaxonRank.Family, name);
 }