from telethon import functions from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, sudo_cmd """Invite the user(s) to the current chat Syntax: .invite <User(s)>""" from telethon import functions from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd @Freaky.on(Freaky_on_cmd(pattern="invite ?(.*)")) @Freaky.on(sudo_cmd(pattern="invite ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return to_add_users = event.pattern_match.group(1) if event.is_private: await edit_or_reply( event, "`.invite` users to a chat, not to a Private Message" ) else: logger.info(to_add_users) if not event.is_channel and event.is_group: # https://lonamiwebs.github.io/Telethon/methods/messages/add_chat_user.html for user_id in to_add_users.split(" "): try: await borg(
from telethon.tl.types import MessageMediaPhoto from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, sudo_cmd glitcher = ImageGlitcher() DURATION = 200 # Set this to however many centiseconds each frame should be visible for LOOP = 0 # Set this to how many times the gif should loop # LOOP = 0 means infinite loop sedpath = "./FreakyUserbotz/" if not os.path.isdir(sedpath): os.makedirs(sedpath) @Freaky.on(Freaky_on_cmd(pattern=r"glitch")) @Freaky.on(sudo_cmd(pattern=r"glitch", allow_sudo=True)) async def glitch(event): sed = await event.get_reply_message() okbruh = await event.edit("`Gli, Glitchiiingggg.....`") if isinstance(sed.media, MessageMediaPhoto): photolove = await borg.download_media(sed.media, sedpath) elif "image" in response.media.document.mime_type.split("/"): photolove = await borg.download_media(sed.media, sedpath) else: await event.edit("`Reply To Image`") return fmt = "gif" pathsn = f"./FreakyUserbotz/@FreakyUserbot.{fmt}" glitch_imgs = glitcher.glitch_image(photolove, 2, gif=True,
"""Get ID of any Telegram media, or any user Syntax: .get_id""" from telethon.utils import pack_bot_file_id from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd @Freaky.on(Freaky_on_cmd("get_id")) @Freaky.on(sudo_cmd("get_id", allow_sudo=True)) async def _(event): noobfreaksop = await edit_or_reply(event, "Processing") if event.fwd_from: return if event.reply_to_msg_id: await event.get_input_chat() r_msg = await event.get_reply_message() if r_msg.media: bot_api_file_id = pack_bot_file_id(r_msg.media) await noobfreaksop.edit( "Current Chat ID: `{}`\nFrom User ID: `{}`\nBot API File ID: `{}`" .format(str(event.chat_id), str(r_msg.from_id), bot_api_file_id)) else: await noobfreaksop.edit( "Current Chat ID: `{}`\nFrom User ID: `{}`".format( str(event.chat_id), str(r_msg.from_id))) else: await noobfreaksop.edit("Current Chat ID: `{}`".format( str(event.chat_id)))
# You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. import asyncio from telethon.errors.rpcerrorlist import YouBlockedUserError from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, sudo_cmd bot = "@MissRose_bot" @Freaky.on(Freaky_on_cmd(pattern="fstat ?(.*)")) @Freaky.on(sudo_cmd(pattern="fstat ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return ok = await event.edit("`Checking...`") if event.reply_to_msg_id: previous_message = await event.get_reply_message() sysarg = str(previous_message.sender_id) user = f"[user](tg://user?id={sysarg})" else: sysarg = event.pattern_match.group(1) user = sysarg if sysarg == "": await ok.edit( "`Give me someones id, or reply to somones message to check his/her fedstat.`" )
import asyncio import io import time from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd @Freaky.on(Freaky_on_cmd(pattern="bash ?(.*)")) @Freaky.on(sudo_cmd(pattern="bash ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return PROCESS_RUN_TIME = 100 cmd = event.pattern_match.group(1) tflyf = await edit_or_reply(event, "Processing Your Request...") reply_to_id = event.message.id if event.reply_to_msg_id: reply_to_id = event.reply_to_msg_id 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: e = "No Error" o = stdout.decode() if not o: o = "**Tip**: \n`If you want to see the results of your code, I suggest printing them to stdout.`" else: _o = o.split("\n")
"""Get Administrators of any Chat* Syntax: .adminlist""" from telethon.tl.types import ( ChannelParticipantAdmin, ChannelParticipantCreator, ChannelParticipantsAdmins, ) from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd @Freaky.on(Freaky_on_cmd("adminlist ?(.*)")) @Freaky.on(sudo_cmd("adminlist ?(.*)", allow_sudo=True)) async def _(event): admeme = await edit_or_reply(event, "Processing") if event.fwd_from: return mentions = "**Admins in this Channel**: \n" should_mention_admins = False reply_message = None pattern_match_str = event.pattern_match.group(1) if "m" in pattern_match_str: should_mention_admins = True if event.reply_to_msg_id: reply_message = await event.get_reply_message() input_str = event.pattern_match.group(2) to_write_chat = await event.get_input_chat() chat = None if not input_str: chat = to_write_chat
import html 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 FreakyUserbot import CMD_HELP, sclient from FreakyUserbot.modules.sql_helper.gmute_sql import is_gmuted from FreakyUserbot.modules.sql_helper.mute_sql import is_muted from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd @Freaky.on(Freaky_on_cmd("info ?(.*)")) @Freaky.on(sudo_cmd("info ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return replied_user, error_i_a = await get_full_user(event) if replied_user is None: await edit_or_reply(event, str(error_i_a)) return False replied_user_profile_photos = await borg( GetUserPhotosRequest( user_id=replied_user.user.id, offset=42, max_id=0, limit=80 ) ) replied_user_profile_photos_count = "None" try: replied_user_profile_photos_count = replied_user_profile_photos.count except AttributeError:
# credits : @catuserbot17 from asyncio import sleep import requests from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, sudo_cmd @Freaky.on(Freaky_on_cmd(pattern="lmg (.*)")) @Freaky.on(sudo_cmd(pattern="lmg (.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) sample_url = "https://da.gd/s?url=http://google.com/search?q={}".format( input_str.replace(" ", "+")) response_api = requests.get(sample_url).text event = await edit_or_reply(event, "`Searching.....`") await sleep(2) if response_api: await event.edit( "Let me **Google** that for you:\n👉 [{}]({})\n`Thank me later 😉` " .format(input_str, response_api.rstrip())) else: await edit_delete(event, "`Something went wrong. Please try again later.`", 5) @Freaky.on(Freaky_on_cmd(pattern="lmy (.*)"))
# credits: @Mr_Hops from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd @Freaky.on(Freaky_on_cmd(pattern="recognize ?(.*)")) @Freaky.on(sudo_cmd(pattern="recognize ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return if not event.reply_to_msg_id: await edit_or_reply(event, "Reply to any user's media message.") return reply_message = await event.get_reply_message() if not reply_message.media: await edit_or_reply(event, "reply to media file") return chat = "@Rekognition_Bot" if reply_message.sender.bot: await event.edit("Reply to actual users message.") return freak = await edit_or_reply(event, "recognizeing this media") async with event.client.conversation(chat) as conv: try: response = conv.wait_event( events.NewMessage(incoming=True, from_users=461083923)) await event.client.forward_messages(chat, reply_message)
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) # ================================================ @Freaky.on(Freaky_on_cmd(pattern=r"setgpic")) @Freaky.on(sudo_cmd(pattern=r"setgpic", allow_sudo=True)) async def set_group_photo(gpic): """ For .setgpic command, changes the picture of a group """ if not gpic.is_group: await gpic.edit("`I don't think this is a group.`") return replymsg = await gpic.get_reply_message() await gpic.get_chat() photo = None if replymsg and replymsg.media: if isinstance(replymsg.media, MessageMediaPhoto): photo = await gpic.client.download_media(message=replymsg.photo) elif "image" in replymsg.media.document.mime_type.split("/"): photo = await gpic.client.download_file(replymsg.media.document) else: await gpic.edit(INVALID_MEDIA)
time_list.append(int(result)) seconds = int(remainder) for x in range(len(time_list)): 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 @Freaky.on(Freaky_on_cmd(pattern="ping$")) @Freaky.on(sudo_cmd(pattern="ping$", allow_sudo=True)) async def _(event): freakybot = await edit_or_reply(event, "`Pong !`") if event.fwd_from: return start = datetime.now() end = datetime.now() ms = (end - start).microseconds / 1000 uptime = get_readable_time((time.time() - Lastupdate)) await freakybot.edit( f"""**PONG **\n ➲ `{ms}` \n ➲ `{uptime}`""" ) CMD_HELP.update(
"`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 ass!.`", ] # =========================================== @Freaky.on(Freaky_on_cmd(pattern="run ?(.*)")) @Freaky.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) @Freaky.on(Freaky_on_cmd(pattern="metoo ?(.*)")) @Freaky.on(sudo_cmd(pattern="metoo ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return bro = random.randint(0, len(METOOSTR) - 1)
from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd telegraph = Telegraph() tgnoob = telegraph.create_account(short_name="Freaky 🇮🇳") Heroku = heroku3.from_key(Var.HEROKU_API_KEY) heroku_api = "https://api.heroku.com" @Freaky.on( Freaky_on_cmd(pattern="(set|get|del) var(?: |$)(.*)(?: |$)([\s\S]*)", outgoing=True) ) @Freaky.on( sudo_cmd(pattern="(set|get|del) var(?: |$)(.*)(?: |$)([\s\S]*)", allow_sudo=True) ) async def variable(var): """ Manage most of ConfigVars setting, set new var, get current var, or delete var... """ if Var.HEROKU_APP_NAME is not None: app = Heroku.app(Var.HEROKU_APP_NAME) else: return await edit_or_reply( var, "`[HEROKU]:" "\nPlease setup your` **HEROKU_APP_NAME**" ) exe = var.pattern_match.group(1) heroku_var = app.config() if exe == "get":
# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # 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/>. import requests from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd @Freaky.on(Freaky_on_cmd(pattern="pokemon ?(.*)")) @Freaky.on(sudo_cmd(pattern="pokemon ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) url = f"https://starkapi.herokuapp.com/pokedex/{input_str}" r = requests.get(url).json() pokemon = r if pokemon.get("error") is not None: kk = f""" Error: {pokemon.get("error")}""" await edit_or_reply(event, kk) return name = str(pokemon.get("name")) number = str(pokemon.get("number")) species = str(pokemon.get("species"))
# 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.tl.functions.messages import SaveDraftRequest from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd @Freaky.on(Freaky_on_cmd(pattern="chain")) @Freaky.on(sudo_cmd(pattern="chain", allow_sudo=True)) async def _(event): pokemonlub = await edit_or_reply(event, "Counting...") count = -1 message = event.message while message: reply = await message.get_reply_message() if reply is None: await borg( SaveDraftRequest(await event.get_input_chat(), "", reply_to_msg_id=message.id)) message = reply count += 1 await pokemonlub.edit(f"Chain length: {count}") CMD_HELP.update({ "chain": ".chain\nUse- Find the total number of replies to a message and it's origin."
"""DA.GD helpers in @UniBorg Available Commands: .isup URL .dns google.com .url <long url> .unshort <short url>""" import requests from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd @Freaky.on(Freaky_on_cmd("dns (.*)")) @Freaky.on(sudo_cmd("dns (.*)", allow_sudo=True)) async def _(event): freaky = await edit_or_reply(event, "Processing.....") if event.fwd_from: return input_str = event.pattern_match.group(1) sample_url = "https://da.gd/dns/{}".format(input_str) response_api = requests.get(sample_url).text if response_api: await freaky.edit("DNS records of {} are \n{}".format(input_str, response_api)) else: await freaky.edit("i can't seem to find {} on the internet".format(input_str)) @Freaky.on(Freaky_on_cmd("url (.*)")) @Freaky.on(sudo_cmd("dns (.*)", allow_sudo=True)) async def _(event): sofreaky = await edit_or_reply(event, "Processing....")
# Lel, Didn't Get Time To Make New One So Used Plugin Made by @mrconfused and @sandy1709 dont edit credits import io import os import lyricsgenius from tswift import Song from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd GENIUS = os.environ.get("GENIUS_API_TOKEN", None) @Freaky.on(Freaky_on_cmd(outgoing=True, pattern="lyrics (.*)")) @Freaky.on(sudo_cmd(pattern="lyrics (.*)", allow_sudo=True)) async def _(event): await edit_or_reply(event, "Searching For Lyrics.....") 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): query = event.pattern_match.group(1) elif reply.text: query = reply.message else: await edit_or_reply(event, "`What I am Supposed to find `") return song = "" song = Song.find_song(query)
pass def mainne(name, typeo): url = f"https://www.brandcrowd.com/maker/logos?text={name}&searchtext={typeo}&searchService=" r = requests.get(url) soup = BeautifulSoup(r.text, "html.parser") images = soup.findAll("img") random.shuffle(images) if images is not None: print("level 1 pass") folder_create(images) @Freaky.on(Freaky_on_cmd(pattern="(logogen|logo) ?(.*)")) @Freaky.on(sudo_cmd(pattern="(logogen|logo) ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return input_st = event.pattern_match.group(2) Credits = "**By @FreakyUserbot // A Part of @PythonDevs**." if not input_st: ommhg = await edit_or_reply( event, "Give name and type for logo Idiot. like `.logogen messi:football`" ) return input_str = input_st.strip() lmnb = "fjv57hxvujo568yxguhi567ug6ug" token = base64.b64decode( "ZnJvbSBmcmlkYXlib3QuX19pbml0X18gaW1wb3J0IGZyaWRheV9uYW1lDQoNCnByaW50KGZyaWRheV9uYW1lKQ=="
) else: media = None event.message.id if event.reply_to_msg_id: event.reply_to_msg_id await event.reply(snip.reply, file=media) if event.chat_id not in last_triggered_filters: last_triggered_filters[event.chat_id] = [] last_triggered_filters[event.chat_id].append(name) await asyncio.sleep(DELETE_TIMEOUT) last_triggered_filters[event.chat_id].remove(name) @Freaky.on(Freaky_on_cmd(pattern="filter (.*)")) @Freaky.on(sudo_cmd(pattern="filter (.*)", allow_sudo=True)) async def on_snip_save(event): hitler = await edit_or_reply(event, "Processing....") name = event.pattern_match.group(1) msg = await event.get_reply_message() if msg: snip = {"type": TYPE_TEXT, "text": msg.message or ""} if msg.media: media = None if isinstance(msg.media, types.MessageMediaPhoto): media = utils.get_input_photo(msg.media.photo) snip["type"] = TYPE_PHOTO elif isinstance(msg.media, types.MessageMediaDocument): media = utils.get_input_document(msg.media.document) snip["type"] = TYPE_DOCUMENT if media:
"""Get information about an user on GitHub Syntax: .github USERNAME""" import requests from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd @borg.on(Freaky_on_cmd("github (.*)")) @borg.on(sudo_cmd("github (.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) url = "https://api.github.com/users/{}".format(input_str) r = requests.get(url) if r.status_code != 404: b = r.json() avatar_url = b["avatar_url"] html_url = b["html_url"] gh_type = b["type"] name = b["name"] company = b["company"] blog = b["blog"] location = b["location"] bio = b["bio"] created_at = b["created_at"] await borg.send_file( event.chat_id, caption="""Name: [{}]({}) Type: {}
import html import os import spamwatch from telethon.tl.functions.users import GetFullUserRequest from FreakyUserbot.utils import Freaky_on_cmd, sudo_cmd swapi = os.environ.get("SPAMWATCH_API", None) @Freaky.on(Freaky_on_cmd(pattern=f"scan(?: |$)(.*)")) @Freaky.on(sudo_cmd(pattern=f"scan(?: |$)(.*)", allow_sudo=True)) async def _(event): sender = await event.get_sender() me = await event.client.get_me() if not sender.id == me.id: tele = await event.reply("`Processing...`") else: tele = await event.edit("`Processing...`") if event.fwd_from: return tuser, rdhs = await get_full_user(event) if tuser is None: await tele.edit("Error! Please mention user to check his stats!!") return False user_id = tuser.user.id first_name = html.escape(tuser.user.first_name) if first_name is not None: first_name = first_name.replace("\u2060", "") user_bio = tuser.about
import asyncio from FreakyUserbot import ALIVE_NAME, CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "The Freak" @Freaky.on(Freaky_on_cmd(pattern="imp(|n) (.*)", outgoing=True)) @Freaky.on(sudo_cmd(pattern="imp(|n) (.*)", allow_sudo=True)) async def _(event): kraken = bot.uid USERNAME = f"tg://user?id={kraken}" name = event.pattern_match.group(2) cmd = event.pattern_match.group(1).lower() text1 = await edit_or_reply( event, "Hmm... Looks like Something is wrong here🤔🧐!!") await asyncio.sleep(2) await text1.delete() stcr1 = await event.client.send_file(event.chat_id, "CAADAQADRwADnjOcH98isYD5RJTwAg") text2 = await event.reply( f"**[{DEFAULTUSER}]({USERNAME}) :** I have to call discussion😯") await asyncio.sleep(3) await stcr1.delete() await text2.delete() stcr2 = await event.client.send_file(event.chat_id, "CAADAQADRgADnjOcH9odHIXtfgmvAg") text3 = await event.reply( f"**[{DEFAULTUSER}]({USERNAME}) :** We have to eject the imposter or will lose😥 " )
import requests from telethon.tl.types import MessageMediaPhoto from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, sudo_cmd @Freaky.on(Freaky_on_cmd(pattern=r"pcheck")) @Freaky.on(sudo_cmd(pattern=r"pcheck", allow_sudo=True)) async def pcheck(event): url = "https://nsfw-categorize.it/api/upload" await event.edit("`Processing..`") replymsg = await event.get_reply_message() photo = None if replymsg and replymsg.media: if isinstance(replymsg.media, MessageMediaPhoto): photo = await borg.download_media(message=replymsg.photo) elif "image" in replymsg.media.document.mime_type.split("/"): photo = await borg.download_file(replymsg.media.document) else: await event.edit("`Reply To Image.`") if photo: files = {"image": (f"{photo}", open(f"{photo}", "rb"))} r = requests.post(url, files=files).json() if r["status"] == "OK": await event.edit( "This image is classified as " + str(r["data"]["classification"]) ) else: await event.edit("Response UnsucessFull. Try Again.")
""" Created by @Jisan7509 plugin for @FreakyUserbot """ from telethon.errors.rpcerrorlist import YouBlockedUserError from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd @Freaky.on(Freaky_on_cmd(pattern=r"score$")) @Freaky.on(sudo_cmd(pattern=r"score$", allow_sudo=True)) async def _(event): if event.fwd_from: return chat = "@cricbuzz_bot" reply_to_id = event.message freakevent = await edit_or_reply(event, "```Gathering info...```") async with event.client.conversation(chat) as conv: try: msg_start = await conv.send_message("/start") response = await conv.get_response() msg = await conv.send_message("/score") respond = await conv.get_response() await event.client.send_read_acknowledge(conv.chat_id) except YouBlockedUserError: await freakevent.edit("Unblock @cricbuzz_bot & try again") return if respond.text.startswith("I can't find that"): await freakevent.edit("sorry i can't find it")
"""Evaluate Python Code inside Telegram 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 FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd @Freaky.on(Freaky_on_cmd("py")) @Freaky.on(sudo_cmd("py", 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
pm_caption += "**✗ Python:** `3.8.6` \n" pm_caption += f"**✗ Uptime** : `{uptime}` \n\n" pm_caption += ( "**✗ Copyright** : [ProjectHackfreaks](https://t.me/ProjectHackfreaks)\n\n" ) pm_caption += "**✗ License** : [GNU General Public License v3.0](https://github.com/swatv3nub/FreakyUserbot/blob/main/LICENSE)\n\n" pm_caption += "**[✗ Updates](https://t.me/FreakyUserbot)**\n" pm_caption += "**[✗ Support](https://t.meHackfreaksSupport)**\n\n" pm_caption += ( "**[✗ GitHub Repository ✗](https://github.com/swatv3nub/FreakyUserbot/)**\n" ) pm_caption += "**[✗ Deploy Freaky ✗](https://heroku.com/deploy?template=https://github.com/swatv3nub/FreakyUserbot)**" @Freaky.on(Freaky_on_cmd(pattern=r"alive")) @Freaky.on(sudo_cmd(pattern=r"alive", allow_sudo=True)) async def Freaky(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() await alive.delete() CMD_HELP.update({ "alive": "**Alive**\ \n\n**Syntax : **`.alive`\ \n**Usage :** Check if UserBot is Alive" })
import asyncio from datetime import datetime from FreakyUserbot.utils import Freaky_on_cmd, sudo_cmd Hackfreaksthumb = "./resources/FreakyUserbot.png" @Freaky.on(Freaky_on_cmd(pattern="send ?(.*)")) @Freaky.on(sudo_cmd(pattern="send ?(.*)", allow_sudo=True)) async def send(event): if event.fwd_from: return message_id = event.message.id input_str = event.pattern_match.group(1) start = datetime.now() the_plugin_file = "./FreakyUserbot/modules/{}.py".format(input_str) end = datetime.now() (end - start).seconds men = f"Plugin Name - {input_str}.py \nUploaded By Freaky" await event.client.send_file( # pylint:disable=E0602 event.chat_id, the_plugin_file, thumb=Hackfreaksthumb, caption=men, force_document=True, allow_cache=False, reply_to=message_id, ) await asyncio.sleep(5) await event.delete()
"\U0001F800-\U0001F8FF" # Supplemental Arrows-C "\U0001F900-\U0001F9FF" # Supplemental Symbols and Pictographs "\U0001FA00-\U0001FA6F" # Chess Symbols "\U0001FA70-\U0001FAFF" # Symbols and Pictographs Extended-A "\U00002702-\U000027B0" # Dingbats "]+") def deEmojify(inputString: str) -> str: """Remove emojis and other non-safe characters from string""" return re.sub(EMOJI_PATTERN, "", inputString) # @register(outgoing=True, pattern="^.waifu(?: |$)(.*)", allow_sudo=True)) @Freaky.on(Freaky_on_cmd(pattern=r"waifu(?: |$)(.*)")) @Freaky.on(sudo_cmd(pattern=r"waifu(?: |$)(.*)", allow_sudo=True)) async def waifu(animu): # """Creates random anime sticker!""" text = animu.pattern_match.group(1) if not text: if animu.is_reply: text = (await animu.get_reply_message()).message else: await edit_or_reply( animu, "`You haven't written any article, Waifu is going away.`") return animus = [1, 3, 7, 9, 13, 22, 34, 35, 36, 37, 43, 44, 45, 52, 53, 55] sticcers = await bot.inline_query( "stickerizerbot", f"#{random.choice(animus)}{(deEmojify(text))}")
image_stream.seek(0) # finally, reply the sticker await event.client.send_file( event.chat_id, image_stream, caption="FreakyUserbot", reply_to=event.message.reply_to_msg_id, ) # cleanup try: os.remove(FONT_FILE) except: pass @Freaky.on(sudo_cmd(pattern="stcr ?(?:(.*?) \| )?(.*)", allow_sudo=True)) async def sticklet(event): R = random.randint(0, 256) G = random.randint(0, 256) B = random.randint(0, 256) reply_message = event.message # get the input text # the text on which we would like to do the magic on font_file_name = event.pattern_match.group(1) if not font_file_name: font_file_name = "" sticktext = event.pattern_match.group(2) if not sticktext and event.reply_to_msg_id: reply_message = await event.get_reply_message() sticktext = reply_message.message elif not sticktext:
"""Get Administrators of any Chat* Syntax: .get_admin""" from telethon.tl.types import ( ChannelParticipantAdmin, ChannelParticipantCreator, ChannelParticipantsAdmins, ) from FreakyUserbot import CMD_HELP from FreakyUserbot.utils import Freaky_on_cmd, edit_or_reply, sudo_cmd @Freaky.on(Freaky_on_cmd("get_ad?(m)in ?(.*)")) @Freaky.on(sudo_cmd("get_ad?(m)in ?(.*)", allow_sudo=True)) async def _(event): admeme = await edit_or_reply(event, "Processing") if event.fwd_from: return mentions = "**Admins in this Channel**: \n" should_mention_admins = False reply_message = None pattern_match_str = event.pattern_match.group(1) if "m" in pattern_match_str: should_mention_admins = True if event.reply_to_msg_id: reply_message = await event.get_reply_message() input_str = event.pattern_match.group(2) to_write_chat = await event.get_input_chat() chat = None if not input_str: chat = to_write_chat