fix and flip empty reply check of the model
This commit is contained in:
parent
72f4648ff9
commit
a0cad7a348
1 changed files with 4 additions and 5 deletions
|
@ -273,15 +273,14 @@ async function executeFromQueue(channel: string) {
|
||||||
|
|
||||||
const answerContent = answer.data.choices[0].message?.content;
|
const answerContent = answer.data.choices[0].message?.content;
|
||||||
|
|
||||||
if (answerContent != undefined || answerContent != "") {
|
if (answerContent == undefined || answerContent == "") {
|
||||||
|
if (message instanceof DiscordApi.Message) message.react("😶").catch(/*it's okay*/);
|
||||||
|
}
|
||||||
|
else {
|
||||||
const response = requestReply(message, {content: answerContent}, {allowedMentions: { repliedUser: false }});
|
const response = requestReply(message, {content: answerContent}, {allowedMentions: { repliedUser: false }});
|
||||||
|
|
||||||
response.then(rval => Moderation.checkMessage(rval));
|
response.then(rval => Moderation.checkMessage(rval));
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if (message instanceof DiscordApi.Message) message.react("😶").catch(/*it's okay*/);
|
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(`Error ocurred while handling chat completion request (${(e as object).constructor.name}):`);
|
console.error(`Error ocurred while handling chat completion request (${(e as object).constructor.name}):`);
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
Loading…
Reference in a new issue