This commit is contained in:
Alexey Chubukov 2023-12-14 13:18:51 +04:00
parent bc7cf655a6
commit e3a45b8d1b
2 changed files with 13 additions and 0 deletions

2
deploy/Dockerfile Normal file
View File

@ -0,0 +1,2 @@
FROM alpine
RUN apk add python3 py3-pip

11
src/bot.py Normal file
View File

@ -0,0 +1,11 @@
from telethon.sync import TelegramClient, events
with TelegramClient('name', api_id, api_hash) as client:
client.send_message('me', 'Hello, myself!')
print(client.download_profile_photo('me'))
@client.on(events.NewMessage(pattern='(?i).*Hello'))
async def handler(event):
await event.reply('Hey!')
client.run_until_disconnected()