Update chat_action.py

This commit is contained in:
Noct 2024-08-09 15:11:20 +09:00 committed by GitHub
parent 3ba724e2fa
commit 649bc8c85d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -349,12 +349,10 @@ class ChatActionMiddleware(BaseMiddleware):
async def __call__(
self,
handler: Callable[[TelegramObject, Dict[str, Any]], Awaitable[Any]],
event: TelegramObject,
handler: Callable[[Message, Dict[str, Any]], Awaitable[Any]],
event: Message,
data: Dict[str, Any],
) -> Any:
if not isinstance(event, Message):
return await handler(event, data)
bot = data["bot"]
chat_action = get_flag(data, "chat_action") or "typing"