Exemple #1
0
        public async Task ItemAsync([Remainder] string itemName)
        {
            if (itemName == string.Empty)
            {
                await ReplyAsync("Please enter a item name.");

                return;
            }

            try
            {
                var item = _items.LoadObject(itemName);

                var embed = new EmbedBuilder()
                            .WithTitle(item.Name)
                            .WithDescription(item.ItemType)
                            .WithUrl(item.LibraryUrl)
                            .WithThumbnailUrl(item.ImageUrl)
                            .WithColor(Color.Blue)
                            .Build();

                await ReplyAsync(embed : embed);
            }
            catch (Exception ex)
            {
                _log.Log($"{ex.GetType().ToString()} occurred while creating item embed");
                await ReplyAsync($"What is a `{itemName}`?");
            }
        }