Create simple inventory list #120

Merged
Vylpes merged 10 commits from feature/97-simple-inventory-list into develop 2023-12-22 14:41:14 +00:00
2 changed files with 20 additions and 1 deletions
Showing only changes of commit bbe8f0d4d8 - Show all commits

View file

@ -0,0 +1,17 @@
import { ButtonInteraction } from "discord.js";
import { ButtonEvent } from "../type/buttonEvent";
import InventoryHelper from "../helpers/InventoryHelper";
export default class Inventory extends ButtonEvent {
public override async execute(interaction: ButtonInteraction) {
const userid = interaction.customId.split(' ')[1];
const page = interaction.customId.split(' ')[2];
const embed = await InventoryHelper.GenerateInventoryPage(interaction.user.username, userid, Number(page));
await interaction.reply({
embeds: [ embed.embed ],
components: [ embed.row ],
});
}
}

View file

@ -1,4 +1,5 @@
import { CoreClient } from "./client/client"; import { CoreClient } from "./client/client";
import { Environment } from "./constants/Environment";
// Global Command Imports // Global Command Imports
import About from "./commands/about"; import About from "./commands/about";
@ -13,8 +14,8 @@ import Droprarity from "./commands/stage/droprarity";
// Button Event Imports // Button Event Imports
import Claim from "./buttonEvents/Claim"; import Claim from "./buttonEvents/Claim";
import InventoryButtonEvent from "./buttonEvents/Inventory";
import Reroll from "./buttonEvents/Reroll"; import Reroll from "./buttonEvents/Reroll";
import { Environment } from "./constants/Environment";
export default class Registry { export default class Registry {
public static RegisterCommands() { public static RegisterCommands() {
@ -36,6 +37,7 @@ export default class Registry {
public static RegisterButtonEvents() { public static RegisterButtonEvents() {
CoreClient.RegisterButtonEvent('claim', new Claim()); CoreClient.RegisterButtonEvent('claim', new Claim());
CoreClient.RegisterButtonEvent('inventory', new InventoryButtonEvent);
CoreClient.RegisterButtonEvent('reroll', new Reroll()); CoreClient.RegisterButtonEvent('reroll', new Reroll());
} }
} }