fix: update validation in interactions

This commit is contained in:
Marius Begby committed 2023-08-29 15:42:29 +02:00
1 parent 37546405e2
commit 5bc0239cdf
17 files changed
+162 -217

No files matched your search

@@ -1,5 +1,6 @@
import { MessageComponentInteraction } from 'discord.js';
import loggerModule from '../services/logger';
import { cannotSendMessageInChannel } from '../utils/validation/permissionValidator';
const logger = loggerModule.child({
source: 'interactionComponentHandler.js',
@@ -16,6 +17,10 @@ export const handleComponent = async (interaction: MessageComponentInteraction,
logger.debug(`Parsed componentId: ${componentId}`);
if (await cannotSendMessageInChannel({ interaction, executionId })) {
return;
}
const componentModule = await import(`../interactions/components/${componentId}.js`);
const { default: component } = componentModule;