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
dffb13361c
Add try-catch in moderation when checking with moderation api
...
Now it won't crash the bot when the moderation api is not availabe (somehow)
2023-03-20 06:08:42 +01:00
2a38ae4a95
Limit sent chat to 2048 tokens.
...
This also solves the issue where we would request more tokens,
than the model is capable of (over 4096)
2023-03-19 09:11:37 +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
fa1caf3ad8
Add support for stickers in messages
...
The sticker name and description will be now forwarded
with the rest of the message content.
2023-03-18 04:55:37 +01:00
582dff5243
Add support for fields in embeds
2023-03-18 03:38:29 +01:00
d5cb03502f
Fix the username formatter returning invalid formatName
...
'?' is not accepted character in OpenAI api as a valid name
I also switched the order of the replace steps,
so there will be less _- in the final username
2023-03-18 03:27:44 +01:00
276d70efee
Parse usernames for use in OpenAI api
...
also document the toOpenAIMssages.ts file
2023-03-18 02:06:49 +01:00
d877097517
Fix embed formatting for author name and hyphen condition.
2023-03-17 19:59:46 +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