Compare commits

..

No commits in common. "4a6031b75e78cee3761fcd2f1a7dde8828df5916" and "e5d85879b97494e450b37767d1969dc062dbe9e7" have entirely different histories.

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 the username of the message author, 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 a username, followed by a colon.";
const client = new Client({
intents: [
@ -58,10 +58,10 @@ client.on("messageCreate", async (message) => {
const context = [
...msgs
.filter((msg) => {
if (msg.webhookId) return false;
if (msg.author.bot && msg.author !== msg.author.client.user)
if (message.webhookId) return false;
if (message.author.bot && msg.author !== msg.author.client.user)
return false;
if (msg.content.startsWith("\\")) return false;
if (message.content.startsWith("\\")) return false;
return true;
})
.mapValues<ChatCompletionRequestMessage>((msg) => {