aboutsummaryrefslogtreecommitdiff
path: root/mentioned.py
diff options
context:
space:
mode:
authormroik <mroik@delayed.space>2021-11-25 15:08:16 +0100
committermroik <mroik@delayed.space>2021-11-25 15:08:16 +0100
commitd9c9525b821ead5b9f8330374c742b60b0b5bc7f (patch)
treef48b50a1aad3cdba26ed93203691e86f53884c0d /mentioned.py
parent6ff65935c878a9dc83eb7d81f1c9e745e543595b (diff)
Small change
Diffstat (limited to 'mentioned.py')
-rw-r--r--mentioned.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/mentioned.py b/mentioned.py
index b3cd7ff..c7a5c21 100644
--- a/mentioned.py
+++ b/mentioned.py
@@ -2,13 +2,16 @@ import re
from telethon import TelegramClient, events
from telethon.tl.types import PeerUser
-from telegram import Bot
+from telegram.ext import Updater
+from telegram import Chat
from config import API_ID, API_HASH, WORDLIST, GROUP_ID, BOT_TOKEN
client = TelegramClient("notify me on untagged", API_ID, API_HASH)
-bot = Bot(BOT_TOKEN)
+updater = Updater(token=BOT_TOKEN)
+bot = updater.bot
+chat: Chat = bot.get_chat(GROUP_ID)
@client.on(events.NewMessage())
@@ -39,7 +42,7 @@ async def handler(event: events.NewMessage.Event):
msg += f"{message.message[:found.start()]}__"\
f"{message.message[found.start():found.end()]}__"\
f"{message.message[found.end():]}"
- bot.send_message(GROUP_ID, msg, parse_mode="markdown")
+ chat.send_message(msg, parse_mode="markdown")
return
XMR address: 854DmXNrxULU3ZFJVs4Wc8PFhbq29RhqHhY8W6cdWrtFN3qmooKyyeYPcDzZTNRxphhJ5UzASQfAdEMwSteVqymk28aLhqj