import asyncio from telethon import events from telethon.tl.functions.channels import EditBannedRequest from telethon.tl.types import ChatBannedRights from Userbot.utils import admin_cmd import Userbot.plugins.sql_helper.antiflood_sql as sql from Userbot import CMD_HELP CHAT_FLOOD = sql.__load_flood_settings() # warn mode for anti flood ANTI_FLOOD_WARN_MODE = ChatBannedRights(until_date=None, view_messages=None, send_messages=True) @borg.on(admin_cmd(incoming=True)) async def _(event): # logger.info(CHAT_FLOOD) if not CHAT_FLOOD: return if not (str(event.chat_id) in CHAT_FLOOD): return should_ban = sql.update_flood(event.chat_id, event.message.from_id) if not should_ban: return try: await event.client( EditBannedRequest(event.chat_id, event.message.from_id, ANTI_FLOOD_WARN_MODE)) except Exception as e: # pylint:disable=C0103,W0703 no_admin_privilege_message = await event.client.send_message(
inspired by : conversationqt.py made by : @Hacker_The_Unknown | Noob edited by : @YOU_ARE_UNDER_ARREST| Ultra pro max Noob # KANG wITH CREDIT """ from telethon import events import asyncio import os import sys import random from Userbot.utils import admin_cmd @borg.on(admin_cmd(pattern=r"rdl")) async def _(event): if event.fwd_from: return await event.edit("Selecting the best riddle for you...") await asyncio.sleep(2) x = random.randrange(1, 60) if x == 1: await event.edit('`"What has hands but can not clap?"`') if x == 2: await event.edit( '`"If an electric train is traveling south, which way is the smoke going?"`' ) if x == 3: await event.edit( '`"A monkey, a squirrel, and a bird are racing to the top of a coconut tree. Who will get the banana first, the monkey, the squirrel, or the bird?"`'
#Totally made by @you_are_under_arrest and @none1p ..plzz don't copy it.. it's only for legend userbot.. #repo https://github.com/aritramandal/LEGEND #if wanna copy don't remove the credit lines.. from Userbot.utils import admin_cmd @borg.on(admin_cmd(pattern=r"ari ?(.*)")) async def ari(event): giveVar = event.text ari = giveVar[4:5] if not ari: ari = "ЁЯШБ" await event.edit( f"уЕдуЕдуЕдуЕдуЕд{ari}{ari}\n {ari}{ari}{ari}\n {ari}{ari}{ari}{ari}\n {ari}{ari} {ari}{ari}\n {ari}{ari} {ari}{ari}\n {ari}{ari} {ari}{ari}\n {ari}{ari}{ari}{ari}{ari}{ari}{ari}\n {ari}{ari}{ari}{ari}{ari}{ari}{ari}{ari}\n {ari}{ari} {ari}{ari}\n {ari}{ari} {ari}{ari}\n{ari}{ari} {ari}{ari}\n\n{ari}{ari}{ari}{ari}{ari}{ari}{ari}\n{ari}{ari}{ari}{ari}{ari}{ari}{ari}\n{ari}{ari} {ari}{ari}\n{ari}{ari} {ari}{ari}\n{ari}{ari}уЕдуЕдуЕдуЕд {ari}{ari}\n{ari}{ari}уЕдуЕдуЕд {ari}{ari}\n{ari}{ari}{ari}{ari}{ari}{ari}{ari}\n{ari}{ari}{ari}{ari}{ari}{ari}{ari}\n{ari}{ari} {ari}{ari}\n{ari}{ari} {ari}{ari}\n{ari}{ari}уЕдуЕдуЕдуЕд {ari}{ari}\n{ari}{ari}уЕдуЕдуЕд {ari}{ari}\n{ari}{ari} {ari}{ari}\n{ari}{ari}уЕдуЕдуЕдуЕдуЕдуЕдуЕд {ari}{ari}\n\n{ari}{ari}{ari}{ari}{ari}{ari}\n{ari}{ari}{ari}{ari}{ari}{ari}\n {ari}{ari}\n {ari}{ari}\n {ari}{ari}\n {ari}{ari}\n {ari}{ari}\n {ari}{ari}\n{ari}{ari}{ari}{ari}{ari}{ari}\n{ari}{ari}{ari}{ari}{ari}{ari}\n\n{ari}{ari}{ari}{ari}{ari}{ari}{ari}{ari}\n{ari}{ari}{ari}{ari}{ari}{ari}{ari}{ari}\n {ari}{ari}\n {ari}{ari}\n {ari}{ari}\n {ari}{ari}\n {ari}{ari}\n {ari}{ari}\n\n{ari}{ari}{ari}{ari}{ari}{ari}{ari}\n{ari}{ari}{ari}{ari}{ari}{ari}{ari}\n{ari}{ari} {ari}{ari}\n{ari}{ari} {ari}{ari}\n{ari}{ari}уЕдуЕдуЕдуЕд {ari}{ari}\n{ari}{ari}уЕдуЕдуЕд {ari}{ari}\n{ari}{ari}{ari}{ari}{ari}{ari}{ari}\n{ari}{ari}{ari}{ari}{ari}{ari}{ari}\n{ari}{ari} {ari}{ari}\n{ari}{ari} {ari}{ari}\n{ari}{ari}уЕдуЕдуЕдуЕд {ari}{ari}\n{ari}{ari}уЕдуЕдуЕд {ari}{ari}\n{ari}{ari} {ari}{ari}\n{ari}{ari}уЕдуЕдуЕдуЕдуЕдуЕдуЕд {ari}{ari}\n\nуЕдуЕдуЕдуЕдуЕд{ari}{ari}\n {ari}{ari}{ari}\n {ari}{ari}{ari}{ari}\n {ari}{ari} {ari}{ari}\n {ari}{ari} {ari}{ari}\n {ari}{ari} {ari}{ari}\n {ari}{ari}{ari}{ari}{ari}{ari}{ari}\n {ari}{ari}{ari}{ari}{ari}{ari}{ari}{ari}\n {ari}{ari} {ari}{ari}\n {ari}{ari} {ari}{ari}\n{ari}{ari} {ari}{ari}\n\n\n\n\n .. \n\n\n\n\n\n\n\n ..
""" command: .movie torrentz2.eu|idop.se """ import cfscrape # https://github.com/Anorov/cloudflare-scrape import requests from datetime import datetime from bs4 import BeautifulSoup from Userbot.utils import admin_cmd, humanbytes @borg.on(admin_cmd( # pylint:disable=E0602 pattern="movie (torrentz2\.eu|idop\.se) (.*)" )) async def _(event): if event.fwd_from: return start = datetime.now() await event.edit("Processing ...") input_type = event.pattern_match.group(1) input_str = event.pattern_match.group(2) search_results = [] if input_type == "torrentz2.eu": search_results = search_torrentz_eu(input_str) elif input_type == "idop.se": search_results = search_idop_se(input_str) logger.info(search_results) # pylint:disable=E0602 output_str = "" i = 0 for result in search_results: if i > 10: break message_text = "👉 <a href=https://t.me/TorrentSearchRoBot?start=" + result["hash"] + ">" + result["title"] + ": " + "</a>" + " \r\n"
await event.edit(input_str + " is not a valid plugin!") else: help_string = f"""Userbot Helper.. Provided by ✨{DEFAULTUSER}✨ \n `Userbot Helper to reveal all the commands`\n__Do .help plugin_name for commands, in case popup doesn't appear.__""" results = await bot.inline_query( # pylint:disable=E0602 tgbotusername, help_string ) await results[0].click( event.chat_id, reply_to=event.reply_to_msg_id, hide_via=True ) await event.delete() @borg.on(admin_cmd(pattern="dc")) # pylint:disable=E0602 async def _(event): if event.fwd_from: return result = await borg(functions.help.GetNearestDcRequest()) # pylint:disable=E0602 await event.edit(result.stringify()) @borg.on(admin_cmd(pattern="config")) # pylint:disable=E0602 async def _(event): if event.fwd_from: return result = await borg(functions.help.GetConfigRequest()) # pylint:disable=E0602 result = result.stringify() logger.info(result) # pylint:disable=E0602 await event.edit("""Telethon UserBot powered by @LEGEND_USERBOT_SUPPORT""")
"""COMMAND : .cname""" import asyncio import time from telethon.tl import functions from telethon.errors import FloodWaitError from Userbot.utils import admin_cmd DEL_TIME_OUT = 60 @borg.on(admin_cmd(pattern="cname")) # pylint:disable=E0602 async def _(event): if event.fwd_from: return while True: DMY = time.strftime("%d.%m.%y") HM = time.strftime("%H:%M") name = f"{HM}🔥𝙎𝙐𝙍𝙑𝙄𝙑𝙊𝙍🔥{DMY}" logger.info(name) try: await borg(functions.account.UpdateProfileRequest( # pylint:disable=E0602 last_name = name )) except FloodWaitError as ex: logger.warning(str(e)) await asyncio.sleep(ex.seconds) # else: # logger.info(r.stringify()) # await borg.send_message( # pylint:disable=E0602
from telethon.tl.types import DocumentAttributeAudio, DocumentAttributeVideo from Userbot.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,
async def get_file_name(content): file_name = "" c_append = False for c in str(content): if c == '"': c_append = True if c == ";": c_append = False if c_append: file_name = file_name + c file_name = file_name.replace('"', "") print("File Name: " + str(file_name)) return file_name @borg.on(admin_cmd(pattern=f"gdl", outgoing=True)) async def g_download(event): if event.fwd_from: return drive_link = event.text[4:] print("Drive Link: " + drive_link) file_id = await get_id(drive_link) await event.edit("Downloading Requested File from G-Drive...") file_name = await download_file_from_google_drive(file_id) await event.edit("File Downloaded.\nName: `" + str(file_name) + "`") CMD_HELP.update({ "gdrive_download": ".gdl <gdrive File-Link>\ \nUsage:G-Drive File Downloader Plugin For Userbot."
import os import sys import asyncio import random import logging from telethon import events from Userbot.utils import admin_cmd @borg.on(admin_cmd("bigoof")) async def _(event): if event.fwd_from: return animation_interval = 0.1 animation_ttl = range(0, 7) await event.edit( "┏━━━┓╋╋╋╋┏━━━┓ \n┃┏━┓┃╋╋╋╋┃┏━┓┃ \n┃┃╋┃┣┓┏┓┏┫┃╋┃┃ \n┃┃╋┃┃┗┛┗┛┃┃╋┃┃ \n┃┗━┛┣┓┏┓┏┫┗━┛┃ \n┗━━━┛┗┛┗┛┗━━━┛" ) 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┃┃╱┃┃╭╮┃╭╮┃╭╮┃╭╮┣╮╭╯ \n┃╰━╯┃╰╯┃╰╯┃╰╯┃╰╯┃┃┃ \n╰━━━┻━━┻━━┻━━┻━━╯╰╯", "╭━━━╮╱╱╱╱╱╱╱╱╱╭━╮ \n┃╭━╮┃╱╱╱╱╱╱╱╱╱┃╭╯ \n┃┃╱┃┣━━┳━━┳━━┳╯╰╮ \n┃┃╱┃┃╭╮┃╭╮┃╭╮┣╮╭╯ \n┃╰━╯┃╰╯┃╰╯┃╰╯┃┃┃ \n╰━━━┻━━┻━━┻━━╯╰╯" ] for i in animation_ttl: await asyncio.sleep(animation_interval) await event.edit(animation_chars[i % 7])
""".admin Plugin for @UniBorg""" import asyncio from telethon import events from telethon.tl.types import ChannelParticipantsAdmins from Userbot.utils import admin_cmd @borg.on(admin_cmd(pattern="admins")) async def _(event): if event.fwd_from: return mentions = "@admin: **Spam Spotted**" chat = await event.get_input_chat() async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins): mentions += f"[\u2063](tg://user?id={x.id})" 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()
from telethon import events from Userbot.utils import admin_cmd import random, re, asyncio from Userbot import CMD_HELP from collections import deque @borg.on(admin_cmd(pattern=r"lul$")) async def _(event): if event.fwd_from: return deq = deque(list("😂🤣😂🤣😂🤣")) for _ in range(48): await asyncio.sleep(0.1) await event.edit("".join(deq)) deq.rotate(1) @borg.on(admin_cmd(pattern=r"nothappy$")) async def _(event): if event.fwd_from: return deq = deque(list("🥺☹️🥺☹️🥺☹️🥺")) for _ in range(48): await asyncio.sleep(0.1) await event.edit("".join(deq)) deq.rotate(1) @borg.on(admin_cmd(pattern=r"sad$")) async def _(event):
import requests import bs4 import re from Userbot.utils import admin_cmd, sudo_cmd from telethon import * from Userbot import * from telethon import events from bs4 import BeautifulSoup from platform import uname from Userbot import ALIVE_NAME from Userbot import CMD_HELP DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "legend" @borg.on(admin_cmd(pattern="app (.*)")) async def apk(event): try: app_name = event.pattern_match.group(1) remove_space = app_name.split(' ') final_name = '+'.join(remove_space) page = requests.get("https://play.google.com/store/search?q=" + final_name + "&c=apps") lnk = str(page.status_code) soup = bs4.BeautifulSoup(page.content, 'lxml', from_encoding='utf-8') results = soup.findAll("div", "ZmHEEd") app_name = results[0].findNext('div', 'Vpfmgd').findNext( 'div', 'WsMG1c nnK0zc').text app_dev = results[0].findNext('div', 'Vpfmgd').findNext('div', 'KoLSrc').text app_dev_link = "https://play.google.com" + results[0].findNext(
TELEGRAPH_MEDIA_LINKS = ["https://telegra.ph/file/2eab4f64ead6fbf41bf87.jpg", "https://telegra.ph/file/6bef1ffbaddc5230c2ae1.jpg", "https://telegra.ph/file/a03f035e83098a7c5bded.jpg", "https://telegra.ph/file/f0a230a30b9952f56d2cd.jpg", "https://telegra.ph/file/d00e6bb4b4a483099c992.jpg", "https://telegra.ph/file/1270ed675db61e6c84eea.jpg", "https://telegra.ph/file/32743c9389915b02fdea7.jpg", "https://telegra.ph/file/8c02a1430502bea931ff7.jpg", "https://telegra.ph/file/1ec37d367bb59ac56131d.jpg", "https://telegra.ph/file/e9aeef4fd2e3d0b9e9f24.jpg", "https://telegra.ph/file/28c242ea9f8cf32db4c21.jpg", "https://telegra.ph/file/c089426ca031d1f6297b0.jpg", "https://telegra.ph/file/a196b6c07f0a659daf058.jpg", "https://telegra.ph/file/69f19acd13b1eaf3fc120.jpg" ] @borg.on(admin_cmd(pattern="survivorpfp ?(.*)")) async def autopic(event): while True: piclink = random.randint(0, len(TELEGRAPH_MEDIA_LINKS) - 1) AUTOPP = TELEGRAPH_MEDIA_LINKS[piclink] downloaded_file_name = "./Userbot/original_pic.png" downloader = SmartDL(AUTOPP, downloaded_file_name, progress_bar=True) downloader.start(blocking=False) photo = "photo_pfp.png" while not downloader.isFinished(): place_holder = None shutil.copy(downloaded_file_name, photo) im = Image.open(photo) current_time = datetime.now().strftime("@Sur_vivor \n \nTime: %H:%M:%S \nDate: %d/%m/%y")
img4=("https://telegra.ph/file/c9b14ac778ffbae2b8877.mp4") img5=("https://telegra.ph/file/4be0c8224a6b49b796505.mp4") img6=("https://telegra.ph/file/ee2bb9d5c4c41751c0cd1.mp4") img7=("https://telegra.ph/file/e982bd34bc29b2908a218.mp4") img8=("https://telegra.ph/file/f7b2555d6e5c11cd94d8f.mp4") img9=("https://telegra.ph/file/30df9bd45b861fd0f5773.mp4") img10=("https://telegra.ph/file/f5364c94795991747f9a7.mp4") img11=("https://telegra.ph/file/227dc0c3315061e25a5b4.mp4") img12=("https://telegra.ph/file/c3f47d45cf14ceb0c70f4.mp4") img13=("https://telegra.ph/file/3d3e86283953a292aef4a.mp4") img14=("https://telegra.ph/file/6311a00f207a1702183e2.mp4") img15=("https://telegra.ph/file/6a561f28fa2e3151e19ce.mp4") img16=("https://telegra.ph/file/2e6647c61f188addc10d6.mp4") @borg.on(admin_cmd(outgoing=True, pattern="bby")) async def _(event): if event.fwd_from: return await event.edit("SENDING...:-)") await asyncio.sleep(0.9) x=(random.randrange(1,16)) if x==1: await borg.send_file(event.chat_id,img1) await event.delete() if x==2: await borg.send_file(event.chat_id,img2) await event.delete() if x==3:
"""Transfer Ownership of Channels Available Commands: .otransfer @username""" import telethon.password as pwd_mod # https://t.me/TelethonChat/140200 from telethon.tl import functions, types from Userbot import utils @borg.on(utils.admin_cmd(pattern="otransfer (.*)")) # pylint:disable=E0602 async def _(event): if event.fwd_from: return user_name = event.pattern_match.group(1) current_channel = event.chat_id # not doing any validations, here FN # MBL try: pwd = await borg(functions.account.GetPasswordRequest()) my_srp_password = pwd_mod.compute_check(pwd, Config.TELE_GRAM_2FA_CODE) await borg( functions.channels.EditCreatorRequest(channel=current_channel, user_id=user_name, password=my_srp_password)) except Exception as e: await event.edit(str(e)) else: await event.edit("Transferred 🌚")
and set as own profile. Syntax: .clone @username""" #Copy That Plugin by @ViperAdnan #Give credit if you are going to kang it. import html import os from telethon.tl.functions.photos import GetUserPhotosRequest from telethon.tl.functions.users import GetFullUserRequest from telethon.tl.types import MessageEntityMentionName from telethon.utils import get_input_location from Userbot.utils import admin_cmd from telethon.tl import functions @borg.on(admin_cmd(pattern="clone ?(.*)")) async def _(event): if event.fwd_from: return reply_message = await event.get_reply_message() replied_user, error_i_a = await get_full_user(event) if replied_user is None: await event.edit(str(error_i_a)) return False user_id = replied_user.user.id profile_pic = await event.client.download_profile_photo(user_id, Config.TMP_DOWNLOAD_DIRECTORY) # some people have weird HTML in their names first_name = html.escape(replied_user.user.first_name) # https://stackoverflow.com/a/5072031/4723940 # some Deleted Accounts do not have first_name if first_name is not None:
# Lots of lub to @r4v4n4 for gibing the base <3 import datetime from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from telethon.tl.functions.account import UpdateNotifySettingsRequest from Userbot.utils import admin_cmd, register from Userbot import CMD_HELP @borg.on(admin_cmd(pattern="scan ?(.*)")) 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.media: await event.edit("```reply to a media message```") return chat = "@DrWebBot" sender = reply_message.sender if reply_message.sender.bot: await event.edit("```Reply to actual users message.```") return await event.edit(" `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)
from telethon.tl import types from Userbot.utils import admin_cmd from telethon.errors import (BadRequestError, ChatAdminRequiredError, ImageProcessFailedError, PhotoCropSizeSmallError, UserAdminInvalidError) def get_who_string(who): who_string = html.escape(utils.get_display_name(who)) if isinstance(who, (types.User, types.Channel)) and who.username: who_string += f" <i>(@{who.username})</i>" who_string += f", <a href='tg://user?id={who.id}'>#{who.id}</a>" return who_string @borg.on(admin_cmd(pattern=r"urid", outgoing=True)) async def _(event): if not event.message.is_reply: who = await event.get_chat() else: msg = await event.message.get_reply_message() if msg.forward: # FIXME forward privacy memes who = await borg.get_entity( msg.forward.from_id or msg.forward.channel_id) else: who = await msg.get_sender() await event.edit(get_who_string(who), parse_mode='html')
"""Emoji Available Commands: .think""" from telethon import events import asyncio from Userbot.utils import admin_cmd @borg.on(admin_cmd(pattern="think")) async def _(event): if event.fwd_from: return animation_interval = 0.01 animation_ttl = range(0, 288) await event.edit("think") animation_chars = [ "THINKING", "THI&K#N₹", "T+IN@I?G", "¿H$NK∆NG", "¶H×NK&N*", "NGITHKIN", "T+I#K@₹G", "THINKING", "THI&K#N₹", "T+IN@I?G", "¿H$NK∆NG", "¶H×NK&N*", "NGITHKIN",
"""Malayalam Calendar plugin for @UniBorg SYNTAX: .calendar YYYY-MM-DD""" from telethon import events import asyncio from datetime import datetime import requests import json from Userbot.utils import admin_cmd import logging logging.basicConfig( format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s', level=logging.WARNING) @borg.on(admin_cmd(pattern="calendar (.*)")) async def _(event): if event.fwd_from: return start = datetime.now() input_str = event.pattern_match.group(1) input_sgra = input_str.split("-") if len(input_sgra) == 3: yyyy = input_sgra[0] mm = input_sgra[1] dd = input_sgra[2] required_url = "https://calendar.kollavarsham.org/api/years/{}/months/{}/days/{}?lang={}".format( yyyy, mm, dd, "en") headers = {"Accept": "application/json"} response_content = requests.get(required_url, headers=headers).json() a = "" if "error" not in response_content:
"""Color Plugin for @UniBorg Syntax: .color <color_code>""" from telethon import events import os from PIL import Image, ImageColor from Userbot.utils import admin_cmd from Userbot import CMD_HELP @borg.on(admin_cmd(pattern="color (.*)")) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) message_id = event.message.id if event.reply_to_msg_id: message_id = event.reply_to_msg_id if input_str.startswith("#"): try: usercolor = ImageColor.getrgb(input_str) except Exception as e: await event.edit(str(e)) return False else: im = Image.new(mode="RGB", size=(1280, 720), color=usercolor) im.save("UniBorg.png", "PNG") input_str = input_str.replace("#", "#COLOR_") await borg.send_file(event.chat_id, "UniBorg.png", force_document=False, caption=input_str,
Code written by @loxxi {iffuci} Syntax: .iffuci""" from telethon import events import asyncio from datetime import datetime import os import requests from Userbot.utils import admin_cmd def progress(current, total): logger.info("Downloaded {} of {}\nCompleted {}".format( current, total, (current / total) * 100)) @borg.on(admin_cmd(pattern="iffuci ?(.*)")) async def _(event): if event.fwd_from: return start = datetime.now() if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) input_str = event.pattern_match.group(1) message = "SYNTAX: `.iffuci <long text to include>`" if input_str: message = input_str elif event.reply_to_msg_id: previous_message = await event.get_reply_message() if previous_message.media: downloaded_file_name = await borg.download_media( previous_message,
from telethon import events import subprocess import asyncio import time from Userbot.utils import admin_cmd #@command(pattern="^.cmds", outgoing=True) @borg.on(admin_cmd(pattern=r"cmds")) async def install(event): if event.fwd_from: return cmd = "ls userbot/plugins" process = await asyncio.create_subprocess_shell( cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE ) stdout, stderr = await process.communicate() o = stdout.decode() _o = o.split("\n") o = "\n".join(_o) OUTPUT = f"**List of Plugins:**\n{o}\n\n**HELP:** __If you want to know the commands for a plugin, do:-__ \n `.help <plugin name>` **without the < > brackets.**\n__All plugins might not work directly. Visit__ @Sensible_userbot __for assistance.__" await event.edit(OUTPUT)
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.c (the "License"); # you may not use this file except in compliance with the License. # """ Userbot module containing hash and encode/decode commands. """ from subprocess import PIPE from subprocess import run as runapp import pybase64 from Userbot import CMD_HELP from Userbot.utils import admin_cmd, errors_handler @borg.on(admin_cmd(outgoing=True, pattern="hash (.*)")) @errors_handler async def gethash(hash_q): """ For .hash command, find the md5, sha1, sha256, sha512 of the string. """ hashtxt_ = hash_q.pattern_match.group(1) hashtxt = open("hashdis.txt", "w+") hashtxt.write(hashtxt_) hashtxt.close() md5 = runapp(["md5sum", "hashdis.txt"], stdout=PIPE) md5 = md5.stdout.decode() sha1 = runapp(["sha1sum", "hashdis.txt"], stdout=PIPE) sha1 = sha1.stdout.decode() sha256 = runapp(["sha256sum", "hashdis.txt"], stdout=PIPE) sha256 = sha256.stdout.decode() sha512 = runapp(["sha512sum", "hashdis.txt"], stdout=PIPE) runapp(["rm", "hashdis.txt"], stdout=PIPE) sha512 = sha512.stdout.decode()
import datetime from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from telethon.tl.functions.account import UpdateNotifySettingsRequest from Userbot.utils import admin_cmd @borg.on(admin_cmd(pattern="cres ?(.*)")) async def _(event): if event.fwd_from: return if not event.reply_to_msg_id: await event.edit("```Reply to a username or username link.```") return reply_message = await event.get_reply_message() if not reply_message.text: await event.edit("```Reply to a username or username link```") return chat = "@CheckRestrictionsBot" sender = reply_message.sender await event.edit("```Processing```") async with event.client.conversation(chat) as conv: try: response = conv.wait_event( events.NewMessage(incoming=True, from_users=894227130)) await event.client.forward_messages(chat, reply_message) response = await response except YouBlockedUserError: await event.reply("`RIP Check Your Blacklist Boss`") return if response.text.startswith(""):
# 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/. """Urban Dictionary Syntax: .ud Query""" from telethon import events import asyncurban from Userbot.utils import admin_cmd @borg.on(admin_cmd(pattern="ud (.*)")) async def _(event): if event.fwd_from: return await event.edit("processing...") word = event.pattern_match.group(1) urban = asyncurban.UrbanDictionary() try: mean = await urban.get_word(word) await event.edit( "Text: **{}**\n\nMeaning: **{}**\n\nExample: __{}__".format( mean.word, mean.definition, mean.example)) except asyncurban.WordNotFoundError: await event.edit("No result found for **" + word + "**")
a_user.id) current_message = await event.reply( 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) @borg.on(admin_cmd(pattern="savewelcome")) # pylint:disable=E0602 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 event.edit("Welcome note saved. ") else: input_str = event.text.split(None, 1) add_welcome_setting(event.chat_id, input_str[1], True, 0, None) await event.edit("Welcome note saved. ")
import datetime import json import logging import requests from telethon import events from Userbot.utils import admin_cmd logging.basicConfig(format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s', level=logging.WARNING) TEMPAT = '' @borg.on(admin_cmd(pattern=("ezanvakti ?(.*)"))) async def get_adzan(adzan): if not adzan.text.startswith("."): return "" if not adzan.pattern_match.group(1): LOKASI = TEMPAT if not LOKASI: await adzan.edit("Please specify a city or a state.") return else: LOKASI = adzan.pattern_match.group(1) url = f'http://muslimsalat.com/{LOKASI}.json?key=bd099c5825cbedb9aa934e255a81a5fc' request = requests.get(url) result = json.loads(request.text)
# Plugin Made BY @Anonymous_Machinee # Use With Or Without Credit # Originally Made for Phantom Userbot # HAPPY DIWALI TO ALL # Now to be used in LEGEND USERBOT from telethon import events import asyncio from Userbot.utils import admin_cmd @borg.on(admin_cmd(pattern="diwali")) async def _(event): if event.fwd_from: return animation_interval = 0.3 animation_ttl = range(0, 24) animation_chars = [ "❤️ **Happy Diwali** ❤️", "💚 **Happy Diwali** 💚", "💜 **Happy Diwali** 💜", "💖 **Happy Diwali** 💖", "💙 **Happy Diwali** 💙", "💛 **Happy Diwali** 💛", "💗 **Happy Diwali** 💗", "💓 **Happy Diwali** 💓", "❤️ **Happy Diwali** ❤️", "💚 **Happy Diwali** 💚", "💜 **Happy Diwali** 💜", "💖 **Happy Diwali** 💖", "💙 **Happy Diwali** 💙",
""" 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 Userbot.utils import admin_cmd GIT_TEMP_DIR = "./userbot/temp/" @borg.on(admin_cmd(pattern="commit", outgoing=True)) 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 your userbot`" ) 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()