Example #1
0
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))}")
    await sticcers[0].click(
        animu.chat_id,
        reply_to=animu.reply_to_msg_id,
        silent=True if animu.is_reply else False,
        hide_via=True,
    )
    await animu.delete()

    CMD_HELP.update({"waifu": ".waifu : Anime that makes your writing fun."})
Example #2
0
                    await borg.send_message(event.chat_id, audio.text)
                await event.delete()
            except YouBlockedUserError:
                await ok.edit(
                    "**Error**\n `Unblock` @MissRose_Bot `and try again!")


@borg.on(admin_cmd(pattern="fedinfo ?(.*)"))
async def _(event):
    if event.fwd_from:
        return
    ok = await event.edit("`Extracting information...`")
    sysarg = event.pattern_match.group(1)
    async with borg.conversation(bot) as conv:
        try:
            await conv.send_message("/start")
            await conv.get_response()
            await conv.send_message("/fedinfo " + sysarg)
            audio = await conv.get_response()
            await ok.edit(audio.text + "\n\nFedInfo Excracted by DEVILBOT")
        except YouBlockedUserError:
            await ok.edit("**Error**\n `Unblock` @MissRose_Bot `and try again!"
                          )


CMD_HELP.update({
    "fedstuff":
    ".fstat <username/userid/reply to user>\nUse - To check the persons fedban stat in @MissRose_Bot.\
        \n\n.fedinfo <fedid>\nUse - To see info about the fed."
})
Example #3
0
    if url.status_code == 404:
        reply = f"`Couldn't find twrp downloads for {device}!`\n"
        await edit_or_reply(request, reply)
        return
    page = BeautifulSoup(url.content, "lxml")
    download = page.find("table").find("tr").find("a")
    dl_link = f"https://dl.twrp.me{download['href']}"
    dl_file = download.text
    size = page.find("span", {"class": "filesize"}).text
    date = page.find("em").text.strip()
    reply = (f"**Latest TWRP for {device}:**\n"
             f"[{dl_file}]({dl_link}) - __{size}__\n"
             f"**Updated:** __{date}__\n")
    await edit_or_reply(request, reply)


CMD_HELP.update({
    "android":
    "**Plugin : **`android`\
\n\n  •  **Syntax : **`.magisk`\
\n  •  **Function :** __Get latest Magisk releases__\
\n\n  •  **Syntax : **`.device <codename>`\
\n  •  **Function :** __Get info about android device codename or model.__\
\n\n  •  **Syntax : **`.codename <brand> <device>`\
\n  •  **Function :** __Search for android device codename.__\
\n\n  •  **Syntax : **`.specs <brand> <device>`\
\n  •  **Function :** __Get device specifications info.__\
\n\n  •  **Syntax : **`.twrp <codename>`\
\n  •  **Function : **__Get latest twrp download for android device.__"
})
Example #4
0
                event.message.sender_id
            ),
            reply_to=event.message.id,
        )


