Fixed the ask command

This commit is contained in:
Atridad Lahiji 2023-06-15 23:26:59 -06:00
parent bcc5bcdcb1
commit f279bc3575
No known key found for this signature in database

View file

@ -47,14 +47,14 @@ export class UserCommand extends Command {
max_tokens: 420 max_tokens: 420
}); });
const content = chatCompletion.data.choices[0].message?.content || 'ERROR!'; const content = `Q: ${prompt}\nA: ${chatCompletion.data.choices[0].message?.content}`;
if (interactionOrMessage instanceof Message) { if (interactionOrMessage instanceof Message) {
return askMessage.edit({ content }); return askMessage.edit({ content: content.length <= 2000 ? content : 'Sorry... AI no work good...' });
} }
return interactionOrMessage.editReply({ return interactionOrMessage.editReply({
content: content content: content.length <= 2000 ? content : 'Sorry... AI no work good...'
}); });
} }
} }