Esempio n. 1
0
async def machine(stick):
#"""Creates random anime sticker!"""
    text = stick.pattern_match.group(1)
    if text is None:
        await event.edit("Use This Command as .stic <emoji>")
    stickers = await bot.inline_query(
        "sticker", f"{text}")
    hm=len(stickers)
    op=random.randrange(0,hm)
    try:
        await stickers[op].click(stick.chat_id,
                            reply_to=stick.reply_to_msg_id,
                            silent=True if stick.is_reply else False,
                            hide_via=True)
        await stick.delete()
    except ValueError:
     await stick.edit("Use This Command as .stic <any emoji>\nor Stickers are Not Avaliable for Entered Emoji")
    except ChatSendStickersForbiddenError:
     await stick.edit("Sorry boss Can't Send Sticker Here !!")

    
    CMD_HELP.update({
    'stic':
    ".stic : will send random sticker from emoji."
})
Esempio n. 2
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 animu.edit("`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."
})
Esempio n. 3
0
                    except BaseException:
                        if ANTI_SPAMBOT_SHOUT:
                            await welcm.reply(
                                "@admins\n"
                                "`ANTI SPAMBOT DETECTOR!\n"
                                "THIS USER MATCHES MY ALGORITHMS AS A SPAMBOT!`"
                                f"REASON: {reason}")
                            kicked = False
                            reported = True

                if BOTLOG:
                    if kicked or reported:
                        await welcm.client.send_message(
                            BOTLOG_CHATID, "#ANTI_SPAMBOT REPORT\n"
                            f"USER: [{user.first_name}](tg://user?id={check_user.id})\n"
                            f"USER ID: `{check_user.id}`\n"
                            f"CHAT: {welcm.chat.title}\n"
                            f"CHAT ID: `{welcm.chat_id}`\n"
                            f"REASON: {reason}\n"
                            f"MESSAGE:\n\n{message.text}")
    except ValueError:
        pass


CMD_HELP.update({
    'anti_spambot':
    "If enabled in config.env or env var,\
        \nthis module will ban(or inform the admins of the group about) the\
        \nspammer(s) if they match the Userbot's anti-spam algorithm."
})
Esempio n. 4
0
    )


@borg.on(admin_cmd(pattern="listwelcome"))  # pylint:disable=E0602
async def _(event):
    if event.fwd_from:
        return
    cws = get_current_welcome_settings(event.chat_id)
    if hasattr(cws, 'custom_welcome_message'):
        await event.edit(
            "Welcome note found. " + \
        "Your welcome message is\n\n`{}`.".format(cws.custom_welcome_message)
        )
    else:
        await event.edit("No Welcome Message found")


CMD_HELP.update({
    "welcome":
    "\
.savewelcome <welcome message> or reply to a message with .setwelcome\
\nUsage: Saves the message as a welcome note in the chat.\
\n\nAvailable variables for formatting welcome messages :\
\n`{mention}, {title}, {count}, {first}, {last}, {fullname}, {userid}, {username}, {my_first}, {my_fullname}, {my_last}, {my_mention}, {my_username}`\
\n\n.listwelcome\
\nUsage: Check whether you have a welcome note in the chat.\
\n\n.clearwelcome\
\nUsage: Deletes the welcome note for the current chat.\
"
})
Esempio n. 5
0
    message_id = event.message.id
    if event.reply_to_msg_id:
        message_id = event.reply_to_msg_id
    if input_str.startswith("#"):
        try:
            usercolor = ImageColor.getrgb(input_str)
        except Exception as e:
            await event.edit(str(e))
            return False
        else:
            im = Image.new(mode="RGB", size=(1280, 720), color=usercolor)
            im.save("UniBorg.png", "PNG")
            input_str = input_str.replace("#", "#COLOR_")
            await borg.send_file(event.chat_id,
                                 "UniBorg.png",
                                 force_document=False,
                                 caption=input_str,
                                 reply_to=message_id)
            os.remove("UniBorg.png")
            await event.delete()
    else:
        await event.edit(
            "Syntax: `.color <color_code>` example : `.color #ff0000`")


