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:
@@ -37,4 +37,4 @@
|
|||||||
"@types/ws": "^8.5.10",
|
"@types/ws": "^8.5.10",
|
||||||
"typed-emitter": "^2.1.0"
|
"typed-emitter": "^2.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,4 +43,4 @@
|
|||||||
"discord-api-types": "^0.37.92",
|
"discord-api-types": "^0.37.92",
|
||||||
"drizzle-kit": "^0.22.8"
|
"drizzle-kit": "^0.22.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ withContext(on, 'interactionCreate', async (context, interaction) => {
|
|||||||
const command = discord.commands[interaction.commandName]
|
const command = discord.commands[interaction.commandName]
|
||||||
|
|
||||||
logger.debug(`Command ${interaction.commandName} being invoked by ${interaction.user.tag}`)
|
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 {
|
try {
|
||||||
logger.debug(`Command ${interaction.commandName} being executed`)
|
logger.debug(`Command ${interaction.commandName} being executed`)
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ withContext(on, 'messageCreate', async (context, msg) => {
|
|||||||
|
|
||||||
const command = discord.commands[commandName]
|
const command = discord.commands[commandName]
|
||||||
logger.debug(`Command ${commandName} being invoked by ${msg.author.id}`)
|
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 argsRegex: RegExp = /[^\s"]+|"([^"]*)"/g
|
||||||
const args: CommandArguments = []
|
const args: CommandArguments = []
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ withContext(on, 'messageCreate', async (context, msg) => {
|
|||||||
if (response) {
|
if (response) {
|
||||||
logger.debug('Response found')
|
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({
|
const reply = await toReply.reply({
|
||||||
...response,
|
...response,
|
||||||
embeds: response.embeds?.map(it => createMessageScanResponseEmbed(it, label ? 'nlp' : 'match')),
|
embeds: response.embeds?.map(it => createMessageScanResponseEmbed(it, label ? 'nlp' : 'match')),
|
||||||
|
|||||||
@@ -10,5 +10,10 @@ if (missingEnvs.length) {
|
|||||||
process.exit(1)
|
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()
|
api.client.connect()
|
||||||
discord.client.login()
|
discord.client.login()
|
||||||
|
|||||||
Reference in New Issue
Block a user