'*censored*'
client: TelegramClient = TelegramClient('-', apiid, apihash)
client.start()
@client.on(events.NewMessage(chats='*censored*', from_users='*censored*'))
async def auto(event):
global newb
a = event.message.text.split()
if 'хавчик' in a:
b = a[10]
newb = b.replace('*', '', 4).replace('%', '', 1)
print(newb)
if int(newb) >= 20:
time.sleep(3)
await client.send_message('*censored*', 'мус)
if event.message.buttons:
for row_idx, row in enumerate(event.message.buttons):
for col_idx, button in enumerate(row):
print(f"Кнопка ({row_idx}, {col_idx}): {button.text}")
if '🥦' in button.text:
if int(newb) + 50 <= 100:
await button.click()
newb = newb + 50
print(f'Сытость равна : {newb}')
elif '🥤' in button.text:
if int(newb) + 100 <= 100:
await button.click()
newb = newb + 100
print(f'Сытость равна : {newb}')
client.run_until_disconnected()
How make cycle for async? While True not work
you are using telethon.sync
Обсуждают сегодня