grammers
grammers copied to clipboard
"SetTypingRequest" Telethon equivalent in Gramme.rs
Is there any?
Currently there is no "friendly method" for it. We should brainstorm how this should work in grammers. In Telethon, we can use a context manager, and the typing status is sent for as long as the context manager is open. But Rust doesn't have that. We could emulate one with a closure, but I don't know if that's the best option. What ideas do you have, or how would you like to use it?
Personally I'd just emulate it manually for n amount of time
Could you sketch some code on how you'd imagine it? Then we can discuss tradeoffs.
maybe something like:
client.set_typing_status(chat_id, true);
🤷🏻♂️
This will only show it for a few seconds. It would be annoying to use, with, say, file uploads, which need to send this request evwry so often (but there's no need to do it too often).
oh sorry didn't know telegram does it this way
What about keep sending it until the library user set it to false?
Then not only does the library have to spawn a long-lived task (which I would rather avoid), but it would also make it easy to accidentally always leave it on.