diff --git a/src/bot.ts b/src/bot.ts index 5cc22a56..135e1e47 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -14,7 +14,6 @@ import { Logger } from 'pino'; const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'bot.js', module: 'shardingClient', name: 'shardingClient', executionId: executionId, diff --git a/src/events/client/debug.ts b/src/events/client/debug.ts index f8f55d98..bcb12e43 100644 --- a/src/events/client/debug.ts +++ b/src/events/client/debug.ts @@ -11,7 +11,6 @@ module.exports = { execute: async (message: string) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'debug.js', module: 'event', name: 'clientDebug', executionId: executionId diff --git a/src/events/client/disconnect.ts b/src/events/client/disconnect.ts index b7217dd6..4d5b515e 100644 --- a/src/events/client/disconnect.ts +++ b/src/events/client/disconnect.ts @@ -16,7 +16,6 @@ module.exports = { execute: async (client: ExtendedClient) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'disconnect.js', module: 'event', name: 'clientDisconnect', executionId: executionId, diff --git a/src/events/client/error.ts b/src/events/client/error.ts index 734f6040..c23d8560 100644 --- a/src/events/client/error.ts +++ b/src/events/client/error.ts @@ -11,7 +11,6 @@ module.exports = { execute: async (error: Error) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'error.js', module: 'event', name: 'clientError', executionId: executionId diff --git a/src/events/client/guildCreate.ts b/src/events/client/guildCreate.ts index 56d80f5d..60ee29e6 100644 --- a/src/events/client/guildCreate.ts +++ b/src/events/client/guildCreate.ts @@ -11,7 +11,6 @@ module.exports = { execute: async (guild: Guild) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'guildCreate.js', module: 'event', name: 'guildCreate', executionId: executionId, diff --git a/src/events/client/guildDelete.ts b/src/events/client/guildDelete.ts index d1c058db..5d37416e 100644 --- a/src/events/client/guildDelete.ts +++ b/src/events/client/guildDelete.ts @@ -11,7 +11,6 @@ module.exports = { execute: async (guild: Guild) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'guildDelete.js', module: 'event', name: 'guildDelete', executionId: executionId, diff --git a/src/events/client/ready.ts b/src/events/client/ready.ts index 7e89f708..d37d67ec 100644 --- a/src/events/client/ready.ts +++ b/src/events/client/ready.ts @@ -20,7 +20,6 @@ module.exports = { execute: async (client: ExtendedClient) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'ready.js', module: 'event', name: 'clientReady', executionId: executionId, diff --git a/src/events/client/reconnecting.ts b/src/events/client/reconnecting.ts index 640191e6..3646965a 100644 --- a/src/events/client/reconnecting.ts +++ b/src/events/client/reconnecting.ts @@ -16,7 +16,6 @@ module.exports = { execute: async (client: ExtendedClient) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'reconnecting.js', module: 'event', name: 'clientReconnecting', executionId: executionId, diff --git a/src/events/client/warn.ts b/src/events/client/warn.ts index 22b1d54d..39d87f13 100644 --- a/src/events/client/warn.ts +++ b/src/events/client/warn.ts @@ -10,7 +10,6 @@ module.exports = { execute: async (warning: string) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'warn.js', module: 'event', name: 'clientWarn', executionId: executionId diff --git a/src/events/interactions/interactionCreate.ts b/src/events/interactions/interactionCreate.ts index d9e0d93d..b77088ed 100644 --- a/src/events/interactions/interactionCreate.ts +++ b/src/events/interactions/interactionCreate.ts @@ -23,7 +23,6 @@ module.exports = { const inputTime: number = new Date().getTime(); const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'interactionCreate.js', module: 'event', name: 'interactionCreate', executionId: executionId, diff --git a/src/events/player/generalDebug.ts b/src/events/player/generalDebug.ts index c5e6e313..965a34e4 100644 --- a/src/events/player/generalDebug.ts +++ b/src/events/player/generalDebug.ts @@ -9,7 +9,6 @@ module.exports = { execute: async (message: string) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'generalDebug.js', module: 'event', name: 'playerGeneralDebug', executionId: executionId diff --git a/src/events/player/generalError.ts b/src/events/player/generalError.ts index 2dc5313b..0b3d8c41 100644 --- a/src/events/player/generalError.ts +++ b/src/events/player/generalError.ts @@ -17,7 +17,6 @@ module.exports = { execute: async (queue: ExtendedGuildQueuePlayerNode, error: Error) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'generalError.js', module: 'event', name: 'playerGeneralError', executionId: executionId, diff --git a/src/events/player/playerDebug.ts b/src/events/player/playerDebug.ts index fe95a77d..03515e34 100644 --- a/src/events/player/playerDebug.ts +++ b/src/events/player/playerDebug.ts @@ -9,7 +9,6 @@ module.exports = { execute: async (message: string) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'playerDebug.js', module: 'event', name: 'playerDebug', executionId: executionId diff --git a/src/events/player/playerError.ts b/src/events/player/playerError.ts index e8a1b101..7dc91519 100644 --- a/src/events/player/playerError.ts +++ b/src/events/player/playerError.ts @@ -17,7 +17,6 @@ module.exports = { execute: async (queue: ExtendedGuildQueuePlayerNode, error: Error) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'playerError.js', module: 'event', name: 'playerError', executionId: executionId, diff --git a/src/events/player/playerSkip.ts b/src/events/player/playerSkip.ts index 0755285d..3e9f51d1 100644 --- a/src/events/player/playerSkip.ts +++ b/src/events/player/playerSkip.ts @@ -18,7 +18,6 @@ module.exports = { execute: async (queue: ExtendedGuildQueuePlayerNode, track: Track) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'playerSkip.js', module: 'event', name: 'playerSkip', executionId: executionId, diff --git a/src/events/player/playerStart.ts b/src/events/player/playerStart.ts index bcc5698c..4570c0b4 100644 --- a/src/events/player/playerStart.ts +++ b/src/events/player/playerStart.ts @@ -11,7 +11,6 @@ module.exports = { execute: async (queue: ExtendedGuildQueuePlayerNode, track: Track) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'playerStart.js', module: 'event', name: 'playerStart', executionId: executionId, diff --git a/src/events/process/uncaughtException.ts b/src/events/process/uncaughtException.ts index 953072ba..9a9d1f00 100644 --- a/src/events/process/uncaughtException.ts +++ b/src/events/process/uncaughtException.ts @@ -8,7 +8,6 @@ module.exports = { execute: async (error: Error) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'uncaughtException.js', module: 'event', name: 'uncaughtException', executionId: executionId diff --git a/src/events/process/unhandledRejection.ts b/src/events/process/unhandledRejection.ts index ae46b2d7..0389eb28 100644 --- a/src/events/process/unhandledRejection.ts +++ b/src/events/process/unhandledRejection.ts @@ -8,7 +8,6 @@ module.exports = { execute: async (error: Error) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'unhandledRejection.js', module: 'event', name: 'unhandledRejection', executionId: executionId diff --git a/src/handlers/interactionAutocompleteHandler.ts b/src/handlers/interactionAutocompleteHandler.ts index 73102317..ab8e9acd 100644 --- a/src/handlers/interactionAutocompleteHandler.ts +++ b/src/handlers/interactionAutocompleteHandler.ts @@ -12,7 +12,6 @@ export const handleAutocomplete = async ( ) => { // TODO: Define TS Type for handlers, and require logger constant? const logger: Logger = loggerModule.child({ - source: 'interactionAutocompleteHandler.ts', module: 'handler', name: 'interactionAutocompleteHandler', executionId: executionId diff --git a/src/handlers/interactionCommandHandler.ts b/src/handlers/interactionCommandHandler.ts index e7ddb4af..9470f6fd 100644 --- a/src/handlers/interactionCommandHandler.ts +++ b/src/handlers/interactionCommandHandler.ts @@ -12,7 +12,6 @@ export const handleCommand = async ( interactionIdentifier: string ) => { const logger: Logger = loggerModule.child({ - source: 'interactionCommandHandler.ts', module: 'handler', name: 'interactionCommandHandler', executionId: executionId diff --git a/src/handlers/interactionComponentHandler.ts b/src/handlers/interactionComponentHandler.ts index 34ff9e59..e31c1805 100644 --- a/src/handlers/interactionComponentHandler.ts +++ b/src/handlers/interactionComponentHandler.ts @@ -12,7 +12,6 @@ export const handleComponent = async ( interactionIdentifier: string ) => { const logger: Logger = loggerModule.child({ - source: 'interactionComponentHandler.js', module: 'handler', name: 'interactionComponentHandler', executionId: executionId diff --git a/src/handlers/interactionErrorHandler.ts b/src/handlers/interactionErrorHandler.ts index b3def550..c141ecd9 100644 --- a/src/handlers/interactionErrorHandler.ts +++ b/src/handlers/interactionErrorHandler.ts @@ -22,7 +22,6 @@ export const handleError = async ( interactionIdentifier: string ) => { const logger: Logger = loggerModule.child({ - source: 'interactionErrorHandler.ts', module: 'handler', name: 'interactionErrorHandler', executionId: executionId diff --git a/src/index.ts b/src/index.ts index 6f3f2f24..3367f1eb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -21,7 +21,6 @@ manager.on('shardCreate', (shard: Shard) => { const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'index.js', module: 'shardingManager', name: 'shardingManager', executionId: executionId, diff --git a/src/interactions/commands/system/reload.ts b/src/interactions/commands/system/reload.ts index 71707928..7fd1d30d 100644 --- a/src/interactions/commands/system/reload.ts +++ b/src/interactions/commands/system/reload.ts @@ -11,7 +11,7 @@ class ReloadCommand extends BaseSlashCommandInteraction { constructor() { const data = new SlashCommandBuilder() .setName('reload') - .setDescription('Reload all slash commands across shards.'); + .setDescription('Reload slash command, autocomplete and component interactions across shards.'); const isSystemCommand: boolean = true; super(data, isSystemCommand); } @@ -25,7 +25,7 @@ class ReloadCommand extends BaseSlashCommandInteraction { } try { - logger.debug('Reloading commands across all shards.'); + logger.debug('Reloading interaction module across all shards.'); await client! .shard!.broadcastEval( async (shardClient: ExtendedClient, { executionId }) => { @@ -34,10 +34,10 @@ class ReloadCommand extends BaseSlashCommandInteraction { { context: { executionId: executionId } } ) .then(() => { - logger.debug('Successfully reloaded commands across all shards.'); + logger.debug('Successfully reloaded interaction module across all shards.'); }); } catch (error) { - logger.error(error, 'Failed to reload commands across shards.'); + logger.error(error, 'Failed to reload interaction module across shards.'); logger.debug('Responding with error embed.'); return await interaction.editReply({ @@ -45,7 +45,7 @@ class ReloadCommand extends BaseSlashCommandInteraction { new EmbedBuilder() .setDescription( - `**${this.embedOptions.icons.error} Oops!**\n_Hmm.._ It seems I am unable to reload commands across shards.` + `**${this.embedOptions.icons.error} Oops!**\n_Hmm.._ It seems I am unable to reload interaction module across shards.` ) .setColor(this.embedOptions.colors.error) .setFooter({ text: `Execution ID: ${executionId}` }) @@ -53,19 +53,21 @@ class ReloadCommand extends BaseSlashCommandInteraction { }); } - const commands: string[] | undefined = client!.slashCommandInteractions?.map((command: BaseSlashCommandInteraction) => { - let params: string = ''; + const commands: string[] | undefined = client!.slashCommandInteractions?.map( + (command: BaseSlashCommandInteraction) => { + let params: string = ''; - if (command.data.options && command.data.options.length > 1) { - const options = command.data.options as unknown as ApplicationCommandOptionData[]; + if (command.data.options && command.data.options.length > 1) { + const options = command.data.options as unknown as ApplicationCommandOptionData[]; - options.map((option: ApplicationCommandOption) => { - params += `**\`${option.name}\`**` + ' '; - }); - } + options.map((option: ApplicationCommandOption) => { + params += `**\`${option.name}\`**` + ' '; + }); + } - return `- **\`/${command.data.name}\`** ${params}- ${command.data.description}`; - }); + return `- **\`/${command.data.name}\`** ${params}- ${command.data.description}`; + } + ); const embedDescription: string = `**${this.embedOptions.icons.bot} Reloaded commands**\n` + commands?.join('\n'); diff --git a/src/utils/deploySlashCommands.ts b/src/utils/deploySlashCommands.ts index ff5b1f93..897d0d54 100644 --- a/src/utils/deploySlashCommands.ts +++ b/src/utils/deploySlashCommands.ts @@ -15,7 +15,6 @@ const systemOptions: SystemOptions = config.get('systemOptions'); const executionId: string = uuidv4(); const logger: Logger = loggerModule.child({ - source: 'deploySlashCommands.js', module: 'deploy', name: 'deploySlashCommands', executionId: executionId diff --git a/src/utils/factory/createClient.ts b/src/utils/factory/createClient.ts index e7b5ff8a..9c1f0ec5 100644 --- a/src/utils/factory/createClient.ts +++ b/src/utils/factory/createClient.ts @@ -5,7 +5,6 @@ import { Logger } from 'pino'; export const createClient = async ({ executionId }: { executionId: string }) => { const logger: Logger = loggerModule.child({ - source: 'createClient.js', module: 'utilFactory', name: 'createClient', executionId: executionId, diff --git a/src/utils/factory/createPlayer.ts b/src/utils/factory/createPlayer.ts index 02e986a3..968a4366 100644 --- a/src/utils/factory/createPlayer.ts +++ b/src/utils/factory/createPlayer.ts @@ -6,7 +6,6 @@ import { Logger } from 'pino'; export const createPlayer = async ({ client, executionId }: CreatePlayerParams) => { const logger: Logger = loggerModule.child({ - source: 'createPlayer.js', module: 'utilFactory', name: 'createPlayer', executionId: executionId, diff --git a/src/utils/other/postBotStats.ts b/src/utils/other/postBotStats.ts index 8ea97d69..d3f52bf4 100644 --- a/src/utils/other/postBotStats.ts +++ b/src/utils/other/postBotStats.ts @@ -8,7 +8,6 @@ import { ClientRequest, ClientRequestArgs } from 'node:http'; export const postBotStats = async ({ client, executionId }: PostBotStatsParams) => { const logger: Logger = loggerModule.child({ - source: 'postBotStats.js', module: 'utilOther', name: 'postBotStats', executionId: executionId, diff --git a/src/utils/other/startLoadTest.ts b/src/utils/other/startLoadTest.ts index ac3df16b..c632fc42 100644 --- a/src/utils/other/startLoadTest.ts +++ b/src/utils/other/startLoadTest.ts @@ -10,7 +10,6 @@ const loadTestOptions: LoadTestOptions = config.get('loadTestOptions'); export const startLoadTest = async ({ client, executionId }: StartLoadTestParams) => { const logger: Logger = loggerModule.child({ - source: 'startLoadTest.js', module: 'utilOther', name: 'startLoadTest', executionId: executionId, diff --git a/src/utils/registerClientInteractions.ts b/src/utils/registerClientInteractions.ts index 2a95b548..2c3d8ed1 100644 --- a/src/utils/registerClientInteractions.ts +++ b/src/utils/registerClientInteractions.ts @@ -9,7 +9,6 @@ import { ExtendedClient } from '../types/clientTypes'; export const registerClientInteractions = async ({ client, executionId }: RegisterClientInteractionsParams) => { const logger: Logger = loggerModule.child({ - source: 'registerClientInteractions.js', module: 'register', name: 'registerClientInteractions', executionId: executionId, diff --git a/src/utils/registerEventListeners.ts b/src/utils/registerEventListeners.ts index 19c627d3..960be997 100644 --- a/src/utils/registerEventListeners.ts +++ b/src/utils/registerEventListeners.ts @@ -44,7 +44,6 @@ const registerPlayerEventListeners = (player: Player, event: CustomEvent, logger export const registerEventListeners = async ({ client, player, executionId }: RegisterEventListenersParams) => { const logger: Logger = loggerModule.child({ - source: 'registerEventListeners.js', module: 'register', name: 'registerEventListeners', executionId: executionId, diff --git a/src/utils/system/getUptimeFormatted.ts b/src/utils/system/getUptimeFormatted.ts index 065689d6..7c6acd08 100644 --- a/src/utils/system/getUptimeFormatted.ts +++ b/src/utils/system/getUptimeFormatted.ts @@ -4,7 +4,6 @@ import { GetUptimeFormattedParams } from '../../types/utilTypes'; export const getUptimeFormatted = async ({ executionId }: GetUptimeFormattedParams) => { const logger: Logger = loggerModule.child({ - source: 'getUptimeFormatted.js', module: 'utilSystem', name: 'getUptimeFormatted', executionId: executionId diff --git a/src/utils/validation/permissionValidator.ts b/src/utils/validation/permissionValidator.ts index 8cd39a14..b1130f5a 100644 --- a/src/utils/validation/permissionValidator.ts +++ b/src/utils/validation/permissionValidator.ts @@ -17,7 +17,6 @@ import { CannotJoinVoiceOrTalkParams, CannotSendMessageInChannelParams } from '. const embedOptions: EmbedOptions = config.get('embedOptions'); export const cannotJoinVoiceOrTalk = async ({ interaction, executionId }: CannotJoinVoiceOrTalkParams) => { const logger: Logger = loggerModule.child({ - source: 'permissionValidator.js', module: 'utilValidation', name: 'cannotJoinVoiceOrTalk', executionId: executionId, @@ -52,7 +51,6 @@ export const cannotJoinVoiceOrTalk = async ({ interaction, executionId }: Cannot export const cannotSendMessageInChannel = async ({ interaction, executionId }: CannotSendMessageInChannelParams) => { const logger: Logger = loggerModule.child({ - source: 'permissionValidator.js', module: 'utilValidation', name: 'cannotSendMessageInChannel', executionId: executionId, diff --git a/src/utils/validation/queueValidator.ts b/src/utils/validation/queueValidator.ts index dbd037cf..3392e4af 100644 --- a/src/utils/validation/queueValidator.ts +++ b/src/utils/validation/queueValidator.ts @@ -9,7 +9,6 @@ import { Logger } from 'pino'; const embedOptions: EmbedOptions = config.get('embedOptions'); export const queueDoesNotExist = async ({ interaction, queue, executionId }: QueueDoesNotExistParams) => { const logger: Logger = loggerModule.child({ - source: 'queueValidator.js', module: 'utilValidation', name: 'queueDoesNotExist', executionId: executionId, @@ -40,7 +39,6 @@ export const queueDoesNotExist = async ({ interaction, queue, executionId }: Que export const queueNoCurrentTrack = async ({ interaction, queue, executionId }: QueueNoCurrentTrackParams) => { const logger: Logger = loggerModule.child({ - source: 'queueValidator.js', module: 'utilValidation', name: 'queueNoCurrentTrack', executionId: executionId, @@ -71,7 +69,6 @@ export const queueNoCurrentTrack = async ({ interaction, queue, executionId }: Q export const queueIsEmpty = async ({ interaction, queue, executionId }: QueueIsEmptyParams) => { const logger: Logger = loggerModule.child({ - source: 'queueValidator.js', module: 'utilValidation', name: 'queueIsEmpty', executionId: executionId, diff --git a/src/utils/validation/searchQueryValidator.ts b/src/utils/validation/searchQueryValidator.ts index 074bdc08..97b1e25a 100644 --- a/src/utils/validation/searchQueryValidator.ts +++ b/src/utils/validation/searchQueryValidator.ts @@ -4,7 +4,6 @@ import { TransformQueryParams } from '../../types/utilTypes'; export const transformQuery = async ({ query, executionId }: TransformQueryParams) => { const logger: Logger = loggerModule.child({ - source: 'searchQueryValidator.js', module: 'utilValidation', name: 'transformQuery', executionId: executionId diff --git a/src/utils/validation/systemCommandValidator.ts b/src/utils/validation/systemCommandValidator.ts index 9e7ac31e..8c20845b 100644 --- a/src/utils/validation/systemCommandValidator.ts +++ b/src/utils/validation/systemCommandValidator.ts @@ -10,7 +10,6 @@ const embedOptions: EmbedOptions = config.get('embedOptions'); const systemOptions: SystemOptions = config.get('systemOptions'); export const notValidGuildId = async ({ interaction, executionId }: NotValidGuildIdParams) => { const logger: Logger = loggerModule.child({ - source: 'systemCommandValidator.js', module: 'utilValidation', name: 'notValidGuildId', executionId: executionId, diff --git a/src/utils/validation/voiceChannelValidator.ts b/src/utils/validation/voiceChannelValidator.ts index af1211e0..16a99433 100644 --- a/src/utils/validation/voiceChannelValidator.ts +++ b/src/utils/validation/voiceChannelValidator.ts @@ -9,7 +9,6 @@ import { NotInSameVoiceChannelParams, NotInVoiceChannelParams } from '../../type const embedOptions: EmbedOptions = config.get('embedOptions'); export const notInVoiceChannel = async ({ interaction, executionId }: NotInVoiceChannelParams) => { const logger: Logger = loggerModule.child({ - source: 'voiceChannelValidator.js', module: 'validator', name: 'notInVoiceChannel', executionId: executionId, @@ -40,7 +39,6 @@ export const notInVoiceChannel = async ({ interaction, executionId }: NotInVoice export const notInSameVoiceChannel = async ({ interaction, queue, executionId }: NotInSameVoiceChannelParams) => { const logger: Logger = loggerModule.child({ - source: 'voiceChannelValidator.js', module: 'utilValidation', name: 'notInSameVoiceChannel', executionId: executionId,