Add page start option

This commit is contained in:
Ethan Lane 2023-12-20 18:41:04 +00:00
parent bbe8f0d4d8
commit fa9a84dbe6

View file

@ -8,11 +8,17 @@ export default class Inventory extends Command {
this.CommandBuilder = new SlashCommandBuilder()
.setName('inventory')
.setDescription('View your inventory');
.setDescription('View your inventory')
.addNumberOption(x =>
x
.setName('page')
.setDescription('The page to start with'));
}
public override async execute(interaction: CommandInteraction) {
const embed = await InventoryHelper.GenerateInventoryPage(interaction.user.username, interaction.user.id, 0);
const page = interaction.options.get('page');
const embed = await InventoryHelper.GenerateInventoryPage(interaction.user.username, interaction.user.id, page ? Number(page.value) : 0);
await interaction.reply({
embeds: [ embed.embed ],