Improve the example for abc.Messageable.typing

This commit is contained in:
MrKomodoDragon 2021-05-23 00:37:55 -07:00 committed by GitHub
parent 71fe40aafa
commit cc8a86a4bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1310,10 +1310,11 @@ class Messageable(Protocol):
This means that both ``with`` and ``async with`` work with this. This means that both ``with`` and ``async with`` work with this.
Example Usage: :: Example Usage: ::
async with channel.typing():
# stimulate something heavy
await asyncio.sleep(10)
async with channel.typing(): await channel.send('done!')
# do expensive stuff here
await channel.send('done!')
""" """
return Typing(self) return Typing(self)