from ULTRA.utils import admin_cmd @borg.on(admin_cmd(pattern='chutia')) async def chutie(e): await e.edit("hehe ye chutia h ")
from telethon.tl.types import DocumentAttributeAudio, DocumentAttributeVideo from ULTRA.utils import admin_cmd, humanbytes, progress, time_formatter import time from datetime import datetime from pySmartDL import SmartDL from hachoir.metadata import extractMetadata from hachoir.parser import createParser from zipfile import ZipFile thumb_image_path = Config.TMP_DOWNLOAD_DIRECTORY + "/thumb_image.jpg" extracted = Config.TMP_DOWNLOAD_DIRECTORY + "extracted/" if not os.path.isdir(extracted): os.makedirs(extracted) @borg.on(admin_cmd(pattern="unzip")) async def _(event): if event.fwd_from: return mone = await event.edit("Processing ...") if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) if event.reply_to_msg_id: start = datetime.now() reply_message = await event.get_reply_message() try: c_time = time.time() downloaded_file_name = await borg.download_media( reply_message, Config.TMP_DOWNLOAD_DIRECTORY, )
"Aʀʀᴇ BSDK Pᴀᴅʜ Lᴇ\n\n`Fᴇʀ Sᴇ Aᴀ Gʏᴀ Mᴜᴛʜ Mᴀʀɴᴇ`😂😂😂", ) except Exception as e: # pylint:disable=C0103,W0703 await borg.send_message( # pylint:disable=E0602 event.chat_id, "Please set `PLUGIN_CHANNEL` " + "for the proper functioning of study command \n\n" + "Ask your doubts, in @UltraXchaT \n\n `{}`".format(str(e)), reply_to=event.message.id, silent=True, ) USER_night = {} # pylint:disable=E0602 night_time = None # pylint:disable=E0602 @borg.on(admin_cmd(pattern=r"study ?(.*)")) async def _(event): if event.fwd_from: return global USER_night # pylint:disable=E0602 global night_time # pylint:disable=E0602 global last_night_message # pylint:disable=E0602 global reason USER_night = {} # ported from madboy482 # kang mat kr lawde, muh tod dunga night_time = None last_night_message = {} reason = event.pattern_match.group(1) if not USER_night: # pylint:disable=E0602
#modify by @LEGENDX22 #credits shivam thanks bruh from telethon import events from ULTRA.events import remove_plugin, load_module from telethon import functions, types from telethon.tl.types import InputMessagesFilterDocument from ULTRA.utils import command, remove_plugin, load_module from pathlib import Path from ULTRA import LOAD_PLUG, CMD_HELP from ULTRA.utils import admin_cmd import os @bot.on(admin_cmd(pattern=r"^uninstall (?P<shortname>\w+)$")) async def unload(event): if event.fwd_from: return shortname = event.pattern_match["shortname"] dir_path = f"./userbot/plugins/{shortname}.py" try: remove_plugin(shortname) os.remove(dir_path) await event.edit(f"**Uɴɪɴsᴛᴀʟʟᴇᴅ** `{shortname}` **Sᴜᴄᴄᴇssғᴜʟʟʏ**") except OSError as e: await event.edit("Error: %s : %s" % (dir_path, e.strerror)) CMD_HELP.update({ "uninstall": "**Plugin : **`uninstall`\
# """RapidLeech plugin: Inspired by @SjProjects""" import aiohttp import asyncio import json import re from bs4 import BeautifulSoup from telethon.utils import get_inner_text from ULTRA.utils import admin_cmd logger.info(Config.OPEN_LOAD_LOGIN) # https://t.me/RoseSupport/33801 @borg.on(admin_cmd(pattern="rl")) async def _(event): if event.fwd_from: return current_message_text = event.raw_text cmt = current_message_text.split(" ") reply_message = await event.get_reply_message() if len(cmt) > 1: list_of_urls = cmt[1:] else: list_of_urls = get_inner_text(reply_message.message, reply_message.entities) converted_links = "" if len(list_of_urls) > 0: converted_links += "Trying to generate IP specific link\n" for a_url in list_of_urls:
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from telethon import events, utils from telethon.tl import types from ULTRA.utils import admin_cmd @borg.on(admin_cmd(pattern="resend")) async def _(event): await event.delete() m = await event.get_reply_message() if not m: return await event.respond(m)
#created by @Mr_Hops """video meme mashup: Avaible commands: .mash <text> """ import datetime from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from telethon.tl.functions.account import UpdateNotifySettingsRequest from ULTRA.utils import admin_cmd @borg.on(admin_cmd(pattern="mash ?(.*)")) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) reply_message = await event.get_reply_message() chat = "@vixxbot" await event.edit("```Checking...```") async with event.client.conversation(chat) as conv: try: response = conv.wait_event(events.NewMessage(incoming=True,from_users=285336877)) await event.client.send_message(chat, "{}".format(input_str)) response = await response except YouBlockedUserError: await event.reply("```Unblock @vixxbot```") return if response.text.startswith("I can't find that"): await event.edit("😐") else:
from telethon import events from ULTRAX import ID import asyncio from ULTRA import CMD_HELP from ULTRA.utils import admin_cmd @borg.on(admin_cmd("bsdk")) async def _(event): if event.fwd_from: return animation_interval = 2 animation_ttl = range(0, 36) #input_str = event.pattern_match.group(1) # if input_str == "gulli": await event.edit("gulli") animation_chars = [ "**OK**", "**SUNN MADERCHOD**", "`TERI MAA KA BHOSDA`", "`BEHEN K LUND`", "**TERI MAA KA DUD**", "`MERA LAWDA LELE TU AGAR CHAIYE TOH`", "`GAANDU`", "**CHUTIYA**", "`TERI MAA KI CHUT PE JCB CHADHAA DUNGA`", "**SAMJHAA LAWDE**", "**YA DU TERE GAAND ME TAPAA TAP😂**", "`TERI BEHEN MERA ROZ LETI HAI`", "`TERI GF K SAATH MMS BANAA CHUKA HU🙈🤣🤣`", "`TU CHUTIYA TERA KHANDAAN CHUTIYA`", "**Yeahhhhhh**", "`AUR KITNA BOLU BEY MANN BHAR GAYA MERA🤣`", "**Ab nikal ja jaake chkko k saath hilaa**", "`😂😂😂🤣🤣`" ] for i in animation_ttl:
.sux .fuk .kiss""" from telethon import events import asyncio from ULTRA.utils import admin_cmd @borg.on(admin_cmd("f**k")) async def _(event): if event.fwd_from: return animation_interval = 1 animation_ttl = range(0, 101) #input_str = event.pattern_match.group(1) # if input_str == "fuk":
from telethon import events import os from PIL import Image from datetime import datetime from telegraph import Telegraph, upload_file, exceptions from ULTRA.utils import admin_cmd from ULTRA import CMD_HELP telegraph = Telegraph() r = telegraph.create_account(short_name=Config.TELEGRAPH_SHORT_NAME) auth_url = r["auth_url"] @borg.on(admin_cmd("t(m|t) ?(.*)")) async def _(event): if event.fwd_from: return if Config.PRIVATE_GROUP_BOT_API_ID is None: await event.edit("Please set the required environment variable `PRIVATE_GROUP_BOT_API_ID` for this plugin to work") return if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) await borg.send_message( Config.PRIVATE_GROUP_BOT_API_ID, "Created New Telegraph account {} for the current session. \n**Do not give this url to anyone, even if they say they are from Telegram!**".format(auth_url) ) optional_title = event.pattern_match.group(2) if event.reply_to_msg_id: start = datetime.now() r_message = await event.get_reply_message()
"""Reply to an image/sticker with .mmf` 'text on top' ; 'text on bottom forked by: @legendx22 created by: @A_Dark_Princ3 """ from PIL import Image, ImageFont, ImageDraw import textwrap, os from ULTRA.utils import admin_cmd @borg.on(admin_cmd(pattern=r"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 event.reply("Reply to a image/sticker") return
send_messages=None, send_media=None, 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) # ================================================ @borg.on(admin_cmd(pattern=f"zombies", allow_sudo=True)) @borg.on(events.NewMessage(pattern="^.zombies(?: |$)(.*)", outgoing=True)) async def rm_deletedacc(show): """ For .zombies command, list all the ghost/deleted/zombie accounts in a chat. """ con = show.pattern_match.group(1).lower() del_u = 0 del_status = "`No deleted accounts found, Group is clean`" if con != "clean": await show.edit("`Searching for ghost/deleted/zombie accounts...`") async for user in show.client.iter_participants(show.chat_id): if user.deleted: del_u += 1 await sleep(1)
"""Check your internet speed powered by speedtest.net Syntax: .speedtest Available Options: image, file, text""" from telethon import events from datetime import datetime import io import speedtest from ULTRA.utils import admin_cmd @borg.on(admin_cmd("speedtest ?(.*)")) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) as_text = False as_document = True if input_str == "image": as_document = False elif input_str == "file": as_document = True elif input_str == "text": as_text = True await event.edit("Calculating my internet speed. Please wait!") start = datetime.now() s = speedtest.Speedtest() s.get_best_server() s.download() s.upload() end = datetime.now() ms = (end - start).microseconds / 1000
# made by @LEGENDX22 # kang with credits else gey from telethon.errors.rpcerrorlist import YouBlockedUserError from ULTRA import CMD_HELP from ULTRA.utils import admin_cmd bot = "@MadBoy_Rotomgram2_Bot" @borg.on(admin_cmd("weak ?(.*)")) async def _(event): if event.fwd_from: return sysarg = event.pattern_match.group(1) if sysarg == "": async with borg.conversation(bot) as conv: try: await conv.send_message("/start") await conv.get_response() await conv.send_message("/type") audio = await conv.get_response() await borg.send_message(event.chat_id, audio.text) await event.delete() except YouBlockedUserError: await event.edit("Error: unblock @inhumanDexBot and retry!") elif "@" in sysarg: async with borg.conversation(bot) as conv:
#credits to @legendx22 """ Userbot module aage ni pta kuch """ import io import sys import traceback from ULTRA import CMD_HELP from ULTRA.utils import admin_cmd, edit_or_reply, sudo_cmd @bot.on(admin_cmd(pattern="calc (.*)")) @bot.on(sudo_cmd(pattern="calc (.*)", allow_sudo=True)) async def _(car): cmd = car.text.split(" ", maxsplit=1)[1] event = await edit_or_reply(car, "Calculating ...") old_stderr = sys.stderr old_stdout = sys.stdout redirected_output = sys.stdout = io.StringIO() redirected_error = sys.stderr = io.StringIO() stdout, stderr, exc = None, None, None san = f"print({cmd})" try: await aexec(san, event) except Exception: exc = traceback.format_exc() stdout = redirected_output.getvalue() stderr = redirected_error.getvalue() sys.stdout = old_stdout sys.stderr = old_stderr
from ULTRA import ALIVE_NAME from ULTRA.utils import admin_cmd, sudo_cmd from platform import uname import sys from telethon import events, functions, version DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "υℓтяα χ" #@command(pattern="^.help ?(.*)") @borg.on(admin_cmd(pattern=r"help ?(.*)", outgoing=True)) @borg.on(sudo_cmd(pattern=r"help ?(.*)", outgoing=True, allow_sudo=True)) async def cmd_list(event): if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "-", "_", "@"): tgbotusername = Var.TG_BOT_USER_NAME_BF_HER input_str = event.pattern_match.group(1) if tgbotusername is None or input_str == "text": string = "" for i in CMD_LIST:
🍆🍆🍆 🍆🍆🍆 🍆🍆🍆 🍆🍆🍆 🍆🍆🍆 🍆🍆🍆 🍆🍆🍆 🍆🍆🍆🍆 🍆🍆🍆🍆🍆🍆 🍆🍆🍆 🍆🍆🍆 🍆🍆 🍆🍆 """ # =========================================== @borg.on(admin_cmd(pattern=r"hf$")) async def facepalm(e): """ Facepalm 🤦♂ """ await e.edit("🤦♂") @borg.on(admin_cmd(pattern=r"corona$")) async def iqless(e): await e.edit("Antivirus scan was completed \n⚠️ Warning! This donkey has Corona Virus") @borg.on(admin_cmd(pattern=r"ggl (.*)")) async def let_me_google_that_for_you(lmgtfy_q): textx = await lmgtfy_q.get_reply_message() qry = lmgtfy_q.pattern_match.group(1) if qry: query = str(qry)
"""FFMpeg for @UniBorg """ import asyncio import io import os import time from datetime import datetime from hachoir.metadata import extractMetadata from hachoir.parser import createParser from ULTRA.utils import admin_cmd, progress FF_MPEG_DOWN_LOAD_MEDIA_PATH = "uniborg.media.ffmpeg" @borg.on(admin_cmd("ffmpegsave")) async def ff_mpeg_trim_cmd(event): if event.fwd_from: return if not os.path.exists(FF_MPEG_DOWN_LOAD_MEDIA_PATH): if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) if event.reply_to_msg_id: start = datetime.now() reply_message = await event.get_reply_message() try: c_time = time.time() downloaded_file_name = await borg.download_media( reply_message, FF_MPEG_DOWN_LOAD_MEDIA_PATH, ) except Exception as e: # pylint:disable=C0103,W0703
from telethon.tl.functions.messages import GetHistoryRequest, CheckChatInviteRequest, GetFullChatRequest from telethon.events import ChatAction from datetime import datetime from math import sqrt from telethon.tl.functions.channels import GetFullChannelRequest, GetParticipantsRequest, LeaveChannelRequest from telethon.utils import get_input_location from telethon.errors.rpcerrorlist import (UserIdInvalidError, MessageTooLongError) from telethon.errors import (BadRequestError, ChatAdminRequiredError, ImageProcessFailedError, PhotoCropSizeSmallError, UserAdminInvalidError) from ULTRA import CMD_HELP from ULTRA.utils import errors_handler, admin_cmd @borg.on(admin_cmd(pattern="leave$")) async def leave(e): await e.edit("`Legend is leaving this chat.....!Goodbye aren't forever..` " ) time.sleep(3) if '-' in str(e.chat_id): await bot(LeaveChannelRequest(e.chat_id)) else: await e.edit('`Sar This is Not A Chat`') @borg.on(admin_cmd(pattern="chatinfo(?: |$)(.*)", outgoing=True)) async def info(event): await event.edit("`Analysing the chat...`") chat = await get_chatinfo(event) caption = await fetch_info(chat, event)
# COPYRIGHT (C) 2021-2022 © Ultra X Bot from ULTRA.utils import admin_cmd from ULTRAX import xbot, NAME from telethon import Button @borg.on(admin_cmd(pattern="button (.*)")) async def Buttons(event): await event.edit("`Mᴀᴋɪɴɢ Yᴏᴜʀ Bᴜᴛᴛᴏɴ ᴡᴇɪᴛ ᴍᴀsᴛᴇʀ !!!`") ULTRAX = Var.TG_BOT_USER_NAME_BF_HER pro = event.text[7:] pro, boy = pro.split("|") if "LEGENDX" == "PROBOYX": await xbot.send_message(event.chat_id, "buttons") else: try: async with bot.conversation(ULTRAX) as proboyx: await proboyx.send_message("/start") await proboyx.get_response() await proboyx.send_message("my button 🥺") await xbot.send_message(bot.me.id, f"{pro}", buttons=[[Button.url(f"{pro}", f"{boy}")]]) pro = await proboyx.get_response() await pro.forward_to(event.chat_id) await event.delete() except: await event.edit("example:\n.button <button name>|<link>\n`.button ULTRAX|https://t.me/ULTRAXOT`\nmake sure your name and link no have Useless spece ",link_preview=False) from .. import CMD_HELP CMD_HELP.update({"button": "example:\n.button <button name>|<link>\n`.button ULTRAX|https://t.me/ULTRAXOT`\nmake sure your name and link no have Useless spece"})
import asyncio import math import os import time from datetime import datetime from pySmartDL import SmartDL from ULTRA.utils import admin_cmd, sudo_cmd, humanbytes, progress from ULTRA import ALIVE_NAME, CMD_HELP DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Hell User" @bot.on(admin_cmd(pattern="download(?: |$)(.*)", outgoing=True)) @bot.on(sudo_cmd(pattern="download(?: |$)(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return mone = await edit_or_reply(event, "`Processing ...`") input_str = event.pattern_match.group(1) if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) if event.reply_to_msg_id: start = datetime.now() reply_message = await event.get_reply_message() try: c_time = time.time() downloaded_file_name = await event.client.download_media( reply_message,
#Ported to @LEGEND_USERBOT_SUPPORT #Made by@LEGENDX22 #ISKO BHI LELE MADARCHOD. KHUD APNI MAA CHUDWATE REHTE HO..... import asyncio from ULTRA.utils import admin_cmd @borg.on(admin_cmd(pattern="hnd (.*)")) async def _(event): name = event.pattern_match.group(1) if event.fwd_from: return animation_interval = 0.5 animation_ttl = range(6) animation_chars = [ "👇🏿👇🏿👇🏿👇🏿👇🏿👇🏿👇🏿👇🏿👇🏿👇🏿👇🏿\n👉🏿 👈🏿\n👉🏿 👈🏿\n👉🏿 👈🏿\n👉🏿 👈🏿\n👉🏿 👈🏿\n👉🏿 👈🏿\n👉🏿 👈🏿\n👉🏿 👈🏿\n👉🏿 👈🏿\n👉🏿👆🏿👆🏿👆🏿👆🏿👆🏿👆🏿👆🏿👆🏿👆🏿👈🏿", "👇🏾👇🏾👇🏾👇🏾👇🏾👇🏾👇🏾👇🏾👇🏾\n👉🏾 👈🏾\n👉🏾 👈🏾\n👉🏾 👈🏾\n👉🏾 👈🏾\n👉🏾 👈🏾\n👉🏾 👈🏾\n👉🏾 👈🏾\n👆🏾👆🏾👆🏾👆🏾👆🏾👆🏾👆🏾👆🏾👆🏾", "👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽\n👉🏽 👈🏽\n👉🏽 👈🏽\n👉🏽 👈🏽\n👉🏽 👈🏽\n👉🏽 👈🏽\n👆🏽👆🏽👆🏽👆🏽👆🏽👆🏽👆🏽", "👇🏼👇🏼👇🏼👇🏼👇🏼\n👉🏼 👈🏼\n👉🏼 👈🏼\n👉🏼 👈🏼\n👆🏼👆🏼👆🏼👆🏼👆🏼", f"👇🏻👇🏻👇🏻\n{name}\n👆🏻👆🏻👆🏻", f"👇🏿👇🏿👇🏿👇🏿👇🏿👇🏿👇🏿👇🏿👇🏿👇🏿👇🏿\n👉🏿👇🏾👇🏾👇🏾👇🏾👇🏾👇🏾👇🏾👇🏾👇🏾👈🏿\n👉🏿👉🏾👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽👈🏾👈🏿\n👉🏿👉🏾👉🏽👇🏼👇🏼👇🏼👇🏼👇🏼👈🏽👈🏾👈🏿\n👉🏿👉🏾👉🏽👉🏼👇🏻👇🏻👇🏻👈🏼👈🏽👈🏾👈🏿\n👉🏿 {name} 👈🏿\n👉🏿👉🏾👉🏽👉🏼👆🏻👆🏻👆🏻👈🏼👈🏽👈🏾👈🏿\n👉🏿👉🏾👉🏽👆🏼👆🏼👆🏼👆🏼👆🏼👈🏽👈🏾👈🏿\n👉🏿👉🏾👆🏽👆🏽👆🏽👆🏽👆🏽👆🏽👆🏽👈🏾👈🏿\n👉🏿👆🏾👆🏾👆🏾👆🏾👆🏾👆🏾👆🏾👆🏾👆🏾👈🏿\n👉🏿👆🏿👆🏿👆🏿👆🏿👆🏿👆🏿👆🏿👆🏿👆🏿👈🏿", ] for i in animation_ttl: await asyncio.sleep(animation_interval) await event.edit(animation_chars[i % 6])
from telethon.tl.functions.users import GetFullUserRequest from telethon.tl.types import MessageEntityMentionName from telethon.utils import get_input_location logger = logging.getLogger(__name__) if 1 == 1: name = "Profile Photos" client = borg @borg.on(admin_cmd(pattern="poto(.*)")) async def potocmd(event): """Gets the profile photos of replied users, channels or chats""" id = "".join(event.raw_text.split(maxsplit=2)[1:]) user = await event.get_reply_message() chat = event.input_chat if user: photos = await event.client.get_profile_photos(user.sender) else:
""" Google Text to Speech Available Commands: .tts LanguageCode as reply to a message .tts LangaugeCode | text to speak""" from ULTRA import CMD_HELP import asyncio import os import subprocess from datetime import datetime from gtts import gTTS from ULTRA.utils import admin_cmd @borg.on(admin_cmd(pattern="voice (.*)")) 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() text = previous_message.message lan = input_str elif "|" in input_str: lan, text = input_str.split("|") else: await event.edit("Invalid Syntax. Module stopping.") return text = text.strip() lan = lan.strip() if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY):
import asyncio import time from telethon.errors import FloodWaitError from telethon.tl import functions from ULTRA.utils import edit_or_reply, admin_cmd from ULTRA import ALIVE_NAME, CMD_HELP, BIO_MSG DEFAULTUSERBIO = str(BIO_MSG) if BIO_MSG else "ʟɛɢɛռɖaʀʏ ᴀғ υℓтяα χ" DEL_TIME_OUT = 60 DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "υℓтяα χ" @bot.on(admin_cmd(pattern="autoname")) # pylint:disable=E0602 async def _(event): hell = await edit_or_reply(event, "`Starting AutoName Please Wait`") if event.fwd_from: return while True: HB = time.strftime("%d-%m-%y") HE = time.strftime("%H:%M") name = f"🕒{HE} ⚡{DEFAULTUSER}⚡ 📅{HB}" logger.info(name) try:
from github import Github import aiohttp import asyncio import os import time from datetime import datetime from telethon import events from telethon.tl.types import DocumentAttributeVideo from ULTRA.utils import admin_cmd GIT_TEMP_DIR = "./ULTRA/temp/" #@command(pattern="^.commit", outgoing=True) @borg.on(admin_cmd(pattern=r"commit")) async def download(event): if event.fwd_from: return if Var.GITHUB_ACCESS_TOKEN is None: await event.edit("`Please ADD Proper Access Token from github.com`") return if Var.GIT_REPO_NAME is None: await event.edit("`Please ADD Proper Github Repo Name of HellBot`") return mone = await event.reply("Processing ...") if not os.path.isdir(GIT_TEMP_DIR): os.makedirs(GIT_TEMP_DIR) start = datetime.now() reply_message = await event.get_reply_message() try:
#port to Legend Bot by@LEGENDX22 import datetime from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from telethon.tl.functions.account import UpdateNotifySettingsRequest from ULTRA import bot, CMD_HELP from ULTRA.utils import admin_cmd @borg.on(admin_cmd("qbot ?(.*)")) async def _(event): if event.fwd_from: return if not event.reply_to_msg_id: await event.edit("```Reply to any user message.```") return reply_message = await event.get_reply_message() if not reply_message.text: await event.edit("```Reply to text message```") return chat = "@QuotLyBot" sender = reply_message.sender if reply_message.sender.bot: await event.edit("```Reply to actual users message.```") return await event.edit("```Making a Quote```") async with bot.conversation(chat) as conv: try: response = conv.wait_event( events.NewMessage(incoming=True, from_users=1031952739))
import asyncio import os from datetime import datetime from pathlib import Path from ULTRA import ALIVE_NAME from ULTRA import bot from ULTRA.utils import admin_cmd, load_module, remove_plugin, sudo_cmd from ULTRA.utils import edit_or_reply as eor DELETE_TIMEOUT = 3 thumb_image_path = "./Resources/UltraX.jpg" DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "EAGLE" @bot.on(admin_cmd(pattern=r"send (?P<shortname>\w+)", outgoing=True)) @bot.on(sudo_cmd(pattern=r"send (?P<shortname>\w+)", allow_sudo=True)) async def send(event): 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 = "./EAGLE/plugins/{}.py".format(input_str) if os.path.exists(the_plugin_file): start = datetime.now() pro = await event.client.send_file( event.chat_id, the_plugin_file, force_document=True,
import time from telethon.events import NewMessage from telethon.tl.custom import Dialog from telethon.tl.types import Channel, Chat, User from ULTRA.utils import admin_cmd, edit_or_reply, sudo_cmd from ULTRA import CMD_HELP @bot.on(admin_cmd(pattern="stats$")) @bot.on(sudo_cmd(pattern="stats$", allow_sudo=True)) async def stats( event: NewMessage.Event, ) -> None: # pylint: disable = R0912, R0914, R0915 """Command to get stats about the account""" alain = await edit_or_reply(event, "`Cᴏʟʟᴇᴄᴛɪɴɢ sᴛᴀᴛs...`") start_time = time.time() private_chats = 0 bots = 0 groups = 0 broadcast_channels = 0 admin_in_groups = 0 creator_in_groups = 0 admin_in_broadcast_channels = 0 creator_in_channels = 0 unread_mentions = 0 unread = 0 dialog: Dialog async for dialog in event.client.iter_dialogs(): entity = dialog.entity if isinstance(entity, Channel):
'apikey': api_key, 'language': language, } r = requests.post( 'https://api.ocr.space/parse/image', data=payload, ) return r.json() def progress(current, total): logger.info("Downloaded {} of {}\nCompleted {}".format( current, total, (current / total) * 100)) @borg.on(admin_cmd(pattern="ocrlanguages")) async def get_ocr_languages(event): if event.fwd_from: return languages = {} languages["English"] = "eng" languages["Arabic"] = "ara" languages["Bulgarian"] = "bul" languages["Chinese (Simplified)"] = "chs" languages["Chinese (Traditional)"] = "cht" languages["Croatian"] = "hrv" languages["Czech"] = "cze" languages["Danish"] = "dan" languages["Dutch"] = "dut" languages["Finnish"] = "fin" languages["French"] = "fre"