Files
pavelle/src/modules/processButton.ts
T
naomi 2544d2d15b
Node.js CI / Lint and Test (push) Successful in 42s
feat: add buttons to throw results
2025-08-15 15:00:27 -07:00

21 lines
683 B
TypeScript

/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { buttonHandlers as handlers } from "../config/handlers.js";
import type { Button } from "../interfaces/button.js";
/**
* Process a button interaction.
* @param pavelle - The Pavelle instance.
* @param interaction - The interaction to process.
*/
export const processButton: Button = async(pavelle, interaction) => {
await interaction.deferReply();
const commandName = interaction.customId;
// eslint-disable-next-line no-underscore-dangle -- Accessing private property for command handler.
await (handlers[commandName] ?? handlers._default)(pavelle, interaction);
};