Fixed the ask command
This commit is contained in:
parent
bcc5bcdcb1
commit
f279bc3575
1 changed files with 3 additions and 3 deletions
|
@ -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...'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue