from telethon import events import os import json from urllib import request from uniborg.util import admin_cmd @borg.on(admin_cmd(pattern="weat (.*)")) async def _(event): if event.fwd_from: return location = event.pattern_match.group(1) wind = 'M' metric = 'm' option = '0T' url = (f'http://wttr.in/{location}?F{wind}{metric}{option}') rqst = request.urlopen(url) charset = rqst.info().get_content_charset() content = rqst.read().decode(charset) await event.edit(content.split('Weather ')[2])
"""Commands: .warn0 .warn1 .warn2 .warn3 .igbun .fw .ocb""" from telethon.tl.types import ChannelParticipantsAdmins from uniborg.util import admin_cmd @borg.on(admin_cmd(pattern="warn1")) async def _(event): if event.fwd_from: return mentions = "`You Have 1/3 warnings...\nWatch out!....\nReason for warn: P**n Demand`" chat = await event.get_input_chat() async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins): mentions += f"" reply_message = None if event.reply_to_msg_id: reply_message = await event.get_reply_message() await reply_message.reply(mentions) else: await event.reply(mentions) await event.delete() """.admin Plugin for @UniBorg"""
import random import requests from uniborg.util import admin_cmd @borg.on(admin_cmd(pattern="hquote ?(.*)")) async def quote_search(event): if event.fwd_from: return await event.edit("Processing...") search_string = event.pattern_match.group(1) input_url = "https://bots.shrimadhavuk.me/Telegram/GoodReadsQuotesBot/?q={}".format( search_string) headers = {"USER-AGENT": "UniBorg"} try: response = requests.get(input_url, headers=headers).json() except: response = None if response is not None: result = random.choice(response).get("input_message_content").get( "message_text") else: result = None if result: await event.edit(result.replace("<code>", "`").replace("</code>", "`")) else: await event.edit("Zero results found")
import asyncio import os import textwrap from hachoir.metadata import extractMetadata from hachoir.parser import createParser from PIL import Image, ImageDraw, ImageFont from telethon.tl.types import DocumentAttributeFilename from uniborg.util import admin_cmd THUMB_IMAGE_PATH = "./thumb_image.jpg" TEMP_DOWNLOAD_DIRECTORY = Config.TMP_DOWNLOAD_DIRECTORY @bot.on(admin_cmd(pattern=r"mms(?: |$)(.*)")) async def mim(event): if not event.reply_to_msg_id: await event.edit( "`Syntax: reply to an image with .mmf` 'text on top' ; 'text on bottom' " ) return reply_message = await event.get_reply_message() if not reply_message.media: await event.edit("```Reply to a image/sticker/gif```") return await event.edit("`Downloading Media..`") if reply_message.photo: dls_loc = await bot.download_media( reply_message, "meme.png",
"""Count the Number of Dialogs you have in your Telegram Account Syntax: .stat""" from datetime import datetime from uniborg.util import admin_cmd @borg.on(admin_cmd(pattern="stat")) async def _(event): if event.fwd_from: return start = datetime.now() u = 0 # number of users g = 0 # number of basic groups c = 0 # number of super groups bc = 0 # number of channels b = 0 # number of bots await event.edit("`Retrieving Telegram Count(s)`") async for d in borg.iter_dialogs(limit=None): if d.is_user: if d.entity.bot: b += 1 else: u += 1 elif d.is_channel: if d.entity.broadcast: bc += 1 else: c += 1 elif d.is_group: g += 1 else:
# (C) SPARKZZZ 2020 # @vishnu175 """syntax: `.repo`""" import asyncio from telethon import events from telethon.tl.types import ChannelParticipantsAdmins from uniborg.util import admin_cmd @sparkzzz.on(admin_cmd("repo")) async def _(event): if event.fwd_from: return mentions = "**Link To The SPARKZZZ Repo:** https://github.com/vishnu175/SPARKZZZ" chat = await event.get_input_chat() async for x in sparkzzz.iter_participants( chat, filter=ChannelParticipantsAdmins): mentions += f"" reply_message = None if event.reply_to_msg_id: reply_message = await event.get_reply_message() await reply_message.reply(mentions) else: await event.reply(mentions) await event.delete()
# For @UniBorg # (c) Shrimadhav U K from telethon import events, functions, types from uniborg.util import admin_cmd from telethon.tl.functions.channels import GetAdminedPublicChannelsRequest @borg.on(admin_cmd("listmyusernames")) async def mine(event): """ For .reserved command, get a list of your reserved usernames. """ result = await bot(GetAdminedPublicChannelsRequest()) output_str = "" for channel_obj in result.chats: output_str += f"{channel_obj.title}\n@{channel_obj.username}\n\n" await event.edit(output_str)
"""Take screenshot of any website Syntax: .long <Website URL>""" import io import traceback from datetime import datetime from selenium import webdriver from uniborg.util import admin_cmd @borg.on(admin_cmd(pattern="long (.*)")) async def _(event): if event.fwd_from: return if Config.GOOGLE_CHROME_BIN is None: await event.edit("Need to install Google Chrome. Module Stopping.") return await event.edit("Processing ...") start = datetime.now() try: chrome_options = webdriver.ChromeOptions() chrome_options.add_argument("--ignore-certificate-errors") chrome_options.add_argument("--test-type") chrome_options.add_argument("--headless") # https://stackoverflow.com/a/53073789/4723940 chrome_options.add_argument("--no-sandbox") chrome_options.add_argument("--disable-dev-shm-usage") chrome_options.binary_location = Config.GOOGLE_CHROME_BIN await event.edit("Starting Google Chrome BIN")
""" command: .compress """ from telethon import events import asyncio import zipfile from pySmartDL import SmartDL import time import os from uniborg.util import admin_cmd, humanbytes, progress, time_formatter @borg.on(admin_cmd(pattern="compress")) async def _(event): if event.fwd_from: return if not event.is_reply: await event.edit("Reply to a file to compress it.") 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: 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, progress_callback=lambda d, t: asyncio.get_event_loop().create_task( progress(d, t, mone, c_time, "trying to download") )
`.iswarn` by replying to know user got warn or not. `.rwarn` to remove warns. For SUDO users Customized by: @meanii """ import asyncio import html from telethon import events from telethon.tl.functions.channels import EditBannedRequest from telethon.tl.types import ChatBannedRights from uniborg.util import admin_cmd import sql_helpers.warns_sql as sql @borg.on(admin_cmd(pattern="warn ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return warn_reason = event.pattern_match.group(1) reply_message = await event.get_reply_message() limit, soft_warn = sql.get_warn_setting(event.chat_id) num_warns, reasons = sql.warn_user(reply_message.from_id, event.chat_id, warn_reason) if num_warns >= limit: sql.reset_warns(reply_message.from_id, event.chat_id) if soft_warn: logger.info("TODO: kick user") reply = "{} warnings, <u><a href='tg://user?id={}'>user</a></u> has been kicked!".format( limit, reply_message.from_id) else:
# 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/. import asyncio import io import time from uniborg.util import admin_cmd from sample_config import Config import logging logging.basicConfig( format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s', level=logging.WARNING) @borg.on(admin_cmd(pattern="exec ?(.*)")) # pylint:disable=E0602 async def _(event): if event.fwd_from: return DELAY_BETWEEN_EDITS = 0.3 PROCESS_RUN_TIME = 100 cmd = event.pattern_match.group(1) reply_to_id = event.message.id if event.reply_to_msg_id: reply_to_id = event.reply_to_msg_id start_time = time.time() + PROCESS_RUN_TIME process = await asyncio.create_subprocess_shell( cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE) stdout, stderr = await process.communicate() e = stderr.decode() if not e:
import sql_helpers.no_log_pms_sql as no_log_pms_sql import sql_helpers.pmpermit_sql as pmpermit_sql from telethon.tl.functions.users import GetFullUserRequest from telethon import events, errors, functions, types from uniborg.util import admin_cmd PM_WARNS = {} PREV_REPLY_MESSAGE = {} BAALAJI_TG_USER_BOT = "My Master hasn't approved you to PM." TG_COMPANION_USER_BOT = "Please wait for his response and don't spam his PM." UNIBORG_USER_BOT_WARN_ZERO = "I am currently offline. Please do not SPAM me." UNIBORG_USER_BOT_NO_WARN = "Hi! I will answer to your message soon. Please wait for my response and don't spam my PM. Thanks" @borg.on(admin_cmd(pattern="nccreatedch")) async def create_dump_channel(event): if Config.PM_LOGGR_BOT_API_ID is None: result = await event.client( functions.channels.CreateChannelRequest( # pylint:disable=E0602 title=f"UniBorg-{borg.uid}-PM_LOGGR_BOT_API_ID-data", about="@UniBorg PM_LOGGR_BOT_API_ID // Do Not Touch", megagroup=False)) logger.info(result) created_chat_id = result.chats[0].id result = await event.client.edit_admin( # pylint:disable=E0602 entity=created_chat_id, user=Config.TG_BOT_USER_NAME_BF_HER, is_admin=True, title="Editor") logger.info(result)
# Path to token json file, it should be in same directory as script G_DRIVE_TOKEN_FILE = Config.TMP_DOWNLOAD_DIRECTORY + "/auth_token.txt" # Copy your credentials from the APIs Console CLIENT_ID = Config.G_DRIVE_CLIENT_ID CLIENT_SECRET = Config.G_DRIVE_CLIENT_SECRET # Check https://developers.google.com/drive/scopes for all available scopes OAUTH_SCOPE = "https://www.googleapis.com/auth/drive.file" # Redirect URI for installed apps, can be left as is REDIRECT_URI = "urn:ietf:wg:oauth:2.0:oob" # global variable to set Folder ID to upload to G_DRIVE_F_PARENT_ID = None # global variable to indicate mimeType of directories in gDrive G_DRIVE_DIR_MIME_TYPE = "application/vnd.google-apps.folder" @borg.on(admin_cmd(pattern="gdrive ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return mone = await event.reply("`Ruk Sale ...`") if CLIENT_ID is None or CLIENT_SECRET is None: await mone.edit( "This module requires credentials from https://da.gd/so63O. Aborting!" ) 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 input_str = event.pattern_match.group(1)
"""COMMAND : .info, .dc, .n***a""" import sys from telethon import events, functions, __version__ from uniborg.util import admin_cmd @borg.on(admin_cmd(pattern="info ?(.*)", allow_sudo=True)) # pylint:disable=E0602 async def _(event): if event.fwd_from: return splugin_name = event.pattern_match.group(1) if splugin_name in borg._plugins: s_help_string = borg._plugins[splugin_name].__doc__ else: s_help_string = "****:" help_string = """@UniBorg ( **Custom Built By** @r4v4n4 ) \n**Verified Account**: ✅\n**Official Website**: https://ravanaisdrunk.site.live\n Pithun {} Talethrun {} **Custom Built Fork**: https://github.com/ravana69/PornHub""".format( sys.version, __version__) tgbotusername = Config.TG_BOT_USER_NAME_BF_HER # pylint:disable=E0602 if tgbotusername is not None: results = await borg.inline_query( # pylint:disable=E0602 tgbotusername, help_string + "\n\n" + s_help_string) await results[0].click(event.chat_id, reply_to=event.reply_to_msg_id, hide_via=True) await event.delete() else:
from telethon import events import asyncio import zipfile from pySmartDL import SmartDL import time import os from uniborg.util import admin_cmd, humanbytes, progress, time_formatter @borg.on(admin_cmd(pattern="compress ?(.*)")) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) 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:
import asyncio from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from uniborg.util import admin_cmd @borg.on(admin_cmd(pattern="purl ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return if not event.reply_to_msg_id: await event.edit("**Reply to any document.**") return reply_message = await event.get_reply_message() chat = "@FiletolinkTGbot" reply_message.sender await event.edit("**Making public url...**") async with event.client.conversation(chat) as conv: try: response = conv.wait_event( events.NewMessage(incoming=True, from_users=1011636686)) await event.client.forward_messages(chat, reply_message) response = await response except YouBlockedUserError: await event.reply("Please unblock me @FiletolinkTGbot") return await event.delete() await event.client.send_message(event.chat_id, response.message, reply_to=reply_message)
import os import requests import zipfile from telethon.errors.rpcerrorlist import StickersetInvalidError from telethon.errors import MessageNotModifiedError from telethon.tl.functions.account import UpdateNotifySettingsRequest from telethon.tl.functions.messages import GetStickerSetRequest from telethon.tl.types import (DocumentAttributeFilename, DocumentAttributeSticker, InputMediaUploadedDocument, InputPeerNotifySettings, InputStickerSetID, InputStickerSetShortName, MessageMediaPhoto) from uniborg.util import admin_cmd @borg.on(admin_cmd("kangsticker ?(.*)")) async def _(event): if event.fwd_from: return if not event.is_reply: await event.edit("Reply to a photo to add to my personal sticker pack." ) return reply_message = await event.get_reply_message() sticker_emoji = "🔥" input_str = event.pattern_match.group(1) if input_str: sticker_emoji = input_str me = borg.me userid = event.from_id
"""Dictionary Plugin for @UniBorg Syntax: .meaning <word>""" import requests from telethon import events from uniborg.util import admin_cmd @borg.on(admin_cmd(pattern="meaning (.*)")) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) input_url = "https://bots.shrimadhavuk.me/dictionary/?s={}".format( input_str) headers = {"USER-AGENT": "UniBorg"} caption_str = f"Meaning of __{input_str}__\n" try: response = requests.get(input_url, headers=headers).json() pronounciation = response.get("p") meaning_dict = response.get("lwo") for current_meaning in meaning_dict: current_meaning_type = current_meaning.get("type") current_meaning_definition = current_meaning.get("definition") caption_str += f"**{current_meaning_type}**: {current_meaning_definition}\n\n" except Exception as e: caption_str = str(e) reply_msg_id = event.message.id if event.reply_to_msg_id: reply_msg_id = event.reply_to_msg_id try:
from pySmartDL import SmartDL from remotezip import RemoteZip from telethon import events from telethon.tl.types import DocumentAttributeAudio, DocumentAttributeVideo from hachoir.metadata import extractMetadata from hachoir.parser import createParser from uniborg.util import admin_cmd, humanbytes, progress, time_formatter from sample_config import Config filedir = f"{Config.TMP_DOWNLOAD_DIRECTORY}extracted/" thumb_image_path = Config.TMP_DOWNLOAD_DIRECTORY + "/thumb_image.jpg" @borg.on(admin_cmd(pattern=("runzip ?(.*)"))) async def _(event): if event.fwd_from: return textx = await event.get_reply_message() message = event.pattern_match.group(1) input_str = event.pattern_match.group(1) if message: pass elif textx: message = textx.text else: await event.edit("`Usage: .direct <url>`") return mone = await event.edit("Processing ...") if not os.path.isdir(filedir):
# plugin by lejend @pureindialover """Emoji Available Commands: .lucky""" from telethon import events import asyncio from uniborg.util import admin_cmd @borg.on(admin_cmd(pattern="lucky")) async def _(event): if event.fwd_from: return animation_interval = 0.5 animation_ttl = range(0, 17) #input_str = event.pattern_match.group(1) #if input_str == "lucky": await event.edit("Lucky..") animation_chars = [
import subprocess import time import telethon.utils from datetime import datetime from hachoir.metadata import extractMetadata from hachoir.parser import createParser from telethon import events from telethon.tl.types import DocumentAttributeVideo from pySmartDL import SmartDL from uniborg.util import admin_cmd, humanbytes, progress, time_formatter from uniborg import util thumb_image_path = Config.TMP_DOWNLOAD_DIRECTORY + "/thumb_image.jpg" @borg.on(admin_cmd("bar (.*)")) async def _(event): if event.fwd_from: return await event.delete() mone = await event.reply("Processing ...") input_str = event.pattern_match.group(1) sample_url = "https://www.scandit.com/wp-content/themes/bridge-child/wbq_barcode_gen.php?symbology=code128&value={}&size=100&ec=L".format( input_str.replace(" ", "-")) link = sample_url.rstrip() start = datetime.now() url = link file_name = "barcode.webp" to_download_directory = Config.TMP_DOWNLOAD_DIRECTORY url = url.strip() file_name = file_name.strip()
# For UniBorg # By Priyam Kalra # Syntax .oof, .sed, .emoji from telethon import events from uniborg.util import admin_cmd import asyncio from telethon.tl import functions, types from sql_helpers.global_variables_sql import SYNTAX, MODULE_LIST MODULE_LIST.append("reactions") @borg.on(admin_cmd(pattern="oof ?(.*)")) async def _(event): if event.fwd_from: return for _ in range(10): await event.edit(";_;") await event.edit("_;;") await event.edit(";;_") await event.edit(";_;") @borg.on(admin_cmd(pattern="sed ?(.*)")) async def _(event): if event.fwd_from: return for _ in range(10): await event.edit(":/") await event.edit(":|") await event.edit(":\\")
# For UniBorg # By Priyam Kalra # Syntax (.say <text_to_print>) from uniborg.util import admin_cmd import time @borg.on(admin_cmd(pattern="say ?(.*)")) async def _(event): if event.fwd_from: return input = event.pattern_match.group(1) if not input: abe = await event.get_reply_message() input = abe.text strings = input.split() count = 0 output = "" for _ in strings: output += f"{strings[count]}\n" count += 1 await event.edit(output) time.sleep(0.25)
"darth-vader-wallpaper" ] async def animepp(): os.system("rm -rf donot.jpg") rnd = random.randint(0, len(COLLECTION_STRING) - 1) pack = COLLECTION_STRING[rnd] pc = requests.get("http://getwallpapers.com/collection/" + pack).text f = re.compile('/\w+/full.+.jpg') f = f.findall(pc) 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") @borg.on(admin_cmd(pattern="gamerpfp ?(.*)")) async def main(event): await event.edit("**Starting Gamer Profile Pic.\n\nModded by @ViperAdnan" ) #Owner @NihiNivi 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") await asyncio.sleep(3600) #Edit this to your required needs
def time_formatter(milliseconds: int) -> str: """Inputs time in milliseconds, to get beautified time, as string""" seconds, milliseconds = divmod(int(milliseconds), 1000) minutes, seconds = divmod(seconds, 60) hours, minutes = divmod(minutes, 60) days, hours = divmod(hours, 24) tmp = ((str(days) + " day(s), ") if days else "") + \ ((str(hours) + " hour(s), ") if hours else "") + \ ((str(minutes) + " minute(s), ") if minutes else "") + \ ((str(seconds) + " second(s), ") if seconds else "") + \ ((str(milliseconds) + " millisecond(s), ") if milliseconds else "") return tmp[:-2] @borg.on(admin_cmd(pattern="yt(a|v) (.*)")) async def download_video(v_url): """ For .ytdl command, download media from YouTube and many other sites. """ url = v_url.pattern_match.group(2) type = v_url.pattern_match.group(1).lower() await v_url.edit("`Preparing to download...`") if type == "a": opts = { 'format': 'bestaudio', 'addmetadata': True, 'key': 'FFmpegMetadata',
file = types.InputMediaUploadedDocument(file, 'video/mp4', []) media = await borg(UploadMediaRequest('me', file)) media = utils.get_input_document(media) # save (that's right, this is relational json) sticker_to_gif[str(sticker.id)] = media.id gif_to_sticker[str(media.id)] = sticker.id access_hashes[str(sticker.id)] = sticker.access_hash access_hashes[str(media.id)] = media.access_hash storage.sticker_to_gif = sticker_to_gif storage.access_hashes = access_hashes return media @borg.on(util.admin_cmd(r'^\.ss$')) async def on_save(event): await event.delete() target = await event.get_reply_message() media = target.gif or target.sticker if not media: return if target.sticker: media = await convert_sticker_to_gif(media) await borg(SaveGifRequest(id=media, unsave=False)) @borg.on(events.NewMessage(outgoing=True)) async def on_sticker(event): if not event.sticker: return
""".admin Plugin for @UniBorg""" import asyncio from telethon import events from telethon.tl.types import ChannelParticipantsAdmins from uniborg.util import admin_cmd @borg.on(admin_cmd("command")) async def _(event): if event.fwd_from: return mentions = "**Commands For ravana69/UniBorg:**\n\n`.info`\n`.pname`\n`.ppic`\n`.pbio`\n`.afk text`\n`.afk`\n`.alive`\n`.baalaji`\n`.admin`\n`.admem\n.sclock\n.cname\n.coin\n.scd text\n.cd text\n.fadmin\n.create b\n.create g\n.create c\n.currency usd inr\n.eye\n.f\n.lslocal\n.savefilter\n.listfilters\n.clearfilter\n.fu\n.kess\n.sux\n.gaali\n.ugdrive\n.get_admin\n.get_bot\n`.get_id`\n`.github`\n`.commit`\n`.leave`\n`.loda`\n`.meme`\n`.🖕`\n`.smoon`\n`.tmoon`\n`.music`\n.ocr\n.weather\n.paste\n.approvepm\n.blockpm\n.listapprovedpms\n.restart\n.reboot\n.fastboot\n.shutdown\n.purge\n.quickheal\n.vqh\n.vquickheal\n.remove.bg\n.sca\n.screencapture\ns/old text/new text\n.shout text\n.spem\n.slap\n.snips\n.snipd\n.snipl\n.solar\n.speedtest image/text\n.stat\n.kangsticker\n.tr language code\n.tts language code\n.telegraph text/media\n.time\n.z\n.repo\n.download\n.upload\n.verystream\n.warn(1-3)\n.gbun\n.savewelcome\n.clearwelcome\n.whois\n.wiki\n**I Don't Use Any Other Plugins Other Than These ,So Haven't Included Others Here...**" chat = await event.get_input_chat() async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins): mentions += f"" reply_message = None if event.reply_to_msg_id: reply_message = await event.get_reply_message() await reply_message.reply(mentions) else: await event.reply(mentions) await event.delete()
#Available Commands: #.hackallph #ANIMATION WRITTED BY @CyberJalagam #OpenSource from telethon import events import asyncio from uniborg.util import admin_cmd @borg.on(admin_cmd(pattern=r"(.*)")) async def _(event): if event.fwd_from: return animation_interval = 1.5 animation_ttl = range(0, 26) input_str = event.pattern_match.group(1) if input_str == "hackallph": await event.edit(input_str)
"`Keep talking, someday you'll say something intelligent!.......(I doubt it though)`", "`Everyone has the right to be stupid but you are abusing the privilege.`", "`I'm sorry I hurt your feelings when I called you stupid. I thought you already knew that.`", "`You should try tasting cyanide.`", "`You should try sleeping forever.`", "`Pick up a gun and shoot yourself.`", "`Try bathing with Hydrochloric Acid instead of water.`", "`Go Green! Stop inhaling Oxygen.`", "`God was searching for you. You should leave to meet him.`", "`You should Volunteer for target in an firing range.`", "`Try playing catch and throw with RDX its fun.`", ] # =========================================== @borg.on(admin_cmd("runs ?(.*)")) async def _(event): if event.fwd_from: return bro = random.randint(0, len(RUNSREACTS) - 1) input_str = event.pattern_match.group(1) reply_text = RUNSREACTS[bro] await event.edit(reply_text) @borg.on(admin_cmd("metoo ?(.*)")) async def _(event): if event.fwd_from: return bro = random.randint(0, len(METOOSTR) - 1) input_str = event.pattern_match.group(1)
from telethon import events import asyncio import os import sys from uniborg.util import admin_cmd @borg.on(admin_cmd(pattern="ftext ?(.*)")) async def payf(event): input_str = event.pattern_match.group(1) if input_str: paytext = input_str pay = "{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}".format( paytext * 8, paytext * 8, paytext * 2, paytext * 2, paytext * 2, paytext * 6, paytext * 6, paytext * 2, paytext * 2, paytext * 2, paytext * 2, paytext * 2) else: pay = "╭━━━╮\n┃╭━━╯\n┃╰━━╮\n┃╭━━╯\n┃┃\n╰╯\n" # pay = "{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}".format(paytext*8, paytext*8, paytext*2, paytext*2, paytext*2, paytext*6, paytext*6, paytext*2, paytext*2, paytext*2, paytext*2, paytext*2) await event.edit(pay)