CMD_HELP.update({
    "colors":
    "`.color` <color_code>  :\
      \nUSAGE: sends you a plain image of the color example :`.color #ff0000` . "
})
Esempio n. 6
0
    async with borg.conversation(chat) as conv:
        try:
            response = conv.wait_event(
                events.NewMessage(incoming=True, from_users=161163358))
            await borg.forward_messages(chat, reply_message)
            response = await response
        except YouBlockedUserError:
            await event.reply(
                "```Please unblock @sangmatainfo_bot and try again```")
            return
        if response.text.startswith("Forward"):
            await event.edit(
                "```can you kindly disable your forward privacy settings for good?```"
            )
        else:
            if response.text.startswith("Select"):
                await event.edit(
                    "`Please go to` @DrWebBot `and select your language.`")
            else:
                await event.edit(
                    f"**Antivirus scan was completed. I got dem final results.**\n {response.message.message}"
                )


CMD_HELP.update({
    "antivirus":
    ".scan reply to media or file\
    \n USEAGE: it scans the media or file and checks either any virus is in the file or media\
"
})
Esempio n. 7
0
        hashfile.close()
        await hash_q.client.send_file(
            hash_q.chat_id,
            "hashes.txt",
            reply_to=hash_q.id,
            caption="`It's too big, sending a text file instead. `")
        runapp(["rm", "hashes.txt"], stdout=PIPE)
    else:
        await hash_q.reply(ans)


@borg.on(admin_cmd(outgoing=True, pattern="hbase (en|de) (.*)"))
@errors_handler
async def endecrypt(query):
    """ For .base64 command, find the base64 encoding of the given string. """
    if query.pattern_match.group(1) == "en":
        lething = str(
            pybase64.b64encode(bytes(query.pattern_match.group(2),
                                     "utf-8")))[2:]
        await query.reply("Shhh! It's Encoded: `" + lething[:-1] + "`")
    else:
        lething = str(
            pybase64.b64decode(bytes(query.pattern_match.group(2), "utf-8"),
                               validate=True))[2:]
        await query.reply("Decoded: `" + lething[:-1] + "`")


CMD_HELP.update({"hash": ".hbase en or .hbase de \nUsage: Find the base64 encoding of the given string\
    \n\n.hash\nUsage: Find the md5, sha1, sha256, sha512 of the string when written into a txt file."
})
Esempio n. 8
0
    c_append = False
    for c in str(content):
        if c == '"':
            c_append = True
        if c == ";":
            c_append = False
        if c_append:
            file_name = file_name + c
    file_name = file_name.replace('"', "")
    print("File Name: " + str(file_name))
    return file_name


@borg.on(admin_cmd(pattern=f"gdl", outgoing=True))
async def g_download(event):
    if event.fwd_from:
        return
    drive_link = event.text[4:]
    print("Drive Link: " + drive_link)
    file_id = await get_id(drive_link)
    await event.edit("Downloading Requested File from G-Drive...")
    file_name = await download_file_from_google_drive(file_id)
    await event.edit("File Downloaded.\nName: `" + str(file_name) + "`")


CMD_HELP.update({
    "gdrive_download":
    ".gdl <gdrive File-Link>\
    \nUsage:G-Drive File Downloader Plugin For Userbot."
})
Esempio n. 9
0
        app_link = "https://play.google.com" + results[0].findNext(
            'div', 'Vpfmgd').findNext('div', 'vU6FJ p63iDd').a['href']
        app_icon = results[0].findNext('div', 'Vpfmgd').findNext(
            'div', 'uzcko').img['data-src']
        app_details = "<a href='" + app_icon + "'>ЁЯУ▓&#8203;</a>"
        app_details += " <b>" + app_name + "</b>"
        app_details += "\n\n<code>Developer :</code> <a href='" + app_dev_link + "'>" + app_dev + "</a>"
        app_details += "\n<code>Rating :</code> " + app_rating.replace(
            "Rated ", "тнР ").replace(" out of ", "/").replace(
                " stars", "", 1).replace(" stars", "тнР ").replace(
                    "five", "5")
        app_details += "\n<code>Features :</code> <a href='" + app_link + "'>View in Play Store</a>"
        app_details += "\n\n<b>Download : </b> <a href='https://t.me/joinchat/JCu-H1NikiYDgNjpjPYd4A'>Request_Here</a>"
        app_details += "\n\n===> @LEGEND_USERBOT_SUPPORT <==="
        await event.edit(app_details, link_preview=True, parse_mode='HTML')
    except IndexError:
        await event.edit(
            "No result found in search. Please enter **Valid app name**")
    except Exception as err:
        await event.edit("Exception Occured:- " + str(err))


