From d2c6607429241dd3f9eed99bd8bd5d5ad22220ee Mon Sep 17 00:00:00 2001 From: udf Date: Sat, 27 Apr 2019 12:15:40 +0200 Subject: [PATCH] echo user who changed the group title --- stdplugins/sp_prog_rename.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stdplugins/sp_prog_rename.py b/stdplugins/sp_prog_rename.py index d8fc58f..db2202b 100644 --- a/stdplugins/sp_prog_rename.py +++ b/stdplugins/sp_prog_rename.py @@ -1,5 +1,6 @@ import asyncio import re +import html from telethon import events from telethon.tl.functions.channels import EditTitleRequest @@ -7,7 +8,7 @@ from telethon.errors.rpcerrorlist import ChatNotModifiedError MULTI_EDIT_TIMEOUT = 80 REVERT_TIMEOUT = 2 * 60 * 60 -CHANNEL_ID = 1040270887 +CHANNEL_ID = 1286178907 DEFAULT_TITLE = "Programming & Tech" rename_lock = asyncio.Lock() revert_task = None @@ -58,6 +59,12 @@ async def on_name(event): if len(new_title) > 255 or rename_lock.locked(): return + await event.respond( + f'{html.escape(event.sender.first_name)}' + ' changed the group title!', + parse_mode='html' + ) + with (await rename_lock): await edit_title(new_title) await asyncio.sleep(MULTI_EDIT_TIMEOUT)