diff --git a/Dockerfile b/Dockerfile index 5a4970a..930d70f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,8 @@ # This file is a part of < https://github.com/TeamUltroid/Ultroid/ > # PLease read the GNU Affero General Public License in . -FROM python:3.9.2 -RUN chmod +x /usr/local/bin/* -RUN wget https://raw.githubusercontent.com/TeamUltroid/Ultroid/main/resources/startup/deploy.sh -RUN sh deploy.sh +FROM python:3.9.2-slim-buster +COPY resources/startup/deploy.sh . +RUN chmod +x deploy.sh && sh deploy.sh WORKDIR /root/TeamUltroid/ CMD ["bash", "resources/startup/startup.sh"] diff --git a/README.md b/README.md index 3f3d0a2..0a58b17 100644 --- a/README.md +++ b/README.md @@ -5,17 +5,17 @@ A stable pluggable Telegram userbot, based on Telethon. TeamUltroid

-[![Stars](https://img.shields.io/github/stars/TeamUltroid/Ultroid?style=social)](https://github.com/TeamUltroid/Ultroid/stargazers) -[![Forks](https://img.shields.io/github/forks/TeamUltroid/Ultroid?style=social)](https://github.com/TeamUltroid/Ultroid/fork) +[![Stars](https://img.shields.io/github/stars/TeamUltroid/Ultroid?style=flat-square&color=green)](https://github.com/TeamUltroid/Ultroid/stargazers) +[![Forks](https://img.shields.io/github/forks/TeamUltroid/Ultroid?style=flat-square&color=green)](https://github.com/TeamUltroid/Ultroid/fork) [![Python Version](https://img.shields.io/badge/Python-v3.9-blue)](https://www.python.org/) -[![Contributors](https://img.shields.io/github/contributors/TeamUltroid/Ultroid)](https://github.com/TeamUltroid/Ultroid/graphs/contributors) +[![Contributors](https://img.shields.io/github/contributors/TeamUltroid/Ultroid?style=flat-square&color=green)](https://github.com/TeamUltroid/Ultroid/graphs/contributors) [![License](https://img.shields.io/badge/License-AGPL-blue)](https://github.com/TeamUltroid/Ultroid/blob/main/LICENSE) -[![Size](https://img.shields.io/github/repo-size/TeamUltroid/Ultroid)](https://github.com/TeamUltroid/Ultroid/) +[![Size](https://img.shields.io/github/repo-size/TeamUltroid/Ultroid?style=flat-square&color=green)](https://github.com/TeamUltroid/Ultroid/)
More Info
- Documentation soon..
+ Documentation - ultroid.netlify.app
# Deploy diff --git a/assistant/customvars.py b/assistant/customvars.py index d0a9fcb..f657239 100644 --- a/assistant/customvars.py +++ b/assistant/customvars.py @@ -92,3 +92,79 @@ async def dell(event): return await event.edit("Done!") except BaseException: return await event.edit("Something went wrong...") + + +@callback("alvcstmm") +@owner +async def alvcs(event): + await event.edit( + "Customise your PMPERMIT Settings -", + buttons=[ + [Button.inline("PM Text", data="alvtxx")], + [Button.inline("Pm Media", data="alvmedd")], + [Button.inline("Delete PM Media", data="delmedd")], + ], + ) + + +@callback("alvtxx") +@owner +async def name(event): + await event.delete() + pru = event.sender_id + var = "PM_TEXT" + name = "PM Text" + async with event.client.conversation(pru) as conv: + await conv.send_message( + "**PM Text**\nEnter the new alive text.\n\nUse /cancel to terminate the operation." + ) + response = conv.wait_event(events.NewMessage(chats=pruu)) + response = await response + themssg = response.message.message + if themssg == "/cancel": + return await conv.send_message("Cancelled!!") + else: + await setit(event, var, themssg) + await conv.send_message("{} changed to {}".format(name, themssg)) + + +@callback("alvmedd") +@owner +async def media(event): + await event.delete() + pru = event.sender_id + var = "PMPIC" + name = "PM Media" + async with event.client.conversation(pru) as conv: + await conv.send_message( + "**PM Media**\nSend me a pic/gif/bot api id of sticker to set as alive media.\n\nUse /cancel to terminate the operation." + ) + response = await conv.get_response() + try: + themssg = response.message.message + if themssg == "/cancel": + return await conv.send_message("Operation cancelled!!") + except BaseException: + pass + media = await event.client.download_media(response, "alvpcc") + if not (response.text).startswith("/") and not response.text == "": + url = response.text + else: + try: + x = upload_file(media) + url = f"https://telegra.ph/{x[0]}" + os.remove(media) + except BaseException: + return await conv.send_message("Terminated.") + await setit(event, var, url) + await conv.send_message("{} has been set.".format(name)) + + +@callback("delmedd") +@owner +async def dell(event): + try: + udB.delete("PMPIC") + return await event.edit("Done!") + except BaseException: + return await event.edit("Something went wrong...") diff --git a/assistant/inlinestuff.py b/assistant/inlinestuff.py index 52401bf..0597af3 100644 --- a/assistant/inlinestuff.py +++ b/assistant/inlinestuff.py @@ -29,16 +29,9 @@ async def gsearch(q_event): except IndexError: kkkk = q_event.builder.article( title="Search Something", - thumb=wb( - gugirl, - 0, - "image/jpeg", - []), + thumb=wb(gugirl, 0, "image/jpeg", []), text="**Gᴏᴏɢʟᴇ Sᴇᴀʀᴄʜ**\n\nYou didn't search anything", - buttons=Button.switch_inline( - "Sᴇᴀʀᴄʜ Aɢᴀɪɴ", - query="go ", - same_peer=True), + buttons=Button.switch_inline("Sᴇᴀʀᴄʜ Aɢᴀɪɴ", query="go ", same_peer=True), ) await q_event.answer([kkkk]) searcher = [] @@ -150,16 +143,9 @@ async def _(e): except IndexError: kkkk = e.builder.article( title="Search Something", - thumb=wb( - ps, - 0, - "image/jpeg", - []), + thumb=wb(ps, 0, "image/jpeg", []), text="**Pʟᴀʏ Sᴛᴏʀᴇ**\n\nYou didn't search anything", - buttons=Button.switch_inline( - "Sᴇᴀʀᴄʜ Aɢᴀɪɴ", - query="app ", - same_peer=True), + buttons=Button.switch_inline("Sᴇᴀʀᴄʜ Aɢᴀɪɴ", query="app ", same_peer=True), ) await e.answer([kkkk]) foles = [] @@ -212,10 +198,7 @@ async def _(e): kkkk = e.builder.article( title="Search Something", text="**Mᴏᴅᴅᴇᴅ Aᴘᴘs**\n\nYou didn't search anything", - buttons=Button.switch_inline( - "Sᴇᴀʀᴄʜ Aɢᴀɪɴ", - query="mods ", - same_peer=True), + buttons=Button.switch_inline("Sᴇᴀʀᴄʜ Aɢᴀɪɴ", query="mods ", same_peer=True), ) await e.answer([kkkk]) page = 1 @@ -277,7 +260,7 @@ async def clip(e): quer = quer.replace(" ", "+") sear = f"https://clipartix.com/search/{quer}" html = urlopen(sear) - bs = BeautifulSoup(html, "lxml", from_encoding="utf-8") + bs = BeautifulSoup(html, "html.parser", from_encoding="utf-8") resul = bs.find_all("img", "attachment-full size-full") buil = e.builder hm = [] diff --git a/assistant/othervars.py b/assistant/othervars.py index bf89c8a..16c609b 100644 --- a/assistant/othervars.py +++ b/assistant/othervars.py @@ -18,7 +18,7 @@ async def otvaar(event): buttons=[ [Button.inline("Tag Logger", data="taglog")], [Button.inline("PM Permit", data="pmset")], - [Button.inline("SuperFban", data="sfban")] + [Button.inline("SuperFban", data="sfban")], ], ) @@ -75,11 +75,13 @@ async def pmofff(event): @callback("sfban") @owner async def sfban(event): - await event.edit("SuperFban Settings:", - buttons=[ - [Button.inline("FBan Group", data="sfgrp")], - [Button.inline("Exclude Feds", data="sfexf")] - ]) + await event.edit( + "SuperFban Settings:", + buttons=[ + [Button.inline("FBan Group", data="sfgrp")], + [Button.inline("Exclude Feds", data="sfexf")], + ], + ) @callback("sfgrp") @@ -90,7 +92,9 @@ async def sfgrp(event): var = "FBAN_GROUP_ID" pru = event.sender_id async with asst.conversation(pru) as conv: - await conv.send_message(f"Make a group, add @MissRose_Bot, send `{hndlr}id`, copy that and send it here.\nUse /cancel to go back.") + await conv.send_message( + f"Make a group, add @MissRose_Bot, send `{hndlr}id`, copy that and send it here.\nUse /cancel to go back." + ) response = conv.wait_event(events.NewMessage(chats=pru)) response = await response themssg = response.message.message @@ -109,7 +113,9 @@ async def sfexf(event): var = "EXCLUDE_FED" pru = event.sender_id async with asst.conversation(pru) as conv: - await conv.send_message(f"Send the Fed IDs you want to exclude in the ban. Split by a space.\neg`id1 id2 id3`\nSet is as `None` if you dont want any.\nUse /cancel to go back.") + await conv.send_message( + f"Send the Fed IDs you want to exclude in the ban. Split by a space.\neg`id1 id2 id3`\nSet is as `None` if you dont want any.\nUse /cancel to go back." + ) response = conv.wait_event(events.NewMessage(chats=pru)) response = await response themssg = response.message.message diff --git a/assistant/start.py b/assistant/start.py index 09f8e04..aef8a08 100644 --- a/assistant/start.py +++ b/assistant/start.py @@ -107,6 +107,7 @@ async def setting(event): "Choose from the below options -", buttons=[ [custom.Button.inline("Alive Customisation", data="alvcstm")], + [custom.Button.inline("PM Customisation", data="alvcstmm")], [custom.Button.inline("API Keys", data="apiset")], [custom.Button.inline("Other Vars.", data="otvars")], ], diff --git a/assistant/ytdl.py b/assistant/ytdl.py index 05af667..5230adf 100644 --- a/assistant/ytdl.py +++ b/assistant/ytdl.py @@ -13,7 +13,8 @@ import time from pyUltroid.functions.all import * from telethon import Button -from telethon.tl.types import DocumentAttributeAudio, InputWebDocument as wb +from telethon.tl.types import DocumentAttributeAudio +from telethon.tl.types import InputWebDocument as wb from youtube_dl import YoutubeDL from youtubesearchpython import VideosSearch diff --git a/plugins/_inline.py b/plugins/_inline.py index 3b3da72..3906d0c 100644 --- a/plugins/_inline.py +++ b/plugins/_inline.py @@ -240,7 +240,6 @@ if Var.BOT_USERNAME is not None and asst is not None: "• Iɴsᴛᴀʟʟ A Pʟᴜɢɪɴ Mᴀɴᴜᴀʟʟʏ Oʀ Aᴅᴅ Vᴀʀ ADDON Wɪᴛʜ Vᴀʟᴜᴇ Tʀᴜᴇ", cache_time=0, alert=True, - link_preview=False, ) @callback("rstrt") @@ -296,7 +295,7 @@ if Var.BOT_USERNAME is not None and asst is not None: @owner async def backr(event): xhelps = helps.format(OWNER_NAME, len(PLUGINS) - 4) - current_page_number = 0 + current_page_number = int(upage) buttons = paginate_help(current_page_number, PLUGINS, "helpme") await event.edit(f"{xhelps}", buttons=buttons, link_preview=False) @@ -304,7 +303,7 @@ if Var.BOT_USERNAME is not None and asst is not None: @owner async def backr(event): xhelps = zhelps.format(OWNER_NAME, len(ADDONS)) - current_page_number = 0 + current_page_number = int(addpage) buttons = paginate_addon(current_page_number, ADDONS, "addon") await event.edit(f"{xhelps}", buttons=buttons, link_preview=False) @@ -427,6 +426,8 @@ def paginate_help(page_number, loaded_plugins, prefix): multi = os.environ.get("EMOJI_TO_DESPLAY_IN_HELP", "✘") mult2i = os.environ.get("EMOJI2_TO_DESPLAY_IN_HELP", "✘") helpable_plugins = [] + global upage + upage = page_number for p in loaded_plugins: if not p.startswith("_"): helpable_plugins.append(p) @@ -459,6 +460,14 @@ def paginate_help(page_number, loaded_plugins, prefix): ), ) ] + else: + pairs = pairs[ + modulo_page * number_of_rows : number_of_rows * (modulo_page + 1) + ] + [ + ( + Button.inline("-Bᴀᴄᴋ-", data="open"), + ) + ] return pairs @@ -468,6 +477,8 @@ def paginate_addon(page_number, loaded_plugins, prefix): multi = os.environ.get("EMOJI_TO_DESPLAY_IN_HELP", "✘") mult2i = os.environ.get("EMOJI2_TO_DESPLAY_IN_HELP", "✘") helpable_plugins = [] + global addpage + addpage = page_number for p in loaded_plugins: if not p.startswith("_"): helpable_plugins.append(p) @@ -500,4 +511,12 @@ def paginate_addon(page_number, loaded_plugins, prefix): ), ) ] + else: + pairs = pairs[ + modulo_page * number_of_rows : number_of_rows * (modulo_page + 1) + ] + [ + ( + Button.inline("-Bᴀᴄᴋ-", data="open"), + ) + ] return pairs diff --git a/plugins/_tagnotifs.py b/plugins/_tagnotifs.py index 62933f7..7053698 100644 --- a/plugins/_tagnotifs.py +++ b/plugins/_tagnotifs.py @@ -5,11 +5,12 @@ # PLease read the GNU Affero General Public License in # . -from telethon import events, custom +from telethon import custom, events from telethon.utils import get_display_name from . import * + @ultroid_bot.on( events.NewMessage( incoming=True, @@ -36,7 +37,7 @@ async def all_messages_catcher(e): NEEDTOLOG, cap, link_preview=False, - buttons=[[custom.Button.url(btx, msg)]] + buttons=[[custom.Button.url(btx, msg)]], ) except BaseException: if e.text: @@ -44,11 +45,7 @@ async def all_messages_catcher(e): else: cap = f"{xx} tagged you in {yy}\n\n [📨Message📨]({msg})" try: - await ultroid_bot.send_message( - NEEDTOLOG, - cap, - link_preview=False - ) + await ultroid_bot.send_message(NEEDTOLOG, cap, link_preview=False) except BaseException: pass else: diff --git a/plugins/admintools.py b/plugins/admintools.py index fc76948..94aa609 100644 --- a/plugins/admintools.py +++ b/plugins/admintools.py @@ -24,23 +24,20 @@ Kick the user from the chat. • `{i}pin ` - Pin the message in the chat. + Pin the message in the chat + for silent pin use ({i}pin silent). • `{i}unpin (all) ` Unpin the message(s) in the chat. -• `{i}dpin ` - Pin the message in the chat Silently. - -• `{i}dunpin (all) ` - Unpin the message(s) in the chat Silently. - • `{i}purge ` Purge all messages from the replied message. -• `{i}purgeall ` +• `{i}purgeme ` + Purge Only your messages from the replied message. + +• `{i}purgeall ` Delete all msgs of replied user. - Delete all msgs of input user • `{i}del ` Delete the replied message. @@ -166,13 +163,6 @@ async def bban(ult): ChatBannedRights( until_date=None, view_messages=True, - send_messages=True, - send_media=True, - send_stickers=True, - send_gifs=True, - send_games=True, - send_inline=True, - embed_links=True, ), ) ) @@ -221,13 +211,6 @@ async def uunban(ult): ChatBannedRights( until_date=None, view_messages=None, - send_messages=None, - send_media=None, - send_stickers=None, - send_gifs=None, - send_games=None, - send_inline=None, - embed_links=None, ), ) ) @@ -280,51 +263,46 @@ async def kck(ult): @ultroid_cmd( - pattern="pin($| (.*))", + pattern="pin ?(.*)", ) async def pin(msg): - x = await eor(msg, "`Wait...`") if not msg.is_private: # for pin(s) in private messages await msg.get_chat() cht = await ultroid_bot.get_entity(msg.chat_id) xx = msg.reply_to_msg_id - if not msg.is_reply: - return await x.edit("`Reply to a message to pin it.`") - ch = msg.pattern_match.group(1) - slnt = False - if ch == "loud": - slnt = True + tt = msg.text try: - await ultroid_bot.pin_message(msg.chat_id, xx, notify=slnt) - except BadRequestError: - return await x.edit("`Hmm, I'm have no rights here...`") - except Exception as e: - return await x.edit(f"**ERROR:**`{str(e)}`") - await x.edit(f"`Pinned` [this message](https://t.me/c/{cht.id}/{xx})!") + kk = tt[4] + if kk == "g": + return + except BaseException: + pass + if not msg.is_reply: + return + ch = msg.pattern_match.group(1) + if ch != "silent": + slnt = True + x = await eor(msg, "`Processing...`") + try: + await ultroid_bot.pin_message(msg.chat_id, xx, notify=slnt) + except BadRequestError: + return await x.edit("`Hmm, I'm have no rights here...`") + except Exception as e: + return await x.edit(f"**ERROR:**`{str(e)}`") + await x.edit(f"`Pinned` [this message](https://t.me/c/{cht.id}/{xx})!") + else: + try: + await ultroid_bot.pin_message(msg.chat_id, xx, notify=False) + except BadRequestError: + return await eor(msg, "`Hmm, I'm have no rights here...`") + except Exception as e: + return await eor(msg, f"**ERROR:**`{str(e)}`") + try: + await msg.delete() + except BaseException: + pass -@ultroid_cmd( - pattern="dpin($| (.*))", -) -async def pin(msg): - if not msg.is_private: - # for pin(s) in private messages - await msg.get_chat() - cht = await ultroid_bot.get_entity(msg.chat_id) - xx = msg.reply_to_msg_id - if not msg.is_reply: - return await msg.edit("Reply to a message to pin it.") - ch = msg.pattern_match.group(1) - slnt = False - if ch == "loud": - slnt = True - try: - await ultroid_bot.pin_message(msg.chat_id, xx, notify=slnt) - except BadRequestError: - return await msg.edit("Hmm, I'm have no rights here...") - except Exception as e: - return await msg.edit(f"**ERROR:**{str(e)}") - await msg.delete() @ultroid_cmd( pattern="unpin($| (.*))", @@ -356,34 +334,6 @@ async def unp(ult): return await xx.edit(f"Either reply to a message, or, use `{hndlr}unpin all`") await xx.edit("`Unpinned!`") -@ultroid_cmd( - pattern="dunpin($| (.*))", -) -async def unp(ult): - if not ult.is_private: - # for (un)pin(s) in private messages - await ult.get_chat() - ch = (ult.pattern_match.group(1)).strip() - msg = ult.reply_to_msg_id - if msg and not ch: - try: - await ultroid_bot.unpin_message(ult.chat_id, msg) - except BadRequestError: - return await ult.edit("`Hmm, I'm have no rights here...`") - except Exception as e: - return await ult.edit(f"**ERROR:**\n`{str(e)}`") - elif ch == "all": - try: - await ultroid_bot.unpin_message(ult.chat_id) - except BadRequestError: - return await ult.edit("`Hmm, I'm have no rights here...`") - except Exception as e: - return await ult.edit(f"**ERROR:**`{str(e)}`") - else: - return await ult.edit(f"Either reply to a message, or, use `{hndlr}unpin all`") - if not msg and ch != "all": - return await ult.edit(f"Either reply to a message, or, use `{hndlr}unpin all`") - await ult.delete() @ultroid_cmd( pattern="purge$", @@ -413,29 +363,55 @@ async def fastpurger(purg): @ultroid_cmd( - pattern="purgeall ?(.*)", + pattern="purgeme$", +) +async def fastpurgerme(purg): + chat = await purg.get_input_chat() + msgs = [] + count = 0 + if not purg.reply_to_msg_id: + return await eod(purg, "`Reply to a message to purge from.`", time=10) + async for msg in ultroid_bot.iter_messages( + chat, from_user="me", min_id=purg.reply_to_msg_id + ): + msgs.append(msg) + count = count + 1 + msgs.append(purg.reply_to_msg_id) + if len(msgs) == 100: + await ultroid_bot.delete_messages(chat, msgs) + msgs = [] + + if msgs: + await ultroid_bot.delete_messages(chat, msgs) + done = await ultroid_bot.send_message( + purg.chat_id, + "__Fast purge complete!__\n**Purged** `" + str(count) + "` **messages.**", + ) + await asyncio.sleep(5) + await done.delete() + + +@ultroid_cmd( + pattern="purgeall$", ) async def _(e): - input = e.pattern_match.group(1) xx = await eor(e, "`Processing...`") if e.reply_to_msg_id: input = (await e.get_reply_message()).sender_id - if input: + user = (await e.client.get_entity(input)).first_name try: nos = 0 async for x in e.client.iter_messages(e.chat_id, from_user=input): await e.client.delete_messages(e.chat_id, x) nos += 1 - await e.client.send_message( - e.chat_id, f"**Purged {nos} msgs of {input} from here**" - ) + await xx.edit(f"**Purged **`{nos}`** msgs of **[{input}](tg://user?id={input})") except ValueError: return await eod(xx, str(er), time=5) else: return await eod( xx, - "Reply to someone's msg or give their id to delete all msgs from this chat", - time=10, + "`Reply to someone's msg to delete.`", + time=5, ) @@ -452,7 +428,7 @@ async def delete_it(delme): await eod( delme, f"Couldn't delete the message.\n\n**ERROR:**\n`{str(e)}`", - time=10, + time=5, ) diff --git a/plugins/afk.py b/plugins/afk.py index fe0b872..da580bb 100644 --- a/plugins/afk.py +++ b/plugins/afk.py @@ -57,17 +57,17 @@ async def set_not_afk(event): shite = await ultroid_bot.send_message(event.chat_id, file=pic) shites = await ultroid_bot.send_message( event.chat_id, - "`No Longer Afk`\n\nWas afk for~`" + total_afk_time + "`", + "`No Longer Afk`\n\nWas afk for~ " + total_afk_time + "`", ) else: shite = await ultroid_bot.send_message( event.chat_id, - "`No Longer Afk`\n\nWas afk for~`" + total_afk_time + "`", + "`No Longer Afk`\n\nWas afk for~ " + total_afk_time + "`", file=pic, ) except BaseException: shite = await ultroid_bot.send_message( - event.chat_id, "`No Longer Afk`\nWas afk for" + total_afk_time + "`" + event.chat_id, "`No Longer Afk \nWas afk for " + total_afk_time + "`" ) try: try: @@ -133,7 +133,7 @@ async def on_afk(event): message_to_reply = ( f"__Master #AFK since__ `{total_afk_time}`\n\n" + f"__" - + f"\n\n**Reason:- **{reason}" + + f"\n\n**Reason:- `**{reason}`" ) else: message_to_reply = f"__Master #AFK since__ `{total_afk_time}`\n\n" + f"__" diff --git a/plugins/autopic.py b/plugins/autopic.py new file mode 100644 index 0000000..dfef6f0 --- /dev/null +++ b/plugins/autopic.py @@ -0,0 +1,51 @@ +# Ultroid - UserBot +# Copyright (C) 2020 TeamUltroid +# +# This file is a part of < https://github.com/TeamUltroid/Ultroid/ > +# PLease read the GNU Affero General Public License in +# . + +""" +✘ Commands Available - + +• `{i}autopic ` + will change your profile pic at defined intervals. + search query required. + +""" +import asyncio +import os +import random +import re +import urllib + +from bs4 import BeautifulSoup as bs +from requests import get +from telethon import functions + +from . import * + + +@ultroid_cmd(pattern="autopic ?(.*)") +async def autopic(e): + search = e.pattern_match.group(1) + if not search: + return await eor(e, "Heya Give me some Text ..") + clls = returnpage(search) + if len(clls) == 0: + return await eor(e, f"No Results found for `{search}`") + num = random.randrange(0, len(clls) - 1) + page = clls[num] + title = page["title"] + a = await eor( + e, f" Got a Collection `{title}` related to your search !\nStarting Autopic !!" + ) + while True: + animepp(page["href"]) + file = await ultroid_bot.upload_file("autopic.jpg") + await ultroid_bot(functions.photos.UploadProfilePhotoRequest(file)) + os.system("rm -rf autopic.jpg") + await asyncio.sleep(1100) + + +HELP.update({f"{__name__.split('.')[1]}": f"{__doc__.format(i=Var.HNDLR)}"}) diff --git a/plugins/core.py b/plugins/core.py index d068598..ab1821d 100644 --- a/plugins/core.py +++ b/plugins/core.py @@ -9,7 +9,9 @@ ✘ Commands Available - • `{i}install ` - To install the plugin. + To install the plugin, + `{i}install f` + To force Install. • `{i}uninstall ` To unload and remove the plugin. @@ -26,13 +28,13 @@ import os -from telethon.tl.custom import Button +from telethon import Button from . import * @in_pattern( - "send (.*)", + "send ?(.*)", ) @in_owner async def inline_handler(event): @@ -40,7 +42,7 @@ async def inline_handler(event): input_str = event.pattern_match.group(1) plug = [*PLUGINS] plugs = [] - if input_str == "all": + if input_str == None or input_str == "": for i in plug: try: plugs.append( @@ -52,7 +54,7 @@ async def inline_handler(event): buttons=[ [ Button.switch_inline( - "Search Again..?", query="send all", same_peer=True + "Search Again..?", query="send ", same_peer=True ) ] ], @@ -96,17 +98,17 @@ async def inline_handler(event): @ultroid_cmd( - pattern="install$", + pattern="install", ) async def install(event): await safeinstall(event) @ultroid_cmd( - pattern=r"unload (?P\w+)$", + pattern=r"unload ?(.*)", ) async def unload(event): - shortname = event.pattern_match["shortname"] + shortname = event.pattern_match.group(1) if not shortname: await eor(event, "`Give name of plugin which u want to unload`") return @@ -126,10 +128,10 @@ async def unload(event): @ultroid_cmd( - pattern=r"uninstall (?P\w+)$", + pattern=r"uninstall ?(.*)", ) async def uninstall(event): - shortname = event.pattern_match["shortname"] + shortname = event.pattern_match.group(1) if not shortname: await eor(event, "`Give name of plugin which u want to uninstall`") return @@ -150,10 +152,10 @@ async def uninstall(event): @ultroid_cmd( - pattern=r"load (?P\w+)$", + pattern=r"load ?(.*)", ) async def load(event): - shortname = event.pattern_match["shortname"] + shortname = event.pattern_match.group(1) if not shortname: await eor(event, "`Give name of plugin which u want to load`") return diff --git a/plugins/google.py b/plugins/google.py index 0574333..a5cfa36 100644 --- a/plugins/google.py +++ b/plugins/google.py @@ -33,7 +33,7 @@ from . import * async def google(event): inp = event.pattern_match.group(1) if not inp: - return await event.edit("Give something to search") + return await event.edit("`Give something to search..`") x = await eor(event, "`searching..`") gs = GoogleSearch() res = await gs.async_search(f"{inp}") @@ -52,7 +52,7 @@ async def google(event): async def goimg(event): query = event.pattern_match.group(1) if not query: - return await eor(event, "`Give something to search") + return await eor(event, "`Give something to search...`") nn = await eor(event, "`Processing Keep Patience...`") if ";" in query: try: @@ -79,7 +79,7 @@ async def goimg(event): async def reverse(event): reply = await event.get_reply_message() if not reply: - return await eor(event, "`Reply to any Image`") + return await eor(event, "`Reply to an Image`") ult = await eor(event, "`Processing...`") dl = await bot.download_media(reply) img = Image.open(dl) diff --git a/plugins/mute.py b/plugins/mute.py new file mode 100644 index 0000000..6f50732 --- /dev/null +++ b/plugins/mute.py @@ -0,0 +1,217 @@ +# Ultroid - UserBot +# Copyright (C) 2020 TeamUltroid +# +# This file is a part of < https://github.com/TeamUltroid/Ultroid/ > +# PLease read the GNU Affero General Public License in +# . + +""" +✘ Commands Available - + +• `{i}mute ` + Mute user in current chat. + +• `{i}unmute ` + Unmute user in current chat. + +• `{i}dmute ` + Mute user in current chat by deleting msgs. + +• `{i}undmute ` + Unmute dmuted user in current chat. + +• `{i}tmute