mirror of
				https://github.com/Rapptz/discord.py.git
				synced 2025-10-25 02:23:04 +00:00 
			
		
		
		
	[commands] fix incorrect typings in ThreadConverter
This commit is contained in:
		| @@ -93,6 +93,7 @@ _utils_get = discord.utils.get | |||||||
| T = TypeVar('T') | T = TypeVar('T') | ||||||
| T_co = TypeVar('T_co', covariant=True) | T_co = TypeVar('T_co', covariant=True) | ||||||
| CT = TypeVar('CT', bound=discord.abc.GuildChannel) | CT = TypeVar('CT', bound=discord.abc.GuildChannel) | ||||||
|  | TT = TypeVar('TT', bound=discord.Thread) | ||||||
|  |  | ||||||
|  |  | ||||||
| @runtime_checkable | @runtime_checkable | ||||||
| @@ -449,7 +450,7 @@ class GuildChannelConverter(IDConverter[discord.abc.GuildChannel]): | |||||||
|         return result |         return result | ||||||
|  |  | ||||||
|     @staticmethod |     @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 |         bot = ctx.bot | ||||||
|  |  | ||||||
|         match = IDConverter._get_id_match(argument) or re.match(r'<#([0-9]{15,20})>$', argument) |         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: |         if match is None: | ||||||
|             # not a mention |             # not a mention | ||||||
|             if guild: |             if guild: | ||||||
|                 iterable: Iterable[CT] = getattr(guild, attribute) |                 iterable: Iterable[TT] = getattr(guild, attribute) | ||||||
|                 result: Optional[CT] = discord.utils.get(iterable, name=argument) |                 result: Optional[TT] = discord.utils.get(iterable, name=argument) | ||||||
|         else: |         else: | ||||||
|             thread_id = int(match.group(1)) |             thread_id = int(match.group(1)) | ||||||
|             if guild: |             if guild: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user