feat: refactored handling of validators

This commit is contained in:
Marius Begby committed 2023-09-05 21:35:18 +02:00
1 parent e67d0004b0
commit 8c05499f08
31 files changed
+316 -338

No files matched your search

+2 -4
View File
@@ -3,7 +3,7 @@ import { Logger } from 'pino';
import loggerModule from '../services/logger';
import { ExtendedClient } from '../types/clientTypes';
import { BaseComponentInteraction } from '../classes/interactions';
import { cannotSendMessageInChannel } from '../utils/validation/permissionValidator';
import { checkChannelPermissionViewable } from '../utils/validation/permissionValidator';
export const handleComponent = async (
interaction: MessageComponentInteraction,
@@ -25,9 +25,7 @@ export const handleComponent = async (
logger.debug(`Parsed componentId '${componentId}' from identifier '${interactionIdentifier}'.`);
if (await cannotSendMessageInChannel({ interaction, executionId })) {
return;
}
await checkChannelPermissionViewable({ interaction, executionId });
const component: BaseComponentInteraction = client.componentInteractions!.get(
componentId