Create base inventory dropdown class
Some checks failed
Test / build (push) Failing after 13s

This commit is contained in:
Ethan Lane 2024-09-21 12:35:32 +01:00
parent 39d44cf8dd
commit a71b33d879
3 changed files with 14 additions and 0 deletions

View file

@ -3,6 +3,7 @@ import ChatInputCommand from "./interactionCreate/ChatInputCommand";
import Button from "./interactionCreate/Button";
import AppLogger from "./appLogger";
import NewUserDiscovery from "./interactionCreate/middleware/NewUserDiscovery";
import StringDropdown from "./interactionCreate/StringDropdown";
export class Events {
public async onInteractionCreate(interaction: Interaction) {
@ -22,6 +23,7 @@ export class Events {
if (interaction.isStringSelectMenu()) {
AppLogger.LogVerbose("Client", `StringDropdown: ${interaction.customId}`);
StringDropdown.onStringDropdownSelected(interaction);
}
}

View file

@ -31,6 +31,9 @@ import SeriesEvent from "./buttonEvents/Series";
import TradeButtonEvent from "./buttonEvents/Trade";
import ViewButtonEvent from "./buttonEvents/View";
// String Dropdown Event Imports
import InventoryStringDropdown from "./stringDropdowns/Inventory";
export default class Registry {
public static RegisterCommands() {
// Global Commands
@ -66,5 +69,6 @@ export default class Registry {
}
public static RegisterStringDropdownEvents() {
CoreClient.RegisterStringDropdownEvent("inventory", new InventoryStringDropdown());
}
}

View file

@ -0,0 +1,8 @@
import {StringSelectMenuInteraction} from "discord.js";
import {StringDropdownEvent} from "../type/stringDropdownEvent";
export default class Inventory extends StringDropdownEvent {
public override async execute(interaction: StringSelectMenuInteraction) {
await interaction.reply(`Test: ${interaction.customId}, ${interaction.values.join(",")}`);
}
}