Remove intents.default and make intents a required parameter

This commit is contained in:
Gnome
2021-08-31 20:48:31 +01:00
parent 773ad6f5bf
commit 6e41bd2219
24 changed files with 60 additions and 52 deletions

View File

@@ -152,6 +152,7 @@ class ConnectionState:
handlers: Dict[str, Callable],
hooks: Dict[str, Callable],
http: HTTPClient,
intents: Intents,
loop: asyncio.AbstractEventLoop,
**options: Any,
) -> None:
@@ -194,12 +195,8 @@ class ConnectionState:
else:
status = str(status)
intents = options.get('intents', None)
if intents is not None:
if not isinstance(intents, Intents):
raise TypeError(f'intents parameter must be Intent not {type(intents)!r}')
else:
intents = Intents.default()
if not isinstance(intents, Intents):
raise TypeError(f'intents parameter must be Intent not {type(intents)!r}')
if not intents.guilds:
_log.warning('Guilds intent seems to be disabled. This may cause state related issues.')