mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
fix: add execution id to footer in error embeds
This commit is contained in:
1 parent
a04d0aeb5b
commit
82ab8c9387
9 files changed
+35
-17
No files matched your search
@@ -96,7 +96,9 @@ module.exports = {
|
||||
|
||||
queue.setRepeatMode(mode);
|
||||
|
||||
if (!queue.repeatMode === mode) {
|
||||
// switch(queue.repeatMode) instead of multiple if statements
|
||||
|
||||
if (queue.repeatMode !== mode) {
|
||||
logger.warn(
|
||||
'Failed to change loop mode. After setting queue repeat mode, the value was not the same as input.'
|
||||
);
|
||||
@@ -109,6 +111,7 @@ module.exports = {
|
||||
`**${embedOptions.icons.error} Uh-oh... Failed to change loop mode!**\nI tried to change the loop mode to \`${modeUserString}\`, but something went wrong.\n\nYou can try to perform the command again.\n\n_If you think this message is incorrect or the issue persists, please submit a bug report in the **[support server](${botOptions.serverInviteUrl})**._`
|
||||
)
|
||||
.setColor(embedOptions.colors.error)
|
||||
.setFooter({ text: `Execution ID: ${executionId}` })
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,6 +8,12 @@ const { lyricsExtractor } = require('@discord-player/extractor');
|
||||
|
||||
const recentQueries = new Map();
|
||||
|
||||
const loggerTempplate = require('../../services/logger').child({
|
||||
source: 'lyrics.js',
|
||||
module: 'slashCommand',
|
||||
name: '/lyrics'
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
isNew: false,
|
||||
isBeta: false,
|
||||
@@ -26,10 +32,7 @@ module.exports = {
|
||||
.setAutocomplete(true)
|
||||
),
|
||||
autocomplete: async ({ interaction, executionId }) => {
|
||||
const logger = require('../../services/logger').child({
|
||||
source: 'lyrics.js',
|
||||
module: 'slashCommand',
|
||||
name: '/lyrics',
|
||||
const logger = loggerTempplate.child({
|
||||
executionId: executionId,
|
||||
shardId: interaction.guild.shardId,
|
||||
guildId: interaction.guild.id
|
||||
@@ -89,10 +92,7 @@ module.exports = {
|
||||
return interaction.respond(response);
|
||||
},
|
||||
execute: async ({ interaction, executionId }) => {
|
||||
const logger = require('../../services/logger').child({
|
||||
source: 'lyrics.js',
|
||||
module: 'slashCommand',
|
||||
name: '/lyrics',
|
||||
const logger = loggerTempplate.child({
|
||||
executionId: executionId,
|
||||
shardId: interaction.guild.shardId,
|
||||
guildId: interaction.guild.id
|
||||
|
||||
@@ -11,6 +11,12 @@ const { useMainPlayer, useQueue } = require('discord-player');
|
||||
|
||||
const recentQueries = new Map();
|
||||
|
||||
const loggerTempplate = require('../../services/logger').child({
|
||||
source: 'play.js',
|
||||
module: 'slashCommand',
|
||||
name: '/play'
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
isNew: false,
|
||||
isBeta: false,
|
||||
@@ -29,10 +35,7 @@ module.exports = {
|
||||
.setAutocomplete(true)
|
||||
),
|
||||
autocomplete: async ({ interaction, executionId }) => {
|
||||
const logger = require('../../services/logger').child({
|
||||
source: 'play.js',
|
||||
module: 'slashCommand',
|
||||
name: '/play',
|
||||
const logger = loggerTempplate.child({
|
||||
executionId: executionId,
|
||||
shardId: interaction.guild.shardId,
|
||||
guildId: interaction.guild.id
|
||||
@@ -84,10 +87,7 @@ module.exports = {
|
||||
return interaction.respond(response);
|
||||
},
|
||||
execute: async ({ interaction, executionId }) => {
|
||||
const logger = require('../../services/logger').child({
|
||||
source: 'play.js',
|
||||
module: 'slashCommand',
|
||||
name: '/play',
|
||||
const logger = loggerTempplate.child({
|
||||
executionId: executionId,
|
||||
shardId: interaction.guild.shardId,
|
||||
guildId: interaction.guild.id
|
||||
@@ -158,6 +158,7 @@ module.exports = {
|
||||
|
||||
try {
|
||||
logger.debug(`Attempting to add track with player.play(). Query: '${query}'.`);
|
||||
|
||||
({ track } = await player.play(interaction.member.voice.channel, searchResult, {
|
||||
requestedBy: interaction.user,
|
||||
nodeOptions: {
|
||||
@@ -227,6 +228,7 @@ module.exports = {
|
||||
`**${embedOptions.icons.error} Uh-oh... Failed to add track!**\nAfter finding a result, I was unable to retrieve audio for the track.\n\nYou can try to perform the command again.\n\n_If you think this message is incorrect, please submit a bug report in the **[support server](${botOptions.serverInviteUrl})**._`
|
||||
)
|
||||
.setColor(embedOptions.colors.error)
|
||||
.setFooter({ text: `Execution ID: ${executionId}` })
|
||||
]
|
||||
});
|
||||
}
|
||||
@@ -242,6 +244,7 @@ module.exports = {
|
||||
`**${embedOptions.icons.error} Uh-oh... Failed to add track!**\nSomething unexpected happened and the operation was cancelled.\n\nYou can try to perform the command again.\n\n_If you think this message is incorrect, please submit a bug report in the **[support server](${botOptions.serverInviteUrl})**._`
|
||||
)
|
||||
.setColor(embedOptions.colors.error)
|
||||
.setFooter({ text: `Execution ID: ${executionId}` })
|
||||
]
|
||||
});
|
||||
}
|
||||
@@ -258,6 +261,7 @@ module.exports = {
|
||||
`**${embedOptions.icons.error} Uh-oh... Failed to add track!**\nSomething unexpected happened and it was not possible to start playing the track. This could happen if the voice connection is lost or queue is destroyed while adding the track.\n\nYou can try to perform the command again.\n\n_If you think this message is incorrect, please submit a bug report in the **[support server](${botOptions.serverInviteUrl})**._`
|
||||
)
|
||||
.setColor(embedOptions.colors.error)
|
||||
.setFooter({ text: `Execution ID: ${executionId}` })
|
||||
]
|
||||
});
|
||||
}
|
||||
@@ -280,6 +284,7 @@ module.exports = {
|
||||
`**${embedOptions.icons.error} Uh-oh... Failed to add track!**\nThere was an issue adding this track to the queue.\n\nYou can try to perform the command again.\n\n_If this problem persists, please submit a bug report in the **[support server](${botOptions.serverInviteUrl})**._`
|
||||
)
|
||||
.setColor(embedOptions.colors.error)
|
||||
.setFooter({ text: `Execution ID: ${executionId}` })
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ module.exports = {
|
||||
`**${embedOptions.icons.error} Oops!**\n_Hmm.._ It seems I am unable to reload commands across shards.`
|
||||
)
|
||||
.setColor(embedOptions.colors.error)
|
||||
.setFooter({ text: `Execution ID: ${executionId}` })
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ module.exports = {
|
||||
`**${embedOptions.icons.error} Oops!**\n_Hmm.._ It seems I am unable to fetch player statistics and client values from shards.`
|
||||
)
|
||||
.setColor(embedOptions.colors.error)
|
||||
.setFooter({ text: `Execution ID: ${executionId}` })
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -100,6 +100,7 @@ module.exports = {
|
||||
`**${embedOptions.icons.error} Uh-oh... _Something_ went wrong!**\nThere was an unexpected error while trying to execute this command.\n\nYou can try to perform the command again.\n\n_If this problem persists, please submit a bug report in the **[support server](${botOptions.serverInviteUrl})**._`
|
||||
)
|
||||
.setColor(embedOptions.colors.error)
|
||||
.setFooter({ text: `Execution ID: ${executionId}` })
|
||||
]
|
||||
});
|
||||
} else {
|
||||
@@ -111,6 +112,7 @@ module.exports = {
|
||||
`**${embedOptions.icons.error} Uh-oh... _Something_ went wrong!**\nThere was an unexpected error while trying to execute this command.\n\nYou can try to perform the command again.\n\n_If this problem persists, please submit a bug report in the **[support server](${botOptions.serverInviteUrl})**._`
|
||||
)
|
||||
.setColor(embedOptions.colors.error)
|
||||
.setFooter({ text: `Execution ID: ${executionId}` })
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ module.exports = {
|
||||
`**${embedOptions.icons.error} Uh-oh... _Something_ went wrong!**\nIt seems there was an issue related to the queue or current track.\n\nIf you performed a command, you can try again.\n\n_If this problem persists, please submit a bug report in the **[support server](${botOptions.serverInviteUrl})**._`
|
||||
)
|
||||
.setColor(embedOptions.colors.error)
|
||||
.setFooter({ text: `Execution ID: ${executionId}` })
|
||||
]
|
||||
});
|
||||
|
||||
@@ -45,6 +46,7 @@ module.exports = {
|
||||
`\n\n<@${systemOptions.systemUserId}>`
|
||||
)
|
||||
.setColor(embedOptions.colors.error)
|
||||
.setFooter({ text: `Execution ID: ${executionId}` })
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ module.exports = {
|
||||
`**${embedOptions.icons.error} Uh-oh... _Something_ went wrong!**\nIt seems there was an issue while streaming the track.\n\nIf you performed a command, you can try again.\n\n_If this problem persists, please submit a bug report in the **[support server](${botOptions.serverInviteUrl})**._`
|
||||
)
|
||||
.setColor(embedOptions.colors.error)
|
||||
.setFooter({ text: `Execution ID: ${executionId}` })
|
||||
]
|
||||
});
|
||||
|
||||
@@ -45,6 +46,7 @@ module.exports = {
|
||||
`\n\n<@${systemOptions.systemUserId}>`
|
||||
)
|
||||
.setColor(embedOptions.colors.error)
|
||||
.setFooter({ text: `Execution ID: ${executionId}` })
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ module.exports = {
|
||||
`**${embedOptions.icons.error} Uh-oh... _Something_ went wrong!**\nIt seems there was an issue while loading stream for the track.\n\nIf you performed a command, you can try again.\n\n_If this problem persists, please submit a bug report in the **[support server](${botOptions.serverInviteUrl})**._`
|
||||
)
|
||||
.setColor(embedOptions.colors.error)
|
||||
.setFooter({ text: `Execution ID: ${executionId}` })
|
||||
]
|
||||
});
|
||||
|
||||
@@ -45,6 +46,7 @@ module.exports = {
|
||||
`\n\n<@${systemOptions.systemUserId}>`
|
||||
)
|
||||
.setColor(embedOptions.colors.error)
|
||||
.setFooter({ text: `Execution ID: ${executionId}` })
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user