From ced4e044b5582a33690b06cea2bb897d528529f5 Mon Sep 17 00:00:00 2001 From: me Date: Mon, 13 Mar 2023 23:18:17 +0000 Subject: [PATCH] datetime --- index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 17ef01d..7b602dd 100644 --- a/index.ts +++ b/index.ts @@ -17,7 +17,7 @@ import { } from "openai"; 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."; + "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: "; const client = new Client({ intents: [ @@ -131,7 +131,7 @@ client.on("messageCreate", async (message) => { const response = await openai.createChatCompletion({ model: "gpt-3.5-turbo", - messages: [{ role: "system", content: SYSTEM_MESSAGE }, ...context], + messages: [{ role: "system", content: SYSTEM_MESSAGE + ((new Date()).toISOString()) }, ...context], }); const responseMessage = response.data.choices[0].message;