mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-11-06 17:29:03 +00:00
Document the change in behaviour of bool(flag_obj)
This commit is contained in:
1 parent
8d047d9e1d
commit
ca0b444047
3 files changed
+66
No files matched your search
@@ -1006,6 +1006,20 @@ Due to a breaking API change by Discord, :meth:`Guild.bans` no longer returns a
|
||||
async for ban in guild.bans(limit=1000):
|
||||
...
|
||||
|
||||
Flag classes now have a custom ``bool()`` implementation
|
||||
--------------------------------------------------------
|
||||
|
||||
To allow library users to easily check whether an instance of a flag class has any flags enabled,
|
||||
using `bool` on them will now only return ``True`` if at least one flag is enabled.
|
||||
|
||||
This means that evaluating instances of the following classes in a bool context (such as ``if obj:``) may no longer return ``True``:
|
||||
|
||||
- :class:`Intents`
|
||||
- :class:`MemberCacheFlags`
|
||||
- :class:`MessageFlags`
|
||||
- :class:`Permissions`
|
||||
- :class:`PublicUserFlags`
|
||||
- :class:`SystemChannelFlags`
|
||||
|
||||
Function Signature Changes
|
||||
----------------------------
|
||||
|
||||
Reference in new issue
Block a user