Typer
A typer what will keep sending typing events to the given channel with the client. Can be used as a context manager.
After entered as a context manager sends a typing event each 8
seconds to the given channel.
Attributes
int
The channel's id where typing will be triggered.
The client what will send the typing events.
float
The leftover timeout till the typer will send typing events. Is reduced every time, when the typer sent a typing event. If goes under 0.0
the typer stops sending more events.
Future
, None
The sleeping future what will wake_up .run
.
Methods
(client, channel_id, ...)
__init__Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
client | The client what will send the typing events. | |||
channel_id |
| The channel's id where typing will be triggered. | ||
timeout |
|
| The maximal amount of time till the client will keep sending typing events. Defaults to |
()
cancelIf the context manager is still active, cancels it.
()
runThe coroutine what keeps sending the typing requests.
This method is a coroutine.
()
__await__Keeps typing till timeout occurs.
()
__enter__Enters the typer's context block by ensuring it's .run
method.
()
__exit__Exits the typer's context block by cancelling it.