diff options
| author | mroik <mroik@delayed.space> | 2021-11-24 23:18:57 +0100 |
|---|---|---|
| committer | mroik <mroik@delayed.space> | 2021-11-24 23:18:57 +0100 |
| commit | 9ac7fd007bb935f708be95ed1dcdba4cc8330d76 (patch) | |
| tree | 654b308def1b1cad23a3b91dcf955c6512fe7b7f | |
| parent | 160b64129a003dab658d08caee7edaf5518d7eb6 (diff) | |
Small changes
| -rw-r--r-- | mentioned.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mentioned.py b/mentioned.py index 327ab10..1cc9f20 100644 --- a/mentioned.py +++ b/mentioned.py @@ -4,7 +4,7 @@ from telethon.tl.types import PeerUser from config import API_ID, API_HASH, WORDLIST -client = TelegramClient("mi_chiamano", API_ID, API_HASH) +client = TelegramClient("notify me on untagged", API_ID, API_HASH) client.parse_mode = "markdown" @@ -21,12 +21,13 @@ async def handler(event: events.NewMessage.Event): return if message.message == "" or message.message is None: return - if event.message.mentioned: + if message.mentioned: return for word in WORDLIST: - if word.upper() in event.message.message.upper(): + if word.upper() in message.message.upper(): msg = f"[{from_.user_id}](tg://user?id={from_.user_id}) tagged you in" - msg += f" [{chan.channel_id}](https://t.me/c/{chan.channel_id}/{str(message.id)})" + msg += f" [{chan.channel_id}](https://t.me/c/{chan.channel_id}/{str(message.id)}):\n" + msg += f"{message.message}" await client.send_message("me", msg) return |
