number = information key = "fe65b94e78fc2e3234c1c6ed1b771abd" api = ("http://apilayer.net/api/validate?access_key=" + key + "&number=" + number + "&country_code=&format=1") output = requests.get(api) content = output.text obj = json.loads(content) country_code = obj["country_code"] country_name = obj["country_name"] location = obj["location"] carrier = obj["carrier"] line_type = obj["line_type"] validornot = obj["valid"] aa = "Valid: " + str(validornot) a = "Phone number: " + str(number) b = "Country: " + str(country_code) c = "Country Name: " + str(country_name) d = "Location: " + str(location) e = "Carrier: " + str(carrier) f = "Device: " + str(line_type) g = f"{aa}\n{a}\n{b}\n{c}\n{d}\n{e}\n{f}" send_message(update.effective_message, g) PHONE_HANDLER = CommandHandler("phone", phone) dispatcher.add_handler(PHONE_HANDLER) __command_list__ = ["phone"] __handlers__ = [PHONE_HANDLER]
return """╘══「 Groups count: <code>???</code> 」""" num_chats = sql.get_user_num_chats(user_id) return f"""╘══「 Groups count: <code>{num_chats}</code> 」""" def __stats__(): return f"• {sql.num_users()} users, across {sql.num_chats()} chats" def __migrate__(old_chat_id, new_chat_id): sql.migrate_chat(old_chat_id, new_chat_id) __help__ = "" # no help string BROADCAST_HANDLER = CommandHandler( ["broadcastall", "broadcastusers", "broadcastgroups"], broadcast) USER_HANDLER = MessageHandler(Filters.all & Filters.group, log_user) CHAT_CHECKER_HANDLER = MessageHandler(Filters.all & Filters.group, chat_checker) CHATLIST_HANDLER = CommandHandler("groups", chats) dispatcher.add_handler(USER_HANDLER, USERS_GROUP) dispatcher.add_handler(BROADCAST_HANDLER) dispatcher.add_handler(CHATLIST_HANDLER) dispatcher.add_handler(CHAT_CHECKER_HANDLER, CHAT_GROUP) __mod_name__ = "Users" __handlers__ = [(USER_HANDLER, USERS_GROUP), BROADCAST_HANDLER, CHATLIST_HANDLER]
Reports bugs at @{SUPPORT_CHAT} [Powered by CoffeeHouse](https://coffeehouse.intellivoid.net) from @Intellivoid """ ADD_CHAT_HANDLER = CommandHandler("addchat", add_chat) REMOVE_CHAT_HANDLER = CommandHandler("rmchat", remove_chat) CHATBOT_HANDLER = MessageHandler( Filters.text & (~Filters.regex(r"^#[^\s]+") & ~Filters.regex(r"^!") & ~Filters.regex(r"^\/")), chatbot, ) LIST_CB_CHATS_HANDLER = CommandHandler("listaichats", list_chatbot_chats, filters=CustomFilters.dev_filter) # Filters for ignoring #note messages, !commands and sed. dispatcher.add_handler(ADD_CHAT_HANDLER) dispatcher.add_handler(REMOVE_CHAT_HANDLER) dispatcher.add_handler(CHATBOT_HANDLER) dispatcher.add_handler(LIST_CB_CHATS_HANDLER) __mod_name__ = "Chatbot 🙋♀️" __command_list__ = ["addchat", "rmchat", "listaichats"] __handlers__ = [ ADD_CHAT_HANDLER, REMOVE_CHAT_HANDLER, CHATBOT_HANDLER, LIST_CB_CHATS_HANDLER, ]
from telegram.ext import run_async from LipsaRobot import dispatcher from LipsaRobot.modules.disable import DisableAbleCommandHandler from LipsaRobot.modules.helper_funcs.alternate import send_message from LipsaRobot.modules.helper_funcs.chat_status import user_admin @run_async @user_admin def send(update, context): args = update.effective_message.text.split(None, 1) creply = args[1] send_message(update.effective_message, creply) ADD_CCHAT_HANDLER = DisableAbleCommandHandler("snd", send) dispatcher.add_handler(ADD_CCHAT_HANDLER) __command_list__ = ["snd"] __handlers__ = [ADD_CCHAT_HANDLER]
if len(args) == 0: update.effective_message.reply_text( "That was a funny joke, but no really, put in a location" ) try: geolocator = Nominatim(user_agent="SkittBot") location = " ".join(args) geoloc = geolocator.geocode(location) chat_id = update.effective_chat.id lon = geoloc.longitude lat = geoloc.latitude the_loc = Location(lon, lat) gm = "https://www.google.com/maps/search/{},{}".format(lat, lon) dispatcher.bot.send_location(chat_id, location=the_loc) update.message.reply_text( "Open with: [Google Maps]({})".format(gm), parse_mode=ParseMode.MARKDOWN, disable_web_page_preview=True, ) except AttributeError: update.message.reply_text("I can't find that") GPS_HANDLER = CommandHandler("gps", gps) dispatcher.add_handler(GPS_HANDLER) __command_list__ = ["gps"] __handlers__ = [GPS_HANDLER]
params = dict(lang="US", 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("tts", gtts, pass_args=True)) dispatcher.add_handler(DisableAbleCommandHandler("splcheck", spellcheck))
• `/kaizoku <anime>`*:* search an anime on animekaizoku.com • `/kayo <anime>`*:* search an anime on animekayo.com • `/airing <anime>`*:* returns anime airing info. """ 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) KAIZOKU_SEARCH_HANDLER = DisableAbleCommandHandler("kaizoku", kaizoku) KAYO_SEARCH_HANDLER = DisableAbleCommandHandler("kayo", kayo) BUTTON_HANDLER = CallbackQueryHandler(button, pattern="anime_.*") dispatcher.add_handler(BUTTON_HANDLER) dispatcher.add_handler(ANIME_HANDLER) dispatcher.add_handler(CHARACTER_HANDLER) dispatcher.add_handler(MANGA_HANDLER) dispatcher.add_handler(AIRING_HANDLER) dispatcher.add_handler(USER_HANDLER) dispatcher.add_handler(KAIZOKU_SEARCH_HANDLER) dispatcher.add_handler(KAYO_SEARCH_HANDLER) dispatcher.add_handler(UPCOMING_HANDLER) __command_list__ = [ "anime", "manga", "character", "user", "upcoming",
Reply 3` ✪ /clear <notename>*:* clear note with this name ✪ /removeallnotes*:* removes all notes from the group *Note:* Note names are case-insensitive, and they are automatically converted to lowercase before getting saved. """ __mod_name__ = "Notes ✍️" GET_HANDLER = CommandHandler("get", cmd_get) HASH_GET_HANDLER = MessageHandler(Filters.regex(r"^#[^\s]+"), hash_get) SLASH_GET_HANDLER = MessageHandler(Filters.regex(r"^/\d+$"), slash_get) SAVE_HANDLER = CommandHandler("save", save) DELETE_HANDLER = CommandHandler("clear", clear) LIST_HANDLER = DisableAbleCommandHandler(["notes", "saved"], list_notes, admin_ok=True) CLEARALL = DisableAbleCommandHandler("removeallnotes", clearall) CLEARALL_BTN = CallbackQueryHandler(clearall_btn, pattern=r"notes_.*") 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(SLASH_GET_HANDLER) dispatcher.add_handler(CLEARALL) dispatcher.add_handler(CLEARALL_BTN)