mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 14:38:49 +00:00
feat!: Extracted handling of interactions into separate files
This commit is contained in:
1 parent
8e9cb308e9
commit
780e20d419
7 files changed
+166
-153
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { AutocompleteInteraction } from 'discord.js';
|
||||
import loggerModule from '../services/logger';
|
||||
|
||||
const logger = loggerModule.child({
|
||||
source: 'interactionCutocompleteHandler.ts',
|
||||
module: 'handler',
|
||||
name: 'interactionAutocompleteHandler'
|
||||
});
|
||||
|
||||
export const handleAutocomplete = async (interaction: AutocompleteInteraction, executionId: string) => {
|
||||
const autocompleteModule = await import(`../interactions/autocomplete/${interaction.commandName}.js`);
|
||||
const { default: autocomplete } = autocompleteModule;
|
||||
|
||||
logger.debug('Executing autocomplete interaction.');
|
||||
await autocomplete.execute({ interaction, executionId });
|
||||
};
|
||||
Reference in new issue
Block a user