forked from uniborg/uniborg
make thing better, idk
This commit is contained in:
parent
d04d082c45
commit
64f971ee64
|
@ -25,7 +25,9 @@ async def edit_title(title):
|
||||||
pattern=re.compile(r"(?i)programming (?:&|and) (.+)"), chats=prog_tech_id))
|
pattern=re.compile(r"(?i)programming (?:&|and) (.+)"), chats=prog_tech_id))
|
||||||
async def on_name(event):
|
async def on_name(event):
|
||||||
new_topic = event.pattern_match.group(1).title()
|
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():
|
if len(new_title) > 255 or lock.locked():
|
||||||
return
|
return
|
||||||
|
@ -33,7 +35,7 @@ async def on_name(event):
|
||||||
with (await lock):
|
with (await lock):
|
||||||
await edit_title(new_title)
|
await edit_title(new_title)
|
||||||
await asyncio.sleep(80)
|
await asyncio.sleep(80)
|
||||||
await asyncio.sleep(60)
|
await asyncio.sleep(2 * 60 * 60)
|
||||||
if lock.locked():
|
if lock.locked():
|
||||||
return
|
return
|
||||||
with (await lock):
|
with (await lock):
|
||||||
|
|
Loading…
Reference in New Issue