feat: add buttons to throw results
Node.js CI / Lint and Test (push) Successful in 42s

This commit is contained in:
2025-08-15 15:00:27 -07:00
parent 2ad10115b8
commit 2544d2d15b
10 changed files with 286 additions and 9 deletions
+20
View File
@@ -0,0 +1,20 @@
/**
* @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);
};