From 64f971ee640d5dd0b6430bf5c933e61d95de778f Mon Sep 17 00:00:00 2001 From: udf Date: Sun, 10 Jun 2018 19:54:00 +0000 Subject: [PATCH] make thing better, idk --- stdplugins/sp_prog_rename.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stdplugins/sp_prog_rename.py b/stdplugins/sp_prog_rename.py index 048ba07..7cffcb6 100644 --- a/stdplugins/sp_prog_rename.py +++ b/stdplugins/sp_prog_rename.py @@ -25,7 +25,9 @@ async def edit_title(title): pattern=re.compile(r"(?i)programming (?:&|and) (.+)"), chats=prog_tech_id)) async def on_name(event): new_topic = event.pattern_match.group(1).title() - new_title = f"Programming & {new_topic} & Tech" + new_title = f"Programming & {new_topic}" + if "Tech" not in new_title: + new_title += " & Tech" if len(new_title) > 255 or lock.locked(): return @@ -33,7 +35,7 @@ async def on_name(event): with (await lock): await edit_title(new_title) await asyncio.sleep(80) - await asyncio.sleep(60) + await asyncio.sleep(2 * 60 * 60) if lock.locked(): return with (await lock):