Commit graph

25 commits

Author SHA1 Message Date
d9a97cce8d Handle 5xx errors by repeating requests
the number of tries is stored in the extension of the array class
the shift method is extended to reset the number of tries
on the queue shift.

also I accidently refactored types in execution.ts
there were duplicate types declared

fixes #9
2023-07-31 21:44:03 +02:00
853bf183ee Refactor out the common error handling in moderation 2023-07-31 20:36:49 +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
0e3962e110 Handle unregistered function calls 2023-07-30 01:51:40 +02:00
124ac5cbf0 Simplify the ChatCompletion calling loop
removes duplicate code in while loop
2023-07-30 01:32:09 +02:00
67d4361c26 Log message data when an error occurs 2023-07-30 01:18:25 +02:00
9c3f25312b fix "0" reply bug
replaces "in" in for loops to "of"
2023-07-28 09:26:53 +02:00
c7b36885a3 Fix overflow of the reply of 2000 character
now it will send more than one message if it gets overflown
fixes #6
2023-07-28 09:22:47 +02:00
a0cad7a348 fix and flip empty reply check of the model 2023-07-28 09:12:59 +02:00
f9097ae68d Make error of the execution more verbose to the user 2023-07-25 04:16:59 +02:00
c03d329c3d Fix unnecessary not, breaking entire bot 2023-07-24 03:52:37 +02:00
6673d3c294 Fix crash when replying to request where bot cannot reply 2023-07-24 03:07:24 +02:00
13d8f73356 Fix crash on reaction blocked
should fix #7
2023-07-23 06:28:56 +02:00
31097e03ce Add newline for limit reached message 2023-07-23 06:28:24 +02:00
0df05e2f06 Add function handling for OpenAI model
for now it's querying only time, but in the future there will be more commands
2023-07-23 05:50:16 +02:00
312f22827e add getNthUseInLimitTimestamp
will be used in a command that check the user limit
2023-05-10 03:03:10 +02:00
c1b165024d export getUserLimit
will be used in a command that check the user limit
2023-05-10 03:02:49 +02:00
56a0e686b0 fully prepare execution for interactions 2023-05-08 08:51:30 +02:00
f6ac5281e7 Prepare more execution.ts for interactions 2023-05-08 08:50:23 +02:00
cb2ae4d4f2 Fix always false if statement 2023-05-08 07:12:08 +02:00
965e0a2602 Remove unneeded type assertion of an empty array. 2023-05-08 02:43:36 +02:00
d2925a3aa9 Create dm channel when sending message in dm channel
if there is no dm channel
2023-05-08 02:42:58 +02:00
47e7c107c1 Add handling for interactions in execution.ts
this in future will be used to handle interaction requests.
2023-05-08 02:40:24 +02:00
cb304f522b Refactor the main bot execution out of index.js 2023-05-08 01:30:32 +02:00