fix: more type annotation

This commit is contained in:
Marius Begby committed 2023-08-30 14:12:55 +02:00
1 parent 3ac692d8eb
commit 2560f0fe9a
65 files changed
+408 -343

No files matched your search

+5 -3
View File
@@ -1,14 +1,15 @@
import { ChatInputCommandInteraction } from 'discord.js';
import { Logger } from 'pino';
import loggerModule from '../services/logger';
import { Command, ExtendedClient } from '../types/clientTypes';
import { cannotSendMessageInChannel } from '../utils/validation/permissionValidator';
import loggerModule from '../services/logger';
export const handleCommand = async (
interaction: ChatInputCommandInteraction,
client: ExtendedClient,
executionId: string
) => {
const logger = loggerModule.child({
const logger: Logger = loggerModule.child({
source: 'interactionCommandHandler.ts',
module: 'handler',
name: 'interactionCommandHandler',
@@ -18,7 +19,8 @@ export const handleCommand = async (
await interaction.deferReply();
logger.debug('Interaction deferred.');
const command = client.commands?.get(interaction.commandName) as Command;
// TODO: Update TS Type for command
const command: Command = client.commands?.get(interaction.commandName) as Command;
if (!command) {
logger.warn(`Interaction created but command '${interaction.commandName}' was not found.`);
return;