Skip to content

Commit

Permalink
Finally fixed the bug. I hope its the last pr. (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
DevSrijit authored May 3, 2023
1 parent d8dd83a commit 1d047a9
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/interactions/gpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,19 @@ const interactionGPT = async (bot, message) => {
let returntext = await createCompletion(prompt);
if (channel == "C0266FRGT") {
return; // #announcements
}
returntext.then((result) => {
if (result.includes("Orpheus:")) {
result = result.replace("Orpheus:", "").trim();
}
if (result.includes("<@")) {
result =
"Response cannot contain a ping, please try to avoid pinging people.";
}
bot.reply(message, transcript(result), (err, src) => {
} else if (returntext.includes("Orpheus:")) {
returntext = returntext.replace("Orpheus:", "").trim();
} else if (returntext.includes("<@")) {
returntext =
"Response cannot contain a ping, please try to avoid pinging people.";
} else {
bot.reply(message, transcript(returntext), (err, src) => {
if (err) {
console.error(err);
return;
}
});
});
};
};

export default interactionGPT;
export default interactionGPT;

0 comments on commit 1d047a9

Please sign in to comment.