Пример #1
0
        public async Task CatalogSearchAsync([Remainder] string input)
        {
            if (!Check.NotNull(input))
            {
                await Context.Channel.SendMessageAsync(Format.Warning("You must specify a reference for the catalog to use."));

                return;
            }

            await Context.Channel.SendMessageAsync(CatalogViewer.Search(Context.Account, input));
        }
Пример #2
0
        public async Task ViewItemAsync(Item item)
        {
            CatalogStatus status = CatalogHelper.GetCatalogStatus(Context.Account, item);

            if (status == CatalogStatus.Unknown && Context.Account.Items.Exists(x => x.Id == item.Id))
            {
                CatalogHelper.SetCatalogStatus(Context.Account, item, CatalogStatus.Known);
            }

            await Context.Channel.SendMessageAsync(CatalogViewer.ViewItem(item, CatalogHelper.GetCatalogStatus(Context.Account, item)));
        }
Пример #3
0
        public async Task ViewInventorySlotAsync(int slot)
        {
            if (Context.Account.Items.Count == 0)
            {
                await Context.Channel.SendMessageAsync(Format.Warning("You do not have any items in your inventory."));

                return;
            }

            slot--;

            Math.Clamp(slot, 0, Context.Account.Items.Count - 1);

            ItemData data = Context.Account.Items[slot];

            await Context.Channel.SendMessageAsync(CatalogViewer.InspectItem(Context, Context.Account, data, slot));
        }
Пример #4
0
        public async Task InspectInInventoryAsync(string dataId)
        {
            ItemData data = ItemHelper.GetItemData(Context.Account, dataId);
            int      slot = Context.Account.Items.IndexOf(data);

            if (data == null)
            {
                if (ItemHelper.Exists(dataId))
                {
                    await Context.Channel.SendMessageAsync(Format.Warning("You do not own this item."));
                }

                await Context.Channel.SendMessageAsync(Format.Warning("Could not find a data reference."));

                return;
            }

            await Context.Channel.SendMessageAsync(CatalogViewer.InspectItem(Context, Context.Account, data, slot));
        }
Пример #5
0
 public async Task ViewCatalogAsync(string query = null, int page = 1)
 {
     await Context.Channel.SendMessageAsync(CatalogViewer.View(Context.Account, query, --page));
 }