mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-22 00:13:01 +00:00
Remove regular context manager support from Typing
This commit is contained in:
@@ -1391,15 +1391,10 @@ class Messageable:
|
||||
await self._state.http.send_typing(channel.id)
|
||||
|
||||
def typing(self) -> Typing:
|
||||
"""Returns a context manager that allows you to type for an indefinite period of time.
|
||||
"""Returns an asynchronous context manager that allows you to type for an indefinite period of time.
|
||||
|
||||
This is useful for denoting long computations in your bot.
|
||||
|
||||
.. note::
|
||||
|
||||
This is both a regular context manager and an async context manager.
|
||||
This means that both ``with`` and ``async with`` work with this.
|
||||
|
||||
Example Usage: ::
|
||||
|
||||
async with channel.typing():
|
||||
@@ -1408,6 +1403,8 @@ class Messageable:
|
||||
|
||||
await channel.send('done!')
|
||||
|
||||
.. versionchanged:: 2.0
|
||||
This no longer works with the ``with`` syntax, ``async with`` must be used instead.
|
||||
"""
|
||||
return Typing(self)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user