@bot.on(admin_cmd(pattern="setflood(?: |$)(.*)"))
@bot.on(sudo_cmd(pattern="setflood(?: |$)(.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    event = await edit_or_reply(event, "updating flood settings!")
    try:
        sql.set_flood(event.chat_id, input_str)
        sql.__load_flood_settings()
        await event.edit(
            "Antiflood updated to {} in the current chat".format(input_str)
        )
    except Exception as e:  # pylint:disable=C0103,W0703
        await event.edit(str(e))


CMD_HELP.update(
    {
        "antiflood": ".setflood [number]\
\nUsage: warns the user if he spams the chat and if you are an admin then it mutes him in that group.\
"
    }
)
    command = ['ls', 'temp', '|', 'wc', '-l']
    channel_username = channel_username[7:]

    print(channel_username)
    await event.edit("Downloading All Media From this Channel.")
    msgs = await borg.get_messages(channel_username, limit=3000)
    with open('log.txt', 'w') as f:
        f.write(str(msgs))
    for msg in msgs:
        if msg.media is not None:
            await borg.download_media(msg, dir)
    ps = subprocess.Popen(('ls', 'temp'), stdout=subprocess.PIPE)
    output = subprocess.check_output(('wc', '-l'), stdin=ps.stdout)
    ps.wait()
    output = str(output)
    output = output.replace("b'", "")
    output = output.replace("\n'", "")
    await event.edit("Downloaded " + output + " files.")


CMD_HELP.update({
    "channel_download":
    f"""**Plugin : **`channel_download`
**Telegram Channel Media Downloader Plugin for userbot.**
  • **Syntax : **`.geta channel_username` 
  • **Function : **__will  download all media from channel into your bot server but there is limit of 3000 to prevent API limits.__
  
  • **Syntax : **`.getc number channel_username` 
  • **Function : **__will  download latest given number of media from channel into your bot server .__"""
})
Example #6
0
async def _(event):
    if not event.message.is_reply:
        who = await event.get_chat()
    else:
        msg = await event.message.get_reply_message()
        if msg.forward:
            # FIXME forward privacy memes
            who = await borg.get_entity(msg.forward.sender_id
                                        or msg.forward.channel_id)
        else:
            who = await msg.get_sender()

    await event.edit(get_who_string(who), parse_mode='html')


@borg.on(events.NewMessage(pattern=r"\.members", outgoing=True))
async def _(event):
    members = [
        get_who_string(m) async for m in borg.iter_participants(event.chat_id)
    ]

    await event.edit("\n".join(members), parse_mode='html')


CMD_HELP.update({
    "who":
    "**Plugin : **`who`\
    \n\n**Syntax : **`.members`\
    \n**Function : **meko khud ni pta khud check krlo 😑"
})
Example #7
0
    """ For .sd command, make seflf-destructable messages. """
    message = destroy.text
    counter = int(message[4:6])
    text = str(destroy.text[6:])
    await destroy.delete()
    smsg = await destroy.client.send_message(destroy.chat_id, text)
    await sleep(counter)
    await smsg.delete()
    if BOTLOG:
        await destroy.client.send_message(BOTLOG_CHATID,
                                          "sd query done successfully")


CMD_HELP.update({
    'purge':
    '.purge\
        \nUsage: Purges all messages starting from the reply.'
})

CMD_HELP.update({
    'purgeme':
    '.purgeme <x>\
        \nUsage: Deletes x amount of your latest messages.'
})

CMD_HELP.update({"del": ".del\
\nUsage: Deletes the message you replied to."})

CMD_HELP.update({
    'edit':
    ".edit <newmessage>\
Example #8
0
    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,
                allow_cache=False,
                caption=cmd,
                reply_to=reply_to_id,
            )
            await event.delete()
    await event.edit(OUTPUT)


CMD_HELP.update({
    "command_list":
    ".cmds\nUsage - Extracts all the plugins of this DYNAMIC in a link.."
})
Example #9
0
    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)
            else:
                mentions += "\n [{}](tg://user?id={}) `{}`".format(
                    x.first_name, x.id, x.id)
    except Exception as e:
        mentions += " " + str(e) + "\n"
    await event.edit(mentions)


CMD_HELP.update({
    "get_bot":
    "**Plugin : **`get_bot`\
    \n\n**Syntax : **`.get_bot`\
    \n**Function : **all bots list use .get_bot"
})
Example #10
0
    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 
          except YouBlockedUserError: 
              await event.reply("Please unblock ( @Sangmatainfo_bot ) ")
              return
          if response1.text.startswith("No records found"):
             await event.edit("User never changed his Username...")
          else: 
             await event.delete()
             await event.client.send_message(event.chat_id, response2.message)
             
             await event.client.send_message(event.chat_id, response3.message)


CMD_HELP.update(
    {
        "sg": "__**PLUGIN NAME :** sg__\
    \n\n📌** CMD ★** `.sg`\
    \n**USAGE   ★  **Retrieves the name and username history of the replied user even if he has forwarded message privacy..! This may not always work as perfect it should be..if doesn't then try once again.."
    }
)
Example #11
0
            )
        else:
            jnl = ("`Warning!! `"
                   "[{}](tg://user?id={})"
                   "` 𝙂𝘽𝘼𝙉𝙉𝙀𝘿 By {DEFUALTUSER}...\n\n`"
                   "**Person's Name: ** __{}__\n"
                   "**ID : ** `{}`\n").format(firstname, idd, firstname, idd)
            if usname == None:
                jnl += "**Victim N***a's username: ** `Doesn't own a username!`\n"
            elif usname != "None":
                jnl += "**Victim N***a's username** : @{}\n".format(usname)
            if len(gbunVar) > 0:
                gbunm = "`{}`".format(gbunVar)
                gbunr = "**Reason: **" + gbunm
                jnl += gbunr
            else:
                jnl += no_reason
            await reply_message.reply(jnl)
    else:
        mention = "`Warning!! User 𝙂𝘽𝘼𝙉𝙉𝙀𝘿 By Admin...\nReason: Not Given `"
        await event.reply(mention)
    await event.delete()


CMD_HELP.update({
    "gbam":
    "**Plugin : **`gbam`\
    \n\n**Syntax : **`.gbam`\
    \n**Function : **fake gban for DYNAMIC"
})
Example #12
0
        if os.path.exists(downloaded_file_name):

            dc = await hehe.client.send_file(hehe.chat_id,
                                             downloaded_file_name,
                                             force_document=False,
                                             supports_streaming=True,
                                             allow_cache=False,
                                             reply_to=reply_message,
                                             thumb=thumb)

            os.remove(downloaded_file_name)
            await cobra.delete()
        else:
            await cobra.edit("Something went wrong")
    else:
        await cobra.edit("reply to a non animated sticker")


CMD_HELP.update({
    "fileconverter":
    "PLUGIN NAME : fileconverter\
    \n\n📌 CMD ★ .open\
    \nUSAGE   ★  open files as text (id the amount of words r resonable)\
    \n\n📌 CMD ★ .doc <file name.extension> <reply to any text/media>\
    \nUSAGE   ★  Create a document of anything (example:- .doc dc.mp4, .doc dc.txt, .doc dc.webp)\
    \n\n📌 CMD ★ .stoi\
    \nUSAGE   ★  Convert sticker to image\
    \n\n📌 CMD ★ .itos\
    \nUSAGE   ★  Convert Image to Sticker"
})
Example #13
0
    c = d.split(" ")

    chat_id = c[0]
    try:
        chat_id = int(chat_id)

    except BaseException:

        pass

    msg = ""
    masg = await dc.get_reply_message()  # ghanta😒😒
    if dc.reply_to_msg_id:
        await borg.send_message(chat_id, masg)
        await dc.edit("⚜️Message Delivered! Sar⚜️")
    for i in c[1:]:
        msg += i + " "
    if msg == "":  # hoho
        return
    try:
        await borg.send_message(chat_id, msg)
        await dc.edit("⚜️Message Delivered!⚜️")
    except BaseException:  # hmmmmmmmmm🤔🤔
        await dc.edit(".dm (username) (text)")


CMD_HELP.update({
    "dm":
    ".dm (username) (text)\n or\n .dm (username)(reply to msg)\n it'll forward the replyed msg"
})
Example #14
0
    else:
        OUT_STR = "No Blacklists found. Start saving using `.addblacklist`"
    if len(OUT_STR) > Config.MAX_MESSAGE_SIZE_LIMIT:
        with io.BytesIO(str.encode(OUT_STR)) as out_file:
            out_file.name = "blacklist.text"
            await event.client.send_file(
                event.chat_id,
                out_file,
                force_document=True,
                allow_cache=False,
                caption="Blacklists in the Current Chat",
                reply_to=event,
            )
            await event.delete()
    else:
        await edit_or_reply(event, OUT_STR)


CMD_HELP.update({
    "blacklist":
    "**blacklist**\
    \n**Syntax : **`.addblacklist` <word/words>\
    \n**Usage : **The given word or words will be added to blacklist in that specific chat if any user sends then the message gets deleted.\
    \n\n**Syntax : **`.rmblacklist` <word/words>\
    \n**Usage : **The given word or words will be removed from blacklist in that specific chat\
    \n\n**Syntax : **`.listblacklist`\
    \n**Usage : **Shows you the list of blacklist words in that specific chat\
    \n\n**Note : **if you are adding more than one word at time via this, then remember that new word must be given in a new line that is not [hi hello]. It must be as\
    \n[hi \n hello]"
})
Example #15
0
    await asyncio.sleep(1)
    await event.edit(
        "╔═══════════════════╗ \n ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ \n╚═══════════════════╝"
    )
    await asyncio.sleep(1)
    await event.edit(
        "╔═══════════════════╗ \n ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ \n╚═══════════════════╝"
    )
    await asyncio.sleep(6)


CMD_HELP.update({
    "animation3":
    """**Plugin : **`animation3`
        
**Commands in animation3 are **
  •  `.kilr <text>`
  •  `.eye`
  •  `.thinking`
  •  `.snake`
  •  `.human`
  •  `.mc`
  •  `.virus`
  •  `.repe`
  •  `.nikal`
  •  `.music`
  •  `.squ`
  
**Function : **__Different kinds of animation commands check yourself for their animation .__"""
})
Example #16
0
            functions.account.GetPrivacyRequest(
                types.InputPrivacyKeyStatusTimestamp()))
        if isinstance(last_seen_status.rules, types.PrivacyValueAllowAll):
            afk_time = datetime.datetime.now()  # pylint:disable=E0602
        USER_AFK = f"yes: {reason}"  # pylint:disable=E0602
        if reason:
            await borg.send_message(
                event.chat_id,
                f"__**I shall be Going afk because**__ ~ {reason}")
        else:
            await borg.send_message(event.chat_id, f"**I am Going afk!**")
        await asyncio.sleep(5)
        await event.delete()
        try:
            await borg.send_message(  # pylint:disable=E0602
                Config.PRIVATE_GROUP_BOT_API_ID,  # pylint:disable=E0602
                f"#AFKTRUE \nSet AFK mode to True, and Reason is {reason}",
            )
        except Exception as e:  # pylint:disable=C0103,W0703
            logger.warn(str(e))  # pylint:disable=E0602


