Browse Source
[commands] Fix variance issues in Bot.add_cog with List[Snowflake]
pull/9080/head
Alex Nørgaard
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
3 deletions
-
discord/ext/commands/bot.py
-
discord/ext/commands/cog.py
|
|
@ -41,6 +41,7 @@ from typing import ( |
|
|
|
Dict, |
|
|
|
TYPE_CHECKING, |
|
|
|
Optional, |
|
|
|
Sequence, |
|
|
|
TypeVar, |
|
|
|
Type, |
|
|
|
Union, |
|
|
@ -703,7 +704,7 @@ class BotBase(GroupMixin[None]): |
|
|
|
*, |
|
|
|
override: bool = False, |
|
|
|
guild: Optional[Snowflake] = MISSING, |
|
|
|
guilds: List[Snowflake] = MISSING, |
|
|
|
guilds: Sequence[Snowflake] = MISSING, |
|
|
|
) -> None: |
|
|
|
"""|coro| |
|
|
|
|
|
|
@ -811,7 +812,7 @@ class BotBase(GroupMixin[None]): |
|
|
|
/, |
|
|
|
*, |
|
|
|
guild: Optional[Snowflake] = MISSING, |
|
|
|
guilds: List[Snowflake] = MISSING, |
|
|
|
guilds: Sequence[Snowflake] = MISSING, |
|
|
|
) -> Optional[Cog]: |
|
|
|
"""|coro| |
|
|
|
|
|
|
|
|
|
@ -39,6 +39,7 @@ from typing import ( |
|
|
|
List, |
|
|
|
Optional, |
|
|
|
TYPE_CHECKING, |
|
|
|
Sequence, |
|
|
|
Tuple, |
|
|
|
TypeVar, |
|
|
|
Union, |
|
|
@ -660,7 +661,7 @@ class Cog(metaclass=CogMeta): |
|
|
|
""" |
|
|
|
pass |
|
|
|
|
|
|
|
async def _inject(self, bot: BotBase, override: bool, guild: Optional[Snowflake], guilds: List[Snowflake]) -> Self: |
|
|
|
async def _inject(self, bot: BotBase, override: bool, guild: Optional[Snowflake], guilds: Sequence[Snowflake]) -> Self: |
|
|
|
cls = self.__class__ |
|
|
|
|
|
|
|
# we'll call this first so that errors can propagate without |
|
|
|