fix(bots/discord): correct respondToReply logic

This commit is contained in:
PalmDevs
2025-09-25 23:17:29 +07:00
parent 6885e18976
commit 6fe15301a2

View File

@@ -33,14 +33,12 @@ withContext(on, 'messageCreate', async (context, msg) => {
if (response) {
logger.debug('Response found')
const toReply = msg.reference?.messageId && (
respondToReply === true
? true
: (respondToReply === 'only_labeled' && label !== undefined) ||
(respondToReply === 'only_regex' && label === undefined)
)
? await msg.fetchReference()
: msg
const toReply =
msg.reference?.messageId &&
(respondToReply === true ||
(label === undefined ? respondToReply === 'only_regex' : respondToReply === 'only_labeled'))
? await msg.fetchReference()
: msg
const reply = await toReply.reply({
...response,