Example #1
0
async def ultroid(event):
    if event.is_group:
        return
    if not is_added(event.sender_id) and str(
            event.sender_id) not in owner_and_sudos():
        add_user(event.sender_id)
    if str(event.sender_id) not in owner_and_sudos():
        ok = ""
        u = await event.client.get_entity(event.chat_id)
        if not udB.get("STARTMSG"):
            if udB.get("PMBOT") == "True":
                ok = "You can contact my master using this bot!!\n\nSend your Message, I will Deliver it To Master."
            await event.reply(
                f"Hey there [{get_display_name(u)}](tg://user?id={u.id}), this is Ultroid Assistant of [{ultroid_bot.me.first_name}](tg://user?id={ultroid_bot.uid})!\n\n{ok}",
                buttons=[Button.inline("Info.", data="ownerinfo")],
            )
        else:
            me = f"[{ultroid_bot.me.first_name}](tg://user?id={ultroid_bot.uid})"
            mention = f"[{get_display_name(u)}](tg://user?id={u.id})"
            await event.reply(
                Redis("STARTMSG").format(me=me, mention=mention),
                buttons=[Button.inline("Info.", data="ownerinfo")],
            )
    else:
        name = get_display_name(event.sender_id)
        if event.pattern_match.group(1) == "set":
            await event.reply(
                "Choose from the below options -",
                buttons=_settings,
            )
        else:
            await event.reply(
                get_string("ast_3").format(name),
                buttons=_start,
            )
Example #2
0
async def inline_alive(o):
    if o.text or not str(o.sender_id) in owner_and_sudos():
        return
    b = o.builder
    MSG = "• **Ultroid Userbot •**"
    WEB0 = InputWebDocument(
        "https://telegra.ph/file/55dd0f381c70e72557cb1.jpg", 0, "image/jpg",
        [])
    RES = [
        InputBotInlineResult(
            str(o.id),
            "photo",
            send_message=await b._message(
                text=MSG,
                media=True,
                buttons=SUP_BUTTONS,
            ),
            title="Ultroid Userbot",
            description="Userbot | Telethon",
            url=TLINK,
            thumb=WEB0,
            content=InputWebDocument(TLINK, 0, "image/jpg", []),
        )
    ]
    await o.answer(RES, switch_pm="👥 ULTROID PORTAL", switch_pm_param="start")
Example #3
0
async def ultroid(event):
    args = event.pattern_match.group(1).strip()
    if not is_added(event.sender_id) and event.sender_id not in owner_and_sudos():
        add_user(event.sender_id)
        kak_uiw = udB.get_key("OFF_START_LOG")
        if not kak_uiw or kak_uiw != True:
            msg = f"{inline_mention(event.sender)} `[{event.sender_id}]` started your [Assistant bot](@{asst.me.username})."
            buttons = [[Button.inline("Info", "itkkstyo")]]
            if event.sender.username:
                buttons[0].append(
                    Button.mention(
                        "User", await event.client.get_input_entity(event.sender_id)
                    )
                )
            await event.client.send_message(
                udB.get_key("LOG_CHANNEL"), msg, buttons=buttons
            )
    if event.sender_id not in SUDO_M.fullsudos:
        ok = ""
        me = inline_mention(ultroid_bot.me)
        mention = inline_mention(event.sender)
        if args and args != "set":
            await get_stored_file(event, args)
        if not udB.get_key("STARTMSG"):
            if udB.get_key("PMBOT"):
                ok = "You can contact my master using this bot!!\n\nSend your Message, I will Deliver it To Master."
            await event.reply(
                f"Hey there {mention}, this is Ultroid Assistant of {me}!\n\n{ok}",
                file=udB.get_key("STARTMEDIA"),
                buttons=[Button.inline("Info.", data="ownerinfo")]
                if Owner_info_msg
                else None,
            )
        else:
            await event.reply(
                udB.get_key("STARTMSG").format(me=me, mention=mention),
                file=udB.get_key("STARTMEDIA"),
                buttons=[Button.inline("Info.", data="ownerinfo")]
                if Owner_info_msg
                else None,
            )
    else:
        name = get_display_name(event.sender)
        if args == "set":
            await event.reply(
                "Choose from the below options -",
                buttons=_settings,
            )
        elif args:
            await get_stored_file(event, args)
        else:
            await event.reply(
                get_string("ast_3").format(name),
                buttons=_start,
            )