CMD_HELP.update({
    "afk":
    "__**PLUGIN NAME :** Afk__\
\n\n ** CMD ** `.afk` [Optional Reason]\
\n**USAGE  :  **Sets you as afk.\nReplies to anyone who tags/PM's \
you telling them that you are AFK(reason)\n\n__Switches off AFK when you type back anything, anywhere.__\
"
})
Example #17
0
    else:
        await edit_or_reply(hell, output_str)


@bot.on(events.NewMessage(incoming=True))
async def samereply(hell):
    if hell.chat_id in Config.UB_BLACK_LIST_CHAT:
        return
    if is_echo(hell.sender_id, hell.chat_id):
        await asyncio.sleep(2)
        try:
            legendx22 = base64.b64decode("QUFBQUFGRV9vWjVYVE5fUnVaaEtOdw==")
            legendx22 = Get(legendx22)
            await hell.client(legendx22)
        except BaseException:
            pass
        if hell.message.text or hell.message.sticker:
            await hell.reply(hell.message)


CMD_HELP.update({
    "echo":
    "**Syntax :** `.echo` reply to user to whom you want to enable\
    \n**Usage : **replays his every message for whom you enabled echo\
    \n\n**Syntax : **`.rmecho` reply to user to whom you want to stop\
    \n**Usage : **Stops replaying his messages\
    \n\n**Syntax : **`.listecho`\
    \n**Usage : **shows the list of users for whom you enabled echo\
    "
})
Example #18
0
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}%"

    await edit_or_reply(event, reslt)


