Похожие чаты

Why does client.action not work well with asyncio.sleep?

10 ответов

12 просмотров
=⁠_⁠=- Автор вопроса

Especially typing

Any particular issue?

=⁠_⁠=- Автор вопроса
⎞ .·. ⎝ ⎝
Any particular issue?

At the asyncio.sleep block action stops

=⁠_⁠=
At the asyncio.sleep block action stops

it shouldn't stop anything, sleep in the client.action doesn't affect the task that sends the requests, it can be some internal issue with the task erroring, make sure you have proper logs set to INFO at least

=⁠_⁠=- Автор вопроса
⎞ .·. ⎝ ⎝
it shouldn't stop anything, sleep in the client.ac...

it's set to info I'm not comfortable otherwise It blocks temporarily and as soon as the sleep is done it resumes typing

=⁠_⁠=- Автор вопроса
⎞ .·. ⎝ ⎝
it shouldn't stop anything, sleep in the client.ac...

Btw is doing async with client.action(chat, 'cancel'): Okay ? I don't want to do if bot_action: async with client.action(chat, 'typing'): do_something() else: do_something()

=⁠_⁠=
Btw is doing async with client.action(chat, 'canc...

client.action will expire after some seconds, it needs a with block

=⁠_⁠=- Автор вопроса

Um I meant like action = "typing" if bot_action else "cancel" async with client.action(chat, action):…

=⁠_⁠=
Um I meant like action = "typing" if bot_action e...

You can try and see if it goes fine. the "cancel" isn't an issue, the action will also expire by itself in few seconds if there is no other with client.action actively sending more, canceling is optional. but you may have a bug in code if the action itself isn't showing properly

=⁠_⁠=- Автор вопроса
⎞ .·. ⎝ ⎝
You can try and see if it goes fine. the "cancel" ...

Okay then I'm currently refactoring code like I mentioned previously Will debug this properly if bug still persists.

Похожие вопросы

Обсуждают сегодня

Ну вот просто даже давайте вот как. Какой нибудь конкретный кейс, можете в пример привести, где бч работает и приносит прикладную пользу, а не просто что бы было? Не крипту.
Alexander Andreev
22
Всем привет! Имеется функция: function IsValidChar(ch: UTF8Char): Boolean; var i: Integer; ValidChars: AnsiString; begin ValidChars := 'abcdefghijklmnopqrstuvwxyzABCDE...
Евгений
44
For all those that keep asking why no pump? why this ? and why that...? Please close ur ewt chart and open 2 others - TOTAL (total mc) and BTC.D (btc dominance). Maybe BTC a...
Inn3r_G
19
"Since pnut can flip FTM easily, I'm swapping my FTM to pnut and hoping for a easy x5-x10" Perfect recipe for disaster. NFA but chances are, you'll end up as exit liquidity ...
C. A.
7
объясните пожалуйста, почему функция не работает должным образом? вроде должно брать активное окно сравнивать его размер с размером экрана, и если есть совпадение = true прове...
JF
9
AMD status update? No longer in the plan but something might be around the corner later on Chinese partner? No longer in the plan. This market does not seem to be the top ...
Ben
6
Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
255
да кстати заметил всюда почему то всех сюда прёт, ни в одном чате столько ботов не прёт как сюда.. Может чота надо доработать?
REDis
15
I get confused when people talk about the ‘bull market’ and the ‘next bull market’ as if anyone really has a clue what’s really going on in the world. First of all - there i...
Shah
1
Мне вот любопытно. Уже сколько времени имею соблазн купить макбук, ибо подозреваю что очень уж удобен будет в связке с другой техникой от эпл которая у меня есть, да и сам по ...
Not Yeromin
14
Карта сайта