Compare commits
2 commits
e5d85879b9
...
4a6031b75e
Author | SHA1 | Date | |
---|---|---|---|
4a6031b75e | |||
3511feec73 |
1 changed files with 4 additions and 4 deletions
8
index.ts
8
index.ts
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue