*Admin only:* - /pin: silently pins the message replied to - add 'loud' or 'notify' to give notifs to users. - /unpin: unpins the currently pinned message - /invitelink: gets invitelink - /promote: promotes the user replied to - /demote: demotes the user replied to - /settitle: sets a custom title for an admin that the bot promoted #BLUETEXT - /cleanbluetext <on/off/yes/no> - clean commands after sending - /ignorecleanbluetext <word> - prevent auto cleaning of the command - /unignorecleanbluetext <word> - remove prevent auto cleaning of the command - /listcleanbluetext - list currently whitelisted commands """ ADMINLIST_HANDLER = DisableAbleCommandHandler(["adminlist", "admins"], adminlist) PIN_HANDLER = CommandHandler("pin", pin, pass_args=True, filters=Filters.group) UNPIN_HANDLER = CommandHandler("unpin", unpin, filters=Filters.group) INVITE_HANDLER = DisableAbleCommandHandler("invitelink", invite, filters=Filters.group) PROMOTE_HANDLER = CommandHandler("promote", promote, pass_args=True) DEMOTE_HANDLER = CommandHandler("demote", demote, pass_args=True) SET_TITLE_HANDLER = CommandHandler("settitle", set_title, pass_args=True) GITPULL_HANDLER = CommandHandler("gitpull", gitpull) RESTART_HANDLER = CommandHandler("restart", restart)
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 . Note: - `<sticker link>` can be `https://t.me/addstickers/<sticker>` or just `<sticker>` or reply to the sticker message. """ __mod_name__ = "S Blacklist" BLACKLIST_STICKER_HANDLER = DisableAbleCommandHandler("blsticker", blackliststicker, pass_args=True, admin_ok=True) ADDBLACKLIST_STICKER_HANDLER = DisableAbleCommandHandler( "addblsticker", add_blackliststicker) UNBLACKLIST_STICKER_HANDLER = CommandHandler(["unblsticker", "rmblsticker"], unblackliststicker) BLACKLISTMODE_HANDLER = CommandHandler("blstickermode", blacklist_mode, pass_args=True) 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)
from telegram import Update, Bot, ParseMode from telegram.ext import run_async from alluka.modules.disable import DisableAbleCommandHandler from alluka import dispatcher from requests import get @run_async def ud(bot: Bot, update: Update): message = update.effective_message text = message.text[len('/ud '):] results = get( f'http://api.urbandictionary.com/v0/define?term={text}').json() reply_text = f'ℹ️ *{text}*\n\n👉🏻 {results["list"][0]["definition"]}\n\n📌 _{results["list"][0]["example"]}_' message.reply_text(reply_text, parse_mode=ParseMode.MARKDOWN) __help__ = """ - /ud:{word} Type the word or expression you want to search use. like /ud telegram Word: Telegram Definition: A once-popular system of telecommunications, in which the sender would contact the telegram service and speak their [message] over the [phone]. The person taking the message would then send it, via a teletype machine, to a telegram office near the receiver's [address]. The message would then be hand-delivered to the addressee. From 1851 until it discontinued the service in 2006, Western Union was the best-known telegram service in the world. """ __mod_name__ = "Urban dictionary" ud_handle = DisableAbleCommandHandler("ud", ud) dispatcher.add_handler(ud_handle)
import requests from telegram import Message, Chat, Update, Bot, MessageEntity from telegram import ParseMode from telegram.ext import CommandHandler, run_async, Filters from telegram import Update, Bot from telegram.ext import run_async from alluka.modules.disable import DisableAbleCommandHandler from alluka import dispatcher from requests import get @run_async def ping(bot: Bot, update: Update): start_time = time.time() requests.get('http://meanii.me') end_time = time.time() ms = float(end_time - start_time) update.effective_message.reply_text("Pong!! {0:.2f}s 🏓".format( round(ms, 2) % 60), parse_mode=ParseMode.MARKDOWN) __mod_name__ = "Ping" PING_HANDLER = DisableAbleCommandHandler("ping", ping) dispatcher.add_handler(PING_HANDLER)
- /notes or /saved: list all saved notes in this chat If you would like to retrieve the contents of a note without any formatting, use `/get <notename> noformat`. This can \ be useful when updating a current note. *Admin only:* - /save <notename> <notedata>: saves notedata as a note with name notename A button can be added to a note by using standard markdown link syntax - the link should just be prepended with a \ `buttonurl:` section, as such: `[somelink](buttonurl:example.com)`. Check /markdownhelp for more info. - /save <notename>: save the replied message as a note with name notename - /clear <notename>: clear note with this name """ __mod_name__ = "NOTES" GET_HANDLER = CommandHandler("get", cmd_get, pass_args=True) HASH_GET_HANDLER = RegexHandler(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) 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)
@run_async def repo(bot: Bot, update: Update, args: [str]): message = update.effective_message text = message.text[len('/repo '):] usr = get(f'https://api.github.com/users/{text}/repos?per_page=40').json() reply_text = "*Repo*\n" for i in range(len(usr)): reply_text += f"[{usr[i]['name']}]({usr[i]['html_url']})\n" message.reply_text(reply_text, parse_mode=ParseMode.MARKDOWN, disable_web_page_preview=True) __help__ = """ - /git:{GitHub username} Returns info about a GitHub user or organization. - /repo: Return the GitHub user or organization repository list (Limited at 40) """ __mod_name__ = "GITHUB" github_handle = DisableAbleCommandHandler("git", github) REPO_HANDLER = DisableAbleCommandHandler("repo", repo, pass_args=True, admin_ok=True) dispatcher.add_handler(github_handle) dispatcher.add_handler(REPO_HANDLER)
return res = "{} is afk".format(fst_name) update.effective_message.reply_text(res) else: if int(userc_id) == int(user_id): return res = "{} is afk.\nReason: {}".format(fst_name, user.reason) update.effective_message.reply_text(res) __help__ = """ - /afk <reason>: mark yourself as AFK(away from keyboard). - 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! """ 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) __mod_name__ = "AFK" __command_list__ = ["afk"] __handlers__ = [(AFK_HANDLER, AFK_GROUP), (AFK_REGEX_HANDLER, AFK_GROUP), (NO_AFK_HANDLER, AFK_GROUP), (AFK_REPLY_HANDLER, AFK_REPLY_GROUP)]
from telegram import Update, Bot from telegram.ext import run_async from alluka.modules.disable import DisableAbleCommandHandler from alluka import dispatcher @run_async def shout(bot: Bot, update: Update, args: List[str]): msg = "```" text = " ".join(args) result = [] result.append(' '.join([s for s in text])) for pos, symbol in enumerate(text[1:]): result.append(symbol + ' ' + ' ' * pos + symbol) result = list("\n".join(result)) result[0] = text[0] result = "".join(result) msg = "```\n" + result + "```" return update.effective_message.reply_text(msg, parse_mode="MARKDOWN") SHOUT_HANDLER = DisableAbleCommandHandler("shout", shout, pass_args=True) dispatcher.add_handler(SHOUT_HANDLER) __command_list__ = ["shout"] __handlers__ = [SHOUT_HANDLER]
- /cos: Cosine `/cos pi` - /sin: Sine `/sin 0` - /tan: Tangent `/tan 0` - /arccos: Inverse Cosine `/arccos 1` - /arcsin: Inverse Sine `/arcsin 0` - /arctan: Inverse Tangent `/arctan 0` - /abs: Absolute Value `/abs -1` - /log: Logarithm `/log 2l8` __Keep in mind__: To find the tangent line of a function at a certain x value, send the request as c|f(x) where c is the given x value and f(x) is the function expression, the separator is a vertical bar '|'. See the table above for an example request. To find the area under a function, send the request as c:d|f(x) where c is the starting x value, d is the ending x value, and f(x) is the function under which you want the curve between the two x values. To compute fractions, enter expressions as numerator(over)denominator. For example, to process 2/4 you must send in your expression as 2(over)4. The result expression will be in standard math notation (1/2, 3/4). """ __mod_name__ = "Math" SIMPLIFY_HANDLER = DisableAbleCommandHandler("math", simplify, pass_args=True) FACTOR_HANDLER = DisableAbleCommandHandler("factor", factor, pass_args=True) DERIVE_HANDLER = DisableAbleCommandHandler("derive", derive, pass_args=True) INTEGRATE_HANDLER = DisableAbleCommandHandler("integrate", integrate, pass_args=True) ZEROES_HANDLER = DisableAbleCommandHandler("zeroes", zeroes, pass_args=True) TANGENT_HANDLER = DisableAbleCommandHandler("tangent", tangent, pass_args=True) AREA_HANDLER = DisableAbleCommandHandler("area", area, pass_args=True) COS_HANDLER = DisableAbleCommandHandler("cos", cos, pass_args=True) SIN_HANDLER = DisableAbleCommandHandler("sin", sin, pass_args=True) TAN_HANDLER = DisableAbleCommandHandler("tan", tan, pass_args=True) ARCCOS_HANDLER = DisableAbleCommandHandler("arccos", arccos, pass_args=True) ARCSIN_HANDLER = DisableAbleCommandHandler("arcsin", arcsin, pass_args=True) ARCTAN_HANDLER = DisableAbleCommandHandler("arctan", arctan, pass_args=True) ABS_HANDLER = DisableAbleCommandHandler("abs", abs, pass_args=True)
"PONG!!\n" "<b>Time Taken : </b> <code>{}</code>\n".format(telegram_ping), parse_mode=ParseMode.HTML) @run_async @sudo_plus def pingall(bot: Bot, update: Update): to_ping = ["Telegram"] pinged_list = ping_func(to_ping) pinged_list.insert(2, '') start_time = time.time() end_time = time.time() hinata_ping = str(round((end_time - start_time) * 1000, 3)) reply_msg = "╭─⌈ Ping Results Are \n" reply_msg += "\n".join(pinged_list) reply_msg += "┗⊸ Time Taken : <code>{}</code>".format(hinata_ping) update.effective_message.reply_text( reply_msg, parse_mode=ParseMode.HTML, disable_web_page_preview=True) PING_HANDLER = DisableAbleCommandHandler("ping", ping) PINGALL_HANDLER = DisableAbleCommandHandler("pingall", pingall) dispatcher.add_handler(PING_HANDLER) dispatcher.add_handler(PINGALL_HANDLER) __command_list__ = ["ping", "pingall"] __handlers__ = [PING_HANDLER, PINGALL_HANDLER]
return f"<b>About user:</b>\n{me}\n<b>What others say:</b>\n{bio}" elif bio: return f"<b>What others say:</b>\n{bio}\n" elif me: return f"<b>About user:</b>\n{me}" else: return "" __help__ = """ - /setbio <text>: while replying, will save another user's bio - /bio: will get your or another user's bio. This cannot be set by yourself. - /setme <text>: will set your info - /me: will get your or another user's info """ SET_BIO_HANDLER = DisableAbleCommandHandler("setbio", set_about_bio) GET_BIO_HANDLER = DisableAbleCommandHandler("bio", about_bio, pass_args=True) SET_ABOUT_HANDLER = DisableAbleCommandHandler("setme", set_about_me) GET_ABOUT_HANDLER = DisableAbleCommandHandler("me", about_me, pass_args=True) dispatcher.add_handler(SET_BIO_HANDLER) dispatcher.add_handler(GET_BIO_HANDLER) dispatcher.add_handler(SET_ABOUT_HANDLER) dispatcher.add_handler(GET_ABOUT_HANDLER) __mod_name__ = "Bios/Abouts" __command_list__ = ["setbio", "bio", "setme", "me"] __handlers__ = [SET_BIO_HANDLER, GET_BIO_HANDLER, SET_ABOUT_HANDLER, GET_ABOUT_HANDLER]
__help__ = """ - /love ❣️ - /hack 👨💻 - /bombs 💣 """ LOVE_HANDLER = DisableAbleCommandHandler("love", love) HACK_HANDLER = DisableAbleCommandHandler("hack", hack) BOMBS_HANDLER =DisableAbleCommandHandler("bombs",bombs) dispatcher.add_handler(LOVE_HANDLER) dispatcher.add_handler(HACK_HANDLER) dispatcher.add_handler(BOMBS_HANDLER) __mod_name__ = "EMOJIS" __command_list__ = ["love", "hack", "bombs"] __handlers__ = [LOVE_HANDLER, HACK_HANDLER, BOMBS_HANDLER]
"Bahasa di *{}* saat ini adalah:\n{}.\n\nPilih bahasa:").format( chatname, LANGS_TEXT[getlang]), parse_mode="markdown", reply_markup=keyboard) @run_async @user_admin_no_reply def button(bot, update): query = update.callback_query # type: Optional[CallbackQuery] user = update.effective_user # type: Optional[User] match = re.match(r"set_lang\((.+?)\)", query.data) if match: set_lang = match.group(1) chat = update.effective_chat # type: Optional[Chat] sql.set_lang(chat.id, set_lang) update.effective_message.edit_text( tl(query.message, "Bahasa telah di ubah ke {}!").format(LANGS_TEXT.get(set_lang))) __help__ = "language_help" __mod_name__ = "Languages" SETLANG_HANDLER = DisableAbleCommandHandler("setlang", set_language) CALLBACK_QUERY_HANDLER = CallbackQueryHandler(button, pattern=r"set_lang") dispatcher.add_handler(SETLANG_HANDLER) dispatcher.add_handler(CALLBACK_QUERY_HANDLER)
data = fetch.text parsed = json.loads(data) total_confirmed_global = parsed["latest"]["confirmed"] total_deaths_global = parsed["latest"]["deaths"] total_recovered_global = parsed["latest"]["recovered"] active_cases_covid19 = total_confirmed_global - total_deaths_global - total_recovered_global reply_text = ("*Corona Stats🦠:*\n" "Total Confirmed: `" + str(total_confirmed_global) + "`\n" "Total Deaths: `" + str(total_deaths_global) + "`\n" "Total Recovered: `" + str(total_recovered_global) +"`\n" "Active Cases: `"+ str(active_cases_covid19) + "`") message.reply_text(reply_text, parse_mode=ParseMode.MARKDOWN, disable_web_page_preview=True) return elif fetch.status_code == 404: reply_text = "The API is currently down." message.reply_text(reply_text, parse_mode=ParseMode.MARKDOWN, disable_web_page_preview=True) __help__ = """ - /covid: get worldwide corona status - /covindia <state>: Get real time COVID-19 stats for the input Indian state """ __mod_name__ = 'COVID-19 Tracker' COV_INDIA_HANDLER = CommandHandler('covindia', covindia) CORONA_HANDLER = DisableAbleCommandHandler("covid", corona, admin_ok=True) dispatcher.add_handler(CORONA_HANDLER) dispatcher.add_handler(COV_INDIA_HANDLER)
- /strongwarn <on/yes/off/no>: If set to on, exceeding the warn limit will result in a ban. Else, will just kick. """ __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) CALLBACK_QUERY_HANDLER = CallbackQueryHandler(button, pattern=r"rm_warn") 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,
return "There are `{}` custom filters here.".format(len(cust_filters)) __help__ = """ - /filters: list all active filters in this chat. *Admin only:* - /filter <keyword> <reply message>: add a filter to this chat. The bot will now reply that message whenever 'keyword'\ is mentioned. If you reply to a sticker with a keyword, the bot will reply with that sticker. NOTE: all filter \ 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. - /stopall: stop all filters """ __mod_name__ = "FILTERS" FILTER_HANDLER = CommandHandler("fil", filters) STOP_HANDLER = CommandHandler("stop", stop_filter) STOPALL_HANDLER = DisableAbleCommandHandler("stopall", stop_all_filters) LIST_HANDLER = DisableAbleCommandHandler("filters", list_handlers, admin_ok=True) CUST_FILTER_HANDLER = MessageHandler(CustomFilters.has_text, reply_filter) dispatcher.add_handler(FILTER_HANDLER) dispatcher.add_handler(STOP_HANDLER) dispatcher.add_handler(STOPALL_HANDLER) dispatcher.add_handler(LIST_HANDLER) dispatcher.add_handler(CUST_FILTER_HANDLER, HANDLER_GROUP)
text += "\nThis person is one of my sudo users! " \ "Nearly as powerful as my owner - so watch it.." elif user.id in SUPPORT_USERS: text += "\nThis person is one of my support users! " \ "Not quite a sudo user, but can still gban you off the map." elif user.id in WHITELIST_USERS: text += "\nThis person has been whitelisted! " \ "That means I'm not allowed to ban/kick them." text += "\n" for mod in USER_INFO: if mod.__mod_name__ == "Users": continue try: mod_info = mod.__user_info__(user.id) except TypeError: mod_info = mod.__user_info__(user.id, chat.id) if mod_info: text += "\n" + mod_info update.effective_message.reply_text(text, parse_mode=ParseMode.HTML, disable_web_page_preview=True) INFO_HANDLER = DisableAbleCommandHandler("info", info, pass_args=True) dispatcher.add_handler(INFO_HANDLER)
result = cas.banchecker(user.id) text += str(result) for mod in USER_INFO: if mod.__mod_name__ == "Users": continue try: mod_info = mod.__user_info__(user.id) except TypeError: mod_info = mod.__user_info__(user.id, chat.id) if mod_info: text += "\n" + mod_info try: profile = bot.get_user_profile_photos(user.id).photos[0][-1] bot.sendChatAction(chat.id, "upload_photo") bot.send_photo(chat.id, photo=profile, caption=(text), parse_mode=ParseMode.HTML, disable_web_page_preview=True) except IndexError: update.effective_message.reply_text(text, parse_mode=ParseMode.HTML, disable_web_page_preview=True) INFO_HANDLER = DisableAbleCommandHandler(["info", "whois"], info, pass_args=True) dispatcher.add_handler(INFO_HANDLER)
from alluka.modules.helper_funcs.chat_status import is_user_admin, user_admin from alluka.modules.helper_funcs.extraction import extract_user #sleep how many times after each edit in 'police' EDIT_SLEEP = 1 #edit how many times in 'police' EDIT_TIMES = 6 police_siren = [ "🔴🔴🔴⬜️⬜️⬜️🔵🔵🔵\n🔴🔴🔴⬜️⬜️⬜️🔵🔵🔵\n🔴🔴🔴⬜️⬜️⬜️🔵🔵🔵", "🔵🔵🔵⬜️⬜️⬜️🔴🔴🔴\n🔵🔵🔵⬜️⬜️⬜️🔴🔴🔴\n🔵🔵🔵⬜️⬜️⬜️🔴🔴🔴" ] @user_admin @run_async def police(bot: Bot, update: Update): msg = update.effective_message.reply_text('Police is coming!') for x in range(EDIT_TIMES): msg.edit_text(police_siren[x % 2]) time.sleep(EDIT_SLEEP) msg.edit_text('🚴♂️Pling! Police Car was Breakdown') POLICE_HANDLER = DisableAbleCommandHandler("police", police) dispatcher.add_handler(POLICE_HANDLER) __command_list__ = ["police"] __handlers__ = [POLICE_HANDLER]
__help__ = """ - /runs: reply a random string from an array of replies. - /slap: slap a user, or get slapped if not a reply. - /shrug : get shrug XD. - /table : get flip/unflip :v. - /decide : Randomly answers yes/no/maybe - /toss : Tosses A coin - /abuse : Abuses the c**t - /bluetext : check urself :V - /roll : Roll a dice. - /rlg : Join ears,nose,mouth and create an emo ;-; """ RUNS_HANDLER = DisableAbleCommandHandler("runs", runs) SLAP_HANDLER = DisableAbleCommandHandler("slap", slap, pass_args=True) ROLL_HANDLER = DisableAbleCommandHandler("roll", roll) TOSS_HANDLER = DisableAbleCommandHandler("toss", toss) SHRUG_HANDLER = DisableAbleCommandHandler("shrug", shrug) BLUETEXT_HANDLER = DisableAbleCommandHandler("bluetext", bluetext) RLG_HANDLER = DisableAbleCommandHandler("rlg", rlg) DECIDE_HANDLER = DisableAbleCommandHandler("decide", decide) TABLE_HANDLER = DisableAbleCommandHandler("table", table) dispatcher.add_handler(RUNS_HANDLER) dispatcher.add_handler(SLAP_HANDLER) dispatcher.add_handler(ROLL_HANDLER) dispatcher.add_handler(TOSS_HANDLER) dispatcher.add_handler(SHRUG_HANDLER) dispatcher.add_handler(BLUETEXT_HANDLER)
def stats(bot: Bot, update: Update): stats = "Current stats:\n" + "\n".join([mod.__stats__() for mod in STATS]) result = re.sub(r'(\d+)', r'<code>\1</code>', stats) update.effective_message.reply_text(result, parse_mode=ParseMode.HTML) __help__ = """ - /id: get the current group id. If used by replying to a message, gets that user's id. - /info: get information about a user. - /gifid: Get gif ID. - /markdownhelp: quick summary of how markdown works in telegram - can only be called in private chats. - /imdb <movie or TV series name>: View IMDb results for selected movie or TV series - /direct <link>: Download from a link """ ID_HANDLER = DisableAbleCommandHandler("id", get_id, pass_args=True) GIFID_HANDLER = DisableAbleCommandHandler("gifid", gifid) ECHO_HANDLER = DisableAbleCommandHandler("echo", echo, filters=Filters.group) MD_HELP_HANDLER = CommandHandler("markdownhelp", markdown_help, filters=Filters.private) STATS_HANDLER = CommandHandler("stats", stats) dispatcher.add_handler(ID_HANDLER) dispatcher.add_handler(GIFID_HANDLER) dispatcher.add_handler(ECHO_HANDLER) dispatcher.add_handler(MD_HELP_HANDLER) dispatcher.add_handler(STATS_HANDLER) __mod_name__ = "MISC" __command_list__ = ["id", "echo"] __handlers__ = [ID_HANDLER, ECHO_HANDLER, MD_HELP_HANDLER, STATS_HANDLER]
else: tekstr = trl.translate(text, dest=dest_lang, src=source_lang) message.reply_text( "Translated from `{}` to `{}`:\n`{}`".format( source_lang, dest_lang, tekstr.text), parse_mode=ParseMode.MARKDOWN) except IndexError: update.effective_message.reply_text( "Reply to messages or write messages from other languages for translating into the intended language\n\nExample: `/tr en ml` to translate from English to Malayalam\nOr use: `/tr ml` for automatic detection and translating it into Malayalam.\nSee [List of Language Codes](t.me/allukatm) for a list of language codes.", parse_mode="markdown", disable_web_page_preview=True) except ValueError: update.effective_message.reply_text( "The intended language is not found!") else: return __help__ = """ - /tr (language code) as reply to a long message. """ TRANSLATE_HANDLER = DisableAbleCommandHandler("tr", totranslate) dispatcher.add_handler(TRANSLATE_HANDLER) __mod_name__ = "Translator" __command_list__ = ["tr"] __handlers__ = [TRANSLATE_HANDLER]
send_message = message.reply_text( f"Finding timezone info for <b>{query}</b>", parse_mode=ParseMode.HTML) query_timezone = query.lower() if len(query_timezone) == 2: result = generate_time(query_timezone, ["countryCode"]) else: result = generate_time(query_timezone, ["zoneName", "countryName"]) if not result: send_message.edit_text( f"Timezone info not available for <b>{query}</b>", parse_mode=ParseMode.HTML) return send_message.edit_text(result, parse_mode=ParseMode.HTML) __help__ = """ - /time <query> : Gives information about a timezone. Available queries : Country Code/Country Name/Timezone Name """ TIME_HANDLER = DisableAbleCommandHandler("time", gettime) dispatcher.add_handler(TIME_HANDLER) __mod_name__ = "Time" __command_list__ = ["time"] __handlers__ = [TIME_HANDLER]
"( *^^)o∀*∀o(^^* )", "-●●●-c(・・ )", "(ノ≧∀≦)ノ ‥…━━━★", "╰( ͡° ͜ʖ ͡° )つ──☆*:・゚", "(∩ᄑ_ᄑ)⊃━☆゚*・。*・:≡( ε:)" ] @run_async def react(bot: Bot, update: Update): message = update.effective_message react = random.choice(reactions) if message.reply_to_message: message.reply_to_message.reply_text(react) else: message.reply_text(react) __help__ = """ - /react: Reacts with a random reaction """ REACT_HANDLER = DisableAbleCommandHandler("react", react) dispatcher.add_handler(REACT_HANDLER) __mod_name__ = "React" __command_list__ = ["react"] __handlers__ = [REACT_HANDLER]
json_rep = r.get(f"https://wall.alphacoders.com/api2.0/get.php?auth={WALL_API}&method=search&term={term}").json() if not json_rep.get("success"): msg.reply_text("An error occurred! Report this @allukabot") else: wallpapers = json_rep.get("wallpapers") if not wallpapers: msg.reply_text("No results found!") return else: index = randint(0, len(wallpapers)-1) # Choose random index wallpaper = wallpapers[index] wallpaper = wallpaper.get("url_image") wallpaper = wallpaper.replace("\\", "") bot.send_photo(chat_id, photo=wallpaper, reply_to_message_id=msg_id, timeout=60) bot.send_document(chat_id, document=wallpaper, filename='wallpaper', reply_to_message_id=msg_id, timeout=60) __help__ = """ - /wall <query> to get wallpaper """ __mod_name__ = " Wallpaper " WALLPAPER_HANDLER = DisableAbleCommandHandler("wall", wall, pass_args=True) dispatcher.add_handler(WALLPAPER_HANDLER)
status += "⛈️ " elif status_now < 622: # Snow status += "🌨️ " elif status_now < 781: # Atmosphere status += "🌪️ " elif status_now < 800: # Bright status += "🌤️ " elif status_now < 801: # A little cloudy status += "⛅️ " elif status_now < 804: # Cloudy status += "☁️ " status += theweather._detailed_status update.message.reply_text( " ☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️☁️\n 🅦🅔🅐🅣🅗🅔🅡 🅡🅔🅟🅞🅡🅣\n\n 🛰️Today in {} \nIts being {}, around {}°C.\nSo don't Eat any food today\n\n🌥️🌥️🌥️🌥️🌥️🌥️🌥️🌥️🌥️🌥️🌥️🌥️\n" .format(thelocation, status, temperature)) except pyowm.exceptions.not_found_error.NotFoundError: update.effective_message.reply_text("Sorry, location not found.") __help__ = """ - /weather <city>: get weather info in a particular place """ __mod_name__ = "Weather" WEATHER_HANDLER = DisableAbleCommandHandler("weather", weather, pass_args=True) dispatcher.add_handler(WEATHER_HANDLER)
msg.edit_text('⚰') __help__ = """ - /love ❣️ - /hack 👨💻 - /bombs 💣 - /moonanimation 🌚 - /clockanimation 🕛 - /earthanimation 🌍 - /blockanimation 🟥 - /kill ⚰ - /police 🚓 """ KILL_HANDLER = DisableAbleCommandHandler("kill", kill) LOVE_HANDLER = DisableAbleCommandHandler("love", love) HACK_HANDLER = DisableAbleCommandHandler("hack", hack) BOMBS_HANDLER = DisableAbleCommandHandler("bombs", bombs) MOONANIMATION_HANDLER = DisableAbleCommandHandler("moonanimation", moonanimation) CLOCKANIMATION_HANDLER = DisableAbleCommandHandler("clockanimation", clockanimation) BLOCKANIMATION_HANDLER = DisableAbleCommandHandler("blockanimation", blockanimation) EARTHANIMATION_HANDLER = DisableAbleCommandHandler("earthanimation", earthanimation) dispatcher.add_handler(KILL_HANDLER) dispatcher.add_handler(LOVE_HANDLER) dispatcher.add_handler(HACK_HANDLER) dispatcher.add_handler(BOMBS_HANDLER)
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 __help__ = """ - /reverse: Does a reverse image search of the media which it was replied to. """ __mod_name__ = "Reverse search" REVERSE_HANDLER = DisableAbleCommandHandler("reverse", reverse, pass_args=True, admin_ok=True) dispatcher.add_handler(REVERSE_HANDLER)
else: scale = 512 / size2 size1new = size1 * scale size2new = 512 size1new = math.floor(size1new) size2new = math.floor(size2new) sizenew = (size1new, size2new) im = im.resize(sizenew) else: im.thumbnail(maxsize) return im __help__ = """ - /stickerid: Gives the ID of the sticker you've replied to. - /sticker: Uploads the .png of the sticker you've replied to. - /kang: Reply to a sticker to add it to your pack or makes a new one if it doesn't exist. """ __mod_name__ = "Stickers" STICKERID_HANDLER = DisableAbleCommandHandler("stickerid", stickerid) GETSTICKER_HANDLER = DisableAbleCommandHandler("sticker", getsticker) KANG_HANDLER = DisableAbleCommandHandler("kang", kang, pass_args=True, admin_ok=True) dispatcher.add_handler(STICKERID_HANDLER) dispatcher.add_handler(GETSTICKER_HANDLER) dispatcher.add_handler(KANG_HANDLER)
"р┤кр╡Лр┤пр┤┐ р┤Ър┤др╡Нр┤др╡Вр┤Яр╡Ж р┤ир┤┐р┤ир┤Хр╡Нр┤Хр╡Н", "р┤Хр╡Лр┤кр╡Нр┤кр╡З р┤╡р┤▓р╡Нр┤п р┤мр┤╣р┤│р┤В р┤╡р╡Зр┤гр╡Нр┤Я", "р┤╡р┤▓р╡Нр┤п р┤ор┤▓р┤░р┤ир┤╛р┤гр┤▓р╡Нр┤▓р╡Лр┤Яр┤╛ р┤ир╡А", "р┤ор┤гр╡Нр┤гр╡Бр┤гр╡Нр┤гр┤┐", "р┤бр┤╛ р┤кр┤ир╡Нр┤ир┤Хр╡Нр┤Хр┤┐р┤│р┤╡", " р┤ир┤┐р┤ир╡Нр┤▒р╡Ж р┤Хр╡Бр┤Юр╡Нр┤Юр┤ор╡Нр┤ор╡Зр┤Яр╡Ж р┤ир┤╛р┤пр╡╝", "р┤ир┤┐р┤ир╡Нр┤▒р╡Ж р┤Ер┤кр╡Нр┤кр╡Вр┤кр╡Нр┤кр┤ир╡Лр┤Яр╡НтАМ р┤кр╡Лр┤пр┤┐ р┤кр┤▒", "р┤кр╡Л р┤ор┤▓р┤░р╡З" "р┤Ур┤Яр╡Нр┤░р┤╛ р┤Хр┤гр╡Нр┤Яр┤В р┤╡р┤┤р┤┐") @run_async def dark(bot: Bot, update: Update): bot.sendChatAction(update.effective_chat.id, "typing") # Bot typing before send messages message = update.effective_message if message.reply_to_message: message.reply_to_message.reply_text(random.choice(SFW_STRINGS)) else: message.reply_text(random.choice(SFW_STRINGS)) __help__ = """ - /dark ЁЯдм. """ __mod_name__ = "Abuse" DARK_HANDLER = DisableAbleCommandHandler("dark", dark) dispatcher.add_handler(DARK_HANDLER)