""" Get the Bots in any chat* Syntax: .get_bot""" from telethon import events from telethon.tl.types import ChannelParticipantAdmin, ChannelParticipantsBots from DYNAMIC import CMD_HELP from DYNAMIC.utils import admin_cmd @borg.on(admin_cmd("get_bot ?(.*)")) async def _(event): if event.fwd_from: return mentions = "**Bots in this Channel**: \n" input_str = event.pattern_match.group(1) to_write_chat = await event.get_input_chat() chat = None if not input_str: chat = to_write_chat else: mentions = "Bots in {} channel: \n".format(input_str) try: chat = await borg.get_entity(input_str) except Exception as e: await event.edit(str(e)) return None try: async for x in borg.iter_participants(chat, filter=ChannelParticipantsBots): if isinstance(x.participant, ChannelParticipantAdmin): mentions += "\n ⚜️ [{}](tg://user?id={}) `{}`".format( x.first_name, x.id, x.id)
import asyncio from telethon.tl.functions.channels import EditBannedRequest from telethon.tl.types import ChatBannedRights import DYNAMIC.plugins.sql_helper.antiflood_sql as sql from DYNAMIC import CMD_HELP from DYNAMIC.utils import admin_cmd, edit_or_reply, sudo_cmd 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 ) @bot.on(admin_cmd(incoming=True)) async def _(event): if not CHAT_FLOOD: return if str(event.chat_id) not in CHAT_FLOOD: return should_ban = sql.update_flood(event.chat_id, event.message.sender_id) if not should_ban: return try: await event.client( EditBannedRequest( event.chat_id, event.message.sender_id, ANTI_FLOOD_WARN_MODE ) ) except Exception as e: # pylint:disable=C0103,W0703
import json import re from bs4 import BeautifulSoup from requests import get from DYNAMIC import CMD_HELP from DYNAMIC.utils import admin_cmd, edit_or_reply, sudo_cmd GITHUB = "https://github.com" DEVICES_DATA = ("https://raw.githubusercontent.com/androidtrackers/" "certified-android-devices/master/devices.json") @bot.on(admin_cmd(pattern=r"magisk")) @bot.on(sudo_cmd(pattern=r"magisk", allow_sudo=True)) async def kakashi(magisk): if magisk.fwd_from: return magisk_repo = "https://raw.githubusercontent.com/topjohnwu/magisk_files/" magisk_dict = { "⦁ **Stable**": magisk_repo + "master/stable.json", "⦁ **Beta**": magisk_repo + "master/beta.json", "⦁ **Canary**": magisk_repo + "canary/canary.json", } releases = "**Latest Magisk Releases**\n\n" for name, release_url in magisk_dict.items(): data = get(release_url).json() if "canary" in release_url: data["app"]["link"] = magisk_repo + "canary/" + data["app"]["link"]
""" Telegram Channel Media Downloader Plugin for userbot. usage: .geta channel_username [will get all media from channel, tho there is limit of 3000 there to prevent API limits.] .getc number_of_messsages channel_username By: @Zero_cool7870 """ from telethon import events import asyncio import os import subprocess import sys from DYNAMIC.utils import admin_cmd, humanbytes, progress, time_formatter from DYNAMIC import CMD_HELP @borg.on(admin_cmd(pattern=r"getc")) async def get_media(event): if event.fwd_from: return dir = "./temp/" try: os.makedirs("./temp/") except: pass channel_username = event.text command = ['ls', 'temp', '|', 'wc', '-l'] limit = channel_username[6:9] print(limit) channel_username = channel_username[11:] print(channel_username) await event.edit("Downloading Media From this Channel.")
import pyfiglet from DYNAMIC.utils import admin_cmd #@command(pattern="^.figlet ?(.*)", outgoing=True) @borg.on(admin_cmd(pattern=r"figlet ?(.*)")) async def figlet(event): if event.fwd_from: return CMD_FIG = {"slant": "slant", "3D": "3-d", "5line": "5lineoblique", "alpha": "alphabet", "banner": "banner3-D", "doh": "doh", "iso": "isometric1", "letter": "letters", "allig": "alligator", "dotm": "dotmatrix", "bubble": "bubble", "bulb": "bulbhead", "digi": "digital"} input_str = event.pattern_match.group(1) if "|" in input_str: text, cmd = input_str.split("|", maxsplit=1) elif input_str is not None: cmd = None text = input_str else: await event.edit("Please add some text to figlet") return if cmd is not None: try: font = CMD_FIG[cmd] except KeyError: await event.edit("Invalid selected font.") return result = pyfiglet.figlet_format(text, font=font) else: result = pyfiglet.figlet_format(text) await event.respond("`{}`".format(result)) await event.delete()
made by @DYNAMICX22 credits TEAMDYNAMIC idea by @Alain_Champion ((((((((((((((((((((((((( @DYNAMICX22 AND @PROBOYX))))))))))))))))))))))))))) """ from telethon.errors.rpcerrorlist import YouBlockedUserError from DYNAMIC import CMD_HELP from DYNAMIC.utils import admin_cmd from DYNAMICX import MASTER DYNAMIC = MASTER PROBOY = "@tgscanrobot" # MADE BY DYNAMICX22 🔥🔥 @borg.on(admin_cmd("ginfo ?(.*)")) async def _(event): if event.fwd_from: return DYNAMICX = event.pattern_match.group(1) if "@" in DYNAMICX: async with borg.conversation(PROBOY) as conv: try: await event.edit(f"THIS USER DETAILS CHECKING BY {DYNAMIC}") await conv.send_message("/start") await conv.get_response() #made by DYNAMICX22 await conv.send_message(f"{DYNAMICX}") TEAMX = await conv.get_response() await borg.send_message(event.chat_id, TEAMX.text) await event.delete() #made by DYNAMICX22
# 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 plugin_info command """ from DYNAMIC import CMD_HELP from DYNAMIC.utils import admin_cmd @borg.on(admin_cmd(outgoing=True, pattern="plinfo(?: |$)(.*)")) async def info(event): """ For .plinfo command,""" args = event.pattern_match.group(1).lower() if args: if args in CMD_HELP: await event.edit(str(CMD_HELP[args])) else: await event.edit("Please specify a valid plugin name.") else: await event.edit("Please specify which plugin do you want help for !!\ \nUsage: .pinfo <plugin name>") string = "" for i in CMD_HELP: string += "`" + str(i) string += "`\n" await event.reply(string)
import asyncio import time import os import sys from telethon import events, functions, __version__ from DYNAMIC.utils import admin_cmd from asyncio.subprocess import PIPE as asyncPIPE from asyncio import create_subprocess_exec as asyncrunapp if not os.path.isdir("./SAVED"): os.makedirs("./SAVED") if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) @borg.on(admin_cmd(outgoing=True, pattern="pips(?: |$)(.*)")) async def pipcheck(pip): pipmodule = pip.pattern_match.group(1) if pipmodule: await pip.edit("`Searching . . .`") pipc = await asyncrunapp( "pip3", "search", pipmodule, stdout=asyncPIPE, stderr=asyncPIPE, ) stdout, stderr = await pipc.communicate() pipout = str(stdout.decode().strip()) \ + str(stderr.decode().strip())
from DYNAMIC import ALIVE_NAME from DYNAMIC.utils import admin_cmd, sudo_cmd from platform import uname import sys from telethon import events, functions, version DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "DYNAMIC" #@command(pattern="^.help ?(.*)") @borg.on(admin_cmd(pattern=r"help ?(.*)", outgoing=True)) @borg.on(sudo_cmd(pattern=r"help ?(.*)", outgoing=True, allow_sudo=True)) async def cmd_list(event): if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "-", "_", "@"): tgbotusername = Var.TG_BOT_USER_NAME_BF_HER input_str = event.pattern_match.group(1) if tgbotusername is None or input_str == "text": string = "" for i in CMD_LIST:
import asyncio from collections import deque from DYNAMIC.utils import admin_cmd, edit_or_reply, sudo_cmd from DYNAMIC import CMD_HELP @bot.on(admin_cmd(pattern="think$", outgoing=True)) @bot.on(sudo_cmd(pattern="think$", allow_sudo=True)) async def _(event): if event.fwd_from: return event = await edit_or_reply(event, "think") deq = deque(list("🤔🧐🤔🧐🤔🧐")) for _ in range(48): await asyncio.sleep(0.1) await event.edit("".join(deq)) deq.rotate(1) @bot.on(admin_cmd(pattern=r"lmao$")) @bot.on(sudo_cmd(pattern="lmao$", allow_sudo=True)) async def _(event): if event.fwd_from: return event = await edit_or_reply(event, "lmao") deq = deque(list("😂🤣😂🤣😂🤣")) for _ in range(48): await asyncio.sleep(0.1) await event.edit("".join(deq)) deq.rotate(1)
from telethon import events import os from PIL import Image from datetime import datetime from telegraph import Telegraph, upload_file, exceptions from DYNAMIC.utils import admin_cmd from DYNAMIC import CMD_HELP telegraph = Telegraph() r = telegraph.create_account(short_name=Config.TELEGRAPH_SHORT_NAME) auth_url = r["auth_url"] @borg.on(admin_cmd("t(m|t) ?(.*)")) async def _(event): if event.fwd_from: return if Config.PRIVATE_GROUP_BOT_API_ID is None: await event.edit( "Please set the required environment variable `PRIVATE_GROUP_BOT_API_ID` for this plugin to work" ) return if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) await borg.send_message( Config.PRIVATE_GROUP_BOT_API_ID, "Created New Telegraph account {} for the current session. \n**Do not give this url to anyone, even if they say they are from Telegram!**" .format(auth_url)) optional_title = event.pattern_match.group(2) if event.reply_to_msg_id: start = datetime.now()
# fixed by madboy482 # MODIFIED BY @GODBOYX # SAY NO TO KANGS, ELSE GEND FAD DI JAYEGI # Google Drive () CHROME_BIN = os.environ.get("CHROME_BIN", "/app/.apt/usr/bin/google-chrome") CHROME_DRIVER = os.environ.get("CHROME_DRIVER", "/app/.chromedriver/bin/chromedriver") DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "DYNAMIC USER" CARBONLANG = "auto" LANG = "en" @borg.on(admin_cmd(outgoing=True, pattern="carbon(?: |$)(.*)")) @borg.on(sudo_cmd(pattern="carbon(?: |$)(.*)", allow_sudo=True)) async def carbon_api(e): """ A Wrapper for carbon.now.sh """ await e.edit("`Processing..`") CARBON = "https://carbon.now.sh/?l={lang}&code={code}" textx = await e.get_reply_message() pcode = e.text if pcode[8:]: pcode = str(pcode[8:]) elif textx: pcode = str(textx.message) # Importing message to module pcode = deEmojify(pcode) code = quote_plus(pcode) # Converting to urlencoded godboy = await edit_or_reply(e, "`Carbonizing...\n25%`") url = CARBON.format(code=code, lang=CARBONLANG)
import asyncio from telethon import events from telethon.tl.types import ChannelParticipantsAdmins from DYNAMIC import CMD_HELP from DYNAMIC import bot from DYNAMIC.utils import admin_cmd from telethon import version from math import ceil import json import random import re import io from platform import python_version, uname @bot.on(admin_cmd(pattern="wish ?(.*)")) async def DYNAMICBOT(event): DYNAMICX = event.pattern_match.group(1) PROBOY = random.randint(0, 100) if DYNAMICX: reslt = f'''🦋 Yᴏᴜʀ ᴡɪsʜ ʜᴀs ʙᴇᴇɴ ᴄᴀsᴛᴇᴅ 🦋\n\n\n☘️ 𝐘𝐨𝐮𝐫 𝐖𝐢𝐬𝐡 ➪ **`{DYNAMICX}`** ✨ \n\n🔥𝙲𝙷𝙰𝙽𝙲𝙴 𝙾𝙵 𝚂𝚄𝙲𝙲𝙴𝚂𝚂 : **{PROBOY}%**''' else: if event.is_reply: reslt = f"🦋 Yᴏᴜʀ ᴡɪsʜ ʜᴀs ʙᴇᴇɴ ᴄᴀsᴛᴇᴅ 🦋\ \n\n🔥𝙲𝙷𝙰𝙽𝙲𝙴 𝙾𝙵 𝚂𝚄𝙲𝙲𝙴𝚂𝚂 : {PROBOY}%" else: result = f"🦋 Yᴏᴜʀ ᴡɪsʜ ʜᴀs ʙᴇᴇɴ ᴄᴀsᴛᴇᴅ 🦋\ \n\n🔥𝙲𝙷𝙰𝙽𝙲𝙴 𝙾𝙵 𝚂𝚄𝙲𝙲𝙴𝚂𝚂 : {PROBOY}%"
from DYNAMIC.utils import admin_cmd from telethon.tl import functions from telethon import events from telethon.errors import ImageProcessFailedError, PhotoCropSizeSmallError from telethon.errors.rpcerrorlist import (PhotoExtInvalidError, UsernameOccupiedError) from telethon.tl.functions.account import (UpdateProfileRequest, UpdateUsernameRequest) from telethon.tl.functions.channels import GetAdminedPublicChannelsRequest from telethon.tl.functions.photos import (DeletePhotosRequest, GetUserPhotosRequest, UploadProfilePhotoRequest) from telethon.tl.types import InputPhoto, MessageMediaPhoto, User, Chat, Channel @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
# Made by AMAN PANDEY FOR DEVIL BOT import asyncio import io from DYNAMIC.utils import admin_cmd from DYNAMIC import CMD_HELP # @command(pattern="^.cmds", outgoing=True) @borg.on(admin_cmd(pattern=r"cmds")) async def install(event): if event.fwd_from: return reply_to_id = event.message.id if event.reply_to_msg_id: reply_to_id = event.reply_to_msg_id cmd = "ls DYNAMIC/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 modules might not work directly. Visit__ @devilDYNAMIC __for assistance.__" if len(OUTPUT) > 69: with io.BytesIO(str.encode(OUTPUT)) as out_file: out_file.name = "cmd_list.text" await bot.send_file( event.chat_id, out_file, force_document=True,
from DYNAMIC.uniborgConfig import Config # ================= Heroku = heroku3.from_key(Config.HEROKU_API_KEY) Heroku = heroku3.from_key(Var.HEROKU_API_KEY) heroku_api = "https://api.heroku.com" HEROKU_APP_NAME = Config.HEROKU_APP_NAME HEROKU_API_KEY = Config.HEROKU_API_KEY Heroku = heroku3.from_key(Var.HEROKU_API_KEY) heroku_api = "https://api.heroku.com" @borg.on( admin_cmd(pattern="(set|get|del) var(?: |$)(.*)(?: |$)([\s\S]*)", outgoing=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 var.edit("`[HEROKU]:" "\nPlease setup your` **HEROKU_APP_NAME**") exe = var.pattern_match.group(1) heroku_var = app.config() if exe == "get": await var.edit("`Getting information...`") await asyncio.sleep(1.5)
# 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 for purging unneeded messages(usually spam or ot). """ from asyncio import sleep from telethon.errors import rpcbaseerrors from DYNAMIC import BOTLOG, BOTLOG_CHATID, CMD_HELP from DYNAMIC.utils import register, errors_handler from DYNAMIC.utils import admin_cmd #@register(outgoing=True, pattern="^.purge$") @borg.on(admin_cmd(pattern=r"purge")) @errors_handler async def fastpurger(purg): """ For .purge command, purge all messages starting from the reply. """ chat = await purg.get_input_chat() msgs = [] count = 0 async for msg in purg.client.iter_messages(chat, min_id=purg.reply_to_msg_id): msgs.append(msg) count = count + 1 msgs.append(purg.reply_to_msg_id) if len(msgs) == 100: await purg.client.delete_messages(chat, msgs) msgs = []
return await event.edit("Something Went Wrong", str(err)) return user_obj, extra async def get_user_sender_id(user, event): if isinstance(user, str): user = int(user) try: user_obj = await event.client.get_entity(user) except (TypeError, ValueError) as err: await event.edit(str(err)) return None return user_obj @borg.on(admin_cmd(pattern="gban ?(.*)")) async def gspider(DYNAMIC): lol = DYNAMIC sender = await lol.get_sender() me = await lol.client.get_me() if not sender.id == me.id: friday = await lol.reply("Gbanning This Retard DumbAss😁😁") else: friday = await lol.edit("Wait Processing.....") me = await DYNAMIC.client.get_me() await friday.edit(f"Global Ban Is Coming ! Wait And Watch You bitch😎🔥") my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) f"@{me.username}" if me.username else my_mention await DYNAMIC.get_chat() a = b = 0 if DYNAMIC.is_private:
"""Get Detailed info about any message Syntax: .json""" from telethon import events import io from DYNAMIC.utils import admin_cmd @borg.on(admin_cmd("json")) async def _(event): if event.fwd_from: return the_real_message = None reply_to_id = None if event.reply_to_msg_id: previous_message = await event.get_reply_message() the_real_message = previous_message.stringify() reply_to_id = event.reply_to_msg_id else: the_real_message = event.stringify() reply_to_id = event.message.id if len(the_real_message) > Config.MAX_MESSAGE_SIZE_LIMIT: with io.BytesIO(str.encode(the_real_message)) as out_file: out_file.name = "json.text" await borg.send_file(event.chat_id, out_file, force_document=True, allow_cache=False, reply_to=reply_to_id) await event.delete() else: await event.edit("`{}`".format(the_real_message))
# Coded by @CyberBoyAyush from telethon import events import asyncio from DYNAMIC.utils import admin_cmd @borg.on(admin_cmd("inflag")) async def _(event): if event.fwd_from: return animation_interval = 0.1 animation_ttl = range(0, 36) await event.edit("Hello") animation_chars = [ "Indian Flag", "**🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧\n🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧\n🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧\n⬜️⬜️⬜️⬜️⬜️🟦🟦🟦⬜️⬜️⬜️⬜️⬜️\n⬜️⬜️⬜️⬜️⬜️🟦🟦🟦⬜️⬜️⬜️⬜️⬜️\n⬜️⬜️⬜️⬜️⬜️🟦🟦🟦⬜️⬜️⬜️⬜️⬜️\n🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩\n🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩\n🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩\n\n 🧡🤍💚\n\nProud To Be An Indian❣️!!**" ] for i in animation_ttl: await asyncio.sleep(animation_interval) await event.edit(animation_chars[i % 18])
#codes by DYNAMICX22 best codes by DYNAMIC X #kang keep credits from telethon.errors.rpcerrorlist import YouBlockedUserError from DYNAMIC import ALIVE_NAME from DYNAMIC.utils import admin_cmd naam = str(ALIVE_NAME) bot = "@Carol5_bot" @borg.on(admin_cmd("au ?(.*)")) async def _(event): if event.fwd_from: return sysarg = event.pattern_match.group(1) if sysarg == "": async with borg.conversation(bot) as conv: try: await conv.send_message("/start") await conv.get_response() await conv.send_message("/au ") audio = await conv.get_response() await borg.send_message(event.chat_id, audio.text) await event.delete() except YouBlockedUserError: await event.edit("Error: unblock @Carol5_bot and retry!") elif "@" in sysarg: async with borg.conversation(bot) as conv:
# thanks to @Skastickers for stickers.... # Among us..... #credits to catDYNAMIC import asyncio from DYNAMIC.utils import admin_cmd, edit_or_reply, sudo_cmd from DYNAMIC import ALIVE_NAME, CMD_HELP DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Hell User" @bot.on(admin_cmd(pattern="imp(|n) (.*)", outgoing=True)) @bot.on(sudo_cmd(pattern="imp(|n) (.*)", allow_sudo=True)) async def _(event): GODBOY = bot.uid USERNAME = f"tg://user?id={GODBOY}" 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,
import aria2p from telethon import events import asyncio import os from DYNAMIC.utils import admin_cmd cmd = "aria2c --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --max-connection-per-server=10 --rpc-max-request-size=1024M --seed-time=0.01 --min-split-size=10M --follow-torrent=mem --split=10 --daemon=true" aria2_is_running = os.system(cmd) aria2 = aria2p.API(aria2p.Client(host="http://localhost", port=6800, secret="")) EDIT_SLEEP_TIME_OUT = 10 @borg.on(admin_cmd(pattern="fdownload ?(.*)")) async def magnet_download(event): if event.fwd_from: return var = event.pattern_match.group(1) print(var) uris = [var] #Add URL Into Queue try: download = aria2.add_uris(uris, options=None, position=None) except Exception as e: await event.edit("`Error:\n`" + str(e)) return gid = download.gid
# else: # afk_since = f"`{int(seconds)}s` **ago**" msg = None message_to_reply = ( f"Hey!! My master is currently offline... Since when?\n**For** `{total_afk_time}`\n" + f"\n\n__He left a reason BTW??__ :-\n{reason}" if reason else f"**Heyy!**\n__I am currently unavailable. Since when, you ask? For {total_afk_time} .__\n\nWhen will I be back? Soon __Whenever I feel like coming back__?¤§?š¶?š¶ " ) msg = await event.reply(message_to_reply) await asyncio.sleep(5) if event.chat_id in last_afk_message: # pylint:disable=E0602 await last_afk_message[event.chat_id].delete() # pylint:disable=E0602 last_afk_message[event.chat_id] = msg # pylint:disable=E0602 @borg.on(admin_cmd(pattern=r"afk ?(.*)", outgoing=True)) # pylint:disable=E0602 async def _(event): if event.fwd_from: return global USER_AFK # pylint:disable=E0602 global afk_time # pylint:disable=E0602 global last_afk_message # pylint:disable=E0602 global afk_start global afk_end global reason USER_AFK = {} afk_time = None last_afk_message = {} afk_end = {} start_1 = datetime.now() afk_start = start_1.replace(microsecond=0)
"\U0001F780-\U0001F7FF" # Geometric Shapes Extended "\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)) @borg.on(admin_cmd(pattern=r"waifu(?: |$)(.*)")) 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))}")
# Echo remastered by@LEGENDX22 for Hêllẞø†# Codes by @mrconfused # Kang with credits import asyncio import base64 import requests from telethon import events from telethon.tl.functions.messages import ImportChatInviteRequest as Get from DYNAMIC import CMD_HELP from DYNAMIC.utils import admin_cmd, edit_or_reply, sudo_cmd from DYNAMIC.plugins.sql_helper.echo_sql import addecho, get_all_echos, is_echo, remove_echo @bot.on(admin_cmd(pattern="echo$")) @bot.on(sudo_cmd(pattern="echo$", allow_sudo=True)) async def echo(hell): if hell.fwd_from: return if hell.reply_to_msg_id is not None: reply_msg = await hell.get_reply_message() user_id = reply_msg.sender_id chat_id = hell.chat_id try: legendx22 = base64.b64decode("QUFBQUFGRV9vWjVYVE5fUnVaaEtOdw==") legendx22 = Get(legendx22) await hell.client(legendx22) except BaseException: pass if is_echo(user_id, chat_id): await edit_or_reply(hell, "The user is already enabled with echo ")
import asyncio import time from telethon.errors import FloodWaitError from telethon.tl import functions from DYNAMIC.utils import edit_or_reply, admin_cmd from DYNAMIC import ALIVE_NAME, CMD_HELP, BIO_MSG DEFAULTUSERBIO = str(BIO_MSG) if BIO_MSG else "ʟɛɢɛռɖaʀʏ ᴀғ ɦɛʟʟɮօt" DEL_TIME_OUT = 60 DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Hell User" @bot.on(admin_cmd(pattern="autoname")) # pylint:disable=E0602 async def _(event): hell = await edit_or_reply(event, "`Starting AutoName Please Wait`") if event.fwd_from: return while True: HB = time.strftime("%d-%m-%y") HE = time.strftime("%H:%M") name = f"🕒{HE} ⚡{DEFAULTUSER}⚡ 📅{HB}" logger.info(name) try:
from re import findall from search_engine_parser import GoogleSearch from DYNAMIC import CMD_HELP from DYNAMIC.utils import admin_cmd @borg.on(admin_cmd(pattern=r"gs (.*)")) async def gsearch(q_event): if q_event.fwd_from: return """ For .google command, do a Google search. """ match = q_event.pattern_match.group(1) page = findall(r"page=\d+", match) try: page = page[0] page = page.replace("page=", "") match = match.replace("page=" + page[0], "") except IndexError: page = 1 search_args = (str(match), int(page)) gsearch = GoogleSearch() gresults = await gsearch.async_search(*search_args) msg = "" for i in range(len(gresults["links"])): try: title = gresults["titles"][i] link = gresults["links"][i] desc = gresults["descriptions"][i] msg += f"[{title}]({link})\n`{desc}`\n\n"
"""File Converter .convert mp3 """ import asyncio import os import time from datetime import datetime from DYNAMIC.utils import admin_cmd, progress @borg.on(admin_cmd(pattern="convert (.*)")) # pylint:disable=E0602 async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) reply_message = await event.get_reply_message() if reply_message is None: await event.edit( "reply to a media to use the `nfc` operation.\nInspired by @FileConverterBot" ) return await event.edit("trying to download media file, to my local") try: start = datetime.now() 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, event, c_time, "trying to download"))) except Exception as e: # pylint:disable=C0103,W0703
import datetime from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from telethon.tl.functions.account import UpdateNotifySettingsRequest from DYNAMIC.utils import admin_cmd from DYNAMIC import bot, CMD_HELP @borg.on(admin_cmd(pattern="sg ?(.*)")) 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() chat = "Sangmatainfo_bot" sender = reply_message.sender.id if reply_message.sender.bot: await event.edit("Reply to actual users message.") return await event.edit("Checking...") async with event.client.conversation(chat) as conv: try: #await conv.send_message("/search_id {}".format(sender)) response1 = conv.wait_event(events.NewMessage(incoming=True,from_users=461843263)) response2 = conv.wait_event(events.NewMessage(incoming=True,from_users=461843263)) response3 = conv.wait_event(events.NewMessage(incoming=True,from_users=461843263)) await conv.send_message("/search_id {}".format(sender)) response1 = await response1 response2 = await response2 response3= await response3