хелп ми плиз

vladsharik

Участник
Автор темы
132
19
1694716753453.png


Python:
while True:
    new_posts = get_new_posts(access_token, group_id, last_post_id)
    if new_posts:
        last_post_id = new_posts[0]['id']
        for post in new_posts:
            send_post_to_telegram(bot_token, chat_id, post)
    time.sleep(60)
Я понимаю, что надо await поставить, но как сделать, чтобы ошибки не вызвало хезе
 

MrDorlik

Известный
977
392
Посмотреть вложение 215068

Python:
while True:
    new_posts = get_new_posts(access_token, group_id, last_post_id)
    if new_posts:
        last_post_id = new_posts[0]['id']
        for post in new_posts:
            send_post_to_telegram(bot_token, chat_id, post)
    time.sleep(60)
Я понимаю, что надо await поставить, но как сделать, чтобы ошибки не вызвало хезе
я ж те 2 раза отвечал уже async for поставь и await