# Enjoy from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from LEGENDBOT.utils import admin_cmd, edit_or_reply, sudo_cmd from userbot import bot from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern="nhentai(?: |$)(.*)", outgoing=True)) @bot.on(sudo_cmd(pattern="nhentai(?: |$)(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return link = event.pattern_match.group() chat = "@nHentaiBot" await edit_or_reply(event, "```Processing```") async with bot.conversation(chat) as conv: try: response = conv.wait_event( events.NewMessage(incoming=True, from_users=424466890)) await bot.send_message(chat, link) response = await response except YouBlockedUserError: await edit_or_reply( event, "```Please unblock @nHentaiBot and try again```") return if response.text.startswith("**Sorry I couldn't get manga from**"): await edit_or_reply(event, "```I think this is not the right link```")
# ℓєgєи∂ import time from telethon.events import NewMessage from telethon.tl.custom import Dialog from telethon.tl.types import Channel, Chat, User from LEGENDBOT.utils import admin_cmd, edit_or_reply, sudo_cmd from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern="stats$")) @bot.on(sudo_cmd(pattern="stats$", allow_sudo=True)) async def stats( event: NewMessage.Event, ) -> None: # pylint: disable = R0912, R0914, R0915 """Command to get stats about the account""" LEGEND = await edit_or_reply(event, "`Collecting stats...`") start_time = time.time() private_chats = 0 bots = 0 groups = 0 broadcast_channels = 0 admin_in_groups = 0 creator_in_groups = 0 admin_in_broadcast_channels = 0 creator_in_channels = 0 unread_mentions = 0 unread = 0 dialog: Dialog async for dialog in event.client.iter_dialogs():
"""COMMAND : .join , .pay , .work , .push , .aag , .climb, .ohh, .suckit, .lovestory, .bf""" import asyncio import random from telethon.tl.types import ChannelParticipantsAdmins from LEGENDBOT.utils import admin_cmd, edit_or_reply, sudo_cmd from userbot import LOGS from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern="join$", outgoing=True)) @bot.on(sudo_cmd(pattern="join$", allow_sudo=True)) async def _(event): if event.fwd_from: return mentions = "`━━━━━┓ \n┓┓┓┓┓┃\n┓┓┓┓┓┃ ヽ○ノ ⇦ Me When You Joined \n┓┓┓┓┓┃. / \n┓┓┓┓┓┃ ノ) \n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃`" chat = await event.get_input_chat() async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins): mentions += f"" reply_message = None if event.reply_to_msg_id: reply_message = await event.get_reply_message() await reply_message.reply(mentions) else: await edit_or_reply(event, mentions) @bot.on(admin_cmd(pattern="pay$", outgoing=True)) @bot.on(sudo_cmd(pattern="pay$", allow_sudo=True))
def time_formatter(milliseconds: int) -> str: """Inputs time in milliseconds, to get beautified time, as string""" seconds, milliseconds = divmod(int(milliseconds), 1000) minutes, seconds = divmod(seconds, 60) hours, minutes = divmod(minutes, 60) days, hours = divmod(hours, 24) tmp = (((str(days) + " day(s), ") if days else "") + ((str(hours) + " hour(s), ") if hours else "") + ((str(minutes) + " minute(s), ") if minutes else "") + ((str(seconds) + " second(s), ") if seconds else "") + ((str(milliseconds) + " millisecond(s), ") if milliseconds else "")) return tmp[:-2] @bot.on(admin_cmd(pattern="yt(a|v) (.*)")) @bot.on(sudo_cmd(pattern="yt(a|v) (.*)", allow_sudo=True)) async def download_video(v_url): if v_url.fwd_from: return """ For .ytdl command, download media from YouTube and many other sites. """ url = v_url.pattern_match.group(2) type = v_url.pattern_match.group(1).lower() await edit_or_reply(v_url, "`Preparing to download...`") if type == "a": opts = { "format": "bestaudio", "addmetadata":
"""Available Commands: .mf""" from telethon import functions from LEGENDBOT.utils import admin_cmd, edit_or_reply, sudo_cmd from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern=r"dc")) # pylint:disable=E0602 @bot.on(sudo_cmd(pattern=r"dc", allow_sudo=True)) async def _(event): if event.fwd_from: return result = await borg(functions.help.GetNearestDcRequest()) # pylint:disable=E0602 await edit_or_reply(event, result.stringify()) @bot.on(admin_cmd(pattern=r"owner")) # pylint:disable=E0602 @bot.on(sudo_cmd(pattern=r"owner", allow_sudo=True)) 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( """This is my master @The_LegendBoy. Support group~@Legend_Userbot. Channel~@The_LegendBoy""" )
import random from LEGENDBOT.utils import admin_cmd from userbot.cmdhelp import CmdHelp RUNSREACTS = [ "`Aur Bata Bsdk Kar Liya Tunee Party De Chal!`", "`Chal Gand Phad Dunga Udd Mat Abb`", "`Oo Wow Mere Beta Sikh Gaya!`", "`Chall Badhiya Congo`", "`F**k You And Congo.`", "`Mere Ladke Lavde te lashan Akhir Karliya Tune.`", "`Very Good.`", "`Veryy Good Nhi Bulanga Bass Tu Chutiya Hai!”`", "`So pleased to see you accomplishing great things.`", "`Feeling so much joy for you today. What an impressive achievement!`", ] @bot.on(admin_cmd(pattern="chalbsdk")) async def _(event): if event.fwd_from: return bro = random.randint(0, len(RUNSREACTS) - 1) reply_text = RUNSREACTS[bro] await event.edit(reply_text) CmdHelp("congbsdk").add_command("chalbsdk", None, "ask about friend in abuse language").add()
from userbot.Config import Config from userbot.helpers.convert import deEmojify from . import * path = "./legendmify/" if not os.path.isdir(path): os.makedirs(path) from userbot.Config import Config from userbot.helpers.mmf import * lg_id = os.environ.get("LOGGER_ID", None) @bot.on(admin_cmd(pattern="mms ?(.*)", outgoing=True)) @bot.on(sudo_cmd(pattern="mms ?(.*)", allow_sudo=True)) async def _(event): _reply = await event.get_reply_message() msg = event.pattern_match.group(1) if not (_reply and (_reply.media)): legen_ = await eod(event, "`Can't memify this 🥴`") return legend = await _reply.download_media() if legend.endswith((".tgs")): legen_ = await eor(event, "**Memifying 🌚🌝**") cmd = ["lottie_convert.py", legend, "pic.png"] file = "pic.png" process = await asyncio.create_subprocess_exec( *cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE )
import asyncio from LEGENDBOT.utils import admin_cmd, edit_or_reply, sudo_cmd from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern="test ?(.*)")) @bot.on(sudo_cmd(pattern="test ?(.*)", allow_sudo=True)) async def _(event): if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "@", "!"): await edit_or_reply(event, "`Testing LEGENDBOT`") await asyncio.sleep(1) await edit_or_reply(event, "`Testing LEGENDBOT.`") await asyncio.sleep(1) await edit_or_reply(event, "`Testing LEGENDBOT..`") await asyncio.sleep(1) await edit_or_reply(event, "`Testing LEGENDBOT...`") await asyncio.sleep(1) await edit_or_reply(event, "`Testing LEGENDBOT....`") await asyncio.sleep(1) await edit_or_reply(event, "`Testing LEGENDBOT.....`") await asyncio.sleep(2) await edit_or_reply(event, "__Testing Successful__") await asyncio.sleep(2) await edit_or_reply(event, "`Generating Output`\nPlease wait") await asyncio.sleep(2) await edit_or_reply(event, "__Output Generated Successfully__") await asyncio.sleep(2) await edit_or_reply(event,
async def await_read(chat, message): chat = telethon.utils.get_peer_id(chat) async def read_filter(read_event): return read_event.chat_id == chat and read_event.is_read(message) fut = borg.await_event(events.MessageRead(inbox=False), read_filter) if await is_read(borg, chat, message): fut.cancel() return await fut @borg.on(admin_cmd(pattern=r"edit")) @errors_handler async def editer(edit): message = edit.text chat = await edit.get_input_chat() self_id = await edit.client.get_peer_id("me") string = str(message[6:]) i = 1 async for message in edit.client.iter_messages(chat, self_id): if i == 2: await message.edit(string) await edit.delete() break i = i + 1 if BOTLOG: await edit.client.send_message(BOTLOG_CHATID,
# PLUGIN MADE BY DANGEROUSJATT # KEEP CREDIT # MADE FOR LEGENDBOT # BY TEAM LEGENDBOT # NOW IN LEGENDBOT import math from LEGENDBOT.utils import admin_cmd, sudo_cmd from userbot import CmdHelp from userbot import bot as LEGENDBOT @LEGENDBOT.on(admin_cmd(pattern="sin ?(.*)")) @LEGENDBOT.on(sudo_cmd(pattern="sin ?(.*)", allow_sudo=True)) async def findsin(event): input_str = int(event.pattern_match.group(1)) output = math.sin(input_str) await event.edit(f"**Value of Sin** `{input_str}`\n== `{output}`") @LEGENDBOT.on(admin_cmd(pattern="cos ?(.*)")) @LEGENDBOT.on(sudo_cmd(pattern="cos ?(.*)", allow_sudo=True)) async def find_cos(event): input_str = int(event.pattern_match.group(1)) output = math.cos(input_str) await event.edit(f"**Value of Cos** `{input_str}`\n== `{output}`") @LEGENDBOT.on(admin_cmd(pattern="tan ?(.*)")) @LEGENDBOT.on(sudo_cmd(pattern="tan ?(.*)", allow_sudo=True)) async def find_tan(event):
# PLUGIN MADE BY @The_LegendBoy FOR LEGENDBOT # KEEP CREDITS ELSE GAY import asyncio from LEGENDBOT.utils import admin_cmd @borg.on(admin_cmd(pattern="hklove", outgoing=True)) async def _(event): await event.edit( "❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘❤😘" ) await asyncio.sleep(1) await event.edit( "🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘🧡😘" ) await asyncio.sleep(1) await event.edit( "💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘💛😘" ) await asyncio.sleep(1) await event.edit( "💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘💚😘" ) await asyncio.sleep(1) await event.edit( "💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘💙😘" ) await asyncio.sleep(1) await event.edit(
"https://telegra.ph/file/5b4847003c89f3151d3e0.jpg", "https://telegra.ph/file/0a4bfab68252fef687277.jpg", "https://telegra.ph/file/2731bc2a09ae58009818d.jpg", "https://telegra.ph/file/b119e59f4c85a34e9f7b9.jpg", "https://telegra.ph/file/cd9756395d2ddbf68d9fe.jpg", "https://telegra.ph/file/05e2c00d108c1009326d6.jpg", "https://telegra.ph/file/b7d9d1731d5b2e448f790.jpg", "https://telegra.ph/file/c1ab0bf6645f5f3cc6399.jpg", "https://telegra.ph/file/db686e8f6e55fe650be08.jpg", "https://telegra.ph/file/288749fe36ae504dee2f6.jpg", "https://telegra.ph/file/47ee53b082262332cb22f.jpg", "https://telegra.ph/file/4d2e881341df8b77c2bab.jpg", ] @borg.on(admin_cmd(pattern="actiondp ?(.*)")) async def autopic(event): while True: piclink = random.randint(0, len(TELEGRAPH_MEDIA_LINKS) - 1) AUTOPP = TELEGRAPH_MEDIA_LINKS[piclink] downloaded_file_name = "./DOWNLOADS/original_pic.png" downloader = SmartDL(AUTOPP, downloaded_file_name, progress_bar=True) downloader.start(blocking=False) photo = "photo_pfp.png" while not downloader.isFinished(): pass shutil.copy(downloaded_file_name, photo) Image.open(photo) current_time = datetime.now().strftime( "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Time: %H:%M:%S \n Date: %d/%m/%y "
import asyncio import os import subprocess from datetime import datetime from gtts import gTTS from LEGENDBOT.utils import admin_cmd from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern="audios (.*)")) @borg.on(admin_cmd(pattern="audios")) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) start = datetime.now() if event.reply_to_msg_id: previous_message = await event.get_reply_message() text = previous_message.message lan = input_str
from telethon.tl.types import ( ChannelParticipantsKicked, ChatBannedRights, UserStatusEmpty, UserStatusLastMonth, UserStatusLastWeek, UserStatusOffline, UserStatusOnline, UserStatusRecently, ) from LEGENDBOT.utils import admin_cmd, edit_or_reply, sudo_cmd from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern=r"unbanall ?(.*)")) @bot.on(sudo_cmd(pattern=r"unbanall ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) if input_str: logger.info("TODO: Not yet Implemented") else: if event.is_private: return False await edit_or_reply(event, "Searching Participant Lists.") p = 0 async for i in borg.iter_participants(event.chat_id, filter=ChannelParticipantsKicked, aggressive=True):
from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from LEGENDBOT.utils import admin_cmd @bot.on(admin_cmd("grab ?(.*)")) 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 text message```") return chat = "" reply_message.sender if reply_message.sender.bot: await event.edit("```Reply to actual users message.```") return await event.edit("```Processing```") async with bot.conversation(chat) as conv: try: response = conv.wait_event( events.NewMessage(incoming=True, from_users=864838521)) await bot.forward_messages(chat, reply_message) response = await response except YouBlockedUserError: await event.reply(
from . import * file1 = "https://telegra.ph/file/fed9ae859812a1173f39d.mp4" file2 = "https://telegra.ph/file/bd0d9edbd748d8a9a7d02.jpg" file3 = "https://telegra.ph/file/2126757ff2390b7258559.jpg" file4 = "https://telegra.ph/file/72e34dc425cddcdb5855f.jpg" file5 = "https://telegra.ph/file/7ae5961e4022c0b0c3500.jpg" file6 = "https://telegra.ph/file/e6b71c2f7cd63c7b0dadf.jpg" file7 = "https://telegra.ph/file/ccfca771e268034fbfe6a.mp4" edit_time = 10 hello_caption = "__The new year stands before us, like a chapter in a book, waiting to be written. We can help write that story by setting goals.__" @bot.on(admin_cmd(pattern="hppynwyr(.*)")) async def xd(event): await event.edit( "╭╮╱╭╮\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╰╯╱╰━╯\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┃┃┃╰╮\n╰╯╰━╯" ) event.pattern_match.group(1) async for tele in borg.iter_dialogs(): lol = 0 done = 0 if tele.is_group: chat = tele.id try: on = await bot.send_file(chat, file=file1, caption=hello_caption) await asyncio.sleep(edit_time) ok = await bot.edit_message(chat, on, file=file2) await asyncio.sleep(edit_time)
from selenium import webdriver from selenium.webdriver.chrome.options import Options from LEGENDBOT.utils import admin_cmd, edit_or_reply, sudo_cmd from userbot import ALIVE_NAME from userbot.cmdhelp import CmdHelp from userbot.Config import Config from userbot.helpers.funct import deEmojify DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "LEGEND User" CARBONLANG = "auto" LANG = "en" @bot.on(admin_cmd(outgoing=True, pattern="carbon(?: |$)(.*)")) @bot.on(sudo_cmd(pattern="carbon(?: |$)(.*)", allow_sudo=True)) async def carbon_api(e): if e.fwd_from: return """ 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
msg = None message_to_reply = ( f"[{DEFAULTUSER}](tg://user?id={LEGEND}) iѕ Currently Unavailable\n\n•♦️•Ꮮ𝚊𝚜𝚝 𝚂𝚎𝚎𝚗 : `{total_afk_time}`\n" + f"•🗒•Ꭱ𝚎𝚊𝚜𝚘𝚗 : `{reason}`" if reason else f"ᎻᎬᎽ Տιя / Ꮇιѕѕ🤔!\nᏆ αм ϲυяяєиτℓγ υиαναιℓαϐℓє😛. ι яєρℓγ υ αƒτєя ϲοмє ϐαϲκοиℓιиє.\n__Since when, you ask? From__ `{total_afk_time}`\nI'll be back when I feel to come🚶😛" ) msg = await event.reply(message_to_reply, file=LEGENDpic) await asyncio.sleep(2) 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 legend = await event.get_reply_message() 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 global LEGENDpic USER_AFK = {} afk_time = None last_afk_message = {} afk_end = {}
# 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 datetime import datetime import requests from LEGENDBOT.utils import admin_cmd, edit_or_reply, sudo_cmd @bot.on(admin_cmd(pattern="xtools (.*)")) @bot.on(sudo_cmd(pattern="xtools (.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) start = datetime.now() if event.reply_to_msg_id: previous_message = await event.get_reply_message() username = previous_message.message sub_domain = input_str else: sub_domain, username = input_str.split("|") final_url = "https://xtools.wmflabs.org/api/user/simple_editcount/{}.wikipedia.org/{}".format( sub_domain, username) json_string = requests.get(final_url).json() result_text = json_string["liveEditCount"] end = datetime.now() ms = (end - start).seconds output_str = "edit count of {} ({}) in {} seconds. \n {}".format(
from telethon.tl.functions.messages import SendMediaRequest from LEGENDBOT.utils import admin_cmd, edit_or_reply, progress, sudo_cmd from userbot.cmdhelp import CmdHelp from userbot.helpers.convert import parse_pre from ..helpers.exceptions import progress from ..helpers.tools import media_type from ..helpers.utils.fileconvert import * from . import * if not os.path.isdir("./temp"): os.makedirs("./temp") @bot.on(admin_cmd(pattern="stim$")) @bot.on(sudo_cmd(pattern="stim$", allow_sudo=True)) async def _(LEGEND): if LEGEND.fwd_from: return reply_to_id = LEGEND.message.id if LEGEND.reply_to_msg_id: reply_to_id = LEGEND.reply_to_msg_id event = await edit_or_reply(LEGEND, "Converting.....") if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) if event.reply_to_msg_id: filename = "hi.jpg" file_name = filename reply_message = await event.get_reply_message() to_download_directory = Config.TMP_DOWNLOAD_DIRECTORY
def time_formatter(milliseconds: int) -> str: """Inputs time in milliseconds, to get beautified time, as string""" seconds, milliseconds = divmod(int(milliseconds), 1000) minutes, seconds = divmod(seconds, 60) hours, minutes = divmod(minutes, 60) days, hours = divmod(hours, 24) tmp = (((str(days) + " day(s), ") if days else "") + ((str(hours) + " hour(s), ") if hours else "") + ((str(minutes) + " minute(s), ") if minutes else "") + ((str(seconds) + " second(s), ") if seconds else "") + ((str(milliseconds) + " millisecond(s), ") if milliseconds else "")) return tmp[:-2] @bot.on(admin_cmd(pattern=r"download(?: |$)(.*)", outgoing=True)) @bot.on(sudo_cmd(pattern=r"download(?: |$)(.*)", allow_sudo=True)) async def download(target_file): """For .dl command, download files to the userbot's server.""" await target_file.edit("Processing using userbot server ( ◜‿◝ )♡") input_str = target_file.pattern_match.group(1) if not os.path.isdir(TMP_DOWNLOAD_DIRECTORY): os.makedirs(TMP_DOWNLOAD_DIRECTORY) if "|" in input_str: url, file_name = input_str.split("|") url = url.strip() # https://stackoverflow.com/a/761825/4723940 file_name = file_name.strip() head, tail = os.path.split(file_name) if head: if not os.path.isdir(os.path.join(TMP_DOWNLOAD_DIRECTORY, head)):
import asyncio import random from LEGENDBOT.utils import admin_cmd @bot.on(admin_cmd(pattern=f"logic$", outgoing=True)) async def _(event): if event.fwd_from: return await asyncio.sleep(0.5) x = random.randrange(1, 104) if x == 1: await event.edit( '`"Underwater bubbles and raindrops are total opposites of each other."`' ) if x == 2: await event.edit( '`"If you buy an eraser you are literally paying for your mistakes."`' ) if x == 3: await event.edit( '`"The Person you care for most has the potential to destroy you the most."`'
get_all_filters, remove_all_filters, remove_filter, ) DELETE_TIMEOUT = 0 TYPE_TEXT = 0 TYPE_PHOTO = 1 TYPE_DOCUMENT = 2 global last_triggered_filters last_triggered_filters = {} # pylint:disable=E0602 @bot.on(admin_cmd(incoming=True)) async def on_snip(event): global last_triggered_filters name = event.raw_text if event.chat_id in last_triggered_filters: if name in last_triggered_filters[event.chat_id]: # avoid userbot spam # "I demand rights for us bots, we are equal to you humans." -Henri Koivuneva (t.me/UserbotTesting/2698) return False snips = get_all_filters(event.chat_id) if snips: for snip in snips: pattern = r"( |^|[^\w])" + re.escape(snip.keyword) + r"( |$|[^\w])" if re.search(pattern, name, flags=re.IGNORECASE): if snip.snip_type == TYPE_PHOTO: media = types.InputPhoto(
import json import re import urllib.parse from os import popen from random import choice import requests from bs4 import BeautifulSoup from humanize import naturalsize from LEGENDBOT.utils import admin_cmd, edit_or_reply, sudo_cmd from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(outgoing=True, pattern=r"direct(?: |$)([\s\S]*)")) @bot.on(sudo_cmd(allow_sudo=True, pattern=r"direct(?: |$)([\s\S]*)")) async def direct_link_generator(request): if request.fwd_from: return """ direct links generator """ LEGENDevent = await edit_or_reply(request, "`Processing...`") textx = await request.get_reply_message() message = request.pattern_match.group(1) if message: pass elif textx: message = textx.text else: await LEGENDevent.edit("`Usage: .direct <url>`") return
import base64 from subprocess import PIPE from subprocess import run as runapp from LEGENDBOT.utils import admin_cmd, sudo_cmd from userbot import * from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern="hash (.*)", outgoing=True)) @bot.on(sudo_cmd(pattern="hash (.*)", allow_sudo=True)) async def gethash(hash_q): if hash_q.fwd_from: return event = await eor(hash_q, "Processing...") 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() ans = ( "Text: `" + hashtxt_
import asyncio import json import re import aiohttp from bs4 import BeautifulSoup from telethon.utils import get_inner_text from LEGENDBOT.utils import admin_cmd from userbot.cmdhelp import CmdHelp logger.info(Config.OPEN_LOAD_LOGIN) # https://t.me/RoseSupport/33801 @borg.on(admin_cmd(pattern="rl")) async def _(event): if event.fwd_from: return current_message_text = event.raw_text cmt = current_message_text.split(" ") reply_message = await event.get_reply_message() if len(cmt) > 1: list_of_urls = cmt[1:] else: list_of_urls = get_inner_text(reply_message.message, reply_message.entities) converted_links = "" if len(list_of_urls) > 0: converted_links += "Trying to generate IP specific link\n" for a_url in list_of_urls: converted_link_infos = await get_direct_ip_specific_link(a_url)
import asyncio import random from LEGENDBOT.utils import admin_cmd from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern=r"engsongs", outgoing=True)) async def _(event): if event.fwd_from: return await event.edit("Singing...") await asyncio.sleep(2) x = random.randrange(1, 33) if x == 1: await event.edit( "🎶 I'm in love with the shape of you \n We push and pull like a magnet do\n Although my heart is falling too \n I'm in love with your body \n And last night you were in my room \n And now my bedsheets smell like you \n Every day discovering something brand new 🎶 \n 🎶 I'm in love with your body \n Oh—I—oh—I—oh—I—oh—I \n I'm in love with your body \n Oh—I—oh—I—oh—I—oh—I \n I'm in love with your body \n Oh—I—oh—I—oh—I—oh—I \n I'm in love with your body 🎶 \n **-Shape of You**" ) if x == 2: await event.edit( "🎶 I've been reading books of old \n The legends and the myths \n Achilles and his gold \n Hercules and his gifts \n Spiderman's control \n And Batman with his fists \n And clearly I don't see myself upon that list 🎶 \n **-Something Just Like This **" )
import os from datetime import datetime import requests from LEGENDBOT.utils import admin_cmd, edit_or_reply, sudo_cmd from userbot.cmdhelp import CmdHelp @bot.on(admin_cmd(pattern="stt (.*)")) @bot.on(sudo_cmd(pattern="stt (.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return start = datetime.now() input_str = event.pattern_match.group(1) if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) LEGENDevent = await edit_or_reply( event, "Downloading to my local, for analysis 🙇") if event.reply_to_msg_id: previous_message = await event.get_reply_message() required_file_name = await event.client.download_media( previous_message, Config.TMP_DOWNLOAD_DIRECTORY) lan = input_str if (Config.IBM_WATSON_CRED_URL is None or Config.IBM_WATSON_CRED_PASSWORD is None): await LEGENDevent.edit( "You need to set the required ENV variables for this module. \nModule stopping" ) else:
import asyncio from LEGENDBOT.utils import admin_cmd from userbot import * from userbot import ALIVE_NAME from userbot.cmdhelp import CmdHelp DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "LEGEND" @borg.on(admin_cmd(pattern="hbd$")) async def _(event): if event.fwd_from: return animation_interval = 6 animation_ttl = range(0, 17) await event.edit("Starting...") animation_chars = [ "**hello!👋**", "**How Are You?**", f"**{DEFAULTUSER}Happy Birthday**" "[Happy Birthday](http://2.bp.blogspot.com/-WGLaIVbpK6U/WT4sr0LG2TI/AAAAAAAAVX0/1t0F3gECRh4okN6zJzq6fMwQ7dA4Qw8AwCLcB/s1600/happy-birthday-to-you.png)", "**Wishing you 👈 a 👌 day 🌞 filled 😏 with 👏 happiness and 👏 a 👌 year 🎉 filled 😏 with 👏 joy 😁.**", "**Sending you 👈 smiles 😀 for every 👏 moment 🏆 of your special 😲 day 🌞*", "**Have 👏 a 👌 wonderful 😊 time 🕐 and a very 👌 happy 😊 birthday 🎂!**", "**Count your 👏 life 👤 by 😈 smiles, 😀 not 🚫 tears. 😭 Count your 👏 age 👵 by 😈 friends, 👫 not 🚫 years. 📅 Happy 😊 birthday 🎂!**", "**I hope 🙏 all 💯 your 👏 birthday 🎂 wishes and 👏 dreams 🔚 come true. 💯**", "**Another 🔄 adventure filled 😏 year 🎉 awaits you. 👈 Welcome it 💯 by 😈 celebrating 🚫 your 👏 birthday 🎂 with 👏 pomp and 👏 splendor. Wishing you 👈 a 👌 very 👌 happy 😊 and 👏 fun-filled birthday 🎂!**", "**Happy 😊 birthday 🎂 to someone 👤 who 😂 is smart, 👩 gorgeous, 😍 funny 😄 and 👏 reminds me 😭 a 👌 lot of 💦 myself… from 👉 one 😤 fabulous chick 🐣 to another !**", "[For You](http://www.handletheheat.com/wp-content/uploads/2015/03/Best-Birthday-Cake-with-milk-chocolate-buttercream-SQUARE.jpg)", "[For You](http://i.pinimg.com/originals/49/d2/e3/49d2e318a2705cbd300e21023392ff6f.jpg)",
""" It does not do to dwell on dreams and forget to live Syntax: .getime""" import asyncio import os from datetime import datetime from PIL import Image, ImageDraw, ImageFont from LEGENDBOT.utils import admin_cmd, sudo_cmd from userbot.cmdhelp import CmdHelp FONT_FILE_TO_USE = "/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf" @bot.on(admin_cmd(pattern="time ?(.*)", outgoing=True)) # pylint:disable=E0602 @bot.on(sudo_cmd(pattern="time ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return current_time = datetime.now().strftime( "⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡ \nLEGENDBOT TIMEZONE \n LOCATION: India🇮🇳 \n Time: %H:%M:%S \n Date: %d.%m.%y \n⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡" ) start = datetime.now() input_str = event.pattern_match.group(1) reply_msg_id = event.message.id if input_str: current_time = input_str elif event.reply_to_msg_id: previous_message = await event.get_reply_message() reply_msg_id = previous_message.id