From 15d8b312f4df9d84eb1484fd03b0407048a18bc6 Mon Sep 17 00:00:00 2001 From: Dan Elkouby Date: Wed, 13 Jun 2018 21:31:48 +0300 Subject: [PATCH] Rename re(gex) plugin to sed --- stdplugins/{re.py => sed.py} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename stdplugins/{re.py => sed.py} (94%) diff --git a/stdplugins/re.py b/stdplugins/sed.py similarity index 94% rename from stdplugins/re.py rename to stdplugins/sed.py index df3e908..fe518a4 100644 --- a/stdplugins/re.py +++ b/stdplugins/sed.py @@ -5,7 +5,7 @@ import regex from telethon import events, utils from telethon.tl import types, functions -HEADER = "[[regex]]\n" +HEADER = "[[sed]]\n" KNOWN_RE_BOTS = re.compile( r'(regex|moku|BananaButler_|rgx|l4mR)bot', flags=re.IGNORECASE @@ -62,7 +62,7 @@ def doit(chat_id, match, original): return None, None -async def group_has_regex(group): +async def group_has_sedbot(group): if isinstance(group, types.InputPeerChannel): full = await borg(functions.channels.GetFullChannelRequest(group)) elif isinstance(group, types.InputPeerChat): @@ -83,7 +83,7 @@ async def on_message(event): async def on_regex(event): if event.forward: return - if not event.is_private and await group_has_regex(await event.input_chat): + if not event.is_private and await group_has_sedbot(await event.input_chat): return chat_id = utils.get_peer_id(await event.input_chat)