Commit graph

20 commits

Author SHA1 Message Date
dc01146ee8 ignore @everyone mentions 2023-12-25 16:09:35 +01:00
24e85f535a "Gracefully" exit when receiving sigint 2023-12-13 20:56:23 +01:00
23ceca5cd3 Update OpenAI dependency 2023-09-27 17:14:17 +02:00
18646b9dc6 config: fix imports not working correctly
this patch moves the rootDir of the typescript project up a directory
this moves all content in the dist directory inside the new src directory

I couldn't find other way
2023-09-21 20:51:38 +02:00
74fe8e3e8b Init: Remove debug logger 2023-09-18 13:33:41 +02:00
7ff4abc3c0 Configuration: recactor how it is written and handled 2023-09-18 11:22:10 +02:00
5a116b0531 Handle almost all of the promise rejections
fixes #7
2023-07-31 12:17:14 +02:00
7225739527 Update eslintrc.json to also make it consider typings
note that I've marked Promises awaiting as a warn,
because I don't want to be bothered with it for now.

I also edited all files to accomodate with the new rules.

I should also think find a way to type-safely import Commands directory,
another time
2023-07-30 22:28:13 +02:00
ae3a5133b3 Create helper script for pushing commands 2023-05-08 09:15:34 +02:00
8b4b35454b Add commandManager and the first slash command
the command allows for summining the bot without sending an actual mention message
that might hang in the chat log sent to openAi, consuming tokens
2023-05-08 08:53:06 +02:00
cb304f522b Refactor the main bot execution out of index.js 2023-05-08 01:30:32 +02:00
1c49e8b730 Add simple limit enforcing
For now it is 25 messages in the last 24 horus.
2023-05-02 20:41:59 +02:00
a66115c3b8 Track all requests to OpenAI in a database
this will be in future used to limit access to the bot
2023-05-02 17:55:48 +02:00
6141dffa68 Defer responding to a message request
Previously if two message requests appered in a short timespan
in the same channel, the bot would reply twice (in two messages)
for the first message.

This commit fixes that, by queuing message requests and responding
to them in the chronological order based on a channelId.
(requests are queued to a queue identified by channelId)

fixes #4
2023-03-25 11:24:43 +01:00
02730ff488 add limits related to current messages to config 2023-03-24 16:47:26 +01:00
4f4b708ba5 move config to a typescript file, add option for chatCompletionConfig
Now we can write code inside config,
which allows us to send current time to the OpenAI api
inside system message!

Example config updated accordingly
2023-03-24 15:44:22 +01:00
960c340760 Log more more information on error (origin, type)
also fix the emoji in embed sent in reply
2023-03-22 06:40:16 +01:00
aafefc3ad0 Fix DiscordAPIError on receiving empty content.
Previously, when OpenAI returned a message with an empty string,
it would try to send that empty message, which throwed an error.

Now it will react with an emoji to the message that triggered the request.
2023-03-19 02:26:28 +01:00
7411648d02 Check messages aganist OpenAI moderation API 2023-03-14 23:52:37 +01:00
c18b8d83ef Initial commit 2023-03-14 21:16:54 +01:00