I wanted to send an update to an entity that will show up as "X is typing..." (X being me) on their (recipient's) side. I've looked through the docs (especially under the telethon.client package) and couldn't find a method that does that. Is it possible to send such an update using telethon?
The function you are looking for is SetTypingRequest. Read more about it here:
https://lonamiwebs.github.io/Telethon/methods/messages/set_typing.html
Example:
from telethon.sync import TelegramClient
from telethon import functions, types
with TelegramClient(name, api_id, api_hash) as client:
result = client(functions.messages.SetTypingRequest(
peer='username',
action=types.SendMessageTypingAction()
))
print(result)
Don't forget to cancel the typing action after some time; you probably don't want to type forever :-D
https://lonamiwebs.github.io/Telethon/constructors/send_message_cancel_action.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With