__mod_name__ = "Warnings" WARN_HANDLER = CommandHandler("warn", warn_user, pass_args=True, filters=Filters.group) RESET_WARN_HANDLER = CommandHandler( ["resetwarn", "resetwarns"], reset_warns, pass_args=True, filters=Filters.group ) REMOVE_WARNS_HANDLER = CommandHandler( ["rmwarn", "unwarn"], remove_warns, pass_args=True, filters=Filters.group ) CALLBACK_QUERY_HANDLER = CallbackQueryHandler(button, pattern=r"rm_warn") SENDRULES_QUERY_HANDLER = CallbackQueryHandler(sendrules_handler, pattern=r"send_rules") MYWARNS_HANDLER = DisableAbleCommandHandler( "warns", warns, pass_args=True, filters=Filters.group ) ADD_WARN_HANDLER = CommandHandler("addwarn", add_warn_filter, filters=Filters.group) RM_WARN_HANDLER = CommandHandler( ["nowarn", "stopwarn"], remove_warn_filter, filters=Filters.group ) LIST_WARN_HANDLER = DisableAbleCommandHandler( ["warnlist", "warnfilters"], list_warn_filters, filters=Filters.group, admin_ok=True ) WARN_FILTER_HANDLER = MessageHandler( CustomFilters.has_text & Filters.group, reply_filter ) WARN_LIMIT_HANDLER = CommandHandler( "warnlimit", set_warn_limit, pass_args=True, filters=Filters.group ) WARN_STRENGTH_HANDLER = CommandHandler(
return text def __gdpr__(user_id): end_afk(user_id) __mod_name__ = "AFK" __help__ = """ - /afk <reason>: Mark yourself as AFK. - brb <reason>: Same as the afk command, but not a command.\n When marked as AFK, any mentions will be replied to with a message stating that you're not available! """ AFK_HANDLER = DisableAbleCommandHandler("afk", afk) AFK_REGEX_HANDLER = MessageHandler(Filters.regex("(?i)brb"), 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)
""" __mod_name__ = "Bans" BAN_HANDLER = CommandHandler("ban", ban, pass_args=True, filters=Filters.group) TEMPBAN_HANDLER = CommandHandler(["tban", "tempban"], temp_ban, pass_args=True, filters=Filters.group) KICK_HANDLER = CommandHandler("kick", kick, pass_args=True, filters=Filters.group) UNBAN_HANDLER = CommandHandler("unban", unban, pass_args=True, filters=Filters.group) KICKME_HANDLER = DisableAbleCommandHandler("kickme", kickme, filters=Filters.group) BANME_HANDLER = DisableAbleCommandHandler("banme", banme, filters=Filters.group) dispatcher.add_handler(BAN_HANDLER) dispatcher.add_handler(TEMPBAN_HANDLER) dispatcher.add_handler(KICK_HANDLER) dispatcher.add_handler(UNBAN_HANDLER) dispatcher.add_handler(KICKME_HANDLER) dispatcher.add_handler(BANME_HANDLER)
- /reverse : Reverse searches image or stickers on google. - /gdpr: Deletes your information from the bot's database. Private chats only. - /markdownhelp: Quick summary of how markdown works in telegram - can only be called in private chats. *Translator* - /tr or /tl: - To translate to your language, by default language is set to english, use `/tr <lang code>` for some other language! - /tr hi-en: translates hindi to english - /splcheck: - As a reply to get grammar corrected text of gibberish message. - /tts: - To some message to convert it into audio format! *Weather* - /weather <city>: Gets weather information of particular place! \* To prevent spams weather command and the output will be deleted after 30 seconds """ __mod_name__ = "Miscs" INFO_HANDLER = DisableAbleCommandHandler("who", who) ECHO_HANDLER = CommandHandler("echo", echo, filters=CustomFilters.sudo_filter) MD_HELP_HANDLER = CommandHandler("markdownhelp", markdown_help, filters=Filters.private) STATS_HANDLER = DisableAbleCommandHandler("stats", stats, filters=CustomFilters.sudo_filter) GDPR_HANDLER = CommandHandler("gdpr", gdpr, filters=Filters.private) WIKI_HANDLER = DisableAbleCommandHandler("wiki", wiki) UD_HANDLER = DisableAbleCommandHandler("ud", ud) GETLINK_HANDLER = CommandHandler("getlink", getlink, pass_args=True, filters=Filters.user(OWNER_ID)) STAFFLIST_HANDLER = CommandHandler("slist",
*Available commands:* - /anime <anime>: returns information about the anime. - /character <character>: returns information about the character. - /manga <manga>: returns information about the manga. - /user <user>: returns information about a MyAnimeList user. - /upcoming: returns a list of new anime in the upcoming seasons. - /airing <anime>: returns anime airing info. - /watchlist: to get your saved watchlist. - /mangalist: to get your saved manga read list. - /characterlist | fcl: to get your favorite characters list. - /removewatchlist | rwl <anime>: to remove a anime from your list. - /rfcharacter | rfcl <character>: to remove a character from your list. - /rmanga | rml <manga>: to remove a manga from your list. """ ANIME_HANDLER = DisableAbleCommandHandler("anime", anime) AIRING_HANDLER = DisableAbleCommandHandler("airing", airing) CHARACTER_HANDLER = DisableAbleCommandHandler("character", character) MANGA_HANDLER = DisableAbleCommandHandler("manga", manga) USER_HANDLER = DisableAbleCommandHandler("user", user) UPCOMING_HANDLER = DisableAbleCommandHandler("upcoming", upcoming) WATCHLIST_HANDLER = DisableAbleCommandHandler("watchlist", watchlist) MANGALIST_HANDLER = DisableAbleCommandHandler("mangalist", readmanga) FVRT_CHAR_HANDLER = DisableAbleCommandHandler(["characterlist", "fcl"], fvrtchar) REMOVE_WATCHLIST_HANDLER = DisableAbleCommandHandler( ["removewatchlist", "rwl"], removewatchlist) REMOVE_FVRT_CHAR_HANDLER = DisableAbleCommandHandler(["rfcharacter", "rfcl"], removefvrtchar) REMOVE_MANGA_CHAR_HANDLER = DisableAbleCommandHandler(["rmanga", "rml"], removemangalist)
*Sticker Blacklist* Blacklist sticker is used to stop certain stickers. Whenever a sticker is sent, the message will be deleted immediately. *NOTE:* Blacklist stickers do not affect the group admin. - /blsticker: See current blacklisted sticker. *Only admin:* - /addblsticker <sticker link>: Add the sticker trigger to the black list. Can be added via reply sticker. - /unblsticker <sticker link>: Remove triggers from blacklist. The same newline logic applies here, so you can delete multiple triggers at once. - /rmblsticker <sticker link>: Same as above. - /blstickermode <ban/tban/mute/tmute>: sets up a default action on what to do if users use blacklisted stickers. (`tmute seems broken right now`) Note: • `<sticker link>` can be `https://t.me/addstickers/<sticker>` or just `<sticker>` or reply to the sticker message. """ BLACKLIST_HANDLER = DisableAbleCommandHandler("blacklist", blacklist, pass_args=True, admin_ok=True) ADD_BLACKLIST_HANDLER = CommandHandler("addblacklist", add_blacklist) UNBLACKLIST_HANDLER = CommandHandler(["unblacklist", "rmblacklist"], unblacklist) BLACKLISTMODE_HANDLER = CommandHandler("blacklistmode", blacklist_mode, pass_args=True) BLACKLIST_DEL_HANDLER = MessageHandler( (Filters.text | Filters.command | Filters.sticker | Filters.photo) & Filters.group, del_blacklist, ) dispatcher.add_handler(BLACKLIST_HANDLER) dispatcher.add_handler(ADD_BLACKLIST_HANDLER)
def __migrate__(old_chat_id, new_chat_id): sql.migrate_chat(old_chat_id, new_chat_id) def __chat_settings__(chat_id, user_id): blacklisted = sql.num_stickers_chat_filters(chat_id) return "There are `{} `blacklisted stickers.".format(blacklisted) def __stats__(): return "• {} blacklist stickers, across {} chats.".format( sql.num_stickers_filters(), sql.num_stickers_filter_chats()) BLACKLIST_STICKER_HANDLER = DisableAbleCommandHandler( "blsticker", blackliststicker, admin_ok=True) ADDBLACKLIST_STICKER_HANDLER = DisableAbleCommandHandler( "addblsticker", add_blackliststicker) UNBLACKLIST_STICKER_HANDLER = CommandHandler(["unblsticker", "rmblsticker"], unblackliststicker) BLACKLISTMODE_HANDLER = CommandHandler("blstickermode", blacklist_mode) BLACKLIST_STICKER_DEL_HANDLER = MessageHandler(Filters.sticker & Filters.group, del_blackliststicker) dispatcher.add_handler(BLACKLIST_STICKER_HANDLER) dispatcher.add_handler(ADDBLACKLIST_STICKER_HANDLER) dispatcher.add_handler(UNBLACKLIST_STICKER_HANDLER) dispatcher.add_handler(BLACKLISTMODE_HANDLER) dispatcher.add_handler(BLACKLIST_STICKER_DEL_HANDLER)
else: try: wall_list = asyncio.run(walld(q)) except: msg.reply_text("Error Occured!") return if not wall_list: msg.reply_text("No results found! Check your query.") return else: index = randint(0, len(wall_list) - 1) wallpaper = wall_list[index] url_w = wallpaper[0] context.bot.send_photo( chat_id, photo=url_w, caption=wallpaper[1], reply_to_message_id=msg_id, timeout=60, ) context.bot.send_document( chat_id, document=url_w, filename=q, caption=wallpaper[1], reply_to_message_id=msg_id, timeout=60, ) WALL_HANDLER = DisableAbleCommandHandler("wall", wall) dispatcher.add_handler(WALL_HANDLER)
temp = str(round((c - k))) return temp def fahr(c): c1 = 9 / 5 c2 = 459.67 tF = c * c1 - c2 if tF < 0 and tF > -1: tF = 0 temp = str(round(tF)) return temp reply = f"*Current weather for {cityname}, {country_name} is*:\n\n*Temperature:* `{celsius(curtemp)}°C ({fahr(curtemp)}ºF), feels like {celsius(feels_like)}°C ({fahr(feels_like)}ºF) \n`*Condition:* `{condmain}, {conddet}` {icon}\n*Humidity:* `{humidity}%`\n*Wind:* `{kmph[0]} km/h`\n" del_msg = update.effective_message.reply_text( "{}".format(reply), parse_mode=ParseMode.MARKDOWN, disable_web_page_preview=True ) time.sleep(30) try: del_msg.delete() update.effective_message.delete() except BadRequest as err: if (err.message == "Message to delete not found") or ( err.message == "Message can't be deleted" ): return WEATHER_HANDLER = DisableAbleCommandHandler("weather", weather, pass_args=True) dispatcher.add_handler(WEATHER_HANDLER)
`/save notename` while replying to a sticker or whatever data you'd like. Now, the note at "#notename" contains a sticker which will be sent as a reply. Tip: to retrieve a note without the formatting, use /get <notename> noformat This will retrieve the note and send it without formatting it; getting you the raw markdown, allowing you to make easy edits. """ __mod_name__ = "Notes" GET_HANDLER = CommandHandler("get", cmd_get, pass_args=True) HASH_GET_HANDLER = MessageHandler(Filters.regex(r"^#[^\s]+"), hash_get) SAVE_HANDLER = CommandHandler("save", save) DELETE_HANDLER = CommandHandler("clear", clear, pass_args=True) LIST_HANDLER = DisableAbleCommandHandler(["notes", "saved"], list_notes, admin_ok=True) CLEARALLNOTES_HANDLER = CommandHandler("clearall", clear_notes, filters=Filters.group) RMBTN_HANDLER = CallbackQueryHandler(rmbutton, pattern=r"rmnotes_") dispatcher.add_handler(GET_HANDLER) dispatcher.add_handler(SAVE_HANDLER) dispatcher.add_handler(LIST_HANDLER) dispatcher.add_handler(DELETE_HANDLER) dispatcher.add_handler(HASH_GET_HANDLER) dispatcher.add_handler(CLEARALLNOTES_HANDLER) dispatcher.add_handler(RMBTN_HANDLER)
Stickers made easy with stickers module! - /addsticker: Reply to a sticker to add it to your pack. - /delsticker: Reply to your anime exist sticker to your pack to delete it. - /stickerid: Reply to a sticker to me to tell you its file ID. - /getsticker: Reply to a sticker to me to upload its raw PNG file. - /addfsticker | afs <custom name>: Reply to a sticker to add it into your favorite pack list. - /myfsticker | mfs: Get list of your favorite packs. - /removefsticker | rfs <custom name>: Reply to a sticker to remove it into your favorite pack list. *Example:* `/addfsticker my cat pack` """ __mod_name__ = "Stickers" KANG_HANDLER = DisableAbleCommandHandler("addsticker", addsticker, pass_args=True) DEL_HANDLER = DisableAbleCommandHandler("delsticker", delsticker) STICKERID_HANDLER = DisableAbleCommandHandler("stickerid", stickerid) ADD_FSTICKER_HANDLER = DisableAbleCommandHandler(["addfsticker", "afs"], add_fvrtsticker, pass_args=True) REMOVE_FSTICKER_HANDLER = DisableAbleCommandHandler(["removefsticker", "rfs"], remove_fvrtsticker, pass_args=True) MY_FSTICKERS_HANDLER = DisableAbleCommandHandler(["myfsticker", "mfs"], list_fvrtsticker) GETSTICKER_HANDLER = DisableAbleCommandHandler("getsticker", getsticker) dispatcher.add_handler(KANG_HANDLER) dispatcher.add_handler(DEL_HANDLER)
clientVersion="2.0", apiKey=API_KEY, text=msg.text) res = requests.get(URL, params=params) changes = json.loads(res.text).get("LightGingerTheTextResult") curr_string = "" prev_end = 0 for change in changes: start = change.get("From") end = change.get("To") + 1 suggestions = change.get("Suggestions") if suggestions: sugg_str = suggestions[0].get( "Text") # should look at this list more curr_string += msg.text[prev_end:start] + sugg_str prev_end = end curr_string += msg.text[prev_end:] update.effective_message.reply_text(curr_string) else: update.effective_message.reply_text( "Reply to some message to get grammar corrected text!") dispatcher.add_handler( DisableAbleCommandHandler(["tr", "tl"], gtrans, pass_args=True)) dispatcher.add_handler(DisableAbleCommandHandler("tts", gtts, pass_args=True)) dispatcher.add_handler(DisableAbleCommandHandler("splcheck", spellcheck))
text += f"\n<i>Since: {since_afk}</i>" else: text = "<i>This user is currently isn't afk (away from keyboard).</i>" return text def __gdpr__(user_id): end_afk(user_id) __mod_name__ = "AFK" __help__ = """ - /afk <reason>: Mark yourself as AFK. - brb <reason>: Same as the afk command, but not a command.\n When marked as AFK, any mentions will be replied to with a message stating that you're not available! """ AFK_HANDLER = DisableAbleCommandHandler("afk", afk) AFK_ALT_HANDLER = DisableAbleCommandHandler("ded", afk) AFK_REGEX_HANDLER = MessageHandler(Filters.regex("(?i)brb"), 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_ALT_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)
sql.set_rules(chat_id, rules) def __migrate__(old_chat_id, new_chat_id): sql.migrate_chat(old_chat_id, new_chat_id) def __chat_settings__(chat_id, user_id): return "This chat has had it's rules set: `{}`".format(bool(sql.get_rules(chat_id))) __help__ = """ Every chat works with different rules; this module will help make those rules clearer! - /rules: get the rules for this chat. *Admin only:* - /setrules <your rules here>: Sets rules for the chat. - /clearrules: Clears saved rules for the chat. """ __mod_name__ = "Rules" GET_RULES_HANDLER = DisableAbleCommandHandler("rules", get_rules, filters=Filters.group) SET_RULES_HANDLER = CommandHandler("setrules", set_rules, filters=Filters.group) RESET_RULES_HANDLER = CommandHandler("clearrules", clear_rules, filters=Filters.group) dispatcher.add_handler(GET_RULES_HANDLER) dispatcher.add_handler(SET_RULES_HANDLER) dispatcher.add_handler(RESET_RULES_HANDLER)
dl_file = download.text size = trs[i].find("span", {"class": "filesize"}).text reply += f"[{dl_file}]({dl_link}) - {size}\n" update.message.reply_text( "{}".format(reply), parse_mode=ParseMode.MARKDOWN, disable_web_page_preview=True, ) __help__ = """ Get Latest magisk relese, Twrp for your device or info about some device using its codename, Directly from Bot! *Android related commands:* - /magisk - Gets the latest magisk release for Stable/Beta/Canary. - /device <codename> - Gets android device basic info from its codename. - /twrp <codename> - Gets latest twrp for the android device using the codename. """ __mod_name__ = "Android" MAGISK_HANDLER = DisableAbleCommandHandler("magisk", magisk) DEVICE_HANDLER = DisableAbleCommandHandler("device", device, pass_args=True) TWRP_HANDLER = DisableAbleCommandHandler("twrp", twrp, pass_args=True) dispatcher.add_handler(MAGISK_HANDLER) dispatcher.add_handler(DEVICE_HANDLER) dispatcher.add_handler(TWRP_HANDLER)
*Regex based memes:* `/decide` can be also used with regex like: `Shoko? <question>: randomly answer "Yes, No" etc.` Some other regex filters are: `me too` | `goodmorning`,`gm`,`good morning` | `goodnight`. Shoko will reply random strings accordingly when these words are used! All regex filters can be disabled incase u don't want... like: `/disable metoo`. """ __mod_name__ = "Memes" SHRUG_HANDLER = DisableAbleCommandHandler("shrug", shrug) DECIDE_HANDLER = DisableAbleMessageHandler(Filters.regex(r"(?i)^Shoko\?"), decide, friendly="decide") SNIPE_HANDLER = CommandHandler("snipe", snipe, pass_args=True, filters=CustomFilters.sudo_filter) ABUSE_HANDLER = DisableAbleCommandHandler("abuse", abuse) RUNS_HANDLER = DisableAbleCommandHandler("runs", runs) SLAP_HANDLER = DisableAbleCommandHandler("slap", slap, pass_args=True) HUG_HANDLER = DisableAbleCommandHandler("warm", hug, pass_args=True) GBUN_HANDLER = CommandHandler("gbun", gbun) TABLE_HANDLER = DisableAbleCommandHandler("table", table) CRI_HANDLER = DisableAbleCommandHandler("cri", cri) PASTA_HANDLER = DisableAbleCommandHandler("pasta", copypasta)
__help__ = """ Tagger is an essential feature to mention all subscribed members in the group. Any chat members can subscribe to tagger. - /tagme: registers to the chat tag list. - /untagme: unsubscribes from the chat tag list. *Admin only:* - /tagall: mention all subscribed members. - /untagall: clears all subscribed members. - /addtag <userhandle>: add a user to chat tag list. (via handle, or reply) - /removetag <userhandle>: remove a user to chat tag list. (via handle, or reply) """ TAG_ALL_HANDLER = DisableAbleCommandHandler("tagall", tagall, filters=Filters.group) UNTAG_ALL_HANDLER = DisableAbleCommandHandler("untagall", untagall, filters=Filters.group) UNTAG_ME_HANDLER = DisableAbleCommandHandler("untagme", untagme, filters=Filters.group) TAG_ME_HANDLER = DisableAbleCommandHandler("tagme", tagme, filters=Filters.group) ADD_TAG_HANDLER = DisableAbleCommandHandler("addtag", addtag, pass_args=True, filters=Filters.group) REMOVE_TAG_HANDLER = DisableAbleCommandHandler("removetag",
- /locks: The current list of locks in this chat. Locks can be used to restrict a group's users. eg: Locking urls will auto-delete all messages with urls, locking stickers will restrict all \ non-admin users from sending stickers, etc. Locking bots will stop non-admins from adding bots to the chat. Note: • Unlocking permission *info* will allow members (non-admins) to change the group information, such as the description or the group name • Unlocking permission *pin* will allow members (non-admins) to pinned a message in a group """ __mod_name__ = "Locks" LOCKTYPES_HANDLER = DisableAbleCommandHandler("locktypes", locktypes) LOCK_HANDLER = CommandHandler("lock", lock, pass_args=True) # , filters=Filters.group) UNLOCK_HANDLER = CommandHandler("unlock", unlock, pass_args=True) # , filters=Filters.group) LOCKED_HANDLER = CommandHandler("locks", list_locks) # , filters=Filters.group) dispatcher.add_handler(LOCK_HANDLER) dispatcher.add_handler(UNLOCK_HANDLER) dispatcher.add_handler(LOCKTYPES_HANDLER) dispatcher.add_handler(LOCKED_HANDLER) dispatcher.add_handler( MessageHandler(Filters.all & Filters.group, del_lockables), PERM_GROUP)
return results def scam(imgspage, lim): """Parse/Scrape the HTML code for the info we want.""" single = opener.open(imgspage).read() decoded = single.decode("utf-8") if int(lim) > 10: lim = 10 imglinks = [] counter = 0 pattern = r"^,\[\"(.*[.png|.jpg|.jpeg])\",[0-9]+,[0-9]+\]$" oboi = re.findall(pattern, decoded, re.I | re.M) for imglink in oboi: counter += 1 imglinks.append(imglink) if counter >= int(lim): break return imglinks REVERSE_HANDLER = DisableAbleCommandHandler("reverse", reverse, pass_args=True) dispatcher.add_handler(REVERSE_HANDLER)
filters=Filters.group) SETDESC_HANDLER = CommandHandler("setdescription", set_desc, filters=Filters.group) PROMOTE_HANDLER = CommandHandler("promote", promote, pass_args=True, filters=Filters.group) DEMOTE_HANDLER = CommandHandler("demote", demote, pass_args=True, filters=Filters.group) SET_TITLE_HANDLER = DisableAbleCommandHandler("settitle", set_title, pass_args=True) ADMINLIST_HANDLER = DisableAbleCommandHandler(["adminlist", "admins"], adminlist, filters=Filters.group) dispatcher.add_handler(PIN_HANDLER) dispatcher.add_handler(UNPIN_HANDLER) dispatcher.add_handler(INVITE_HANDLER) dispatcher.add_handler(PROMOTE_HANDLER) dispatcher.add_handler(DEMOTE_HANDLER) dispatcher.add_handler(ADMINLIST_HANDLER) dispatcher.add_handler(SET_TITLE_HANDLER) dispatcher.add_handler(CHAT_PIC_HANDLER) dispatcher.add_handler(DEL_CHAT_PIC_HANDLER) dispatcher.add_handler(SETCHAT_TITLE_HANDLER)
keywords are in lowercase. If you want your keyword to be a sentence, use quotes. eg: /filter "hey there" How you \ doin? - /stop <filter keyword>: Stop that filter. *Chat creator only:* - /stopall: Stop all chat filters at once. *Note*: Filters also support markdown formatters like: {first}, {last} etc.. and buttons. Check `/markdownhelp` to know more! """ __mod_name__ = "Filters" FILTER_HANDLER = CommandHandler("filter", filters) STOP_HANDLER = CommandHandler("stop", stop_filter) STOPALL_HANDLER = CommandHandler("stopall", rmall_filters, filters=Filters.group) LIST_HANDLER = DisableAbleCommandHandler("filters", list_handlers, admin_ok=True) CUST_FILTER_HANDLER = MessageHandler( CustomFilters.has_text & ~Filters.update.edited_message, reply_filter) dispatcher.add_handler(FILTER_HANDLER) dispatcher.add_handler(STOP_HANDLER) dispatcher.add_handler(LIST_HANDLER) dispatcher.add_handler(CUST_FILTER_HANDLER, HANDLER_GROUP) dispatcher.add_handler(STOPALL_HANDLER)