👍8❤3
👍7❤6👎1🎉1
👍6❤2💩1🤡1🖕1
The StackOverflow question PyQt, Telethon. How to send a message on button click? prompted me to write a Wrapper to launch async tasks from threaded code. This is in my opinion one of the cleanest way in which you can combine threaded code with async code (a.k.a. Telethon).
Note that I still recommend you to avoid threaded code when possible, and use only async, but if you can't for some reason, this wrapper will setup and manage a new thread just for async code to run. Then you can use as many threads as you want, and communicate safely with the async code via a shared queue.
Note that I still recommend you to avoid threaded code when possible, and use only async, but if you can't for some reason, this wrapper will setup and manage a new thread just for async code to run. Then you can use as many threads as you want, and communicate safely with the async code via a shared queue.
❤11👍5💩3🤡1🖕1
❤7👍5💩4🎉3🤡1🖕1
👍8🔥5🎉5💩5🤡1🖕1
👍8💩5🔥1💔1
👍9💩5🔥1🎉1
Given the amount of trolls having fun with the reactions here, I've toned them down a bit. If you had a legitimate reason to react with a poop emoji or middle finger, please message me privately argumenting why you think it's a bad idea to disable that reaction, and I may reconsider. If you're a troll though, I'll simply report you and go on with my life.
❤16🔥6👍5💔5😁4👎1🎉1
👍8💔2🔥1
👍3💔2❤1
Telethon Updates
Version 1.26 (view new and changed raw API methods)
Version 1.26.1 has been released which should fix
The problem occured when a new channel was created and an update for "message read" arrived before "new message", which caused Telethon to initialize the state for the new channel as 0, which led to the error above. Telethon now knows why and when it happens, and correctly sets the initial state as 1 when this occurs (Telegram seems to be aware of this issue, as it sends the second update with a value of 2 instead of the expected 1).
PersistentTimestampEmptyError
. Thanks to everyone who reported the issue.The problem occured when a new channel was created and an update for "message read" arrived before "new message", which caused Telethon to initialize the state for the new channel as 0, which led to the error above. Telethon now knows why and when it happens, and correctly sets the initial state as 1 when this occurs (Telegram seems to be aware of this issue, as it sends the second update with a value of 2 instead of the expected 1).
👍7❤3🔥3🎉2😁1