mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-01 07:40:07 +00:00
Allow creating an Intent through a passed integer value
This commit is contained in:
parent
9e3375f3fc
commit
ef20264b1c
@ -505,8 +505,8 @@ class Intents(BaseFlags):
|
|||||||
|
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
|
|
||||||
def __init__(self, **kwargs: bool) -> None:
|
def __init__(self, value: int = 0, **kwargs: bool) -> None:
|
||||||
self.value: int = self.DEFAULT_VALUE
|
self.value: int = value
|
||||||
for key, value in kwargs.items():
|
for key, value in kwargs.items():
|
||||||
if key not in self.VALID_FLAGS:
|
if key not in self.VALID_FLAGS:
|
||||||
raise TypeError(f'{key!r} is not a valid flag name.')
|
raise TypeError(f'{key!r} is not a valid flag name.')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user