mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 22:15:37 +00:00
fix: update validation in interactions
This commit is contained in:
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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user