Browse Source
Improve the example for abc.Messageable.typing
pull/6948/head
MrKomodoDragon
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
3 deletions
-
discord/abc.py
|
|
@ -1310,10 +1310,11 @@ class Messageable(Protocol): |
|
|
|
This means that both ``with`` and ``async with`` work with this. |
|
|
|
|
|
|
|
Example Usage: :: |
|
|
|
async with channel.typing(): |
|
|
|
# stimulate something heavy |
|
|
|
await asyncio.sleep(10) |
|
|
|
|
|
|
|
async with channel.typing(): |
|
|
|
# do expensive stuff here |
|
|
|
await channel.send('done!') |
|
|
|
await channel.send('done!') |
|
|
|
|
|
|
|
""" |
|
|
|
return Typing(self) |
|
|
|