A workaround for an apparent bug in Discord.Net's
`SocketGuild.DownloadUsersAsync()` method.
Conclusions made while writing and testing this workaround:
* The guilds it hangs on are seemingly random.
* Guild size does not matter.
* If a download hangs, it never recovers within 2 hours, probably more.
* Trying a guild again never works. It just hangs again.
A lot of these things were designed with the thought in mind that
there used to be many, many issues when running the bot on a large
number of servers. The reason for these bugs turned out to be simple:
the hardware was not fast enough to keep up with everything.
This extra reporting and these extra behaviors have not been
necessary for some time, and it is best to remove them.
Set up a structure not unlike what exists for text commands in order to neatly separate subsets of commands/features into their own files.
Changed references for existing commands to "text commands" where it made sense to do so.
This staggering was most likely the cause of a major amount of data lost recently, in which certain guilds never had their values updated.
The staggering was meant to attempt to reduce load on a server with limited capabilities, and testing shows that it runs on more capable hardware without this issue when run this way.
-Add command line options for shards
-Set consistent exit codes
-Turn on nullable option and edit code further to conform and reduce warnings
-Update libraries
-Removed a number of diagnostic messages
-Removed ConnectionStatus, connection scores, etc.
-Modified work intervals for certain background tasks
-Updated code style
-New config values ShardRange and ShardTotal
--ShardTotal replaces ShardCount
-New config value QuitOnFails:
--Program quits after enough shards have been removed
- Manager loop updated to act on dead shards and initialize new ones
- Initialization of new shards is now staggered in case of many shards
- Now using intents
- Adding a delay and a second connection check when downloading guild
members. This has greatly improved stability over the previously
attempted method.
- No longer sends guild counts to external sites until fully connected
The BirthdayBot class has been split up into ShardInstance and
ShardManager. Several other things have been reorganized so that shards
may act independently.
The overall goal of these changes made is to limit failures to sections
that can easily be discarded and replaced.