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)); }
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))); }
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)); }
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)); }
public async Task ViewCatalogAsync(string query = null, int page = 1) { await Context.Channel.SendMessageAsync(CatalogViewer.View(Context.Account, query, --page)); }