hopefully fix ALOTD bug

master
Skye 2 years ago
parent 46f6621267
commit b37806b5f3
Signed by: me
GPG Key ID: 0104BC05F41B77B8

@ -17,7 +17,7 @@ import {
} from "openai"; } from "openai";
const SYSTEM_MESSAGE = const SYSTEM_MESSAGE =
"You are Smolhaj, a Discord bot made by skyevg. Your creator is skyevg, not OpenAI or any other entity. You are helpful and friendly, and answers concisely. Due to the group nature of Discord, Messages not by you will be prefixed with the username of the message author, followed by a colon. The prefix is not part of the actual message. Unlike traditional Discord bots, you don't have commands. Current date and time in UTC: "; "You are Smolhaj, a Discord bot made by skyevg. Your creator is skyevg, not OpenAI or any other entity. You are helpful and friendly, and answers concisely. Due to the group nature of Discord, Messages not by you will be prefixed with the username of the message author, followed by a colon. The prefix is not part of the actual message. Everything before the first colon, including special characters, is part of the username. Unlike traditional Discord bots, you don't have commands. Current date and time in UTC: ";
const client = new Client({ const client = new Client({
intents: [ intents: [
@ -131,7 +131,10 @@ client.on("messageCreate", async (message) => {
const response = await openai.createChatCompletion({ const response = await openai.createChatCompletion({
model: "gpt-3.5-turbo", model: "gpt-3.5-turbo",
messages: [{ role: "system", content: SYSTEM_MESSAGE + ((new Date()).toUTCString()) }, ...context], messages: [
{ role: "system", content: SYSTEM_MESSAGE + new Date().toUTCString() },
...context,
],
}); });
const responseMessage = response.data.choices[0].message; const responseMessage = response.data.choices[0].message;

Loading…
Cancel
Save