diff options
| author | Alex Nørgaard <[email protected]> | 2021-07-21 07:43:37 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-07-21 02:43:37 -0400 |
| commit | 26e68b31ef4d3ae54ebb5062eff2f2ed05f6e274 (patch) | |
| tree | 82822dd3c11d17391b0ebebbc7ad335d67a51461 /discord/ext | |
| parent | Sync Guild.features to documentation (diff) | |
| download | discord.py-26e68b31ef4d3ae54ebb5062eff2f2ed05f6e274.tar.xz discord.py-26e68b31ef4d3ae54ebb5062eff2f2ed05f6e274.zip | |
[commands] fix incorrect typings in ThreadConverter
Diffstat (limited to 'discord/ext')
| -rw-r--r-- | discord/ext/commands/converter.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index dd7d6577..740ca2f4 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -93,6 +93,7 @@ _utils_get = discord.utils.get T = TypeVar('T') T_co = TypeVar('T_co', covariant=True) CT = TypeVar('CT', bound=discord.abc.GuildChannel) +TT = TypeVar('TT', bound=discord.Thread) @runtime_checkable @@ -449,7 +450,7 @@ class GuildChannelConverter(IDConverter[discord.abc.GuildChannel]): return result @staticmethod - def _resolve_thread(ctx: Context, argument: str, attribute: str, type: Type[CT]) -> CT: + def _resolve_thread(ctx: Context, argument: str, attribute: str, type: Type[TT]) -> TT: bot = ctx.bot match = IDConverter._get_id_match(argument) or re.match(r'<#([0-9]{15,20})>$', argument) @@ -459,8 +460,8 @@ class GuildChannelConverter(IDConverter[discord.abc.GuildChannel]): if match is None: # not a mention if guild: - iterable: Iterable[CT] = getattr(guild, attribute) - result: Optional[CT] = discord.utils.get(iterable, name=argument) + iterable: Iterable[TT] = getattr(guild, attribute) + result: Optional[TT] = discord.utils.get(iterable, name=argument) else: thread_id = int(match.group(1)) if guild: |