mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 14:38:49 +00:00
fix: more type annotation
This commit is contained in:
1 parent
3ac692d8eb
commit
2560f0fe9a
65 files changed
+408
-343
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user