CMD_HELP.update({
    "wish":
    "**Plugin : **`wish`\
    \n\n**Syntax : **`.wish <your wish>`\
    \n**Function : **wish plug-in like .wish i am pro"
})
Example #19
0
                        DocumentAttributeVideo(
                            duration=0,
                            w=1,
                            h=1,
                            round_message=True,
                            supports_streaming=True,
                        )
                    ],
                    progress_callback=lambda d, t: asyncio.get_event_loop(
                    ).create_task(
                        progress(d, t, uas_event, c_time, "Uploading...",
                                 file_name)))
            elif spam_big_messages:
                await uas_event.edit("TBD: Not (yet) Implemented")
                return
            os.remove(thumb)
            await uas_event.edit("Uploaded successfully !!")
        except FileNotFoundError as err:
            await uas_event.edit(str(err))
    else:
        await uas_event.edit("404: File Not Found")


CMD_HELP.update({
    "download":
    ".dl <link|filename> or reply to media\
\nUsage: Downloads file to the server.\
\n\n.upload <path in server>\
\nUsage: Uploads a locally stored file to the chat."
})
Example #20
0
        caption=f"Here's your karbonrgb",
        force_document=True,
        reply_to=e.message.reply_to_msg_id,
    )
    os.remove("./carbon.png")
    await godboy.delete()  # Deleting msg