CMD_HELP.update({
    "app":
    ".app [app name]\
\nUsage: searches the app in the playstore and provides the link to the app in playstore and fetchs app details \
\n\n.appr [app name]\
\nUsage: searches the app in the playstore and provides the link to the app in playstore and fetchs app details with @LEGEND_USERBOT_SUPPORT request link. \
"
})
Esempio n. 10
0
            "This is useless SPAM dude . stop this enjoy chat man ",
            link_preview=False)
    else:
        await event.client.send_message(entity=event.chat_id,
                                        message="""**Automatic AntiFlooder**
[User](tg://user?id={}) has been automatically restricted
because he reached the defined flood limit.""".format(event.message.from_id),
                                        reply_to=event.message.id)


@borg.on(admin_cmd(pattern="setflood (.*)"))
async def _(event):
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    try:
        sql.set_flood(event.chat_id, input_str)
        CHAT_FLOOD = 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  if you are admin mutes him in that group .\
"
})
Esempio n. 11
0
        heroku_git_url = heroku_app.git_url.replace(
            "https://", "https://*****:*****@")
        if "heroku" in repo.remotes:
            remote = repo.remote("heroku")
            remote.set_url(heroku_git_url)
        else:
            remote = repo.create_remote("heroku", heroku_git_url)
        await ups.edit("`Userbot Build in Progress,\nPlease Wait a While`")
        remote.push(refspec="HEAD:refs/heads/master", force=True)
    else:
        try:
            ups_rem.pull(ac_br)
        except GitCommandError:
            repo.git.reset("--hard", "FETCH_HEAD")
        reqs_upgrade = await update_requirements()
        await ups.edit('`Successfully Updated!\n'
                       'Bot is restarting... Wait for Some Time`')
        # Spin a new instance of bot
        args = [sys.executable, "-m", "userbot"]
        execle(sys.executable, *args, environ)
        return
    

CMD_HELP.update({
    'update':
    ".update\
\nUsage: Checks if the main userbot repository has any updates and shows a changelog if so.\
\n\n.update now\
\nUsage: Updates your userbot, if there are any updates in the main userbot repository."
})
Esempio n. 12
0
    CMD_WEB = {
        "anonfiles": "curl -F \"file=@{}\" https://anonfiles.com/api/upload",
        "transfer":
        "curl --upload-file \"{}\" https://transfer.sh/{os.path.basename(file_name)}",
        "filebin":
        "curl -X POST --data-binary \"@test.png\" -H \"filename: {}\" \"https://filebin.net\"",
        "anonymousfiles":
        "curl -F file=\"@{}\" https://api.anonymousfiles.io/",
        "megaupload": "curl -F \"file=@{}\" https://megaupload.is/api/upload",
        "bayfiles":
        ".exec curl -F \"file=@{}\" https://bayfiles.com/api/upload"
    }
    try:
        selected_one = CMD_WEB[selected_transfer].format(file_name)
    except KeyError:
        await event.edit("Invalid selected Transfer")
    cmd = selected_one
    start_time = 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()
    await event.edit(f"{stdout.decode()}")


CMD_HELP.update({
    "webupload":
    ".webupload ?(.+?|) (?:--)(anonfiles|transfer|filebin|anonymousfiles|megaupload|bayfiles\
    \nexample: `.webupload --anonfiles` tag this to a file\
"
})