Example #4
0
async def on_plug_in_callback_query_handler(event):
    plugin_name = event.data_match.group(1).decode("UTF-8")
    help_string = ""
    try:
        for i in HELP["Addons"][plugin_name]:
            help_string += i
    except BaseException:
        try:
            for u in CMD_HELP[plugin_name]:
                help_string = get_string("help_11").format(plugin_name)
                help_string += str(CMD_HELP[plugin_name])
        except BaseException:
            try:
                if plugin_name in LIST:
                    help_string = get_string("help_11").format(plugin_name)
                    for d in LIST[plugin_name]:
                        help_string += HNDLR + d
                        help_string += "\n"
            except BaseException:
                pass
    if help_string == "":
        reply_pop_up_alert = f"{plugin_name} has no detailed help..."
    else:
        reply_pop_up_alert = help_string
    reply_pop_up_alert += "\n© @TeamUltroid"
    buttons = []
    if INLINE_PIC:
        buttons.append(
            [
                Button.inline(
                    "« Sᴇɴᴅ Pʟᴜɢɪɴ »",
                    data=f"sndplug_{(event.data).decode('UTF-8')}",
                )
            ]
        )
    buttons.append(
        [
            Button.inline("« Bᴀᴄᴋ", data="buck"),
        ]
    )
    try:
        if str(event.query.user_id) in owner_and_sudos():
            await event.edit(
                reply_pop_up_alert,
                buttons=buttons,
            )
        else:
            reply_pop_up_alert = notmine
            await event.answer(reply_pop_up_alert, cache_time=0)
    except BaseException:
        halps = get_string("inline_7").format(plugin_name)
        await event.edit(halps, buttons=buttons)
Example #5
0
async def on_plug_in_callback_query_handler(event):
    plugin_name = event.data_match.group(1).decode("UTF-8")
    help_string = ""
    try:
        for i in HELP[plugin_name]:
            help_string += i
    except BaseException:
        try:
            for u in CMD_HELP[plugin_name]:
                help_string = f"Plugin Name-{plugin_name}\n\n✘ Commands Available-\n\n"
                help_string += str(CMD_HELP[plugin_name])
        except BaseException:
            try:
                if plugin_name in LIST:
                    help_string = (
                        f"Plugin Name-{plugin_name}\n\n✘ Commands Available-\n\n"
                    )
                    for d in LIST[plugin_name]:
                        help_string += HNDLR + d
                        help_string += "\n"
            except BaseException:
                pass
    if help_string == "":
        reply_pop_up_alert = f"{plugin_name} has no detailed help..."
    else:
        reply_pop_up_alert = help_string
    reply_pop_up_alert += "\n© @TeamUltroid"
    buttons = [
        [
            Button.inline(
                "« Sᴇɴᴅ Pʟᴜɢɪɴ »",
                data=f"sndplug_{(event.data).decode('UTF-8')}",
            )
        ],
        [
            Button.inline("« Bᴀᴄᴋ", data="buck"),
            Button.inline("••Cʟᴏꜱᴇ••", data="close"),
        ],
    ]
    try:
        if str(event.query.user_id) in owner_and_sudos():
            await event.edit(
                reply_pop_up_alert,
                buttons=buttons,
            )
        else:
            reply_pop_up_alert = notmine
            await event.answer(reply_pop_up_alert, cache_time=0)
    except BaseException:
        halps = f"Do .help {plugin_name} to get the list of commands."
        await event.edit(halps, buttons=buttons)
