feat(bots/discord): add replyToReplied option in response config

This commit is contained in:
PalmDevs
2024-07-26 01:08:23 +07:00
parent d0acab1915
commit 27662ed91a
3 changed files with 28 additions and 30 deletions

View File

@@ -21,12 +21,13 @@ withContext(on, 'messageCreate', async (context, msg) => {
try {
logger.debug(`Classifying message ${msg.id}`)
const { response, label } = await getResponseFromText(msg.content, filteredResponses, context)
const { response, label, replyToReplied } = await getResponseFromText(msg.content, filteredResponses, context)
if (response) {
logger.debug('Response found')
const reply = await msg.reply({
const toReply = replyToReplied ? await msg.fetchReference() : msg
const reply = await toReply.reply({
...response,
embeds: response.embeds?.map(it => createMessageScanResponseEmbed(it, label ? 'nlp' : 'match')),
})