fast-discord-js
Version:
FastDiscordJS is an unofficial extension of the 'discord.js' library. Our extension aims to simplify the development of Discord bots, promoting cleaner code and easier maintenance.
16 lines (13 loc) • 612 B
text/typescript
import { AutocompleteInteraction, Interaction, StringSelectMenuInteraction } from "discord.js";
import { Client } from ".";
export const interactionHandlers = new Map();
export interface IInteractionHandlerOptions {
customId: string;
run: (client: Client, interaction: Exclude<Interaction, AutocompleteInteraction> | StringSelectMenuInteraction, ...args: string[]) => void;
useParams?: boolean;
}
export default class {
constructor(options: IInteractionHandlerOptions){
interactionHandlers.set(options.customId, {run: options.run, useParams: options.useParams});
}
}