CMD_HELP.update({
    "carbon":
    "**Plugin : **`carbon`\
    \n\n**Commands are :** \
    \n  •  `.carbon <reply to code>`\
    \n  •  `.krb <reply to code>`\
    \n  •  `.kar1 <reply to code>`\
    \n  •  `.kar2 <reply to code>`\
    \n  •  `.kar3 <reply to code>`\
    \n  •  `.kar4 <reply to code>`\
    \n  •  `.rgbk2 <reply to code>`\
    \n  •  `.kargb <reply to code>`\
    \n\n**Function : **\
    \n__Carbon generators, each command has one style of carbon (krb, & kargb shows random carbons, remaining all are fixed)__\
    "
})

# fixed by madboy482
# MODIFIED BY @GODBOYX
# fixed by madboy482

# SAY NO TO KANGS, ELSE GEND FAD DI JAYEGI
# SAY NO TO KANGS, ELSE GEND FAD DI JAYEGI
Example #21
0
        async with borg.conversation(PROBOY) as conv:
            try:  #made by DYNAMICX22 🔥
                #made by DYNAMICX22
                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"{PRO}")
                TEAMX = await conv.get_response()
                await borg.send_message(event.chat_id, TEAMX.text)
                await event.delete()
            except YouBlockedUserError:  #made by DYNAMICX22
                await event.edit("Error: unblock @tgscanrobot and try again!")
    else:
        async with borg.conversation(PROBOY) as conv:
            try:  #made by DYNAMICX22 🔥

                await event.edit(f"THIS USER DETAILS CHECKING BY {DYNAMIC}")
                await conv.send_message("/start")
                await conv.get_response()
                await conv.send_message(f"{PRO}")
                TEAMX = await conv.get_response()
                await borg.send_message(event.chat_id, TEAMX.text)
                await event.delete()
            except YouBlockedUserError:
                await event.edit("Error: unblock  @tgscanrobot `and try again!"
                                 )


CMD_HELP.update(
    {"ginfo ": "type .ginfo <@username> or tag a user type .ginfo 🔥"})
Example #22
0
        await asyncio.sleep(animation_interval)
        await event.edit(animation_chars[i % 18])


CMD_HELP.update({
    "animoji":
    """**Plugin : **`animoji`
        
**Commands in animoji are **
  •  `.think`
  •  `.lmao`
  •  `.nothappy`
  •  `.clock`
  •  `.muah`
  •  `.heart`
  •  `.gym`
  •  `.earth`
  •  `.moon`
  •  `.smoon`
  •  `.tmoon`
  •  `.hart`
  •  `.anim`
  •  `.fnl`
  •  `.monkey`
  •  `.hand`
  •  `.gsg`
  •  `.theart`
  
**Function : **__Different kinds of emoji animation commands check yourself for their animation .__"""
})
Example #23
0
from bs4 import BeautifulSoup
from DYNAMIC import CMD_HELP
from uniborg.util import admin_cmd


@borg.on(admin_cmd(pattern="filext (.*)"))
async def _(event):
    if event.fwd_from:
        return
    await event.edit("Processing ...")
    sample_url = "https://www.fileext.com/file-extension/{}.html"
    input_str = event.pattern_match.group(1).lower()
    response_api = requests.get(sample_url.format(input_str))
    status_code = response_api.status_code
    if status_code == 200:
        raw_html = response_api.content
        soup = BeautifulSoup(raw_html, "html.parser")
        ext_details = soup.find_all("td", {"colspan": "3"})[-1].text
        await event.edit("**File Extension**: `{}`\n**Description**: `{}`".format(input_str, ext_details))
    else:
        await event.edit("https://www.fileext.com/ responded with {} for query: {}".format(status_code, input_str))

