Example #1
0
        public async Task ProcessRetainerSale(uint itemId, int amount, bool isHq)
        {
            if (this.config.RetainerNotificationChannel == null)
            {
                return;
            }

            var channel = await GetChannel(this.config.RetainerNotificationChannel);

            dynamic item = XivApi.GetItem(itemId).GetAwaiter().GetResult();

            var character     = this.dalamud.ClientState.LocalPlayer;
            var characterInfo = await GetCharacterInfo(character.Name, character.HomeWorld.GameData.Name);

            var embedBuilder = new EmbedBuilder {
                Title        = (isHq ? "<:hq:593406013651156994> " : "") + item.Name,
                Url          = "https://www.garlandtools.org/db/#item/" + itemId,
                Description  = "Sold " + amount,
                Timestamp    = DateTimeOffset.Now,
                Color        = new Color(0xd89b0d),
                ThumbnailUrl = "https://xivapi.com" + item.Icon,
                Footer       = new EmbedFooterBuilder {
                    Text    = $"XIVLauncher | {character.Name}",
                    IconUrl = characterInfo.AvatarUrl
                }
            };

            await channel.SendMessageAsync(embed : embedBuilder.Build());
        }
Example #2
0
 public override void Resolve()
 {
     if (string.IsNullOrEmpty(ItemName))
     {
         dynamic item = XivApi.GetItem((int)ItemId).GetAwaiter().GetResult();
         ItemName = item.Name;
     }
 }