Raise after loop completes without returning with most recent values
for r, data. This is a bit less fragile than checking tries < 4, since
changing the retry count requires changing values in multiple places.
(There seemed to already be handling in the 502 retry, tries <= 5,
which always evaluated to true, e.g.)
Previously, once out of retries, we would always return None without
raising.
This won't NameError so long as we make at least one HTTP request.
The old code for some reason assumed that the length of the command
would be 1. This is because when I tested this I would use single
letter command names and it would "just work" when in reality it was
completely incorrect.
A reminder to thoroughly test instead of just fitting something to work
When unloading cogs, currently we do not remove submodules from
sys.modules, meaning they will not be reloaded. Removing here
makes new imports reload from file. Of course, any already imported
modules will still hold a reference to the old module, since they
will not re-import it, and will not be forcably unloaded.
In Discord, if the @everyone role has an explicit allow but a later
role has an explicit deny, the permission is denied rather than allowed
despite the fact that on Discord, allows have a higher priority than
denies.
This is because the @everyone role is supposed to be the first role to
be applied, while the rest could be applied in an aggregate fashion.
Fixes#630.
New API change[1] will make it so CHANNEL_CREATE will keep getting
sent for private channels, so might as well avoid the overhead of
constantly creating the channel if we can avoid it.
[1]: https://github.com/hammerandchisel/discord-api-docs/issues/184
re #221, Game.name can still be None, which will cause TypeError on
str(game).
Currently discord does not treat these weird statuses uniformly, with it
showing as playing a game on mobile, but not playing a game on desktop. It
may be useful to know users are in this weird state.
Previously, Context.command was not guaranteed to be the actual command
being checked if it can run. This could be troublesome when
implementing help commands or when using the default help command.
This new change allows at least for the guarantee that Context.command
to be technically correct in Command.can_run.
There is a counterpart for this in cogs, called __global_check_once.
This allows for predicates that would filter a command globally that
do not necessarily require rechecking in the case of e.g. the help
command such as blocking users or blocking channels.