from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from telebot import CMD_HELP from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern="ascii ?(.*)")) @telebot.on(sudo_cmd(pattern="ascii ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return if not event.reply_to_msg_id: await eor(event, "```Reply to any user message.```") return reply_message = await event.get_reply_message() if not reply_message.media: await eor(event, "```reply to media message```") return chat = "@asciiart_bot" reply_message.sender if reply_message.sender.bot: await eor(event, "```Reply to actual users message.```") return await eor(event, "```Wait making ASCII...```") # For TeleBot async with borg.conversation(chat) as conv: try: response = conv.wait_event( events.NewMessage(incoming=True, from_users=164766745)) await borg.send_message(chat, reply_message)
# BY @Deonnn """ Game of Thrones Dialogues That You Can Use In Everyday Situations command .gotm by @Deonnn """ import asyncio import random from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern="gotm", outgoing=True)) async def _(event): if event.fwd_from: return await eor(event, "Thinking... 🤔") await asyncio.sleep(2) x = random.randrange(1, 30) if x == 1: await eor( event, "[To your teachers on failing you in all your papers confidently, every time...](https://telegra.ph/file/431d178780f9bff353047.jpg)", link_preview=True,
# For The-TG-Bot-3.0 # By Priyam Kalra # Parts of the code below is taken from other sources, the links to the # sources is commented above the taken code import os import textwrap from PIL import Image, ImageDraw, ImageFont from telebot import CMD_HELP from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern="mmf ?(.*)")) async def handler(event): if event.fwd_from: return if not event.reply_to_msg_id: await event.reply("Usage:- memify upper text ; lower text") return reply_message = await event.get_reply_message() if not reply_message.media: await eor(event, "Reply to a image/sticker.") return file = await borg.download_media(reply_message, Var.TEMP_DOWNLOAD_DIRECTORY) a = await event.reply("Memifying this image! (」゚ロ゚)」 ") text = str(event.pattern_match.group(1)).strip() if len(text) < 1: return await a.edit("Usage:- memify upper text ; lower text")
"口", "尸", "㔿", "尺", "丂", "丅", "凵", "リ", "山", "乂", "丫", "乙", ] @telebot.on(admin_cmd(pattern="weeb ?(.*)")) @telebot.on(sudo_cmd(pattern="weeb ?(.*)", allow_sudo=True)) async def weebify(event): args = event.pattern_match.group(1) if not args: get = await event.get_reply_message() args = get.text if not args: await eor(event, "`What I am Supposed to Weebify U Dumb`") return string = " ".join(args).lower() for normiecharacter in string: if normiecharacter in normiefont: weebycharacter = weebyfont[normiefont.index(normiecharacter)] string = string.replace(normiecharacter, weebycharacter)
import re from bs4 import BeautifulSoup from requests import get from telebot import CMD_HELP from telebot.utils import admin_cmd GITHUB = "https://github.com" DEVICES_DATA = ( "https://raw.githubusercontent.com/androidtrackers/" "certified-android-devices/master/devices.json" ) @telebot.on(admin_cmd(outgoing=True, pattern="magisk")) @telebot.on(sudo_cmd(pattern="magisk")) async def magisk(request): """ magisk latest releases """ magisk_dict = { "Stable": "https://raw.githubusercontent.com/topjohnwu/magisk_files/master/stable.json", "Beta": "https://raw.githubusercontent.com/topjohnwu/magisk_files/master/beta.json", "Canary (Release)": "https://raw.githubusercontent.com/topjohnwu/magisk_files/canary/release.json", "Canary (Debug)": "https://raw.githubusercontent.com/topjohnwu/magisk_files/canary/debug.json", } releases = "Latest Magisk Releases:\n" for name, release_url in magisk_dict.items(): data = get(release_url).json() releases += ( f'{name}: [ZIP v{data["magisk"]["version"]}]({data["magisk"]["link"]}) | ' f'[APK v{data["app"]["version"]}]({data["app"]["link"]}) | '
MESAG = ( str(CUSTOM_PMPERMIT) if CUSTOM_PMPERMIT else "`TeleBot PM security! Please wait for me to approve you. 😊" ) DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "TeleBot User" USER_BOT_WARN_ZERO = "`I had warned you not to spam. Now you have been blocked and reported until further notice.`\n\n**GoodBye!** " USER_BOT_NO_WARN = ( "**PM Security ~ TeleBot**\n\nNice to see you here, but " "[{}](tg://user?id={}) is currently unavailable.\nThis is an automated message.\n\n" "{}\n\n**You have** `{}/{}` **warnings...**" "\n\n ~ Thank You." ) @telebot.on(admin_cmd(pattern="a ?(.*)")) @telebot.on(admin_cmd(pattern="approve ?(.*)")) async def approve_p_m(event): if event.fwd_from: return replied_user = await event.client(GetFullUserRequest(event.chat_id)) firstname = replied_user.user.first_name reason = event.pattern_match.group(1) chat = await event.get_chat() if event.is_private: if not pmpermit_sql.is_approved(chat.id): if chat.id in PM_WARNS: del PM_WARNS[chat.id] if chat.id in PREV_REPLY_MESSAGE: await PREV_REPLY_MESSAGE[chat.id].delete() del PREV_REPLY_MESSAGE[chat.id]
# You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. from telegraph import Telegraph from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from telebot.telebotConfig import Var from telebot.utils import admin_cmd, sudo_cmd telegraph = Telegraph() mee = telegraph.create_account(short_name="telebot") @telebot.on(admin_cmd(pattern="purl ?(.*)")) @telebot.on(sudo_cmd(pattern="purl ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return if not event.reply_to_msg_id: await event.reply("**Reply to any document.**") return reply_message = await event.get_reply_message() chat = "@FiletolinkTGbot" reply_message.sender await eor(event, "**Making public url...**") async with event.client.conversation(chat) as conv: try: response = conv.wait_event( events.NewMessage(incoming=True, from_users=1011636686))
"\U0001F780-\U0001F7FF" # Geometric Shapes Extended "\U0001F800-\U0001F8FF" # Supplemental Arrows-C "\U0001F900-\U0001F9FF" # Supplemental Symbols and Pictographs "\U0001FA00-\U0001FA6F" # Chess Symbols "\U0001FA70-\U0001FAFF" # Symbols and Pictographs Extended-A "\U00002702-\U000027B0" # Dingbats "]+" ) def deEmojify(inputString: str) -> str: """Remove emojis and other non-safe characters from string""" return re.sub(EMOJI_PATTERN, "", inputString) @telebot.on(admin_cmd(outgoing=True, pattern="waifu(?: |$)(.*)")) @telebot.on(sudo_cmd(pattern="waifu(?: |$)(.*)")) async def waifu(animu): # """Creates random anime sticker!""" text = animu.pattern_match.group(1) if not text: if animu.is_reply: text = (await animu.get_reply_message()).message else: await animu.edit("`You haven't written any article, Waifu is going away.`") return animus = [1, 3, 7, 9, 13, 22, 34, 35, 36, 37, 43, 44, 45, 52, 53, 55] sticcers = await bot.inline_query( "stickerizerbot", f"#{random.choice(animus)}{(deEmojify(text))}" )
from datetime import datetime from pathlib import Path from telethon.tl.types import InputMessagesFilterDocument from telebot import CMD_HELP from telebot.utils import admin_cmd, load_module, remove_plugin from .. import ALIVE_NAME DELETE_TIMEOUT = 5 thumb_image_path = "./resources/TeleBot.jpeg" DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "TeleBot User" @telebot.on(admin_cmd(pattern=r"send (?P<shortname>\w+)", outgoing=True)) @telebot.on(sudo_cmd(pattern=r"send (?P<shortname>\w+)", allow_sudo=True)) async def send(event): ok = await eor(event, "Sending...") if event.fwd_from: return hmm = bot.uid message_id = event.message.id thumb = thumb_image_path input_str = event.pattern_match.group(1) the_plugin_file = "./telebot/plugins/{}.py".format(input_str) if os.path.exists(the_plugin_file): await ok.delete() start = datetime.now() pro = await event.client.send_file( event.chat_id,
"""Pins the replied message Syntax: .cpin [LOUD]""" from telethon.tl import functions from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern="cpin ?(.*)")) @telebot.on(sudo_cmd(pattern="cpin ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return silent = True input_str = event.pattern_match.group(1) if input_str: silent = False if event.message.reply_to_msg_id is not None: message_id = event.message.reply_to_msg_id try: await borg( functions.messages.UpdatePinnedMessageRequest( event.chat_id, message_id, silent)) except Exception as e: await eor(event, str(e)) else: await event.delete() else: await eor(event, "Reply to a message to pin the message in this Channel.")
# credits: @r4v4n4 from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from telebot import CMD_HELP from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern="frybot ?(.*)")) @telebot.on(sudo_cmd(pattern="frybot ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return if not event.reply_to_msg_id: await eor(event, "```Reply to any user message.```") return reply_message = await event.get_reply_message() if not reply_message.media: await eor(event, "```reply to text message```") return chat = "@image_deepfrybot" reply_message.sender if reply_message.sender.bot: await eor(event, "```Reply to actual users message.```") return await eor(event, "```Processing```") async with borg.conversation(chat) as conv: try: response = conv.wait_event( events.NewMessage(incoming=True, from_users=432858024)) await borg.forward_messages(chat, reply_message)
import asyncio from telebot import CMD_HELP from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern="gangasta ?(.*)")) async def _(event): if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "@", "!"): await event.edit("EVERyBOdy") await asyncio.sleep(0.3) await event.edit("iZ") await asyncio.sleep(0.2) await event.edit("GangSTur") await asyncio.sleep(0.5) await event.edit("UNtIL ") await asyncio.sleep(0.2) await event.edit("I") await asyncio.sleep(0.3) await event.edit("ArRivE") await asyncio.sleep(0.3) await event.edit("🔥🔥🔥") await asyncio.sleep(0.3) await event.edit("EVERyBOdy iZ GangSTur UNtIL I ArRivE 🔥🔥🔥") CMD_HELP.update({"gangsta": ".gangsta\nUse - Spam recents of a group lel."})
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.b (the "License"); # you may not use this file except in compliance with the License. # from asyncio import wait from telebot import CMD_HELP from telebot.telebotConfig import Var from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern=r"bigspam", outgoing=True)) async def spammer(e): if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"): message = e.text counter = int(message[9:13]) spam_message = str(e.text[13:]) await wait([e.respond(spam_message) for i in range(1, counter)]) await e.delete() if Var.PRIVATE_GROUP_ID: await e.client.send_message( Var.PRIVATE_GROUP_ID, "#BIGSPAM \n\n" "BIGSpam was executed successfully") CMD_HELP.update( {"bigspam": ".bigspam <n> <text>\nUse -Spam the word/sentence 'n' times."})
# By @HeisenbergTheDanger for TeleBot # @its_xditya # Kangers keep credits from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern="pmto ?(.*)")) async def pmto(event): a = event.pattern_match.group(1) b = a.split(" ") chat_id = b[0] try: chat_id = int(chat_id) except BaseException: pass msg = "" for i in b[1:]: msg += i + " " if msg == "": return try: await borg.send_message(chat_id, msg) await event.edit("Message sent!") except BaseException: await event.edit("Something went wrong.")
""" Google Text to Speech Available Commands: .tts LanguageCode as reply to a message .tts LangaugeCode | text to speak""" import asyncio import os import subprocess from datetime import datetime from gtts import gTTS from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern="tts (.*)")) @telebot.on(sudo_cmd(pattern="tts (.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) start = datetime.now() if event.reply_to_msg_id: previous_message = await event.get_reply_message()
# Author: Shubhendra Kushwaha (@TheShubhendra) # Email: [email protected] import pygita from telebot import CMD_HELP from telebot.utils import admin_cmd CLIENT_ID = Config.GITA_CLIENT_ID CLIENT_SECRET = Config.GITA_CLIENT_SECRET """Get API crendentials from https://bhagavadgita.io.""" @telebot.on(admin_cmd(pattern="gita +(.*) +(.*)$")) async def gita(event): """To get a specific verse from a specific chapter in English.""" if CLIENT_ID is None or CLIENT_SECRET is None: await event.edit( "`Please add required GITA_CLIENT_SECRET and GITA_CLIENT_ID env var`" ) return pygita.auth(CLIENT_ID, CLIENT_SECRET) try: chapter_number = int(event.pattern_match.group(1)) verse_number = int(event.pattern_match.group(2)) except ValueError: return verse = pygita.get_verse(chapter_number, verse_number, language="en") await event.edit(f"**{verse.text}** {verse.meaning}") @telebot.on(admin_cmd(pattern="gita +(.*) +(.*) hi$"))
from emoji import emojize from telethon.errors import ( ChannelInvalidError, ChannelPrivateError, ChannelPublicGroupNaError, ) from telethon.tl.functions.channels import GetFullChannelRequest, GetParticipantsRequest from telethon.tl.functions.messages import GetFullChatRequest, GetHistoryRequest from telethon.tl.types import ChannelParticipantsAdmins, MessageActionChannelMigrateFrom from telethon.utils import get_input_location from telebot import CMD_HELP from telebot.utils import admin_cmd, sudo_cmd @telebot.on(admin_cmd(pattern="chatinfo(?: |$)(.*)", outgoing=True)) @telebot.on(sudo_cmd(pattern="chatinfo(?: |$)(.*)")) async def info(event): await eor(event, "`Analysing the chat...`") chat = await get_chatinfo(event) caption = await fetch_info(chat, event) try: await eor(event, caption, parse_mode="html") except Exception as e: print("Exception:", e) await eor(event, f"`An unexpected error has occurred. {e}`") return async def get_chatinfo(event): chat = event.pattern_match.group(1)
) except Exception as e: # pylint:disable=C0103,W0703 await borg.send_message( # pylint:disable=E0602 event.chat_id, "Please set `PRIVATE_GROUP_BOT_API_ID` " + "for the proper functioning of afk functionality " + "\nCheck pinned message in @TeleBotSupport for more info.\n\n `{}`" .format(str(e)), reply_to=event.message.id, silent=True, ) USER_AFK = {} # pylint:disable=E0602 afk_time = None # pylint:disable=E0602 @telebot.on(admin_cmd(pattern=r"afk ?(.*)")) # pylint:disable=E0602 async def _(event): if event.fwd_from: return global USER_AFK # pylint:disable=E0602 global afk_time # pylint:disable=E0602 global last_afk_message # pylint:disable=E0602 global reason USER_AFK = {} afk_time = None last_afk_message = {} reason = event.pattern_match.group(1) me = await borg.get_me() me.first_name (me.last_name) if not USER_AFK: # pylint:disable=E0602
# (c)2020 TeleBot # # You may not use this plugin without proper authorship and consent from @TeleBotSupport # # By @buddhhu, @Itzsjdude # import os from telebot import CMD_HELP from telebot.utils import admin_cmd, sudo_cmd @telebot.on(admin_cmd(pattern=r"reveal", outgoing=True)) @telebot.on(sudo_cmd(pattern=r"reveal")) async def _(event): b = await event.client.download_media(await event.get_reply_message()) a = open(b, "r") c = a.read() a.close() a = await event.reply("**Reading file...**") if len(c) > 4095: await a.edit( "`The Total words in this file is more than telegram limits.`") else: await event.client.send_message(event.chat_id, f"```{c}```") await a.delete() os.remove(b) CMD_HELP.update({ "reveal":
# Lots of lub to @r4v4n4 for gibing the base <3 from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern="scan ?(.*)")) @telebot.on(sudo_cmd(pattern="scan ?(.*)")) async def _(event): if event.fwd_from: return if not event.reply_to_msg_id: xx = await event.eor(xx, "```Reply to any user message.```") return reply_message = await event.get_reply_message() if not reply_message.media: xx = await event.eor(xx, "```reply to a media message```") return chat = "@DrWebBot" reply_message.sender if reply_message.sender.bot: xx = await event.eor(xx, "```Reply to actual users message.```") return xx = await event.eor(xx, " `Sliding my tip, of fingers over it`") async with borg.conversation(chat) as conv: try: response = conv.wait_event( events.NewMessage(incoming=True, from_users=161163358)) await borg.forward_messages(chat, reply_message) response = await response
# Using this might lead to ban of your account, use at your own risk. # Re-Written by @its_xditya import asyncio import time from telethon.errors import FloodWaitError from telethon.tl import functions from telebot import CMD_HELP from telebot.utils import admin_cmd DEL_TIME_OUT = 60 @telebot.on(admin_cmd(pattern="autobio")) # pylint:disable=E0602 async def _(event): if event.fwd_from: return while True: DMY = time.strftime("%d.%m.%Y") HM = time.strftime("%H:%M:%S") bio = f"📅 {DMY} | This is my bio, I guess.. 😁 | ⌚️ {HM}" logger.info(bio) try: await borg( functions.account.UpdateProfileRequest( # pylint:disable=E0602 about=bio)) except FloodWaitError as ex: logger.warning(str(e)) await asyncio.sleep(ex.seconds)
"""Default Permission in Telegram 5.0.1 Available Commands: .lock <option>, .unlock <option>, .locks API Options: msg, media, sticker, gif, gamee, ainline, gpoll, adduser, cpin, changeinfo DB Options: bots, commands, email, forward, url""" from telethon import events, functions, types from telebot import CMD_HELP from telebot.plugins.sql_helper.locks_sql import get_locks, is_locked, update_lock from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern=r"lock( (?P<target>\S+)|$)")) @telebot.on(sudo_cmd(pattern=r"lock( (?P<target>\S+)|$)", allow_sudo=True)) async def _(event): # Space weirdness in regex required because argument is optional and other # commands start with ".lock" if event.fwd_from: return input_str = event.pattern_match.group("target") if input_str == "": await eor( event, "LockTypes -\n➟ bots\n➟ commands\n➟ forward\n➟ url\n➟ msg\n➟ media\n ➟ sticker\n➟ gif\n➟ gamee\n➟ ainline\n ➟ gpoll\n➟ adduser\n➟ cpin\n➟ changeinfo\n\nUse `.lock <locktypes>` to lock it.", ) peer_id = event.chat_id if input_str in (("bots", "commands", "email", "forward", "url")): update_lock(peer_id, input_str, True) await eor(event, "Locked {}".format(input_str)) else: msg = None
# Kangers keep credits # © @TeleBotHelp """command: .hack""" import asyncio from telebot import CMD_HELP from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern=r"(.*)", outgoing=True)) async def _(event): if event.fwd_from: return animation_interval = 2 animation_ttl = range(0, 12) input_str = event.pattern_match.group(1) if input_str == "heck": await event.edit(input_str) animation_chars = [ "**Connecting To Telegram Data Centre**", "`Target Selected By Hacker: @TeleBotHelp`", "`Hacking... 0%\n▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `\n\n\n TERMINAL:\nDownloading Bruteforce-Telegram-0.1.tar.gz (9.3 kB)",
"""Enable Seen Counter in any message to know how many users have seen your message Syntax: .fwd as reply to any message""" from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern="frwd")) @telebot.on(sudo_cmd(pattern="frwd", allow_sudo=True)) async def _(event): if event.fwd_from: return if Config.CHANNEL_ID is None: await eor( event, "Please set the required environment variable `CHANNEL_ID` for this plugin to work", ) return try: e = await borg.get_entity(Config.CHANNEL_ID) except Exception as e: await eor(event, str(e)) else: re_message = await event.get_reply_message() # https://t.me/telethonofftopic/78166 fwd_message = await borg.forward_messages(e, re_message, silent=True) await borg.forward_messages(event.chat_id, fwd_message) await fwd_message.delete() await event.delete()
send_stickers=None, send_gifs=None, send_games=None, send_inline=None, embed_links=None, ) MUTE_RIGHTS = ChatBannedRights(until_date=None, send_messages=True) UNMUTE_RIGHTS = ChatBannedRights(until_date=None, send_messages=False) # ================================================ BOTLOG_CHATID = Var.PRIVATE_GROUP_ID @telebot.on(admin_cmd(outgoing=True, pattern="setgpic")) @telebot.on(sudo_cmd(outgoing=True, pattern="setgpic", allow_sudo=True)) @errors_handler async def set_group_photo(gpic): """ For .setgpic command, changes the picture of a group """ if not gpic.is_group: await gpic.eor(event, "`I don't think this is a group.`") return replymsg = await gpic.get_reply_message() chat = await gpic.get_chat() admin = chat.admin_rights creator = chat.creator photo = None if not admin and not creator: x = await gpic.eor(x, NO_ADMIN)
fy = "http://getwallpapers.com" + random.choice(f) print(fy) if not os.path.exists("f.ttf"): urllib.request.urlretrieve( "https://github.com/rebel6969/mym/raw/master/Rebel-robot-Regular.ttf", "f.ttf", ) urllib.request.urlretrieve(fy, "donottouch.jpg") @telebot.on(admin_cmd(pattern="actressdp ?(.*)")) async def main(event): await event.edit( "**Starting Actress Profile Pic...\n\nDone !!! Check Your DP in 5 seconds. \n By [TeleBot](https://github.com/xditya/TeleBot)**" ) while True: await animepp() file = await event.client.upload_file("donottouch.jpg") await event.client(functions.photos.UploadProfilePhotoRequest(file)) os.system("rm -rf donottouch.jpg")
executable="bash", ) talk = subproc.communicate() exitCode = subproc.returncode if exitCode != 0: reply += ( "```An error was detected while running the subprocess:\n" f"exit code: {exitCode}\n" f"stdout: {talk[0]}\n" f"stderr: {talk[1]}```" ) return reply return talk @telebot.on(admin_cmd(outgoing=True, pattern=r"direct(?: |$)([\s\S]*)")) @telebot.on(sudo_cmd(allow_sudo=True, pattern=r"direct(?: |$)([\s\S]*)")) async def direct_link_generator(request): """ direct links generator """ await eor(request, "`Processing...`") textx = await request.get_reply_message() message = request.pattern_match.group(1) if message: pass elif textx: message = textx.text else: await eor(request, "`Usage: .direct <url>`") return reply = "" links = re.findall(r"\bhttps?://.*\.\S+", message)
current_saved_welcome_message.format( mention=mention, title=title, count=count, first=first, last=last, fullname=fullname, username=username, userid=userid, ), file=cws.media_file_id, ) update_previous_welcome(event.chat_id, current_message.id) @telebot.on(admin_cmd(pattern="savewelcome")) # pylint:disable=E0602 @telebot.on(sudo_cmd(pattern="savewelcome", allow_sudo=True)) async def _(event): if event.fwd_from: return msg = await event.get_reply_message() if msg and msg.media: bot_api_file_id = pack_bot_file_id(msg.media) add_welcome_setting(event.chat_id, msg.message, True, 0, bot_api_file_id) await eor(event, "Welcome note saved. ") else: input_str = event.text.split(None, 1) add_welcome_setting(event.chat_id, input_str[1], True, 0, None) await eor(event, "Welcome note saved. ")
"""Get Detailed info about any message Syntax: .json""" import io from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern="json")) @telebot.on(sudo_cmd(pattern="json", allow_sudo=True)) async def _(event): if event.fwd_from: return the_real_message = None reply_to_id = None if event.reply_to_msg_id: previous_message = await event.get_reply_message() the_real_message = previous_message.stringify() reply_to_id = event.reply_to_msg_id else: the_real_message = event.stringify() reply_to_id = event.message.id if len(the_real_message) > Config.MAX_MESSAGE_SIZE_LIMIT: with io.BytesIO(str.encode(the_real_message)) as out_file: out_file.name = "json.text" await borg.send_file( event.chat_id, out_file, force_document=True, allow_cache=False, reply_to=reply_to_id, )
import os from datetime import datetime import requests from bs4 import BeautifulSoup from google_images_download import google_images_download from telebot.utils import admin_cmd, edit_or_reply, sudo_cmd def progress(current, total): logger.info("Downloaded {} of {}\nCompleted {}".format( current, total, (current / total) * 100)) @telebot.on(admin_cmd(pattern="go (.*)")) @telebot.on(sudo_cmd(pattern="go (.*)")) async def _(event): lool = await edit_or_reply(event, "`Processing Your Request`") if event.fwd_from: return start = datetime.now() x = await eor(lool, "`Connecting...`") # SHOW_DESCRIPTION = False # + " -inurl:(htm|html|php|pls|txt) intitle:index.of \"last modified\" (mkv|mp4|avi|epub|pdf|mp3)" input_str = event.pattern_match.group(1) input_url = "https://bots.shrimadhavuk.me/search/?q={}".format(input_str) headers = {"USER-AGENT": "UniBorg"} response = requests.get(input_url, headers=headers).json() output_str = " " for result in response["results"]: