public async Task ListStructures()
        {
            StringBuilder reply = new StringBuilder();
            List <EsiCorporationStructure> structures = await GetCorporationStructures();

            for (int i = 0; i < structures.Count; i++)
            {
                EsiCorporationStructure structure = structures[i];
                EsiItem structureItem             = await GetItem(structure.TypeId);

                EsiSystem structureSystem = await GetSystem(structure.SystemId);

                reply.Append($"{i}: {structureItem.Name} in {structureSystem.Name}\n");
            }

            await RespondAsync($"```{reply}```", false, false);
        }
Пример #2
0
        /// <summary>
        /// Create a embed for a killmail
        /// </summary>
        /// <param name="km"></param>
        /// <returns></returns>
        async Task <Embed> BuildKillmailEmbed(KillMail km)
        {
            Attacker finalBlow = km.Attackers.Find(a => a.FinalBlow);
            DateTime killTime  = DateTime.Parse(km.Time);

            List <EsiCharacter> chars = await GetCharacters(new List <object>()
            {
                km.Victim.CharacterID.ToString(),
                finalBlow.CharacterID.ToString(),
            });

            List <EsiCorporation> corps = await GetCorporations(new List <object>()
            {
                km.Victim.CorporationID.ToString(),
                finalBlow.CorporationID.ToString(),
            });

            List <EsiAlliance> alliances = await GetAlliances(corps.Select(x => x.AllianceId).Cast <object>().ToList());

            List <EsiItem> ships = await GetShips(new List <object>()
            {
                km.Victim.ShipType.ToString(),
                finalBlow.ShipType.ToString(),
            });

            EsiSystem system = (await ApiModule.Esi.Path("/universe/systems/{system_id}/").Get <EsiSystem>(("system_id", km.Solarsystem.ToString()))).FirstPage;

            return(new KillmailEmbedBuilder()
                   .AddVictim(chars[0].Name, (int)km.Victim.CharacterID, corps[0].Name, (int)km.Victim.CorporationID, alliances[0].Name, km.Victim.ShipType)
                   .AddFinalBlow(chars[1].Name, (int)finalBlow.CharacterID, corps[1].Name, (int)finalBlow.CorporationID, alliances[1].Name, finalBlow.ShipType, ships[1].Name, finalBlow.ShipType)
                   .AddDetails(km.Zkb.Awox, km.Zkb.TotalValue, killTime, km.KillmailId)
                   .AddTitle(ships[0].Name, system.Name, km.KillmailId)
                   .AddThumbnail(km.Victim.ShipType)
                   .AddFooter((int)finalBlow.CorporationID)
                   .Build());
        }