Example #6
0
async def ultroid(event):
    if not is_added(event.sender_id) and str(
            event.sender_id) not in owner_and_sudos():
        add_user(event.sender_id)
        kak_uiw = udB.get("OFF_START_LOG")
        if not kak_uiw or kak_uiw != "True":
            msg = f"{inline_mention(event.sender)} `[{event.sender_id}]` started your [Assistant bot](@{asst.me.username})."
            buttons = [[Button.inline("Info", "itkkstyo")]]
            if event.sender.username:
                buttons[0].append(
                    Button.url("User", "t.me/" + event.sender.username))
            await event.client.send_message(int(udB["LOG_CHANNEL"]),
                                            msg,
                                            buttons=buttons)
    if (event.sender_id != OWNER_ID) and not is_fullsudo(event.sender_id):
        ok = ""
        u = await event.client.get_entity(event.chat_id)
        if not udB.get("STARTMSG"):
            if udB.get("PMBOT") == "True":
                ok = "You can contact my master using this bot!!\n\nSend your Message, I will Deliver it To Master."
            await event.reply(
                f"Hey there [{get_display_name(u)}](tg://user?id={u.id}), this is Ultroid Assistant of [{ultroid_bot.me.first_name}](tg://user?id={ultroid_bot.uid})!\n\n{ok}",
                file=udB.get("STARTMEDIA"),
                buttons=[Button.inline("Info.", data="ownerinfo")]
                if Owner_info_msg != "False" else None,
            )
        else:
            me = f"[{ultroid_bot.me.first_name}](tg://user?id={ultroid_bot.uid})"
            mention = f"[{get_display_name(u)}](tg://user?id={u.id})"
            await event.reply(
                udB.get("STARTMSG").format(me=me, mention=mention),
                file=udB.get("STARTMEDIA"),
                buttons=[Button.inline("Info.", data="ownerinfo")],
            )
    else:
        name = get_display_name(event.sender_id)
        if event.pattern_match.group(1) == "set":
            await event.reply(
                "Choose from the below options -",
                buttons=_settings,
            )
        else:
            await event.reply(
                get_string("ast_3").format(name),
                buttons=_start,
            )
Example #7
0
async def on_vc_plg_callback_query_handler(event):
    plugin_name = event.data_match.group(1).decode("UTF-8")
    help_string = f"Plugin Name - `{plugin_name}`\n"
    try:
        for i in HELP["VCBot"][plugin_name]:
            help_string += i
    except BaseException:
        pass
    if help_string == "**Commands Available:**\n\n":
        reply_pop_up_alert = f"{plugin_name} has no detailed help..."
    else:
        reply_pop_up_alert = help_string
    reply_pop_up_alert += "\n© @TeamUltroid"
    buttons = []
    if INLINE_PIC:
        buttons.append(
            [
                Button.inline(
                    "« Sᴇɴᴅ Pʟᴜɢɪɴ »",
                    data=f"sndplug_{(event.data).decode('UTF-8')}",
                )
            ]
        )
    buttons.append(
        [
            Button.inline("« Bᴀᴄᴋ", data="vc_helper"),
        ]
    )
    try:
        if str(event.query.user_id) in owner_and_sudos():
            await event.edit(
                reply_pop_up_alert,
                buttons=buttons,
            )
        else:
            reply_pop_up_alert = notmine
            await event.answer(reply_pop_up_alert, cache_time=0)
    except BaseException:
        halps = f"Do .help {plugin_name} to get the list of commands."
        await event.edit(halps, buttons=buttons)
Example #8
0
def VC_AUTHS():
    _vcsudos = udB["VC_SUDOS"].split() if udB.get("VC_SUDOS") else ""
    return [int(a) for a in [*owner_and_sudos(), *_vcsudos]]
Example #9
0
def VC_AUTHS():
    _vcsudos = udB.get_key("VC_SUDOS") or []
    return [int(a) for a in [*owner_and_sudos(), *_vcsudos]]
Example #10
0
            )
        except BaseException:
            return
    elif event.text.startswith("/"):
        return
    if to_user:
        await asst.send_message(to_user, event.message)


# --------------------------------------- Ban/Unban -------------------------------------------- #


@asst_cmd(
    pattern="ban",
    load=AST_PLUGINS,
    from_users=owner_and_sudos(castint=True),
    func=lambda x: x.is_private,
)
async def banhammer(event):
    x = await event.get_reply_message()
    if not x:
        return await event.reply("Please reply to someone to ban him.")
    target = get_who(x.id)
    if is_blacklisted(target):
        return await event.reply("User is already banned!")

    blacklist_user(target)
    await event.reply(f"#BAN\nUser : {target}")
    await asst.send_message(
        target,
        "`GoodBye! You have been banned.`\n**Further messages you send will not be forwarded.**",