This is how Discord deals with you after hitting a certain number of connections:
Hey Webber, It appears your bot, Unity CI, has connected to Discord more than 1000 times within a short time period.
Since this kind of behaviour is usually the result of a bug we have gone ahead and reset your bot's token.
No warning or anything.
Since our bot is running on a cron, every 15 minutes, 24 hours a day.
This means the minimum number of connections is 100 a day.
The threshold of 1000 times seems to span multiple days.
This means our minimum number of connections is already very close to Discords maximum number of connections.
As a result we will not be able to set the cron to run much more frequently, as we'll hit the same problem even if we're only connecting at maximum once per run.
Changes
Discord service class only connects as needed and never disconnects by itself.
At the end of the cron in the finally block we disconnect from discord (required to be able to make new ones after a while)
Checklist
[x] Read the contribution guide and accept the code of conduct
Context
This is how Discord deals with you after hitting a certain number of connections:
No warning or anything.
Since our bot is running on a cron, every 15 minutes, 24 hours a day. This means the minimum number of connections is 100 a day.
The threshold of 1000 times seems to span multiple days. This means our minimum number of connections is already very close to Discords maximum number of connections.
As a result we will not be able to set the cron to run much more frequently, as we'll hit the same problem even if we're only connecting at maximum once per run.
Changes
Checklist