mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
fix: other small issues
This commit is contained in:
@@ -9,7 +9,8 @@ withContext(on, 'interactionCreate', async (context, interaction) => {
|
||||
const command = discord.commands[interaction.commandName]
|
||||
|
||||
logger.debug(`Command ${interaction.commandName} being invoked by ${interaction.user.tag}`)
|
||||
if (!command) return void logger.error(`Command ${interaction.commandName} not implemented but registered!!!`)
|
||||
if (!command)
|
||||
return void logger.error(`Interaction command ${interaction.commandName} not implemented but registered!!!`)
|
||||
|
||||
try {
|
||||
logger.debug(`Command ${interaction.commandName} being executed`)
|
||||
|
||||
@@ -19,7 +19,7 @@ withContext(on, 'messageCreate', async (context, msg) => {
|
||||
|
||||
const command = discord.commands[commandName]
|
||||
logger.debug(`Command ${commandName} being invoked by ${msg.author.id}`)
|
||||
if (!command) return void logger.error(`Command ${commandName} not implemented`)
|
||||
if (!command) return void logger.debug(`Message command ${commandName} not implemented`)
|
||||
|
||||
const argsRegex: RegExp = /[^\s"]+|"([^"]*)"/g
|
||||
const args: CommandArguments = []
|
||||
|
||||
@@ -33,7 +33,7 @@ withContext(on, 'messageCreate', async (context, msg) => {
|
||||
if (response) {
|
||||
logger.debug('Response found')
|
||||
|
||||
const toReply = replyToReplied ? await msg.fetchReference() : msg
|
||||
const toReply = replyToReplied ? (msg.reference?.messageId ? await msg.fetchReference() : msg) : msg
|
||||
const reply = await toReply.reply({
|
||||
...response,
|
||||
embeds: response.embeds?.map(it => createMessageScanResponseEmbed(it, label ? 'nlp' : 'match')),
|
||||
|
||||
@@ -10,5 +10,10 @@ if (missingEnvs.length) {
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
// Handle uncaught exceptions
|
||||
|
||||
process.on('uncaughtException', error => console.error('Uncaught exception:', error))
|
||||
process.on('unhandledRejection', reason => console.error('Unhandled rejection:', reason))
|
||||
|
||||
api.client.connect()
|
||||
discord.client.login()
|
||||
|
||||
Reference in New Issue
Block a user