ChannelFlag
Represents a channel's flags.
The implemented channel flags are the following:
Respective name | Bitwise position |
---|---|
guild_feed_removed | 0 |
pinned | 1 |
active_channels_removed | 2 |
??? | 3 |
require_tag | 4 |
spam | 5 |
??? | 6 |
guild_resource_channel | 7 |
clyde_ai | 8 |
scheduled_for_deletion | 9 |
media_channel | 10 |
summaries_disabled | 11 |
??? | 12 |
role_subscription_template_preview_channel | 13 |
broadcasting | 14 |
hide_media_download_option | 15 |
Properties
active_channels_removed
broadcasting
clyde_ai
guild_feed_removed
guild_resource_channel
hide_media_download_option
media_channel
pinned
require_tag
role_subscription_template_preview_channel
scheduled_for_deletion
spam
summaries_disabled
Methods
()
is_strict_subsetReturns whether self has more flags disabled than other.
()
is_strict_supersetReturns whether self has more flags enabled than other.
()
is_subsetReturns whether self has the same amount or more flags disabled than other.
()
is_supersetReturns whether self has the same amount or more flags enabled than other.
()
itemsYields the items of the flag.
This method is a generator.
Yields
name : str
The name of the specific flag
enabled : int
(0
, 1
)
Whether the specific bitwise value is enabled.
()
keysYields the name of the bitwise flags, which are enabled.
This method is a generator.
Yields
name : str
(...)
update_by_keysUpdates the source value with the given flags and returns a new one.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
**keyword_parameters | Keyword parameters |
|
Returns
flag : FlagBase
Raises
LookupError
If a keyword is invalid.
Examples
>>> from hata import Permission
>>> perm = Permission().update_by_keys(kick_users = True, ban_users = True)
>>> list(perm)
['kick_users', 'ban_users']
>>> perm = perm.update_by_keys(manage_roles = True, kick_users = False)
>>> list(perm)
['ban_users', 'manage_roles']
()
valuesYields the shift values of the flags, under which shift value the flag is enabled.
This method is a generator.
Yields
shift : int
(keys)
_get_shift_ofGets the shift value for the given keys.
Parameter | Type | Description |
---|---|---|
keys |
| The key's name. |
Returns
shift : int
Raises
LookupError
- Invalid key given.
()
__contains__Returns whether the specific flag of the given name is enabled.
(name, shift, deprecation_info)
__disabler_factory__Creates a flag disabler function.
Parameter | Type | Description |
---|---|---|
name |
| The flag's name. |
shift |
| Bit shift value. |
deprecation_info |
| Deprecation info for the field if deprecated. |
Returns
flag_disabler : FunctionType
(name, shift, deprecation_info)
__enabler_factory__Creates a flag enabler function.
Parameter | Type | Description |
---|---|---|
name |
| The flag's name. |
shift |
| Bit shift value. |
deprecation_info |
| Deprecation info for the field if deprecated. |
Returns
flag_enabler : FunctionType
()
__ge__Returns whether self has the same amount or more flags enabled than other.
()
__getitem__Returns whether a specific flag of the given name is enabled.
(name, shift, deprecation_info)
__getter_factory__Creates a flag getter function.
Parameter | Type | Description |
---|---|---|
name |
| The flag's name. |
shift |
| Bit shift value. |
deprecation_info |
| Deprecation info for the field if deprecated. |
Returns
flag_getter : FunctionType
()
__gt__Returns whether self has more flags enabled than other.
()
__iter__Yields the name of the bitwise flags, which are enabled.
This method is a generator.
Yields
name : str
()
__le__Returns whether self has the same amount or more flags disabled than other.
()
__lt__Returns whether self has more flags disabled than other.
()
__repr__Returns the representation of the flag.