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,25 +1,29 @@
|
||||
import config from 'config';
|
||||
import { ChatInputCommandInteraction, EmbedBuilder, Interaction, MessageComponentInteraction } from 'discord.js';
|
||||
import { BotOptions, EmbedOptions } from '../types/configTypes';
|
||||
import { ChatInputCommandInteraction, EmbedBuilder, Interaction, InteractionReplyOptions, MessageComponentInteraction } from 'discord.js';
|
||||
import { Logger } from 'pino';
|
||||
import loggerModule from '../services/logger';
|
||||
import { BotOptions, EmbedOptions } from '../types/configTypes';
|
||||
import { CustomError } from '../types/interactionTypes';
|
||||
|
||||
const embedOptions: EmbedOptions = config.get('embedOptions');
|
||||
const botOptions: BotOptions = config.get('botOptions');
|
||||
|
||||
// TODO: Update TS Type for handlError
|
||||
export const handleError = async (
|
||||
interaction: Interaction,
|
||||
error: CustomError,
|
||||
interactionIdentifier: string,
|
||||
executionId: string
|
||||
) => {
|
||||
const logger = loggerModule.child({
|
||||
const logger: Logger = loggerModule.child({
|
||||
source: 'interactionErrorHandler.ts',
|
||||
module: 'handler',
|
||||
name: 'interactionErrorHandler',
|
||||
executionId: executionId
|
||||
});
|
||||
|
||||
const errorReply = {
|
||||
// TODO: Extract replies for embeds
|
||||
const errorReply: InteractionReplyOptions = {
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
.setDescription(
|
||||
|
||||
Reference in new issue
Block a user