# Copyright (c) By Midhun KM [@StarkXD] # I Am Noob # Official Web : nekobot.xyz # "Copy It As You Want But Don't Edit Credits" import requests from uniborg.util import edit_or_reply, WhiteEye_on_cmd, sudo_cmd @WhiteEye.on(WhiteEye_on_cmd("ttt ?(.*)")) @WhiteEye.on(sudo_cmd("ttt ?(.*)", allow_sudo=True)) async def noobishere(event): reply_to_id = event.message.id if event.reply_to_msg_id: reply_to_id = event.reply_to_msg_id reply = await event.get_reply_message() if event.pattern_match.group(1): ipman = event.pattern_match.group(1) elif reply.text: ipman = reply.message else: await edit_or_reply(event, "Trump : What Should I Tweet For You ?") return url = f"https://nekobot.xyz/api/imagegen?type=trumptweet&text={ipman}" starkgang = requests.get(url=url).json() meikobot = starkgang.get("message") tweetimg = meikobot starkxd = f"Trump Has Tweeted {ipman}" await edit_or_reply(event, "Trump : Wait I Am Tweeting Your Texts") await event.client.send_file(event.chat_id, tweetimg,
from telethon.tl.functions.photos import DeletePhotosRequest, GetUserPhotosRequest from telethon.tl.types import InputPhoto from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd(pattern="delpfp ?(.*)")) @friday.on(sudo_cmd(pattern="delpfp ?(.*)", allow_sudo=True)) async def remove_profilepic(delpfp): """ For .delpfp command, delete your current profile picture in Telegram. """ group = delpfp.text[8:] if group == "all": lim = 0 elif group.isdigit(): lim = int(group) else: lim = 1 pfplist = await delpfp.client( GetUserPhotosRequest(user_id=delpfp.from_id, offset=0, max_id=0, limit=lim)) input_photos = [] for sep in pfplist.photos: input_photos.append( InputPhoto( id=sep.id, access_hash=sep.access_hash, file_reference=sep.file_reference, )) await delpfp.client(DeletePhotosRequest(id=input_photos))
RUNSREACTS = [ "`Congratulations and BRAVO!`", "`You did it! So proud of you!`", "`This calls for celebrating! Congratulations!`", "`I knew it was only a matter of time. Well done!`", "`Congratulations on your well-deserved success.`", "`Heartfelt congratulations to you.`", "`Warmest congratulations on your achievement.`", "`Congratulations and best wishes for your next adventure!”`", "`So pleased to see you accomplishing great things.`", "`Feeling so much joy for you today. What an impressive achievement!`", ] @WhiteEye.on(WhiteEye_on_cmd(pattern="congo")) @WhiteEye.on(sudo_cmd(pattern="congo", allow_sudo=True)) async def _(event): if event.fwd_from: return bro = random.randint(0, len(RUNSREACTS) - 1) reply_text = RUNSREACTS[bro] await edit_or_reply(event, reply_text) CMD_HELP.update( { "congratulations": "**Congratulations**\ \n\n**Syntax : **`.congo`\ \n**Usage :** This plugin is used to congratulate someone." } )
RUNSREACTS = [ "`Congratulations and BRAVO!`", "`You did it! So proud of you!`", "`This calls for celebrating! Congratulations!`", "`I knew it was only a matter of time. Well done!`", "`Congratulations on your well-deserved success.`", "`Heartfelt congratulations to you.`", "`Warmest congratulations on your achievement.`", "`Congratulations and best wishes for your next adventure!”`", "`So pleased to see you accomplishing great things.`", "`Feeling so much joy for you today. What an impressive achievement!`", ] @friday.on(friday_on_cmd(pattern="congo")) @friday.on(sudo_cmd(pattern="congo", allow_sudo=True)) async def _(event): if event.fwd_from: return bro = random.randint(0, len(RUNSREACTS) - 1) reply_text = RUNSREACTS[bro] await edit_or_reply(event, reply_text) CMD_HELP.update( { "congratulations": "**Congratulations**\ \n\n**Syntax : **`.congo`\ \n**Usage :** This plugin is used to congratulate someone." } )
By @snappy101 """ import asyncio import os from datetime import datetime import barcode from barcode.writer import ImageWriter from uniborg.util import WhiteEye_on_cmd, edit_or_reply, sudo_cmd from WhiteEyeUserBot import CMD_HELP @WhiteEye.on(WhiteEye_on_cmd(pattern="barcode ?(.*)")) @WhiteEye.on(sudo_cmd(pattern="barcode ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return await edit_or_reply(event, "...") start = datetime.now() input_str = event.pattern_match.group(1) message = "SYNTAX: `.barcode <long text to include>`" reply_msg_id = event.message.id if input_str: message = input_str elif event.reply_to_msg_id: previous_message = await event.get_reply_message() reply_msg_id = previous_message.id if previous_message.media: downloaded_file_name = await borg.download_media(
# Copyright (c) By Midhun KM [@StarkXD] # I Am Noob # Official Web : nekobot.xyz # "Copy It As You Want But Don't Edit Credits" import requests from uniborg.util import admin_cmd, sudo_cmd, edit_or_reply @borg.on(admin_cmd("ttt ?(.*)")) @borg.on(sudo_cmd("ttt ?(.*)", allow_sudo=True)) async def noobishere(event): reply_to_id = event.message.id if event.reply_to_msg_id: reply_to_id = event.reply_to_msg_id reply = await event.get_reply_message() if event.pattern_match.group(1): ipman = event.pattern_match.group(1) elif reply.text: ipman = reply.message else: await edit_or_reply(event, "Trump : What Should I Tweet For You ?") return url = f"https://nekobot.xyz/api/imagegen?type=trumptweet&text={ipman}" starkgang = requests.get(url=url).json() meikobot = starkgang.get("message") tweetimg = meikobot starkxd = f"Trump Has Tweeted {ipman}" await edit_or_reply(event, "Trump : Wait I Am Tweeting Your Texts") await event.client.send_file(event.chat_id, tweetimg, caption=starkxd, reply_to=reply_to_id)
"hurls", ] HIT = [ "hits", "whacks", "slaps", "smacks", "bashes", ] DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Shinchan User" @bot.on(admin_cmd(pattern="slap ?(.*)", outgoing=True)) @bot.on(sudo_cmd(pattern="slap ?(.*)", allow_sudo=True)) async def who(event): if event.fwd_from: return replied_user = await get_user(event) caption = await slap(replied_user, event) message_id_to_reply = event.message.reply_to_msg_id if not message_id_to_reply: message_id_to_reply = None try: await edit_or_reply(event, caption) except: await edit_or_reply(event, "`Can't slap this nibba !!`")
from telethon.errors import FloodWaitError from telethon.tl import functions from uniborg.util import edit_or_reply, sudo_cmd from userbot import bot as cipherx from userbot.utils import admin_cmd as cipherx_on_cmd from userbot import ALIVE_NAME, CMD_HELP DEL_TIME_OUT = 60 DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Ultimate" @cipherx.on(cipherx_on_cmd(pattern="cipher")) @cipherx.on(sudo_cmd(pattern="cipher", allow_sudo=True)) async def _(event): sed = await edit_or_reply(event, "`sᴛᴀʀᴛɪɴɢ ᴀᴜᴛᴏɴᴀᴍᴇ. ᴘʟᴇᴀsᴇ ᴡᴀɪᴛ...`") if event.fwd_from: return while True: dictionary = { "0": "₀", "1": "₁", "2": "₂", "3": "₃", "4": "₄", "5": "₅", "6": "₆", "7": "₇", "8": "₈",
RUNSREACTS = [ "`Congratulations and BRAVO!`", "`You did it! So proud of you!`", "`This calls for celebrating! Congratulations!`", "`I knew it was only a matter of time. Well done!`", "`Congratulations on your well-deserved success.`", "`Heartfelt congratulations to you.`", "`Warmest congratulations on your achievement.`", "`Congratulations and best wishes for your next adventure!”`", "`So pleased to see you accomplishing great things.`", "`Feeling so much joy for you today. What an impressive achievement!`", ] @Freaky.on(Freaky_on_cmd(pattern="congo")) @Freaky.on(sudo_cmd(pattern="congo", allow_sudo=True)) async def _(event): if event.fwd_from: return bro = random.randint(0, len(RUNSREACTS) - 1) reply_text = RUNSREACTS[bro] await edit_or_reply(event, reply_text) CMD_HELP.update({ "congratulations": "**Congratulations**\ \n\n**Syntax : **`.congo`\ \n**Usage :** This plugin is used to congratulate someone." })
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] @friday.on(friday_on_cmd(pattern="yt(a|v) (.*)")) @friday.on(sudo_cmd(pattern="yt(a|v) (.*)", allow_sudo=True)) 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() friday = await edit_or_reply(v_url, "Trying To Download......") await friday.edit("`Preparing to download...`") if type == "a": opts = { "format": "bestaudio", "addmetadata": True, "key": "FFmpegMetadata", "writethumbnail": True, "prefer_ffmpeg": True, "geo_bypass": True,
Syntax: .eval PythonCode""" # 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/. import inspect import asyncio import io import sys import traceback from telethon import events, errors, functions, types from uniborg.util import friday_on_cmd, edit_or_reply, sudo_cmd @friday.on(friday_on_cmd("eval")) @friday.on(sudo_cmd("eval", allow_sudo=True)) async def _(event): if event.fwd_from: return await edit_or_reply(event, "Processing ...") cmd = event.text.split(" ", maxsplit=1)[1] reply_to_id = event.message.id if event.reply_to_msg_id: reply_to_id = event.reply_to_msg_id 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
time_list[x] = str(time_list[x]) + time_suffix_list[x] if len(time_list) == 4: ping_time += time_list.pop() + ", " time_list.reverse() ping_time += ":".join(time_list) return ping_time DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Slayer" PM_IMG = Config.ALIVE_IMAGE @slayer.on(slayer_on_cmd(pattern=r"alive")) @slayer.on(sudo_cmd(pattern=r"alive", allow_sudo=True)) async def slayer(alive): if alive.fwd_from: return await alive.get_chat() uptime = get_readable_time((time.time() - Lastupdate)) repo = Repo() branch_name = repo.active_branch.name pm_caption = ( "➥ **SLAYER IS:** `ONLINE`\n\n" "➥ **SYSTEMS STATS**\n" f"➥ **Telethon Version:** `{tv}` \n" f"➥ **Python:** `{platform.python_version()}` \n" f"➥ **Uptime** : `{uptime}` \n" "➥ **Database Status:** `Functional`\n" f"➥ **Current Branch** : `{branch_name}`\n"
# # 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 apscheduler.executors.asyncio import AsyncIOExecutor from apscheduler.schedulers.asyncio import AsyncIOScheduler from uniborg.util import WhiteEye_on_cmd, edit_or_reply, sudo_cmd from WhiteEyeUserBot import CMD_HELP from WhiteEyeUserBot.functions.matic_tool import auto_bio, auto_name, auto_pic scheduler = AsyncIOScheduler(executors={"default": AsyncIOExecutor()}) @WhiteEye.on(WhiteEye_on_cmd(pattern="autoname(?: |$)(.*)")) @WhiteEye.on(sudo_cmd(pattern="autoname(?: |$)(.*)", allow_sudo=True)) async def autoname(event): if event.fwd_from: return await edit_or_reply( event, "`Started AutoName Your Name Will Be Changed Every 1 Min, According To TimeZone Given. To Terminate This Process Use .stop Cmd`", ) scheduler.add_job( auto_name, "interval", args=[event.pattern_match.group(1)], minutes=1, id="autoname", )
ExtractorError, GeoRestrictedError, MaxDownloadsReached, PostProcessingError, UnavailableVideoError, XAttrMetadataError, ) from fridaybot.function import progress, humanbytes, time_formatter from fridaybot.function.FastTelethon import upload_file from fridaybot import CMD_HELP from fridaybot.Configs import Config from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd(pattern="ytmusic ?(.*)")) @friday.on(sudo_cmd(pattern="ytmusic ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return urlissed = event.pattern_match.group(1) myself_stark = await edit_or_reply( event, f"`Getting {urlissed} From Youtube Servers. Please Wait.`" ) search = SearchVideos(f"{urlissed}", offset=1, mode="dict", max_results=1) mi = search.result() mio = mi["search_result"] mo = mio[0]["link"] thum = mio[0]["title"] fridayz = mio[0]["id"] thums = mio[0]["channel"] kekme = f"https://img.youtube.com/vi/{fridayz}/hqdefault.jpg"
from uniborg.util import Freaky_on_cmd, sudo_cmd from FreakyUserbot import CMD_HELP logging.basicConfig( format="[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s", level=logging.WARNING) def progress(current, total): logger.info("Downloaded {} of {}\nCompleted {}".format( current, total, (current / total) * 100)) @Freaky.on(Freaky_on_cmd("paste ?(.*)")) @Freaky.on(sudo_cmd("paste ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return datetime.now() if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) input_str = event.pattern_match.group(1) 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, Config.TMP_DOWNLOAD_DIRECTORY,
"""Syntax: .meaning <word>""" from PyDictionary import PyDictionary from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd from fridaybot import CMD_HELP @friday.on(friday_on_cmd("meaning (.*)")) @friday.on(sudo_cmd("meaning (.*)", allow_sudo=True)) async def _(event): omg = await edit_or_reply(event, "Finding Meaning.....") if event.fwd_from: return input_str = event.pattern_match.group(1) dictionary = PyDictionary() a = dictionary.meaning(input_str) try: b = a.get("Noun") except: await omg.edit("Couldn't Find Meaning Of Given Word") messi = "" for x in b: messi += x + "\n" await omg.edit( f"<b> meaning of {input_str} is:-</b>\n{messi}", parse_mode="HTML", )
# along with this program. If not, see <https://www.gnu.org/licenses/>. import asyncio import time from telethon.errors import FloodWaitError from telethon.tl import functions from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd from apscheduler.schedulers.asyncio import AsyncIOScheduler from apscheduler.executors.asyncio import AsyncIOExecutor from fridaybot.function.auto_tools import auto_name, auto_bio, auto_pic from fridaybot import ALIVE_NAME, CMD_HELP scheduler = AsyncIOScheduler(executors={'default': AsyncIOExecutor()}) @friday.on(friday_on_cmd(pattern="autoname(?: |$)(.*)")) @friday.on(sudo_cmd(pattern="autoname(?: |$)(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return sed = await edit_or_reply(event, "`Started AutoName Your Name Will Be Changed Every 1 Min, According To TimeZone Given. To Terminate This Process Use .stop Cmd`") scheduler.add_job(auto_name, 'interval', args=[event.pattern_match.group(1)], minutes=1, id='autoname') @friday.on(friday_on_cmd(pattern="autopic(?: |$)(.*)")) @friday.on(sudo_cmd(pattern="autopic(?: |$)(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return sed = await edit_or_reply(event, "`Started AutoPic Your Name Will Be Changed Every 1 Min, According To TimeZone Given. To Terminate This Process Use .stop Cmd`") scheduler.add_job(auto_pic, 'interval', minutes=1, id='autopic') @friday.on(friday_on_cmd(pattern="autobio(?: |$)(.*)"))
from telethon import events import random, re from uniborg.util import admin_cmd, sudo_cmd, edit_or_reply RUNSREACTS = [ "`Congratulations and BRAVO!`", "`You did it! So proud of you!`", "`This calls for celebrating! Congratulations!`", "`I knew it was only a matter of time. Well done!`", "`Congratulations on your well-deserved success.`", "`Heartfelt congratulations to you.`", "`Warmest congratulations on your achievement.`", "`Congratulations and best wishes for your next adventure!”`", "`So pleased to see you accomplishing great things.`", "`Feeling so much joy for you today. What an impressive achievement!`", ] @borg.on(admin_cmd(pattern="congo")) @borg.on(sudo_cmd(pattern="congo", allow_sudo=True)) async def _(event): if event.fwd_from: return bro = random.randint(0, len(RUNSREACTS) - 1) reply_text = RUNSREACTS[bro] await edit_or_reply(event, reply_text)
Available Commands: .restart .shutdown .reboot""" # This Source Code Form is subject to the terms of the GNU # General Public License, v.3.0. If a copy of the GPL was not distributed with this # file, You can obtain one at https://www.gnu.org/licenses/gpl-3.0.en.html from telethon import events import asyncio import os import sys from uniborg.util import admin_cmd, sudo_cmd @borg.on(admin_cmd(pattern="restart")) @borg.on(sudo_cmd(pattern="restart")) async def _(event): await event.edit("Restarting ▰▱▱▱▱▱▱▱18%...") await asyncio.sleep(1) await event.edit("Restarting ▰▰▰▰▱▱▱▱49.6%...") await asyncio.sleep(1) await event.edit("Restarting ▰▰▰▰▰▰▰▰100%...") await asyncio.sleep(0.1) await event.edit( "Restarted boss....✈ `.king` me or type `.help` or type '.awake' or type '.allive' to check if your DC is online/alive " ) await borg.disconnect() os.execl(sys.executable, sys.executable, *sys.argv) # You probably don't need it but whatever quit()
"""WikiMedia.ORG Syntax: .wikimedia Query""" import requests from uniborg.util import edit_or_reply, WhiteEye_on_cmd, sudo_cmd @WhiteEye.on(WhiteEye_on_cmd(pattern="wikimedia (.*)")) @WhiteEye.on(sudo_cmd(pattern="wikimedia (.*)", allow_sudo=True)) async def _(event): wowsosmart = await edit_or_reply(event, "Wait Finding This Bleeding Media xD") if event.fwd_from: return input_str = event.pattern_match.group(1) url = "https://commons.wikimedia.org/w/api.php?action={}&generator={}&prop=imageinfo&gimlimit={}&redirects=1&titles={}&iiprop={}&format={}".format( "query", "images", "5", input_str, "timestamp|user|url|mime|thumbmime|mediatype", "json", ) r = requests.get(url).json() result = "" results = r["query"]["pages"] for key in results: current_value = results[key] pageid = current_value["pageid"] title = current_value["title"] imageinfo = current_value["imageinfo"][0] timestamp = imageinfo["timestamp"]
.autoname""" import asyncio import time from telethon.errors import FloodWaitError from telethon.tl import functions from uniborg.util import admin_cmd, edit_or_reply, sudo_cmd from userbot import ALIVE_NAME DEL_TIME_OUT = 60 DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "FridayUserbot" @borg.on(admin_cmd(pattern="autoname")) # pylint:disable=E0602 @borg.on(sudo_cmd(pattern="autoname", allow_sudo=True)) async def _(event): sed = await edit_or_reply(event, "`Starting AutoName Please Wait`") if event.fwd_from: return while True: DM = time.strftime("%d-%m-%y") HM = time.strftime("%H:%M") name = f"🕒{HM} ⚡{DEFAULTUSER}⚡ 📅{DM}" logger.info(name)
"`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.`", "`People like you are the reason we have middle fingers.`", "`When your mom dropped you off at the school, she got a ticket for littering.`", "`You’re so ugly that when you cry, the tears roll down the back of your head…just to avoid your face.`", "`If you’re talking behind my back then you’re in a perfect position to kiss my a**!.`", ] # =========================================== @friday.on(friday_on_cmd(pattern="run ?(.*)")) @friday.on(sudo_cmd(pattern="run ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return bro = random.randint(0, len(RUNSREACTS) - 1) event.pattern_match.group(1) reply_text = RUNSREACTS[bro] await edit_or_reply(event, reply_text) @friday.on(friday_on_cmd(pattern="metoo ?(.*)")) @friday.on(sudo_cmd(pattern="metoo ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return bro = random.randint(0, len(METOOSTR) - 1)
# Copyright (c) By Midhun KM [@StarkXD] # I Am Noob # Official Web : nekobot.xyz # "Copy It As You Want But Don't Edit Credits" import requests from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd("ttt ?(.*)")) @friday.on(sudo_cmd("ttt ?(.*)", allow_sudo=True)) async def noobishere(event): reply_to_id = event.message.id if event.reply_to_msg_id: reply_to_id = event.reply_to_msg_id reply = await event.get_reply_message() if event.pattern_match.group(1): ipman = event.pattern_match.group(1) elif reply.text: ipman = reply.message else: await edit_or_reply(event, "Trump : What Should I Tweet For You ?") return url = f"https://nekobot.xyz/api/imagegen?type=trumptweet&text={ipman}" starkgang = requests.get(url=url).json() meikobot = starkgang.get("message") tweetimg = meikobot starkxd = f"Trump Has Tweeted {ipman}" await edit_or_reply(event, "Trump : Wait I Am Tweeting Your Texts") await event.client.send_file(event.chat_id, tweetimg,
pm_caption += "⛄ **Telethon Version:** `1.15.0` \n" pm_caption += "⛄ **Python:** `3.7.4` \n" pm_caption += f"⛄ **Uptime** : `{uptime}` \n" pm_caption += "⛄ **Database Status:** `Functional`\n" pm_caption += "⛄ **Current Branch** : `master`\n" pm_caption += f"⛄ **Version** : `5.0`\n" pm_caption +=f"⛄ **My Boss** : {DEFAULTUSER} \n" pm_caption += "⛄ **Heroku Database** : `AWS - Working Properly`\n\n" pm_caption += "⛄ **License** : [GNU General Public License v3.0](github.com/StarkGang/FridayUserbot/blob/master/LICENSE)\n" pm_caption += "⛄ **Copyright** : By [Bruce Wayne](https://t.me/BruceSL)\n" pm_caption += "⛄ **Check Stats By Doing** `.stat`. \n\n" @friday.on(friday_on_cmd(pattern=r"alive")) @friday.on(sudo_cmd(pattern=r"alive", allow_sudo=True)) async def friday(alive): await alive.get_chat() """ For .alive command, check if the bot is running. """ await borg.send_file(alive.chat_id, PM_IMG, caption=pm_caption) await alive.delete() CMD_HELP.update( { "alive": "**ALive**\ \n\n**Syntax : **`.alive`\ \n**Usage :** Check if UserBot is Alive" } )
Syntax: .eval PythonCode""" # 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/. import io import sys import traceback from uniborg.util import admin_cmd, sudo_cmd from DaisyX import CMD_HELP, eor @borg.on(admin_cmd("eval")) @borg.on(sudo_cmd(pattern="eval", allow_sudo=True)) async def _(event): if event.fwd_from: return await eor(event, "Processing ...") cmd = event.text.split(" ", maxsplit=1)[1] reply_to_id = event.message.id if event.reply_to_msg_id: reply_to_id = event.reply_to_msg_id 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
"""XKCD Search Syntax: .xkcd <search>""" from urllib.parse import quote import requests from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="xkcd ?(.*)")) @friday.on(sudo_cmd(pattern="xkcd ?(.*)", allow_sudo=True)) async def _(event): livinglegend = await edit_or_reply(event, "Oh SeD Pls Wait") if event.fwd_from: return input_str = event.pattern_match.group(1) xkcd_id = None if input_str: if input_str.isdigit(): xkcd_id = input_str else: xkcd_search_url = "https://relevantxkcd.appspot.com/process?" queryresult = requests.get(xkcd_search_url, params={ "action": "xkcd", "query": quote(input_str) }).text xkcd_id = queryresult.split(" ")[2].lstrip("\n") if xkcd_id is None: xkcd_url = "https://xkcd.com/info.0.json"
else: logchat = "Dis-Connected ❌" DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Unknown" PM_IMG = "https://telegra.ph/file/22535f8051a58af113586.jpg" pm_caption = "➥ **FRIDAY IS:** `ONLINE`\n\n" pm_caption += "➥ **SYSTEMS STATS**\n" pm_caption += "➥ **Telethon Version:** `1.15.0` \n" pm_caption += "➥ **Python:** `3.7.4` \n" pm_caption += f"➥ **Uptime** : `{uptime}` \n" pm_caption += "➥ **Database Status:** `Functional`\n" pm_caption += "➥ **OS** : `Slim Buster` \n" pm_caption += "➥ **Current Branch** : `Master`\n" pm_caption += f"➥ **Version** : `{currentversion}`\n" pm_caption += f"➥ **Sudo** : `{amiusingsudo}`\n" pm_caption += f"➥ **Log Connections** : `{logchat}` \n" pm_caption += f"➥ **My Boss** : {DEFAULTUSER} \n" pm_caption += "➥ **Heroku Database** : `AWS - Working Properly`\n\n" pm_caption += "➥ **License** : [GNU General Public License v3.0](github.com/StarkGang/FridayUserbot/blob/master/LICENSE)\n" pm_caption += "➥ **Copyright** : By [StarkGang@Github](GitHub.com/StarkGang)\n" pm_caption += "[Deploy FridayUserbot 🇮🇳](https://telegra.ph/FRIDAY-06-15)" @borg.on(admin_cmd(pattern=r"alive")) @borg.on(sudo_cmd(pattern=r"alive", allow_sudo=True)) async def friday(alive): await alive.get_chat() """ For .alive command, check if the bot is running. """ await borg.send_file(alive.chat_id, PM_IMG, caption=pm_caption) await alive.delete()
from uniborg.util import WhiteEye_on_cmd, sudo_cmd from WhiteEyeUserBot import CMD_HELP logging.basicConfig( format="[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s", level=logging.WARNING) def progress(current, total): logger.info("Downloaded {} of {}\nCompleted {}".format( current, total, (current / total) * 100)) @WhiteEye.on(WhiteEye_on_cmd("paste ?(.*)")) @WhiteEye.on(sudo_cmd("paste ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return datetime.now() if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) input_str = event.pattern_match.group(1) 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, Config.TMP_DOWNLOAD_DIRECTORY,
from telethon.tl.types import InputMediaUploadedPhoto from uniborg.util import admin_cmd, edit_or_reply, sudo_cmd from userbot.plugins.sql_helper.broadcast_sql import ( add_channel, get_all_channels, in_channels, rm_channel, ) from var import Var logs_id = Var.PRIVATE_GROUP_ID @borg.on(admin_cmd("bforward ?(.*)")) @borg.on(sudo_cmd("bforward ?(.*)", allow_sudo=True)) async def forw(event): if event.fwd_from: return if not event.is_reply: await edit_or_reply(event, "Reply to a message to broadcast.") return channels = get_all_channels() await edit_or_reply(event, "Sending...") error_count = 0 sent_count = 0 if event.reply_to_msg_id: previous_message = await event.get_reply_message() previous_message.message previous_message.raw_text error_count = 0
"""XKCD Search Syntax: .xkcd <search>""" from telethon import events import asyncio import json import requests from urllib.parse import quote from uniborg.util import admin_cmd, sudo_cmd, edit_or_reply @borg.on(admin_cmd(pattern="xkcd ?(.*)")) @borg.on(sudo_cmd(pattern="xkcd ?(.*)", allow_sudo=True)) async def _(event): livinglegend = await edit_or_reply(event, "Oh SeD Pls Wait") if event.fwd_from: return input_str = event.pattern_match.group(1) xkcd_id = None if input_str: if input_str.isdigit(): xkcd_id = input_str else: xkcd_search_url = "https://relevantxkcd.appspot.com/process?" queryresult = requests.get(xkcd_search_url, params={ "action": "xkcd", "query": quote(input_str) }).text xkcd_id = queryresult.split(" ")[2].lstrip("\n") if xkcd_id is None: xkcd_url = "https://xkcd.com/info.0.json"