Browse Source

Pass `BotT` type argument to `DeferTyping`

pull/10106/head
ItsWilliboy 2 months ago
parent
commit
80ffe65cc5
No known key found for this signature in database GPG Key ID: A77DA821B97055C2
  1. 4
      discord/ext/commands/context.py

4
discord/ext/commands/context.py

@ -751,7 +751,7 @@ class Context(discord.abc.Messageable, Generic[BotT]):
else: else:
return await self.send(content, **kwargs) return await self.send(content, **kwargs)
def typing(self, *, ephemeral: bool = False) -> Union[Typing, DeferTyping]: def typing(self, *, ephemeral: bool = False) -> Union[Typing, DeferTyping[BotT]]:
"""Returns an asynchronous context manager that allows you to send a typing indicator to """Returns an asynchronous context manager that allows you to send a typing indicator to
the destination for an indefinite period of time, or 10 seconds if the context manager the destination for an indefinite period of time, or 10 seconds if the context manager
is called using ``await``. is called using ``await``.
@ -789,7 +789,7 @@ class Context(discord.abc.Messageable, Generic[BotT]):
""" """
if self.interaction is None: if self.interaction is None:
return Typing(self) return Typing(self)
return DeferTyping(self, ephemeral=ephemeral) return DeferTyping[BotT](self, ephemeral=ephemeral)
async def defer(self, *, ephemeral: bool = False) -> None: async def defer(self, *, ephemeral: bool = False) -> None:
"""|coro| """|coro|

Loading…
Cancel
Save