return # empty string errors -_- if len(text) >= telegram.MAX_MESSAGE_LENGTH: update.effective_message.reply_text( "The result of the sed command was too long for \ telegram!") elif text: update.effective_message.reply_to_message.reply_text(text) __help__ = """ - s/<text1>/<text2>(/<flag>): Reply to a message with this to perform a sed operation on that message, replacing all \ occurrences of 'text1' with 'text2'. Flags are optional, and currently include 'i' for ignore case, 'g' for global, \ or nothing. Delimiters include `/`, `_`, `|`, and `:`. Text grouping is supported. The resulting message cannot be \ larger than {}. *Reminder:* Sed uses some special characters to make matching easier, such as these: `+*.?\\` If you want to use these characters, make sure you escape them! eg: \\?. """.format(telegram.MAX_MESSAGE_LENGTH) __mod_name__ = "Sed/Regex" SED_HANDLER = DisableAbleRegexHandler(r's([{}]).*?\1.*'.format( "".join(DELIMITERS)), sed, friendly="sed") dispatcher.add_handler(SED_HANDLER)
valid, reason = sql.check_afk_status(user_id) if valid: if not reason: res = "{} is AFK!".format(fst_name) else: res = "{} is AFK! says its because of:\n{}".format(fst_name, reason) message.reply_text(res) def __gdpr__(user_id): sql.rm_afk(user_id) __help__ = """ - /afk <reason>: mark yourself as AFK. - brb <reason>: same as the afk command - but not a command. When marked as AFK, any mentions will be replied to with a message to say you're not available! """ __mod_name__ = "AFK" AFK_HANDLER = DisableAbleCommandHandler("afk", afk) AFK_REGEX_HANDLER = DisableAbleRegexHandler("(?i)brb", afk, friendly="afk") NO_AFK_HANDLER = MessageHandler(Filters.all & Filters.group , no_longer_afk) AFK_REPLY_HANDLER = MessageHandler(Filters.all & Filters.group , reply_afk) dispatcher.add_handler(AFK_HANDLER, AFK_GROUP) dispatcher.add_handler(AFK_REGEX_HANDLER, AFK_GROUP) dispatcher.add_handler(NO_AFK_HANDLER, AFK_GROUP) dispatcher.add_handler(AFK_REPLY_HANDLER, AFK_REPLY_GROUP)
- /mock : Converts text into alternate capital and small letters """ __mod_name__ = "Memes" COPYPASTA_HANDLER = DisableAbleCommandHandler("copypasta", copypasta) COPYPASTA_ALIAS_HANDLER = DisableAbleCommandHandler("😂", copypasta) CLAPMOJI_HANDLER = DisableAbleCommandHandler("clapmoji", clapmoji) CLAPMOJI_ALIAS_HANDLER = DisableAbleCommandHandler("👏", clapmoji) BMOJI_HANDLER = DisableAbleCommandHandler("🅱", bmoji) BMOJI_ALIAS_HANDLER = DisableAbleCommandHandler("bmoji", bmoji) OWO_HANDLER = DisableAbleCommandHandler("owo", owo) STRETCH_HANDLER = DisableAbleCommandHandler("stretch", stretch) VAPOR_HANDLER = DisableAbleCommandHandler("vapor", vapor, pass_args=True) MOCK_HANDLER = DisableAbleCommandHandler("mock", spongemocktext, admin_ok=True) ME_TOO_THANKS_HANDLER = DisableAbleRegexHandler(r"(?i)me too", me_too, friendly="me_too") dispatcher.add_handler(COPYPASTA_HANDLER) dispatcher.add_handler(COPYPASTA_ALIAS_HANDLER) dispatcher.add_handler(CLAPMOJI_HANDLER) dispatcher.add_handler(CLAPMOJI_ALIAS_HANDLER) dispatcher.add_handler(BMOJI_HANDLER) dispatcher.add_handler(BMOJI_ALIAS_HANDLER) dispatcher.add_handler(OWO_HANDLER) dispatcher.add_handler(STRETCH_HANDLER) dispatcher.add_handler(VAPOR_HANDLER) dispatcher.add_handler(MOCK_HANDLER) dispatcher.add_handler(ME_TOO_THANKS_HANDLER)