vladsharik
14.09.2023, 22:39
https://forum.antichat.xyz/attachments/28378089/img_d9986a1076.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 поставить, но как сделать, чтобы ошибки не вызвало хезе
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 поставить, но как сделать, чтобы ошибки не вызвало хезе