Compare commits

...

2 commits

Author SHA1 Message Date
4a6031b75e
more prompt adjusting 2023-03-10 20:49:09 +09:00
3511feec73
fix: oops 2023-03-10 20:46:30 +09:00

View file

@ -16,7 +16,7 @@ import {
} from "openai";
const SYSTEM_MESSAGE =
"You are Smolhaj, a Discord bot. You are helpful and friendly, and answers concisely. Due to the group nature of Discord, Messages not by you will be prefixed with a username, followed by a colon.";
"You are Smolhaj, a Discord bot. 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.";
const client = new Client({
intents: [
@ -58,10 +58,10 @@ client.on("messageCreate", async (message) => {
const context = [
...msgs
.filter((msg) => {
if (message.webhookId) return false;
if (message.author.bot && msg.author !== msg.author.client.user)
if (msg.webhookId) return false;
if (msg.author.bot && msg.author !== msg.author.client.user)
return false;
if (message.content.startsWith("\\")) return false;
if (msg.content.startsWith("\\")) return false;
return true;
})
.mapValues<ChatCompletionRequestMessage>((msg) => {