TheHamkerCat %!s(int64=5) %!d(string=hai) anos
pai
achega
eaabeec446
Modificáronse 6 ficheiros con 28 adicións e 48 borrados
  1. 1 29
      README.md
  2. 8 11
      wbb/modules/chatbot.py
  3. 4 0
      wbb/modules/create.py
  4. 3 1
      wbb/modules/misc.py
  5. 4 2
      wbb/modules/proxy.py
  6. 8 5
      wbb/modules/sudoers.py

+ 1 - 29
README.md

@@ -23,7 +23,7 @@
 
 ## Requirements
 
-- Python >= 3.9
+- Python == 3.9
 - A [Telegram API key](https://docs.pyrogram.org/intro/setup#api-keys).
 - A [Telegram bot token](https://t.me/botfather).
 - A [MongoDB URI](https://telegra.ph/How-To-get-Mongodb-URI-04-06)
@@ -106,34 +106,6 @@ async def some_function(_, message):
 
 And put that file in wbb/modules/, restart and test your bot.
 
-# LICENSE
-
-MIT
-
-```
-MIT License
-
-Copyright (c) 2021 TheHamkerCat
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-```
-
 ## Note
 
 1. Support Chat: [WbbSupport](https://t.me/wbbsupport)

+ 8 - 11
wbb/modules/chatbot.py

@@ -34,8 +34,8 @@ from wbb.utils.filter_groups import chatbot_group
 
 __MODULE__ = "ChatBot"
 __HELP__ = """
-/chatbot [ON|OFF] To Enable Or Disable ChatBot In Your Chat.
-.chatbot [ON|OFF] To Do The Same For Userbot."""
+/chatbot [ENABLE|DISABLE] To Enable Or Disable ChatBot In Your Chat.
+.chatbot [ENABLE|DISABLE] To Do The Same For Userbot."""
 
 active_chats_bot = []
 active_chats_ubot = []
@@ -44,18 +44,15 @@ active_chats_ubot = []
 async def chat_bot_toggle(db, message: Message):
     status = message.text.split(None, 1)[1].lower()
     chat_id = message.chat.id
-    if status == "on":
+    if status == "enable":
         if chat_id not in db:
             db.append(chat_id)
-            text = (
-                "Chatbot Enabled Reply To Any Message "
-                + "Of Mine To Get A Reply"
-            )
+            text = "Chatbot Enabled!"
             return await edit_or_reply(message, text=text)
         await edit_or_reply(
             message, text="ChatBot Is Already Enabled."
         )
-    elif status == "off":
+    elif status == "disable":
         if chat_id in db:
             db.remove(chat_id)
             return await edit_or_reply(
@@ -66,7 +63,7 @@ async def chat_bot_toggle(db, message: Message):
         )
     else:
         await edit_or_reply(
-            message, text="**Usage**\n/chatbot [ON|OFF]"
+            message, text="**Usage**\n/chatbot [ENABLE|DISABLE]"
         )
 
 
@@ -78,7 +75,7 @@ async def chat_bot_toggle(db, message: Message):
 async def chatbot_status(_, message: Message):
     if len(message.command) != 2:
         return await edit_or_reply(
-            message, text="**Usage**\n/chatbot [ON|OFF]"
+            message, text="**Usage**\n/chatbot [ENABLE|DISABLE]"
         )
     await chat_bot_toggle(active_chats_bot, message)
 
@@ -129,7 +126,7 @@ async def chatbot_talk(_, message: Message):
 async def chatbot_status_ubot(_, message: Message):
     if len(message.text.split()) != 2:
         return await edit_or_reply(
-            message, text="**Usage**\n.chatbot [ON|OFF]"
+            message, text="**Usage**\n.chatbot [ENABLE|DISABLE]"
         )
     await chat_bot_toggle(active_chats_ubot, message)
 

+ 4 - 0
wbb/modules/create.py

@@ -1,4 +1,5 @@
 from pyrogram import filters
+
 from wbb import BOT_USERNAME, SUDOERS, USERBOT_PREFIX, app2
 from wbb.modules.userbot import edit_or_reply
 
@@ -27,6 +28,7 @@ async def create(_, message):
         await edit_or_reply(
             message,
             text=f"**Basicgroup Created: [{group_name}]({link['invite_link']})**",
+            disable_web_page_preview=True,
         )
     elif group_type == "s":  # for supergroup
         _id = await app2.create_supergroup(group_name, desc)
@@ -34,6 +36,7 @@ async def create(_, message):
         await edit_or_reply(
             message,
             text=f"**Supergroup Created: [{group_name}]({link['invite_link']})**",
+            disable_web_page_preview=True,
         )
     elif group_type == "c":  # for channel
         _id = await app2.create_channel(group_name, desc)
@@ -41,4 +44,5 @@ async def create(_, message):
         await edit_or_reply(
             message,
             text=f"**Channel Created: [{group_name}]({link['invite_link']})**",
+            disable_web_page_preview=True,
         )

+ 3 - 1
wbb/modules/misc.py

@@ -90,7 +90,9 @@ async def getid(_, message):
     if len(message.command) == 2:
         split = message.text.split(None, 1)[1].strip()
         user_id = (await app.get_users(split)).id
-        text += f"**[User ID:](tg://user?id={user_id})** `{user_id}`\n"
+        text += (
+            f"**[User ID:](tg://user?id={user_id})** `{user_id}`\n"
+        )
     text += f"**[Chat ID:](https://t.me/{chat.username})** `{chat.id}`\n\n"
     if not getattr(reply, "empty", True):
         text += f"**[Replied Message ID:]({reply.link})** `{reply.message_id}`\n"

+ 4 - 2
wbb/modules/proxy.py

@@ -7,8 +7,10 @@ from wbb import app, arq
 from wbb.core.keyboard import ikb
 
 __MODULE__ = "Proxy"
-__HELP__ = "/proxy - Get socks5 proxy which you can" \
-           + " use with telegram or other things"
+__HELP__ = (
+    "/proxy - Get socks5 proxy which you can"
+    + " use with telegram or other things"
+)
 
 proxies = []
 

+ 8 - 5
wbb/modules/sudoers.py

@@ -333,11 +333,14 @@ async def broadcast_message(_, message):
 
 @app.on_message(filters.command("update") & filters.user(SUDOERS))
 async def update_restart(_, message):
-    await message.reply_text(
-        f'```{subprocess.check_output(["git", "pull"]).decode("UTF-8")}```'
-    )
+    try:
+        await message.reply_text(
+            f'```{subprocess.check_output(["git", "pull"]).decode("UTF-8")}```'
+        )
+    except Exception as e:
+        return await message.reply_text(str(e))
     m = await message.reply_text(
-        "**Updated with default branch, restarting now**"
+        "**Updated with default branch, restarting now.**"
     )
     await start_restart_stage(m.chat.id, m.message_id)
-    os.execvp("python3", ["python3", "-m", "wbb"])
+    os.execvp("python3.9", ["python3.9", "-m", "wbb"])