Team Ai
Apppublic

azils3/bash

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
other.py76 linesDownload Raw Back to plugins
1# Ultroid - UserBot2# Copyright (C) 2021-2025 TeamUltroid3#4# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >5# PLease read the GNU Affero General Public License in6# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.7"""8✘ Commands Available -9 10• `{i}send <username/id> <reply/type>`11    send message to User/Chat.12 13• `{i}fwdreply <reply to msg>`14    Reply to someone's msg by forwarding it in private.15 16• `{i}save <reply message>`17    Save that replied msg to ur saved messages box.18 19• `{i}fsave <reply message>`20    Forward that replied msg to ur saved messages.21"""22 23from . import HNDLR, eod, get_string, ultroid_cmd24 25 26@ultroid_cmd(pattern="(send|dm)( (.*)|$)", fullsudo=True)27async def dm(e):28    if len(e.text.split()) <= 1:29        return await e.eor(get_string("dm_1"), time=5)30    chat = e.text.split()[1]31    try:32        chat_id = await e.client.parse_id(chat)33    except Exception as ex:34        return await e.eor(f"`{ex}`", time=5)35    if len(e.text.split()) > 2:36        msg = e.text.split(maxsplit=2)[2]37    elif e.reply_to:38        msg = await e.get_reply_message()39    else:40        return await e.eor(get_string("dm_2"), time=5)41    try:42        _ = await e.client.send_message(chat_id, msg)43        n_, time = get_string("dm_3"), None44        if not _.is_private:45            n_ = f"[{n_}]({_.message_link})"46        await e.eor(n_, time=time)47    except Exception as m:48        await e.eor(get_string("dm_4").format(m, HNDLR), time=5)49 50 51@ultroid_cmd(pattern="fwdreply( (.*)|$)", fullsudo=True)52async def _(e):53    message = e.pattern_match.group(1).strip()54    if not e.reply_to_msg_id:55        return await e.eor(get_string("ex_1"), time=5)56    if not message:57        return await e.eor(get_string("dm_6"), time=5)58    msg = await e.get_reply_message()59    fwd = await msg.forward_to(msg.sender_id)60    await fwd.reply(message)61    await e.eor(get_string("dm_5"), time=5)62 63 64@ultroid_cmd(pattern="(f|)save$")65async def saf(e):66    x = await e.get_reply_message()67    if not x:68        return await eod(69            e, "Reply to Any Message to save it to ur saved messages", time=570        )71    if e.pattern_match.group(1).strip() == "f":72        await x.forward_to(e.sender_id)73    else:74        await e.client.send_message(e.sender_id, x)75    await e.eor("Message saved to Your Pm/Saved Messages.", time=5)76