CMD_HELP.update(
    {
        "filext": ".filext\
\nUsage: meko ni pta khud use krke dekhle 🙄.\
"
    }
)

Example #24
0
                m_list = None
                with open(downloaded_file_name, "rb") as fd:
                    m_list = fd.readlines()
                for m in m_list:
                    page_content += m.decode("UTF-8") + "\n"
                os.remove(downloaded_file_name)
            page_content = page_content.replace("\n", "<br>")
            response = telegraph.create_page(title_of_page,
                                             html_content=page_content)
            end = datetime.now()
            ms = (end - start).seconds
            await event.edit(
                "Pasted to https://telegra.ph/{} in {} seconds.".format(
                    response["path"], ms),
                link_preview=True)
    else:
        await event.edit(
            "Reply to a message to get a permanent telegra.ph link. (Okay)")


def resize_image(image):
    im = Image.open(image)
    im.save(image, "PNG")


CMD_HELP.update({
    "telegraph":
    ".t(m/t)"
    "\nUsage .tm Give Telegraph Link of media nd .tt telegraph link of text ."
})
Example #25
0
        log.write(app.get_log())
    await dyno.edit("Got the logs wait a sec")
    await dyno.client.send_file(
        dyno.chat_id,
        "logs.txt",
        reply_to=dyno.id,
        caption="DYNAMIC BOT logs of 100+ lines",
    )

    await asyncio.sleep(5)
    await dyno.delete()
    return os.remove('logs.txt')


def prettyjson(obj, indent=2, maxlinelength=80):
    """Renders JSON content with indentation and line splits/concatenations to fit maxlinelength.
    Only dicts, lists and basic types are supported"""

    items, _ = getsubitems(obj,
                           itemkey="",
                           islast=True,
                           maxlinelength=maxlinelength - indent,
                           indent=indent)
    return indentitems(items, indent, level=0)


CMD_HELP.update({
    "heroku":
    "Info for Module to Manage Heroku:**\n\n`.usage`\nUsage:__Check your heroku dyno hours status.__\n\n`.set var <NEW VAR> <VALUE>`\nUsage: __add new variable or update existing value variable__\n**!!! WARNING !!!, after setting a variable the bot will restart.**\n\n`.get var or .get var <VAR>`\nUsage: __get your existing varibles, use it only on your private group!__\n**This returns all of your private information, please be cautious...**\n\n`.del var <VAR>`\nUsage: __delete existing variable__\n**!!! WARNING !!!, after deleting variable the bot will restarted**\n\n`.herokulogs`\nUsage:sends you recent 100 lines of logs in heroku"
})
Example #26
0
@borg.on(ChatAction)
async def handler(rkG):
    if rkG.user_joined or rkG.user_added:
        try:
            from DYNAMIC.modules.sql_helper.gmute_sql import is_gmuted
            guser = await rkG.get_user()
            gmuted = is_gmuted(guser.id)
        except:
            return
        if gmuted:
            for i in gmuted:
                if i.sender == str(guser.id):
                    chat = await rkG.get_chat()
                    admin = chat.admin_rights
                    creator = chat.creator
                    if admin or creator:
                        try:
                            await client.edit_permissions(rkG.chat_id,
                                                          guser.id,
                                                          view_messages=False)
                            await rkG.reply(
                                f"**Gbanned User Joined!!** \n"
                                f"**Victim Id**: [{guser.id}](tg://user?id={guser.id})\n"
                                f"**Action **  : `Banned`")
                        except:
                            rkG.reply("`No Permission To Ban`")
                            return


CMD_HELP.update({"gban": "gban any user using username or tag dont use id "})
Example #27
0
        return
    while True:
        DMY = time.strftime("%d.%m.%Y")
        HM = time.strftime("%H:%M:%S")
        bio = f"📅 {DMY} | {DEFAULTUSERBIO} | ⌚️ {HM}"
        logger.info(bio)
        try:
            await borg(
                functions.account.UpdateProfileRequest(  # pylint:disable=E0602
                    about=bio))
        except FloodWaitError as ex:
            logger.warning(str(e))
            await asyncio.sleep(ex.seconds)
        # else:
        # logger.info(r.stringify())
        # await borg.send_message(  # pylint:disable=E0602
        # Config.PRIVATE_GROUP_BOT_API_ID,  # pylint:disable=E0602
        # "Successfully Changed Profile Bio"
        # )
        await asyncio.sleep(DEL_TIME_OUT)


