* Initial guild member support
* Add back is_guild_evicted() check, fix some documentation/typing, actually use count
* Better error handling
* Fix predicate and chunking on small guilds
* Silence asyncio.CancelledErrors when bot is stopped
* Properly filter events, assert that assert_guild_presence_count() works
* Working events!!!!! (also a fix for sometimes crashing when joining a guild)
* Uniform timeouts
Relative time intervals can be thought of as:
for _ in range(count):
await body()
await asyncio.sleep(interval)
While explicit time intervals should be thought of as:
times = [1pm, 2pm, 3pm, 12am]
current = 0
for _ in range(count):
time = times.wrapping_index(current) # magic to wrap around
await utils.sleep_until(time)
await body()
current += 1
This results in poor ergonomics due to the lack of default generics
for the common case. For most users this ends up in a degraded
experience since the type will resolve to Unknown rather than at the
very least a Client.
This has potential to be a breaking change and Discord could definitely
royally screw this over in the future. However, as far as I can tell
every interaction has either a User or a Member so this change should
be kosher. I'm unaware of any interaction, even in the future, where
this is not true.
I hope these are not my famous last words.
This implements it in three different ways:
* The first is using typing.Literal for quick and easy ones
* The second is using enum.Enum for slightly more complex ones
* The last is using a Choice type hint with a decorator to pass
a list of choices.
This should hopefully cover most use cases.
This facilitates the "converter-like" API of the app_commands
submodule. As a consequence of this refactor, more types are supported
like channels and attachment.