def keep_typing(last: float, chat: Chat, action: str) -> float: now = time.time() if (now - last) > 1: chat.send_action(action) return now
def keep_typing(last: float, chat: Chat, action: str, application: Application) -> float: now = time.time() if (now - last) > 1: application.create_task(chat.send_action(action)) return now