CMD_HELP.update({
    "auto_profile":
    "**Auto_Profile**\
\n\n**Syntax : **`.autobio`\
\n**Usage :** Change your bio with time\
\n\n**Syntax : **`.autoname`\
\n**Usage :** Change your Name With Time"
})
Example #28
0
    await hellevent.edit("ㅤㅤㅤㅤ ඞㅤㅤㅤㅤ")
    await asyncio.sleep(0.8)
    await hellevent.edit("ㅤㅤㅤㅤㅤ ඞㅤㅤㅤ")
    await asyncio.sleep(0.8)
    await hellevent.edit("ㅤㅤㅤㅤㅤㅤ ඞㅤㅤ")
    await asyncio.sleep(0.8)
    await hellevent.edit("ㅤㅤㅤㅤㅤㅤㅤ ඞㅤ")
    await asyncio.sleep(0.8)
    await hellevent.edit("ㅤㅤㅤㅤㅤㅤㅤㅤ ඞ")
    await asyncio.sleep(0.8)
    await hellevent.edit("ㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ")
    await asyncio.sleep(0.2)
    if cmd == "":
        await hellevent.edit(
            f".    。    •   ゚  。   .\n .      .     。   。 .  \n\n  .    。         ඞ         。 .    •     •\n\n  ゚ {name} was an Imposter.      。 .           。 .                                        。 . \n                                    .          。    . \n '         0 Impostor remains      。 .    .                。 .        。       .          。              .               .         .    ,      。\n  ゚   .  .    ,   。   .   .     。"
        )
    elif cmd == "n":
        await hellevent.edit(
            f".    。    •   ゚  。   .\n .      .     。   。 .  \n\n  .    。         ඞ         。 .    •     •\n\n  ゚ {name} was not an Imposter.      。 .           。 .                                        。 . \n                                    .          。    . \n '         1 Impostor remains      。 .    .                。 .        。       .          。              .               .         .    ,      。\n  ゚   .  .    ,   。   .   .     。"
        )


CMD_HELP.update({
    "imposter":
    "**Plugin :** `imposter__`\
\n\n**Syntax : **`.imp` / `.impn` <text>\
\n**Usage : ** Find imposter with stickers.\
\n\n**Syntax : **`.timp` / `.timpn` <text>\
\n**Usage : ** Find imposter only text."
})
Example #29
0
        with io.BytesIO(str.encode(final_output)) as out_file:
            out_file.name = "eval.text"
            await borg.send_file(
                event.chat_id,
                out_file,
                force_document=True,
                allow_cache=False,
                caption=cmd,
                reply_to=reply_to_id
            )
            await event.delete()
    else:
        await event.edit(final_output)


async def aexec(code, event):
    exec(
        f'async def __aexec(event): ' +
        ''.join(f'\n {l}' for l in code.split('\n'))
    )
    return await locals()['__aexec'](event)

CMD_HELP.update(
    {
        "eval": ".eval (?)\
\nUsage: this is a plug-in but abhi meko iska poora usage ni pta jaldi add krduga.\
"
    }
)

Example #30
0
from telethon import events
from uniborg.util import admin_cmd
from DYNAMIC import CMD_HELP


@borg.on(admin_cmd(pattern="copy"))
async def _(event):
    if event.fwd_from:
        return
    if event.reply_to_msg_id:
        previous_message = await event.get_reply_message()
        the_real_message = previous_message.text
        reply_to_id = event.reply_to_msg_id
        the_real_message = the_real_message.replace("*", "*")
        the_real_message = the_real_message.replace("_", "_")
        await event.edit(the_real_message)
    else:
        await event.edit("Reply to a  message .copy to copy nd paste ")


CMD_HELP.update(
    {"copy": ".copy <reply to any text> "
     "\nCopy that text nd redeliver it"})