From e3a45b8d1b75526463362a7bf93612cd5e7cc6c7 Mon Sep 17 00:00:00 2001 From: Alexey Chubukov Date: Thu, 14 Dec 2023 13:18:51 +0400 Subject: [PATCH] scrapped --- deploy/Dockerfile | 2 ++ src/bot.py | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 deploy/Dockerfile create mode 100644 src/bot.py diff --git a/deploy/Dockerfile b/deploy/Dockerfile new file mode 100644 index 0000000..9b43e8c --- /dev/null +++ b/deploy/Dockerfile @@ -0,0 +1,2 @@ +FROM alpine +RUN apk add python3 py3-pip diff --git a/src/bot.py b/src/bot.py new file mode 100644 index 0000000..d6e73f3 --- /dev/null +++ b/src/bot.py @@ -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() \ No newline at end of file