Explorar el Código

Upgrade to pyrogram 2.0 (#184)

* Upgrade to pyrogram 2.0

* remove in memory parameter

* fix comma in import

* remove get event loop policy

* fixed ig

* fixing loop

* a

* set all parameter in chatprivileges
Pranav Saraswat hace 4 años
padre
commit
5073053a15
Se han modificado 82 ficheros con 811 adiciones y 642 borrados
  1. 1 1
      LICENSE
  2. 0 1
      Procfile
  3. 2 0
      heroku.yml
  4. 1 1
      requirements.txt
  5. 1 1
      str_gen.py
  6. 2 2
      wbb/__init__.py
  7. 17 10
      wbb/__main__.py
  8. 1 1
      wbb/core/decorators/misc.py
  9. 1 1
      wbb/core/decorators/permissions.py
  10. 1 1
      wbb/core/filters.py
  11. 1 1
      wbb/core/keyboard.py
  12. 1 1
      wbb/core/sections.py
  13. 24 0
      wbb/core/tasks.py
  14. 0 313
      wbb/core/types/InlineQueryResult.py
  15. 0 6
      wbb/core/types/__init__.py
  16. 1 1
      wbb/modules/__init__.py
  17. 1 1
      wbb/modules/__main__.py
  18. 77 49
      wbb/modules/admin.py
  19. 1 4
      wbb/modules/admin_misc.py
  20. 1 1
      wbb/modules/alive.py
  21. 3 2
      wbb/modules/anonymize.py
  22. 0 1
      wbb/modules/antiservice.py
  23. 1 2
      wbb/modules/arq.py
  24. 28 3
      wbb/modules/autocorrect.py
  25. 12 8
      wbb/modules/blacklist.py
  26. 24 3
      wbb/modules/blacklist_chat.py
  27. 1 2
      wbb/modules/carbon.py
  28. 1 1
      wbb/modules/chat_watcher.py
  29. 11 7
      wbb/modules/chatbot.py
  30. 9 7
      wbb/modules/couple.py
  31. 1 2
      wbb/modules/create.py
  32. 27 1
      wbb/modules/crypto.py
  33. 31 2
      wbb/modules/dice.py
  34. 7 3
      wbb/modules/download_upload.py
  35. 11 5
      wbb/modules/filters.py
  36. 11 9
      wbb/modules/flood.py
  37. 15 9
      wbb/modules/global_stats.py
  38. 17 6
      wbb/modules/greetings.py
  39. 4 2
      wbb/modules/img_pdf.py
  40. 7 3
      wbb/modules/info.py
  41. 1 1
      wbb/modules/inline.py
  42. 10 7
      wbb/modules/karma.py
  43. 12 4
      wbb/modules/locks.py
  44. 35 15
      wbb/modules/misc.py
  45. 7 4
      wbb/modules/mongo_backup.py
  46. 12 6
      wbb/modules/music.py
  47. 32 9
      wbb/modules/notes.py
  48. 33 8
      wbb/modules/parse_preview.py
  49. 8 3
      wbb/modules/paste.py
  50. 21 6
      wbb/modules/pipes.py
  51. 4 5
      wbb/modules/pmpermit.py
  52. 3 2
      wbb/modules/purge_me.py
  53. 12 6
      wbb/modules/quotly.py
  54. 4 2
      wbb/modules/reddit.py
  55. 4 2
      wbb/modules/repo.py
  56. 11 6
      wbb/modules/reverse.py
  57. 7 8
      wbb/modules/rice.py
  58. 36 8
      wbb/modules/rss.py
  59. 12 5
      wbb/modules/stickers.py
  60. 13 4
      wbb/modules/sudo.py
  61. 19 7
      wbb/modules/sudoers.py
  62. 2 3
      wbb/modules/taglogger.py
  63. 27 1
      wbb/modules/telegraph.py
  64. 6 4
      wbb/modules/tts.py
  65. 9 11
      wbb/modules/userbot.py
  66. 8 3
      wbb/modules/webss.py
  67. 1 1
      wbb/utils/__init__.py
  68. 32 4
      wbb/utils/constants.py
  69. 1 1
      wbb/utils/dbfunctions.py
  70. 24 0
      wbb/utils/downloader.py
  71. 1 1
      wbb/utils/files.py
  72. 1 1
      wbb/utils/filter_groups.py
  73. 1 1
      wbb/utils/formatter.py
  74. 6 5
      wbb/utils/functions.py
  75. 5 5
      wbb/utils/http.py
  76. 7 4
      wbb/utils/inlinefuncs.py
  77. 1 1
      wbb/utils/json_prettify.py
  78. 1 1
      wbb/utils/misc.py
  79. 1 1
      wbb/utils/pastebin.py
  80. 1 1
      wbb/utils/read_lines.py
  81. 24 0
      wbb/utils/rss.py
  82. 1 1
      wbb/utils/stickerset.py

+ 1 - 1
LICENSE

@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 0 - 1
Procfile

@@ -1 +0,0 @@
-worker: python3 -m wbb

+ 2 - 0
heroku.yml

@@ -1,3 +1,5 @@
 build:
   docker:
       worker: Dockerfile
+run:
+  worker: python3 -m wbb

+ 1 - 1
requirements.txt

@@ -9,7 +9,7 @@ motor
 pillow
 psutil
 pykeyboard
-pyrogram==1.4.16
+pyrogram
 python-arq
 requests
 search-engine-parser

+ 1 - 1
str_gen.py

@@ -5,7 +5,7 @@ API_HASH = input("\nEnter Your API_HASH:\n > ")
 
 print("\n\n Enter Phone number when asked.\n\n")
 
-i = c(":memory:", api_id=API_ID, api_hash=API_HASH)
+i = c(name="wbb", in_memory=True, api_id=API_ID, api_hash=API_HASH)
 
 with i:
     ss = i.export_session_string()

+ 2 - 2
wbb/__init__.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -109,7 +109,7 @@ if not HEROKU:
         api_hash=API_HASH,
     )
 else:
-    app2 = Client(SESSION_STRING, api_id=API_ID, api_hash=API_HASH)
+    app2 = Client(session_string=SESSION_STRING, api_id=API_ID, api_hash=API_HASH)
 
 aiohttpsession = ClientSession()
 

+ 17 - 10
wbb/__main__.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -27,7 +27,7 @@ import re
 from contextlib import closing, suppress
 
 from uvloop import install
-from pyrogram import filters, idle
+from pyrogram import filters, idle, enums
 from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
 
 from wbb import (
@@ -106,7 +106,7 @@ async def start_bot():
     log.info("Stopping clients")
     await app.stop()
     log.info("Cancelling asyncio tasks")
-    for task in asyncio.all_tasks():
+    for task in asyncio.all_tasks(loop):
         task.cancel()
     log.info("Dead!")
 
@@ -115,7 +115,8 @@ home_keyboard_pm = InlineKeyboardMarkup(
     [
         [
             InlineKeyboardButton(
-                text="Commands ❓", callback_data="bot_commands"
+                text="Commands ❓", 
+                callback_data="bot_commands"
             ),
             InlineKeyboardButton(
                 text="Repo 🛠",
@@ -169,9 +170,11 @@ keyboard = InlineKeyboardMarkup(
 )
 
 
-@app.on_message(~filters.edited & filters.command("start"))
+@app.on_message(
+    filters.command("start")
+)
 async def start(_, message):
-    if message.chat.type != "private":
+    if message.chat.type != enums.ChatType.PRIVATE:
         return await message.reply(
             "Pm Me For More Details.", reply_markup=keyboard
         )
@@ -179,7 +182,9 @@ async def start(_, message):
         name = (message.text.split(None, 1)[1]).lower()
         if name == "mkdwn_help":
             await message.reply(
-                MARKDOWN, parse_mode="html", disable_web_page_preview=True
+                MARKDOWN, 
+                parse_mode=enums.ParseMode.HTML, 
+                disable_web_page_preview=True
             )
         elif "_" in name:
             module = name.split("_", 1)[1]
@@ -202,9 +207,11 @@ async def start(_, message):
     return
 
 
-@app.on_message(~filters.edited & filters.command("help"))
+@app.on_message(
+    filters.command("help")
+)
 async def help_command(_, message):
-    if message.chat.type != "private":
+    if message.chat.type != enums.ChatType.PRIVATE:
         if len(message.command) >= 2:
             name = (message.text.split(None, 1)[1]).replace(" ", "_").lower()
             if str(name) in HELPABLE:
@@ -378,4 +385,4 @@ if __name__ == "__main__":
     with closing(loop):
         with suppress(asyncio.exceptions.CancelledError):
             loop.run_until_complete(start_bot())
-        loop.run_until_complete(asyncio.sleep(3.0))  # task cancel wait
+        asyncio.run(asyncio.sleep(3))

+ 1 - 1
wbb/core/decorators/misc.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 1 - 1
wbb/core/decorators/permissions.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 1 - 1
wbb/core/filters.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 1 - 1
wbb/core/keyboard.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 1 - 1
wbb/core/sections.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 24 - 0
wbb/core/tasks.py

@@ -1,3 +1,27 @@
+"""
+MIT License
+
+Copyright (c) present 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.
+"""
+
 from asyncio import Lock, create_task
 from time import time
 

+ 0 - 313
wbb/core/types/InlineQueryResult.py

@@ -1,313 +0,0 @@
-"""
-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.
-"""
-from typing import List, Optional, Union
-
-import pyrogram
-from pyrogram import raw, types, utils
-from pyrogram.file_id import DOCUMENT_TYPES, PHOTO_TYPES, FileId, FileType
-from pyrogram.types import InlineQueryResult
-
-
-class InlineQueryResultAudio(InlineQueryResult):
-    """Link to an audio.
-    By default, this audio will be sent by the user with optional caption.
-    Alternatively, you can use *input_message_content* to send a message
-    with the specified content instead of the audio.
-    Parameters:
-        audio_url (``str``):
-            A valid URL for the embedded audio player or audio file.
-
-        thumb_url (``str``):
-            URL of the thumbnail (jpeg only) for the audio.
-
-        title (``str``):
-            Title for the result.
-
-        mime_type (``str``):
-            Mime type of the content of audio url, “text/html” or “audio/mp3”.
-
-        id (``str``, *optional*):
-            Unique identifier for this result, 1-64 bytes.
-            Defaults to a randomly generated UUID4.
-
-        description (``str``, *optional*):
-            Short description of the result.
-
-        caption (``str``, *optional*):
-            Caption of the audio to be sent, 0-1024 characters.
-
-        performer (``str``, *optional*):
-            Performer.
-
-        duration (``int``, *optional*):
-            Audio duration in seconds.
-
-        parse_mode (``str``, *optional*):
-            By default, texts are parsed using both Markdown and HTML styles.
-            You can combine both syntaxes together.
-            Pass "markdown" or "md" to enable Markdown-style parsing only.
-            Pass "html" to enable HTML-style parsing only.
-            Pass None to completely disable style parsing.
-
-        caption_entities (List of :obj:`~pyrogram.types.MessageEntity`):
-            List of special entities that appear in the caption, which can be specified instead of *parse_mode*.
-
-        reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup`, *optional*):
-            An InlineKeyboardMarkup object.
-
-        input_message_content (:obj:`~pyrogram.types.InputMessageContent`):
-            Content of the message to be sent instead of the audio. This field is required if InlineQueryResultAudio is
-            used to send an HTML-page as a result.
-    """
-
-    def __init__(
-            self,
-            audio_url: str,
-            thumb_url: str,
-            title: str,
-            mime_type: str,
-            id: str = None,
-            description: str = None,
-            caption: str = "",
-            performer: str = "",
-            duration: int = 0,
-            parse_mode: Optional[str] = object,
-            caption_entities: List["types.MessageEntity"] = None,
-            reply_markup: "types.InlineKeyboardMarkup" = None,
-            input_message_content: "types.InputMessageContent" = None,
-    ):
-        super().__init__("audio", id, input_message_content, reply_markup)
-
-        self.audio_url = audio_url
-        self.thumb_url = thumb_url
-        self.voice = bool(mime_type == "audio/ogg")
-        self.title = title
-        self.caption = caption
-        self.description = description
-        self.mime_type = mime_type
-        self.parse_mode = parse_mode
-        self.performer = performer
-        self.duration = duration
-        self.caption_entities = caption_entities
-        self.reply_markup = reply_markup
-        self.input_message_content = input_message_content
-
-        if mime_type == "text/html" and input_message_content is None:
-            raise ValueError(
-                "input_message_content is required for audio with `text/html` mime type"
-            )
-
-    async def write(self, client: "pyrogram.Client"):
-        audio = raw.types.InputWebDocument(
-            url=self.audio_url,
-            size=0,
-            mime_type=self.mime_type,
-            attributes=[],
-        )
-
-        thumb = raw.types.InputWebDocument(
-            url=self.thumb_url,
-            size=0,
-            mime_type="image/jpeg",
-            attributes=[
-                raw.types.DocumentAttributeAudio(
-                    duration=self.duration,
-                    voice=self.voice,
-                    title=self.title,
-                    performer=self.performer,
-                )
-            ],
-        )
-
-        message, entities = (
-            await utils.parse_text_entities(
-                client,
-                self.caption,
-                self.parse_mode,
-                self.caption_entities,
-            )
-        ).values()
-
-        return raw.types.InputBotInlineResult(
-            id=self.id,
-            type=self.type,
-            title=self.title,
-            description=self.description,
-            thumb=thumb,
-            content=audio,
-            send_message=(
-                await self.input_message_content.write(
-                    client, self.reply_markup
-                )
-                if self.input_message_content
-                else raw.types.InputBotInlineMessageMediaAuto(
-                    reply_markup=await self.reply_markup.write(client)
-                    if self.reply_markup
-                    else None,
-                    message=message,
-                    entities=entities,
-                )
-            ),
-        )
-
-
-#  CREDITS:
-#       THE CODE BELOW THIS LINE IS WRITTEN BY https://github.com/Mahesh0253. [https://t.me/DeletedUser420]
-#       https://github.com/Mahesh0253/pyrogram/blob/inline/pyrogram/types/inline_mode/inline_query_result_cached_document.py
-
-
-class InlineQueryResultCachedDocument(InlineQueryResult):
-    """Link to a file stored on the Telegram servers.
-
-    By default, this file will be sent by the user with an optional caption.
-    Alternatively, you can use input_message_content to send a message with the specified content instead of the file.
-
-    Parameters:
-        title (``str``):
-            Title for the result.
-
-        file_id (``str``):
-            Pass a file_id as string to send a media that exists on the Telegram servers.
-
-        id (``str``, *optional*):
-            Unique identifier for this result, 1-64 bytes.
-            Defaults to a randomly generated UUID4.
-
-        description (``str``, *optional*):
-            Short description of the result.
-
-        caption (``str``, *optional*):
-            Caption of the photo to be sent, 0-1024 characters.
-
-        parse_mode (``str``, *optional*):
-            By default, texts are parsed using both Markdown and HTML styles.
-            You can combine both syntaxes together.
-            Pass "markdown" or "md" to enable Markdown-style parsing only.
-            Pass "html" to enable HTML-style parsing only.
-            Pass None to completely disable style parsing.
-        caption_entities (List of :obj:`~pyrogram.types.MessageEntity`):
-                List of special entities that appear in the caption, which can be specified instead of *parse_mode*.
-
-        reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup`, *optional*):
-            Inline keyboard attached to the message.
-
-        input_message_content (:obj:`~pyrogram.types.InputMessageContent`):
-            Content of the message to be sent.
-    """
-
-    def __init__(
-            self,
-            file_id: str,
-            title: str = None,
-            id: str = None,
-            description: str = None,
-            caption: str = "",
-            parse_mode: Optional[str] = object,
-            caption_entities: List["types.MessageEntity"] = None,
-            reply_markup: "types.InlineKeyboardMarkup" = None,
-            input_message_content: "types.InputMessageContent" = None,
-    ):
-        super().__init__("file", id, input_message_content, reply_markup)
-
-        self.file_id = file_id
-        self.title = title
-        self.description = description
-        self.caption = caption
-        self.caption_entities = caption_entities
-        self.parse_mode = parse_mode
-        self.reply_markup = reply_markup
-        self.input_message_content = input_message_content
-
-    async def write(self, client: "pyrogram.Client"):
-        document = get_input_file_from_file_id(self.file_id)
-
-        message, entities = (
-            await utils.parse_text_entities(
-                client,
-                self.caption,
-                self.parse_mode,
-                self.caption_entities,
-            )
-        ).values()
-
-        return raw.types.InputBotInlineResultDocument(
-            id=self.id,
-            type=self.type,
-            title=self.title,
-            description=self.description,
-            document=document,
-            send_message=(
-                await self.input_message_content.write(
-                    client, self.reply_markup
-                )
-                if self.input_message_content
-                else raw.types.InputBotInlineMessageMediaAuto(
-                    reply_markup=await self.reply_markup.write(client)
-                    if self.reply_markup
-                    else None,
-                    message=message,
-                    entities=entities,
-                )
-            ),
-        )
-
-
-def get_input_file_from_file_id(
-        file_id: str, expected_file_type: FileType = None
-) -> Union["raw.types.InputPhoto", "raw.types.InputDocument"]:
-    try:
-        decoded = FileId.decode(file_id)
-    except Exception:
-        raise ValueError(
-            f'Failed to decode "{file_id}". The value does not represent an existing local file, '
-            f"HTTP URL, or valid file id."
-        )
-
-    file_type = decoded.file_type
-
-    if expected_file_type is not None and file_type != expected_file_type:
-        raise ValueError(
-            f'Expected: "{expected_file_type}", got "{file_type}" file_id instead'
-        )
-
-    if file_type in (FileType.THUMBNAIL, FileType.CHAT_PHOTO):
-        raise ValueError(
-            f"This file_id can only be used for download: {file_id}"
-        )
-
-    if file_type in PHOTO_TYPES:
-        return raw.types.InputPhoto(
-            id=decoded.media_id,
-            access_hash=decoded.access_hash,
-            file_reference=decoded.file_reference,
-        )
-
-    if file_type in DOCUMENT_TYPES:
-        return raw.types.InputDocument(
-            id=decoded.media_id,
-            access_hash=decoded.access_hash,
-            file_reference=decoded.file_reference,
-        )
-
-    raise ValueError(f"Unknown file id: {file_id}")

+ 0 - 6
wbb/core/types/__init__.py

@@ -1,6 +0,0 @@
-# flake8: noqa
-
-from .InlineQueryResult import (
-    InlineQueryResultAudio,
-    InlineQueryResultCachedDocument,
-)

+ 1 - 1
wbb/modules/__init__.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 1 - 1
wbb/modules/__main__.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 77 - 49
wbb/modules/admin.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -26,12 +26,13 @@ import re
 
 from time import time
 from pyrogram.errors import FloodWait
-from pyrogram import filters
+from pyrogram import filters, enums
 from pyrogram.types import (
     CallbackQuery,
     ChatMemberUpdated,
     ChatPermissions,
     Message,
+    ChatPrivileges,
 )
 
 from wbb import BOT_ID, SUDOERS, app, log
@@ -81,7 +82,7 @@ __HELP__ = """/ban - Ban A User
 async def member_permissions(chat_id: int, user_id: int):
     perms = []
     try:
-        member = await app.get_chat_member(chat_id, user_id)
+        member = (await app.get_chat_member(chat_id, user_id)).privileges
     except Exception:
         return []
     if member.can_post_messages:
@@ -100,8 +101,8 @@ async def member_permissions(chat_id: int, user_id: int):
         perms.append("can_invite_users")
     if member.can_pin_messages:
         perms.append("can_pin_messages")
-    if member.can_manage_voice_chats:
-        perms.append("can_manage_voice_chats")
+    if member.can_manage_video_chats:
+        perms.append("can_manage_video_chats")
     return perms
 
 
@@ -121,8 +122,8 @@ async def list_admins(chat_id: int):
         "last_updated_at": time(),
         "data": [
             member.user.id
-            async for member in app.iter_chat_members(
-                chat_id, filter="administrators"
+            async for member in app.get_chat_members(
+                chat_id, filter=enums.ChatMembersFilter.ADMINISTRATORS
             )
         ],
     }
@@ -139,8 +140,8 @@ async def admin_cache_func(_, cmu: ChatMemberUpdated):
             "last_updated_at": time(),
             "data": [
                 member.user.id
-                async for member in app.iter_chat_members(
-                    cmu.chat.id, filter="administrators"
+                async for member in app.get_chat_members(
+                    cmu.chat.id, filter=enums.ChatMembersFilter.ADMINISTRATORS
                 )
             ],
         }
@@ -150,7 +151,10 @@ async def admin_cache_func(_, cmu: ChatMemberUpdated):
 # Purge Messages
 
 
-@app.on_message(filters.command("purge") & ~filters.edited & ~filters.private)
+@app.on_message(
+    filters.command("purge") 
+    & ~filters.private
+)
 @adminsOnly("can_delete_messages")
 async def purgeFunc(_, message: Message):
     repliedmsg = message.reply_to_message
@@ -200,7 +204,8 @@ async def purgeFunc(_, message: Message):
 
 
 @app.on_message(
-    filters.command(["kick", "dkick"]) & ~filters.edited & ~filters.private
+    filters.command(["kick", "dkick"]) 
+    & ~filters.private
 )
 @adminsOnly("can_restrict_members")
 async def kickFunc(_, message: Message):
@@ -235,7 +240,6 @@ async def kickFunc(_, message: Message):
 
 @app.on_message(
     filters.command(["ban", "dban", "tban"])
-    & ~filters.edited
     & ~filters.private
 )
 @adminsOnly("can_restrict_members")
@@ -298,7 +302,10 @@ async def banFunc(_, message: Message):
 # Unban members
 
 
-@app.on_message(filters.command("unban") & ~filters.edited & ~filters.private)
+@app.on_message(
+    filters.command("unban") 
+    & ~filters.private
+)
 @adminsOnly("can_restrict_members")
 async def unban_func(_, message: Message):
     # we don't need reasons for unban, also, we
@@ -327,7 +334,9 @@ async def unban_func(_, message: Message):
 
 
 @app.on_message(
-    SUDOERS & filters.command("listban") & ~filters.edited & ~filters.private
+    SUDOERS 
+    & filters.command("listban") 
+    & ~filters.private
 )
 async def list_ban_(c, message: Message):
     userid, msglink_reason = await extract_user_and_reason(message)
@@ -373,7 +382,7 @@ async def list_ban_(c, message: Message):
             await app.ban_chat_member(username.strip("@"), userid)
             await asyncio.sleep(1)
         except FloodWait as e:
-            await asyncio.sleep(e.x)
+            await asyncio.sleep(e.value)
         except:
             continue
         count += 1
@@ -393,7 +402,9 @@ async def list_ban_(c, message: Message):
 
 
 @app.on_message(
-    SUDOERS & filters.command("listunban") & ~filters.edited & ~filters.private
+    SUDOERS 
+    & filters.command("listunban") 
+    & ~filters.private
 )
 async def list_unban_(c, message: Message):
     userid, msglink = await extract_user_and_reason(message)
@@ -424,7 +435,7 @@ async def list_unban_(c, message: Message):
             await app.unban_chat_member(username.strip("@"), userid)
             await asyncio.sleep(1)
         except FloodWait as e:
-            await asyncio.sleep(e.x)
+            await asyncio.sleep(e.value)
         except:
             continue
         count += 1
@@ -441,7 +452,10 @@ async def list_unban_(c, message: Message):
 # Delete messages
 
 
-@app.on_message(filters.command("del") & ~filters.edited & ~filters.private)
+@app.on_message(
+    filters.command("del") 
+    & ~filters.private
+)
 @adminsOnly("can_delete_messages")
 async def deleteFunc(_, message: Message):
     if not message.reply_to_message:
@@ -455,7 +469,6 @@ async def deleteFunc(_, message: Message):
 
 @app.on_message(
     filters.command(["promote", "fullpromote"])
-    & ~filters.edited
     & ~filters.private
 )
 @adminsOnly("can_promote_members")
@@ -464,7 +477,7 @@ async def promoteFunc(_, message: Message):
     umention = (await app.get_users(user_id)).mention
     if not user_id:
         return await message.reply_text("I can't find that user.")
-    bot = await app.get_chat_member(message.chat.id, BOT_ID)
+    bot = (await app.get_chat_member(message.chat.id, BOT_ID)).privileges
     if user_id == BOT_ID:
         return await message.reply_text("I can't promote myself.")
     if not bot.can_promote_members:
@@ -479,20 +492,22 @@ async def promoteFunc(_, message: Message):
             can_pin_messages=bot.can_pin_messages,
             can_promote_members=bot.can_promote_members,
             can_manage_chat=bot.can_manage_chat,
-            can_manage_voice_chats=bot.can_manage_voice_chats,
+            can_manage_video_chats=bot.can_manage_video_chats,
         )
         return await message.reply_text(f"Fully Promoted! {umention}")
 
     await message.chat.promote_member(
-        user_id=user_id,
-        can_change_info=False,
-        can_invite_users=bot.can_invite_users,
-        can_delete_messages=bot.can_delete_messages,
-        can_restrict_members=False,
-        can_pin_messages=False,
-        can_promote_members=False,
-        can_manage_chat=bot.can_manage_chat,
-        can_manage_voice_chats=bot.can_manage_voice_chats,
+        user_id,
+        ChatPrivileges(
+            can_change_info=False,
+            can_restrict_members=False,
+            can_pin_messages=False,
+            can_promote_members=False,
+            can_invite_users=True,
+            can_delete_messages=True,
+            can_manage_chat=True,
+            can_manage_video_chats=True,
+        ),
     )
     await message.reply_text(f"Promoted! {umention}")
 
@@ -500,7 +515,10 @@ async def promoteFunc(_, message: Message):
 # Demote Member
 
 
-@app.on_message(filters.command("demote") & ~filters.edited & ~filters.private)
+@app.on_message(
+    filters.command("demote") 
+    & ~filters.private
+)
 @adminsOnly("can_promote_members")
 async def demote(_, message: Message):
     user_id = await extract_user(message)
@@ -514,14 +532,16 @@ async def demote(_, message: Message):
         )
     await message.chat.promote_member(
         user_id=user_id,
-        can_change_info=False,
-        can_invite_users=False,
-        can_delete_messages=False,
-        can_restrict_members=False,
-        can_pin_messages=False,
-        can_promote_members=False,
-        can_manage_chat=False,
-        can_manage_voice_chats=False,
+        privileges=ChatPrivileges(
+            can_change_info=False,
+            can_invite_users=False,
+            can_delete_messages=False,
+            can_restrict_members=False,
+            can_pin_messages=False,
+            can_promote_members=False,
+            can_manage_chat=False,
+            can_manage_video_chats=False,
+        ),    
     )
     umention = (await app.get_users(user_id)).mention
     await message.reply_text(f"Demoted! {umention}")
@@ -531,7 +551,8 @@ async def demote(_, message: Message):
 
 
 @app.on_message(
-    filters.command(["pin", "unpin"]) & ~filters.edited & ~filters.private
+    filters.command(["pin", "unpin"]) 
+    & ~filters.private
 )
 @adminsOnly("can_pin_messages")
 async def pin(_, message: Message):
@@ -558,7 +579,8 @@ async def pin(_, message: Message):
 
 
 @app.on_message(
-    filters.command(["mute", "tmute"]) & ~filters.edited & ~filters.private
+    filters.command(["mute", "tmute"]) 
+    & ~filters.private
 )
 @adminsOnly("can_restrict_members")
 async def mute(_, message: Message):
@@ -611,7 +633,10 @@ async def mute(_, message: Message):
 # Unmute members
 
 
-@app.on_message(filters.command("unmute") & ~filters.edited & ~filters.private)
+@app.on_message(
+    filters.command("unmute") 
+    & ~filters.private
+)
 @adminsOnly("can_restrict_members")
 async def unmute(_, message: Message):
     user_id = await extract_user(message)
@@ -628,7 +653,6 @@ async def unmute(_, message: Message):
 @app.on_message(
     filters.command("ban_ghosts")
     & ~filters.private
-    & ~filters.edited
 )
 @adminsOnly("can_restrict_members")
 async def ban_deleted_accounts(_, message: Message):
@@ -637,7 +661,7 @@ async def ban_deleted_accounts(_, message: Message):
     banned_users = 0
     m = await message.reply("Finding ghosts...")
 
-    async for i in app.iter_chat_members(chat_id):
+    async for i in app.get_chat_members(chat_id):
         if i.user.is_deleted:
             deleted_users.append(i.user.id)
     if len(deleted_users) > 0:
@@ -653,7 +677,8 @@ async def ban_deleted_accounts(_, message: Message):
 
 
 @app.on_message(
-    filters.command(["warn", "dwarn"]) & ~filters.edited & ~filters.private
+    filters.command(["warn", "dwarn"]) 
+    & ~filters.private
 )
 @adminsOnly("can_restrict_members")
 async def warn_user(_, message: Message):
@@ -732,7 +757,8 @@ async def remove_warning(_, cq: CallbackQuery):
 
 
 @app.on_message(
-    filters.command("rmwarns") & ~filters.edited & ~filters.private
+    filters.command("rmwarns") 
+    & ~filters.private
 )
 @adminsOnly("can_restrict_members")
 async def remove_warnings(_, message: Message):
@@ -756,7 +782,10 @@ async def remove_warnings(_, message: Message):
 # Warns
 
 
-@app.on_message(filters.command("warns") & ~filters.edited & ~filters.private)
+@app.on_message(
+    filters.command("warns") 
+    & ~filters.private
+)
 @capture_err
 async def check_warns(_, message: Message):
     user_id = await extract_user(message)
@@ -779,7 +808,6 @@ async def check_warns(_, message: Message):
             filters.command("report")
             | filters.command(["admins", "admin"], prefixes="@")
     )
-    & ~filters.edited
     & ~filters.private
 )
 @capture_err
@@ -811,7 +839,7 @@ async def report_user(_, message):
     user_mention = reply.from_user.mention if reply.from_user else reply.sender_chat.title
     text = f"Reported {user_mention} to admins!"
     admin_data = await app.get_chat_members(
-        chat_id=message.chat.id, filter="administrators"
+        chat_id=message.chat.id, filter=enums.ChatMembersFilter.ADMINISTRATORS
     )  # will it giv floods ?
     for admin in admin_data:
         if admin.user.is_bot or admin.user.is_deleted:

+ 1 - 4
wbb/modules/admin_misc.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -39,7 +39,6 @@ __HELP__ = """
 @app.on_message(
     filters.command("set_chat_title")
     & ~filters.private
-    & ~filters.edited
 )
 @adminsOnly("can_change_info")
 async def set_chat_title(_, message):
@@ -56,7 +55,6 @@ async def set_chat_title(_, message):
 @app.on_message(
     filters.command("set_user_title")
     & ~filters.private
-    & ~filters.edited
 )
 @adminsOnly("can_change_info")
 async def set_user_title(_, message):
@@ -84,7 +82,6 @@ async def set_user_title(_, message):
 @app.on_message(
     filters.command("set_chat_photo")
     & ~filters.private
-    & ~filters.edited
 )
 @adminsOnly("can_change_info")
 async def set_chat_photo(_, message):

+ 1 - 1
wbb/modules/alive.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 3 - 2
wbb/modules/anonymize.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -39,7 +39,8 @@ from wbb.utils.functions import extract_user
 
 
 @app2.on_message(
-    filters.command("anonymize", prefixes=USERBOT_PREFIX) & SUDOERS
+    filters.command("anonymize", prefixes=USERBOT_PREFIX) 
+    & SUDOERS
 )
 async def change_profile(_, message: Message):
     m = await eor(message, text="Anonymizing...")

+ 0 - 1
wbb/modules/antiservice.py

@@ -22,7 +22,6 @@ Plugin to delete service messages in a chat!
 @app.on_message(
     filters.command("antiservice")
     & ~filters.private
-    & ~filters.edited
 )
 @adminsOnly("can_change_info")
 async def anti_service(_, message):

+ 1 - 2
wbb/modules/arq.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -29,7 +29,6 @@ from wbb.core.sections import section
 
 @app.on_message(
     filters.command("arq")
-    & ~filters.edited
 )
 async def arq_stats(_, message):
     data = await arq.stats()

+ 28 - 3
wbb/modules/autocorrect.py

@@ -1,3 +1,27 @@
+"""
+MIT License
+
+Copyright (c) present 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.
+"""
+
 from pyrogram import filters
 from pyrogram.types import Message
 
@@ -8,7 +32,6 @@ from wbb.utils.filter_groups import autocorrect_group
 
 @app.on_message(
     filters.command("autocorrect")
-    & ~filters.edited
 )
 async def autocorrect_bot(_, message: Message):
     if not message.reply_to_message:
@@ -28,7 +51,8 @@ IS_ENABLED = False
 
 
 @app2.on_message(
-    filters.command("autocorrect", prefixes=USERBOT_PREFIX) & SUDOERS
+    filters.command("autocorrect", prefixes=USERBOT_PREFIX) 
+    & SUDOERS
 )
 async def autocorrect_ubot_toggle(_, message: Message):
     global IS_ENABLED
@@ -48,7 +72,8 @@ async def autocorrect_ubot_toggle(_, message: Message):
 
 
 @app2.on_message(
-    filters.text & ~filters.edited & filters.user(USERBOT_ID),
+    filters.text 
+    & filters.user(USERBOT_ID),
     group=autocorrect_group,
 )
 async def autocorrect_ubot(_, message: Message):

+ 12 - 8
wbb/modules/blacklist.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 """
 import re
-from time import time
+from datetime import datetime, timedelta
 
 from pyrogram import filters
 from pyrogram.types import ChatPermissions
@@ -47,7 +47,8 @@ __HELP__ = """
 
 
 @app.on_message(
-    filters.command("blacklist") & ~filters.edited & ~filters.private
+    filters.command("blacklist") 
+    & ~filters.private
 )
 @adminsOnly("can_restrict_members")
 async def save_filters(_, message):
@@ -64,7 +65,8 @@ async def save_filters(_, message):
 
 
 @app.on_message(
-    filters.command("blacklisted") & ~filters.edited & ~filters.private
+    filters.command("blacklisted") 
+    & ~filters.private
 )
 @capture_err
 async def get_filterss(_, message):
@@ -79,7 +81,8 @@ async def get_filterss(_, message):
 
 
 @app.on_message(
-    filters.command("whitelist") & ~filters.edited & ~filters.private
+    filters.command("whitelist") 
+    & ~filters.private
 )
 @adminsOnly("can_restrict_members")
 async def del_filter(_, message):
@@ -97,8 +100,9 @@ async def del_filter(_, message):
 
 @app.on_message(
     filters.text
-    & ~filters.private
-    & ~filters.edited, group=blacklist_filters_group)
+    & ~filters.private,
+    group=blacklist_filters_group
+)
 @capture_err
 async def blacklist_filters_re(_, message):
     text = message.text.lower().strip()
@@ -120,7 +124,7 @@ async def blacklist_filters_re(_, message):
                 await message.chat.restrict_member(
                     user.id,
                     ChatPermissions(),
-                    until_date=int(time() + 3600),
+                    until_date=datetime.now() + timedelta(seconds=3600),
                 )
             except Exception:
                 return

+ 24 - 3
wbb/modules/blacklist_chat.py

@@ -1,3 +1,27 @@
+"""
+MIT License
+
+Copyright (c) present 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.
+"""
+
 from pyrogram import filters
 from pyrogram.types import Message
 
@@ -25,7 +49,6 @@ in which you don't want it to be in.
 @app.on_message(
     filters.command("blacklist_chat")
     & SUDOERS
-    & ~filters.edited
 )
 @capture_err
 async def blacklist_chat_func(_, message: Message):
@@ -47,7 +70,6 @@ async def blacklist_chat_func(_, message: Message):
 @app.on_message(
     filters.command("whitelist_chat")
     & SUDOERS
-    & ~filters.edited
 )
 @capture_err
 async def whitelist_chat_func(_, message: Message):
@@ -69,7 +91,6 @@ async def whitelist_chat_func(_, message: Message):
 @app.on_message(
     filters.command("blacklisted_chats")
     & SUDOERS
-    & ~filters.edited
 )
 @capture_err
 async def blacklisted_chats_func(_, message: Message):

+ 1 - 2
wbb/modules/carbon.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -31,7 +31,6 @@ from wbb.utils.functions import make_carbon
 
 @app.on_message(
     filters.command("carbon")
-    & ~filters.edited
 )
 @capture_err
 async def carbon_func(_, message):

+ 1 - 1
wbb/modules/chat_watcher.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 11 - 7
wbb/modules/chatbot.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -71,7 +71,9 @@ async def chat_bot_toggle(message: Message, is_userbot: bool):
 # Enabled | Disable Chatbot
 
 
-@app.on_message(filters.command("chatbot") & ~filters.edited)
+@app.on_message(
+    filters.command("chatbot")
+)
 @capture_err
 async def chatbot_status(_, message: Message):
     if len(message.command) != 2:
@@ -99,8 +101,7 @@ async def type_and_send(message: Message):
     & filters.reply
     & ~filters.bot
     & ~filters.via_bot
-    & ~filters.forwarded
-    & ~filters.edited,
+    & ~filters.forwarded,
     group=chatbot_group,
 )
 @capture_err
@@ -122,7 +123,6 @@ async def chatbot_talk(_, message: Message):
 
 @app2.on_message(
     filters.command("chatbot", prefixes=USERBOT_PREFIX)
-    & ~filters.edited
     & SUDOERS
 )
 @capture_err
@@ -133,7 +133,9 @@ async def chatbot_status_ubot(_, message: Message):
 
 
 @app2.on_message(
-    ~filters.me & ~filters.private & filters.text & ~filters.edited,
+    filters.me 
+    & ~filters.private 
+    & ~filters.text,
     group=chatbot_group,
 )
 @capture_err
@@ -157,7 +159,9 @@ async def chatbot_talk_ubot(_, message: Message):
 
 
 @app2.on_message(
-    filters.text & filters.private & ~filters.me & ~filters.edited,
+    filters.text 
+    & ~filters.private 
+    & ~filters.me,
     group=(chatbot_group + 1),
 )
 @capture_err

+ 9 - 7
wbb/modules/couple.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -24,14 +24,14 @@ SOFTWARE.
 import random
 from datetime import datetime
 
-from pyrogram import filters
+from pyrogram import filters, enums
 
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.dbfunctions import get_couple, save_couple
 
 __MODULE__ = "Shippering"
-__HELP__ = "/detect_gay - To Choose Couple Of The Day"
+__HELP__ = "/couple - To Choose Couple Of The Day"
 
 
 # Date and time
@@ -61,20 +61,22 @@ def tomorrow():
     return str(dt_tom())
 
 
-@app.on_message(filters.command("detect_gay") & ~filters.edited)
+@app.on_message(
+    filters.command("couple")
+)
 @capture_err
 async def couple(_, message):
-    if message.chat.type == "private":
+    if message.chat.type == enums.ChatType.PRIVATE:
         return await message.reply_text("This command only works in groups.")
 
-    m = await message.reply("Detecting gay among us...")
+    m = await message.reply("Detecting Couple among us...")
 
     try:
         chat_id = message.chat.id
         is_selected = await get_couple(chat_id, today())
         if not is_selected:
             list_of_users = []
-            async for i in app.iter_chat_members(message.chat.id):
+            async for i in app.get_chat_members(message.chat.id):
                 if not i.user.is_bot:
                     list_of_users.append(i.user.id)
             if len(list_of_users) < 2:

+ 1 - 2
wbb/modules/create.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -32,7 +32,6 @@ from wbb.modules.userbot import eor
     SUDOERS
     & ~filters.forwarded
     & ~filters.via_bot
-    & ~filters.edited
     & filters.command("create", prefixes=USERBOT_PREFIX)
 )
 async def create(_, message):

+ 27 - 1
wbb/modules/crypto.py

@@ -1,3 +1,27 @@
+"""
+MIT License
+
+Copyright (c) present 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.
+"""
+
 from pyrogram import filters
 
 from wbb import app
@@ -13,7 +37,9 @@ __HELP__ = """
 """
 
 
-@app.on_message(filters.command("crypto") & ~filters.edited)
+@app.on_message(
+    filters.command("crypto")
+)
 @capture_err
 async def crypto(_, message):
     if len(message.command) < 2:

+ 31 - 2
wbb/modules/dice.py

@@ -1,3 +1,27 @@
+"""
+MIT License
+
+Copyright (c) present 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.
+"""
+
 from pyrogram import filters
 from pyrogram.types import Message
 
@@ -10,8 +34,13 @@ __HELP__ = """
 """
 
 
-@app2.on_message(filters.command("dice", prefixes=USERBOT_PREFIX) & SUDOERS)
-@app.on_message(filters.command("dice") & ~filters.edited)
+@app2.on_message(
+    filters.command("dice", prefixes=USERBOT_PREFIX) 
+    & SUDOERS
+)
+@app.on_message(
+    filters.command("dice")
+)
 async def throw_dice(client, message: Message):
     six = (message.from_user.id in SUDOERS) if message.from_user else False
 

+ 7 - 3
wbb/modules/download_upload.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -37,7 +37,8 @@ from wbb.utils.downloader import download
 
 
 @app2.on_message(
-    SUDOERS & filters.command("download", prefixes=USERBOT_PREFIX)
+    SUDOERS 
+    & filters.command("download", prefixes=USERBOT_PREFIX)
 )
 async def download_func(_, message: Message):
     reply = message.reply_to_message
@@ -105,7 +106,10 @@ async def download_func(_, message: Message):
     await eor(m, text=section("Downloaded", body))
 
 
-@app2.on_message(SUDOERS & filters.command("upload", prefixes=USERBOT_PREFIX))
+@app2.on_message(
+    SUDOERS 
+    & filters.command("upload", prefixes=USERBOT_PREFIX)
+)
 async def upload_func(_, message: Message):
     if len(message.text.split()) != 2:
         return await eor(message, text="Invalid Arguments")

+ 11 - 5
wbb/modules/filters.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -50,7 +50,10 @@ Checkout /markdownhelp to know more about formattings and other syntax.
 """
 
 
-@app.on_message(filters.command("filter") & ~filters.edited & ~filters.private)
+@app.on_message(
+    filters.command("filter") 
+    & ~filters.private
+)
 @adminsOnly("can_change_info")
 async def save_filters(_, message):
     if len(message.command) < 2 or not message.reply_to_message:
@@ -82,7 +85,8 @@ async def save_filters(_, message):
 
 
 @app.on_message(
-    filters.command("filters") & ~filters.edited & ~filters.private
+    filters.command("filters") 
+    & ~filters.private
 )
 @capture_err
 async def get_filterss(_, message):
@@ -96,7 +100,10 @@ async def get_filterss(_, message):
     await message.reply_text(msg)
 
 
-@app.on_message(filters.command("stop") & ~filters.edited & ~filters.private)
+@app.on_message(
+    filters.command("stop") 
+    & ~filters.private
+)
 @adminsOnly("can_change_info")
 async def del_filter(_, message):
     if len(message.command) < 2:
@@ -114,7 +121,6 @@ async def del_filter(_, message):
 
 @app.on_message(
     filters.text
-    & ~filters.edited
     & ~filters.private
     & ~filters.via_bot
     & ~filters.forwarded,

+ 11 - 9
wbb/modules/flood.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -21,8 +21,8 @@ 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.
 """
-from asyncio import get_running_loop, sleep
-from time import time
+import asyncio
+from datetime import datetime, timedelta
 
 from pyrogram import filters
 from pyrogram.types import (
@@ -61,8 +61,7 @@ def reset_flood(chat_id, user_id=0):
     & ~filters.me
     & ~filters.private
     & ~filters.channel
-    & ~filters.bot
-    & ~filters.edited,
+    & ~filters.bot,
     group=flood_group,
 )
 @capture_err
@@ -101,7 +100,7 @@ async def flood_control_func(_, message: Message):
             await message.chat.restrict_member(
                 user_id,
                 permissions=ChatPermissions(),
-                until_date=int(time() + 3600),
+                until_date=datetime.now() + timedelta(seconds=3600),
             )
         except Exception:
             return
@@ -121,13 +120,13 @@ async def flood_control_func(_, message: Message):
         )
 
         async def delete():
-            await sleep(3600)
+            await asyncio.sleep(3600)
             try:
                 await m.delete()
             except Exception:
                 pass
 
-        loop = get_running_loop()
+        loop = asyncio.get_running_loop()
         return loop.create_task(delete())
     DB[chat_id][user_id] += 1
 
@@ -151,7 +150,10 @@ async def flood_callback_func(_, cq: CallbackQuery):
     await cq.message.edit(text)
 
 
-@app.on_message(filters.command("flood") & ~filters.private & ~filters.edited)
+@app.on_message(
+    filters.command("flood") 
+    & ~filters.private
+)
 @adminsOnly("can_change_info")
 async def flood_toggle(_, message: Message):
     if len(message.command) != 2:

+ 15 - 9
wbb/modules/global_stats.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -23,7 +23,7 @@ SOFTWARE.
 """
 import asyncio
 
-from pyrogram import filters
+from pyrogram import filters, enums
 from pyrogram.errors import FloodWait
 
 from wbb import BOT_ID, BOT_NAME, SUDOERS, USERBOT_NAME, app, app2
@@ -45,7 +45,10 @@ from wbb.utils.http import get
 from wbb.utils.inlinefuncs import keywords_list
 
 
-@app.on_message(filters.command("clean_db") & ~filters.edited & SUDOERS)
+@app.on_message(
+    filters.command("clean_db") 
+    & SUDOERS
+)
 @capture_err
 async def clean_db(_, message):
     served_chats = [int(i["chat_id"]) for i in (await get_served_chats())]
@@ -64,7 +67,10 @@ async def clean_db(_, message):
     await m.edit("**Database Cleaned.**")
 
 
-@app.on_message(filters.command("gstats") & ~filters.edited & SUDOERS)
+@app.on_message(
+    filters.command("gstats") 
+    & SUDOERS
+)
 @capture_err
 async def global_stats(_, message):
     m = await app.send_message(
@@ -118,17 +124,17 @@ async def global_stats(_, message):
 
     # Userbot info
     groups_ub = channels_ub = bots_ub = privates_ub = total_ub = 0
-    async for i in app2.iter_dialogs():
+    async for i in app2.get_dialogs():
         t = i.chat.type
         total_ub += 1
 
-        if t in ["supergroup", "group"]:
+        if t in [enums.ChatType.SUPERGROUP, enums.ChatType.GROUP]:
             groups_ub += 1
-        elif t == "channel":
+        elif t == enums.ChatType.CHANNEL:
             channels_ub += 1
-        elif t == "bot":
+        elif t == enums.ChatType.BOT:
             bots_ub += 1
-        elif t == "private":
+        elif t == enums.ChatType.PRIVATE:
             privates_ub += 1
 
     msg = f"""

+ 17 - 6
wbb/modules/greetings.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -106,7 +106,10 @@ async def get_initial_captcha_cache():
 loop.create_task(get_initial_captcha_cache())
 
 
-@app.on_message(filters.new_chat_members, group=welcome_captcha_group)
+@app.on_message(
+    filters.new_chat_members, 
+    group=welcome_captcha_group
+)
 @capture_err
 async def welcome(_, message: Message):
     global answers_dicc
@@ -361,7 +364,9 @@ async def _ban_restricted_user_until_date(
 
 
 @app.on_message(
-    filters.command("captcha") & ~filters.private & ~filters.edited)
+    filters.command("captcha") 
+    & ~filters.private
+)
 @adminsOnly("can_restrict_members")
 async def captcha_state(_, message):
     usage = "**Usage:**\n/captcha [ENABLE|DISABLE]"
@@ -385,7 +390,9 @@ async def captcha_state(_, message):
 
 
 @app.on_message(
-    filters.command("set_welcome") & ~filters.private & ~filters.edited)
+    filters.command("set_welcome") 
+    & ~filters.private
+)
 @adminsOnly("can_change_info")
 async def set_welcome_func(_, message):
     usage = "You need to reply to a text, check the Greetings module in /help"
@@ -404,7 +411,9 @@ async def set_welcome_func(_, message):
 
 
 @app.on_message(
-    filters.command("del_welcome") & ~filters.private & ~filters.edited)
+    filters.command("del_welcome") 
+    & ~filters.private
+)
 @adminsOnly("can_change_info")
 async def del_welcome_func(_, message):
     chat_id = message.chat.id
@@ -413,7 +422,9 @@ async def del_welcome_func(_, message):
 
 
 @app.on_message(
-    filters.command("get_welcome") & ~filters.private & ~filters.edited)
+    filters.command("get_welcome") 
+    & ~filters.private
+)
 @adminsOnly("can_change_info")
 async def get_welcome_func(_, message):
     chat = message.chat

+ 4 - 2
wbb/modules/img_pdf.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -92,7 +92,9 @@ async def convert(
             remove(file)
 
 
-@app.on_message(filters.command("pdf") & ~filters.edited)
+@app.on_message(
+    filters.command("pdf")
+)
 @capture_err
 async def img_to_pdf(_, message: Message):
     reply = message.reply_to_message

+ 7 - 3
wbb/modules/info.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -95,7 +95,9 @@ async def get_chat_info(chat, already=False):
     return [caption, photo_id]
 
 
-@app.on_message(filters.command("info") & ~filters.edited)
+@app.on_message(
+    filters.command("info")
+)
 async def info_func(_, message: Message):
     if message.reply_to_message:
         user = message.reply_to_message.from_user.id
@@ -120,7 +122,9 @@ async def info_func(_, message: Message):
     os.remove(photo)
 
 
-@app.on_message(filters.command("chat_info") & ~filters.edited)
+@app.on_message(
+    filters.command("chat_info")
+)
 async def chat_info_func(_, message: Message):
     try:
         if len(message.command) > 2:

+ 1 - 1
wbb/modules/inline.py

@@ -2,7 +2,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 10 - 7
wbb/modules/karma.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -60,8 +60,7 @@ regex_downvote = r"^(-|--|-1|👎|-- .+)$"
     & filters.reply
     & filters.regex(regex_upvote, re.IGNORECASE)
     & ~filters.via_bot
-    & ~filters.bot
-    & ~filters.edited,
+    & ~filters.bot,
     group=karma_positive_group,
 )
 @capture_err
@@ -99,8 +98,7 @@ async def upvote(_, message):
     & filters.reply
     & filters.regex(regex_downvote, re.IGNORECASE)
     & ~filters.via_bot
-    & ~filters.bot
-    & ~filters.edited,
+    & ~filters.bot,
     group=karma_negative_group,
 )
 @capture_err
@@ -132,7 +130,10 @@ async def downvote(_, message):
     )
 
 
-@app.on_message(filters.command("karma") & filters.group & ~filters.edited)
+@app.on_message(
+    filters.command("karma") 
+    & filters.group
+)
 @capture_err
 async def command_karma(_, message):
     chat_id = message.chat.id
@@ -183,7 +184,9 @@ async def command_karma(_, message):
 
 
 @app.on_message(
-    filters.command("karma_toggle") & ~filters.private & ~filters.edited)
+    filters.command("karma_toggle") 
+    & ~filters.private
+)
 @adminsOnly("can_change_info")
 async def captcha_state(_, message):
     usage = "**Usage:**\n/karma_toggle [ENABLE|DISABLE]"

+ 12 - 4
wbb/modules/locks.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -113,7 +113,9 @@ async def tg_lock(message, permissions: list, perm: str, lock: bool):
 
 
 @app.on_message(
-    filters.command(["lock", "unlock"]) & ~filters.private & ~filters.edited)
+    filters.command(["lock", "unlock"]) 
+    & ~filters.private
+)
 @adminsOnly("can_restrict_members")
 async def locks_func(_, message):
     if len(message.command) != 2:
@@ -157,7 +159,9 @@ async def locks_func(_, message):
 
 
 @app.on_message(
-    filters.command("locks") & ~filters.private & ~filters.edited)
+    filters.command("locks") 
+    & ~filters.private
+)
 @capture_err
 async def locktypes(_, message):
     permissions = await current_chat_permissions(message.chat.id)
@@ -172,7 +176,11 @@ async def locktypes(_, message):
     await message.reply_text(perms)
 
 
-@app.on_message(filters.text & ~filters.private, group=69)
+@app.on_message(
+    filters.text & 
+    ~filters.private, 
+    group=69
+)
 async def url_detector(_, message):
     user = message.from_user
     chat_id = message.chat.id

+ 35 - 15
wbb/modules/misc.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -28,7 +28,7 @@ import subprocess
 from asyncio import Lock
 from re import findall
 
-from pyrogram import filters
+from pyrogram import filters, enums
 
 from wbb import SUDOERS, USERBOT_PREFIX, app, app2, arq, eor
 from wbb.core.decorators.errors import capture_err
@@ -104,9 +104,10 @@ PING_LOCK = Lock()
 @app2.on_message(
     SUDOERS
     & filters.command("ping", prefixes=USERBOT_PREFIX)
-    & ~filters.edited
 )
-@app.on_message(filters.command("ping") & ~filters.edited)
+@app.on_message(
+    filters.command("ping")
+)
 async def ping_handler(_, message):
     m = await eor(message, text="Pinging datacenters...")
     async with PING_LOCK:
@@ -139,7 +140,9 @@ async def ping_handler(_, message):
         await m.edit(text)
 
 
-@app.on_message(filters.command("asq") & ~filters.edited)
+@app.on_message(
+    filters.command("asq")
+)
 async def asq(_, message):
     err = "Reply to text message or pass the question as argument"
     if message.reply_to_message:
@@ -156,7 +159,9 @@ async def asq(_, message):
         await m.edit(resp.result)
 
 
-@app.on_message(filters.command("commit") & ~filters.edited)
+@app.on_message(
+    filters.command("commit")
+)
 async def commit(_, message):
     await message.reply_text(await get("http://whatthecommit.com/index.txt"))
 
@@ -171,17 +176,24 @@ async def rtfm(_, message):
     )
 
 
-@app.on_message(filters.command("runs") & ~filters.edited)
+@app.on_message(
+    filters.command("runs")
+)
 async def runs(_, message):
     await message.reply_text((await random_line("wbb/utils/runs.txt")))
 
 
-@app2.on_message(filters.command("id", prefixes=USERBOT_PREFIX) & SUDOERS)
-@app.on_message(filters.command("id"))
+@app2.on_message(
+    filters.command("id", prefixes=USERBOT_PREFIX) 
+    & SUDOERS
+)
+@app.on_message(
+    filters.command("id")
+)
 async def getid(client, message):
     chat = message.chat
     your_id = message.from_user.id
-    message_id = message.message_id
+    message_id = message.id
     reply = message.reply_to_message
 
     text = f"**[Message ID:]({message.link})** `{message_id}`\n"
@@ -210,12 +222,14 @@ async def getid(client, message):
         message,
         text=text,
         disable_web_page_preview=True,
-        parse_mode="md",
+        parse_mode=enums.ParseMode.MARKDOWN,
     )
 
 
 # Random
-@app.on_message(filters.command("random") & ~filters.edited)
+@app.on_message(
+    filters.command("random")
+)
 @capture_err
 async def random(_, message):
     if len(message.command) != 2:
@@ -239,7 +253,9 @@ async def random(_, message):
 
 
 # Translate
-@app.on_message(filters.command("tr") & ~filters.edited)
+@app.on_message(
+    filters.command("tr")
+)
 @capture_err
 async def tr(_, message):
     if len(message.command) != 2:
@@ -262,7 +278,9 @@ async def tr(_, message):
     await message.reply_text(result.result.translatedText)
 
 
-@app.on_message(filters.command("json") & ~filters.edited)
+@app.on_message(
+    filters.command("json")
+)
 @capture_err
 async def json_fetch(_, message):
     if len(message.command) != 2:
@@ -284,7 +302,9 @@ async def json_fetch(_, message):
         await m.edit(str(e))
 
 
-@app.on_message(filters.command(["kickme", "banme"]))
+@app.on_message(
+    filters.command(["kickme", "banme"])
+)
 async def kickbanme(_, message):
     await message.reply_text(
         "Haha, it doesn't work that way, You're stuck with everyone here."

+ 7 - 4
wbb/modules/mongo_backup.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -24,15 +24,18 @@ SOFTWARE.
 from os import remove
 from os import system as execute
 
-from pyrogram import filters
+from pyrogram import filters, enums
 from pyrogram.types import Message
 
 from wbb import MONGO_URL, SUDOERS, app
 
 
-@app.on_message(filters.command("backup") & SUDOERS & ~filters.edited)
+@app.on_message(
+    filters.command("backup") 
+    & SUDOERS
+)
 async def backup(_, message: Message):
-    if message.chat.type != "private":
+    if message.chat.type != enums.ChatType.PRIVATE:
         return await message.reply("This command can only be used in private")
 
     m = await message.reply("Backing up data...")

+ 12 - 6
wbb/modules/music.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -24,7 +24,7 @@ SOFTWARE.
 
 import datetime
 import os
-from asyncio import get_running_loop
+import asyncio
 from functools import partial
 from io import BytesIO
 
@@ -78,7 +78,9 @@ def download_youtube_audio(arq_resp):
     return [title, performer, duration, audio_file, thumbnail_file]
 
 
-@app.on_message(filters.command("ytmusic") & ~filters.edited)
+@app.on_message(
+    filters.command("ytmusic")
+)
 @capture_err
 async def music(_, message):
     global is_downloading
@@ -95,7 +97,7 @@ async def music(_, message):
         f"Downloading {url}", disable_web_page_preview=True
     )
     try:
-        loop = get_running_loop()
+        loop = asyncio.get_running_loop()
         arq_resp = await arq.youtube(url)
         music = await loop.run_in_executor(
             None, partial(download_youtube_audio, arq_resp)
@@ -138,7 +140,9 @@ async def download_song(url):
 # Jiosaavn Music
 
 
-@app.on_message(filters.command("saavn") & ~filters.edited)
+@app.on_message(
+    filters.command("saavn")
+)
 @capture_err
 async def jssong(_, message):
     global is_downloading
@@ -181,7 +185,9 @@ async def jssong(_, message):
 # Lyrics
 
 
-@app.on_message(filters.command("lyrics") & ~filters.edited)
+@app.on_message(
+    filters.command("lyrics")
+)
 async def lyrics_func(_, message):
     if len(message.command) < 2:
         return await message.reply_text("**Usage:**\n/lyrics [QUERY]")

+ 32 - 9
wbb/modules/notes.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -50,8 +50,14 @@ Checkout /markdownhelp to know more about formattings and other syntax.
 """
 
 
-@app2.on_message(filters.command("save", prefixes=USERBOT_PREFIX) & SUDOERS)
-@app.on_message(filters.command("save") & ~filters.edited & ~filters.private)
+@app2.on_message(
+    filters.command("save", prefixes=USERBOT_PREFIX) 
+    & SUDOERS
+)
+@app.on_message(
+    filters.command("save") 
+    & ~filters.private
+)
 @adminsOnly("can_change_info")
 async def save_notee(_, message):
     if len(message.command) < 2 or not message.reply_to_message:
@@ -85,8 +91,14 @@ async def save_notee(_, message):
         await eor(message, text=f"__**Saved note {name}.**__")
 
 
-@app2.on_message(filters.command("notes", prefixes=USERBOT_PREFIX) & SUDOERS)
-@app.on_message(filters.command("notes") & ~filters.edited & ~filters.private)
+@app2.on_message(
+    filters.command("notes", prefixes=USERBOT_PREFIX) 
+    & SUDOERS
+)
+@app.on_message(
+    filters.command("notes") 
+    & ~filters.private
+)
 @capture_err
 async def get_notes(_, message):
     prefix = message.text.split()[0][0]
@@ -104,7 +116,10 @@ async def get_notes(_, message):
     await eor(message, text=msg)
 
 
-@app2.on_message(filters.command("get", prefixes=USERBOT_PREFIX) & SUDOERS)
+@app2.on_message(
+    filters.command("get", prefixes=USERBOT_PREFIX) 
+    & SUDOERS
+)
 async def get_one_note_userbot(_, message):
     if len(message.text.split()) < 2:
         return await eor(message, text="Invalid arguments")
@@ -127,7 +142,9 @@ async def get_one_note_userbot(_, message):
 
 
 @app.on_message(
-    filters.regex(r"^#.+") & filters.text & ~filters.edited & ~filters.private
+    filters.regex(r"^#.+") 
+    & filters.text 
+    & ~filters.private
 )
 @capture_err
 async def get_one_note(_, message):
@@ -153,8 +170,14 @@ async def get_one_note(_, message):
         await message.reply_sticker(_note["data"])
 
 
-@app2.on_message(filters.command("delete", prefixes=USERBOT_PREFIX) & SUDOERS)
-@app.on_message(filters.command("delete") & ~filters.edited & ~filters.private)
+@app2.on_message(
+    filters.command("delete", prefixes=USERBOT_PREFIX) 
+    & SUDOERS
+)
+@app.on_message(
+    filters.command("delete") 
+    & ~filters.private
+)
 @adminsOnly("can_change_info")
 async def del_note(_, message):
     if len(message.command) < 2:

+ 33 - 8
wbb/modules/parse_preview.py

@@ -1,6 +1,30 @@
-from asyncio import sleep
+"""
+MIT License
 
-from pyrogram import filters
+Copyright (c) present 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.
+"""
+
+import asyncio
+
+from pyrogram import filters, enums
 from pyrogram.types import Message
 
 from wbb import SUDOERS, USERBOT_PREFIX, app2, eor
@@ -8,7 +32,8 @@ from wbb.core.sections import section
 
 
 @app2.on_message(
-    filters.command("parse_preview", prefixes=USERBOT_PREFIX) & SUDOERS
+    filters.command("parse_preview", prefixes=USERBOT_PREFIX) 
+    & SUDOERS
 )
 async def parse(_, message: Message):
     r = message.reply_to_message
@@ -22,7 +47,7 @@ async def parse(_, message: Message):
         text = r.text or r.caption
         if text:
             m = await app2.send_message("me", text)
-            await sleep(1)
+            await asyncio.sleep(1)
             await m.delete()
             if m.web_page:
                 r = m
@@ -52,16 +77,16 @@ async def parse(_, message: Message):
 
     t = wpp.type
 
-    if t == "photo":
+    if t == enums.MessagesFilter.PHOTO:
         media = wpp.photo
         func = app2.send_photo
-    elif t == "audio":
+    elif t == enums.MessagesFilter.AUDIO:
         media = wpp.audio
         func = app2.send_audio
-    elif t == "video":
+    elif t == enums.MessagesFilter.VIDEO:
         media = wpp.video
         func = app2.send_video
-    elif t == "document":
+    elif t == enums.MessagesFilter.DOCUMENT:
         media = wpp.document
         func = app2.send_document
     else:

+ 8 - 3
wbb/modules/paste.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -38,8 +38,13 @@ __HELP__ = "/paste - To Paste Replied Text Or Document To A Pastebin"
 pattern = re.compile(r"^text/|json$|yaml$|xml$|toml$|x-sh$|x-shellscript$")
 
 
-@app2.on_message(filters.command("paste", prefixes=USERBOT_PREFIX) & SUDOERS)
-@app.on_message(filters.command("paste") & ~filters.edited)
+@app2.on_message(
+    filters.command("paste", prefixes=USERBOT_PREFIX) 
+    & SUDOERS
+)
+@app.on_message(
+    filters.command("paste")
+)
 @capture_err
 async def paste_func(_, message: Message):
     if not message.reply_to_message:

+ 21 - 6
wbb/modules/pipes.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -60,7 +60,10 @@ pipes_list_bot = {}
 pipes_list_userbot = {}
 
 
-@app.on_message(~filters.me, group=500)
+@app.on_message(
+    ~filters.me, 
+    group=500
+)
 @capture_err
 async def pipes_worker_bot(_, message: Message):
     chat_id = message.chat.id
@@ -68,7 +71,10 @@ async def pipes_worker_bot(_, message: Message):
         await message.forward(pipes_list_bot[chat_id])
 
 
-@app2.on_message(~filters.me, group=500)
+@app2.on_message(
+    ~filters.me, 
+    group=500
+)
 @capture_err
 async def pipes_worker_userbot(_, message: Message):
     chat_id = message.chat.id
@@ -95,7 +101,10 @@ async def pipes_worker_userbot(_, message: Message):
         await app.send_message(to_chat_id, text=message.text + caption)
 
 
-@app.on_message(filters.command("activate_pipe") & SUDOERS & ~filters.edited)
+@app.on_message(
+    filters.command("activate_pipe") 
+    & SUDOERS
+)
 @capture_err
 async def activate_pipe_func(_, message: Message):
     global pipes_list_bot, pipes_list_userbot
@@ -125,7 +134,10 @@ async def activate_pipe_func(_, message: Message):
     await message.reply_text("Activated pipe.")
 
 
-@app.on_message(filters.command("deactivate_pipe") & SUDOERS & ~filters.edited)
+@app.on_message(
+    filters.command("deactivate_pipe") 
+    & SUDOERS
+)
 @capture_err
 async def deactivate_pipe_func(_, message: Message):
     global pipes_list_bot, pipes_list_userbot
@@ -147,7 +159,10 @@ async def deactivate_pipe_func(_, message: Message):
     await message.reply_text("Deactivated pipe.")
 
 
-@app.on_message(filters.command("pipes") & SUDOERS & ~filters.edited)
+@app.on_message(
+    filters.command("pipes") 
+    & SUDOERS
+)
 @capture_err
 async def show_pipes_func(_, message: Message):
     pipes_list_bot.update(pipes_list_userbot)

+ 4 - 5
wbb/modules/pmpermit.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -40,7 +40,6 @@ flood = {}
     filters.private
     & filters.incoming
     & ~filters.service
-    & ~filters.edited
     & ~filters.me
     & ~filters.bot
     & ~filters.via_bot
@@ -51,7 +50,7 @@ async def pmpermit_func(_, message):
     user_id = message.from_user.id
     if not PM_PERMIT or await is_pmpermit_approved(user_id):
         return
-    async for m in app2.iter_history(user_id, limit=6):
+    async for m in app2.get_chat_history(user_id, limit=6):
         if m.reply_markup:
             await m.delete()
     if str(user_id) in flood:
@@ -98,7 +97,7 @@ async def pm_disapprove(_, message):
     user_id = message.reply_to_message.from_user.id
     if not await is_pmpermit_approved(user_id):
         await eor(message, text="User is already disapproved to pm")
-        async for m in app2.iter_history(user_id, limit=6):
+        async for m in app2.get_chat_history(user_id, limit=6):
             if m.reply_markup:
                 try:
                     await m.delete()
@@ -177,7 +176,7 @@ async def pmpermit_cq(_, cq):
         return await cq.answer("It's For The Other Person.")
 
     if data == "to_scam_you":
-        async for m in app2.iter_history(user_id, limit=6):
+        async for m in app2.get_chat_history(user_id, limit=6):
             if m.reply_markup:
                 await m.delete()
         await app2.send_message(user_id, "Blocked, Go scam someone else.")

+ 3 - 2
wbb/modules/purge_me.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -90,7 +90,8 @@ log.info("Done pasting userbot commands on telegraph")
 
 
 @app2.on_message(
-    filters.command("help", prefixes=USERBOT_PREFIX) & filters.user(USERBOT_ID)
+    filters.command("help", prefixes=USERBOT_PREFIX) 
+    & filters.user(USERBOT_ID)
 )
 async def get_help(_, message: Message):
     await eor(

+ 12 - 6
wbb/modules/quotly.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -64,8 +64,14 @@ def isArgInt(message: Message) -> list:
         return [False, 0]
 
 
-@app2.on_message(filters.command("q", prefixes=USERBOT_PREFIX) & SUDOERS)
-@app.on_message(filters.command("q") & ~filters.private & ~filters.edited)
+@app2.on_message(
+    filters.command("q", prefixes=USERBOT_PREFIX) 
+    & SUDOERS
+)
+@app.on_message(
+    filters.command("q") 
+    & ~filters.private
+)
 @capture_err
 async def quotly_func(client, message: Message):
     if not message.reply_to_message:
@@ -93,8 +99,8 @@ async def quotly_func(client, message: Message):
                 for i in await client.get_messages(
                     message.chat.id,
                     range(
-                        message.reply_to_message.message_id,
-                        message.reply_to_message.message_id + (count + 5),
+                        message.reply_to_message.id,
+                        message.reply_to_message.id + (count + 5),
                     ),
                     replies=0,
                 )
@@ -108,7 +114,7 @@ async def quotly_func(client, message: Message):
                 )
             reply_message = await client.get_messages(
                 message.chat.id,
-                message.reply_to_message.message_id,
+                message.reply_to_message.id,
                 replies=1,
             )
             messages = [reply_message]

+ 4 - 2
wbb/modules/reddit.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -30,7 +30,9 @@ __MODULE__ = "Reddit"
 __HELP__ = "/reddit [query] - results something from reddit"
 
 
-@app.on_message(filters.command("reddit") & ~filters.edited)
+@app.on_message(
+    filters.command("reddit")
+)
 @capture_err
 async def reddit(_, message):
     if len(message.command) != 2:

+ 4 - 2
wbb/modules/repo.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -31,7 +31,9 @@ __MODULE__ = "Repo"
 __HELP__ = "/repo - To Get My Github Repository Link " "And Support Group Link"
 
 
-@app.on_message(filters.command("repo") & ~filters.edited)
+@app.on_message(
+    filters.command("repo")
+)
 @capture_err
 async def repo(_, message):
     users = await get(

+ 11 - 6
wbb/modules/reverse.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 """
 import os
-from asyncio import gather, get_running_loop
+import asyncio
 from base64 import b64decode
 from io import BytesIO
 from random import randint
@@ -44,8 +44,13 @@ async def get_soup(url: str, headers):
     return BeautifulSoup(html, "html.parser")
 
 
-@app2.on_message(filters.command("reverse", prefixes=USERBOT_PREFIX) & SUDOERS)
-@app.on_message(filters.command("reverse") & ~filters.edited)
+@app2.on_message(
+    filters.command("reverse", prefixes=USERBOT_PREFIX) 
+    & SUDOERS
+)
+@app.on_message(
+    filters.command("reverse")
+)
 @capture_err
 async def reverse_image_search(client, message: Message):
     if not message.reply_to_message:
@@ -82,7 +87,7 @@ async def reverse_image_search(client, message: Message):
                     search_url, files=multipart, allow_redirects=False
                 )
 
-            loop = get_running_loop()
+            loop = asyncio.get_running_loop()
             response = await loop.run_in_executor(None, post_non_blocking)
             location = response.headers.get("Location")
             os.remove(image)
@@ -130,7 +135,7 @@ async def reverse_image_search(client, message: Message):
 
         # Cache images, so we can use file_ids
         tasks = [client.send_photo(MESSAGE_DUMP_CHAT, img) for img in media]
-        messages = await gather(*tasks)
+        messages = await asyncio.gather(*tasks)
 
         await message.reply_media_group(
             [

+ 7 - 8
wbb/modules/rice.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -23,7 +23,7 @@ SOFTWARE.
 """
 from re import MULTILINE as RE_MULTILINE
 
-from pyrogram import filters
+from pyrogram import filters, enums
 from pyrogram.types import (
     InlineKeyboardButton,
     InlineKeyboardMarkup,
@@ -46,7 +46,6 @@ RICE_CHANNEL = "RiceGallery"
     & (filters.photo | filters.video | filters.document)
     & filters.regex(r"^\[RICE\]", RE_MULTILINE)
     & ~filters.forwarded
-    & ~filters.edited
 )
 @capture_err
 async def rice(_, message: Message):
@@ -67,17 +66,17 @@ async def rice(_, message: Message):
             ]
         ),
         quote=True,
-        parse_mode="markdown",
+        parse_mode=enums.ParseMode.MARKDOWN,
     )
 
 
 @app.on_callback_query(filters.regex("forward"))
 async def callback_query_forward_rice(_, callback_query):
-    app.set_parse_mode("markdown")
+    app.set_parse_mode(enums.ParseMode.MARKDOWN)
     u_approver = callback_query.from_user
     c_group = callback_query.message.chat
     approver_status = (await c_group.get_member(u_approver.id)).status
-    if not (approver_status in ("creator", "administrator")):
+    if not (approver_status in (enums.ChatMemberStatus.OWNER, enums.ChatMemberStatus.ADMINISTRATOR)):
         await callback_query.answer("Only admin can approve this!")
         return
     await callback_query.answer("Successfully approved")
@@ -85,7 +84,7 @@ async def callback_query_forward_rice(_, callback_query):
     u_op = m_op.from_user
     arg_caption = f"{m_op.caption}\nOP: [{u_op.first_name}]({m_op.link})"
     if m_op.media_group_id:
-        message_id = m_op.message_id
+        message_id = m_op.id
         media_group = await app.get_media_group(RICE_GROUP, message_id)
         arg_media = []
         for m in media_group:
@@ -124,7 +123,7 @@ async def callback_query_ignore_rice(_, callback_query):
     u_op = m_op.from_user
     if u_disprover.id == u_op.id:
         await callback_query.answer("Ok, this rice won't be forwarded")
-    elif disprover_status in ("creator", "administrator"):
+    elif disprover_status in (enums.ChatMemberStatus.OWNER, enums.ChatMemberStatus.ADMINISTRATOR):
         await m_op.reply_text(f"{u_disprover.mention} ignored this rice")
     else:
         return await callback_query.answer("Only admin or OP could ignore it")

+ 36 - 8
wbb/modules/rss.py

@@ -1,4 +1,28 @@
-from asyncio import get_event_loop, sleep
+"""
+MIT License
+
+Copyright (c) present 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.
+"""
+
+import asyncio
 
 from feedparser import parse
 from pyrogram import filters
@@ -37,10 +61,10 @@ async def rss_worker():
     while True:
         feeds = await get_rss_feeds()
         if not feeds:
-            await sleep(RSS_DELAY)
+            await asyncio.sleep(RSS_DELAY)
             continue
 
-        loop = get_event_loop()
+        loop = asyncio.get_event_loop()
 
         for _feed in feeds:
             chat = _feed["chat_id"]
@@ -65,14 +89,16 @@ async def rss_worker():
                 log.info(f"Removed RSS Feed from {chat} (Invalid Chat)")
             except Exception as e:
                 log.info(f"RSS in {chat}: {str(e)}")
-        await sleep(RSS_DELAY)
+        await asyncio.sleep(RSS_DELAY)
 
 
-loop = get_event_loop()
+loop = asyncio.get_event_loop()
 loop.create_task(rss_worker())
 
 
-@app.on_message(filters.command("add_feed") & ~filters.edited)
+@app.on_message(
+    filters.command("add_feed")
+)
 @capture_err
 async def add_feed_func(_, m: Message):
     if len(m.command) != 2:
@@ -93,7 +119,7 @@ async def add_feed_func(_, m: Message):
 
     ns = "[ERROR]: This feed isn't supported."
     try:
-        loop = get_event_loop()
+        loop = asyncio.get_event_loop()
         parsed = await loop.run_in_executor(None, parse, url)
         feed = Feed(parsed)
     except Exception:
@@ -111,7 +137,9 @@ async def add_feed_func(_, m: Message):
     await add_rss_feed(chat_id, parsed.url, feed.title)
 
 
-@app.on_message(filters.command("rm_feed") & ~filters.edited)
+@app.on_message(
+    filters.command("rm_feed")
+)
 async def rm_feed_func(_, m: Message):
     if await is_rss_active(m.chat.id):
         await remove_rss_feed(m.chat.id)

+ 12 - 5
wbb/modules/stickers.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -66,7 +66,9 @@ MAX_STICKERS = (
 SUPPORTED_TYPES = ["jpeg", "png", "webp"]
 
 
-@app.on_message(filters.command("sticker_id") & ~filters.edited)
+@app.on_message(
+    filters.command("sticker_id")
+)
 @capture_err
 async def sticker_id(_, message: Message):
     reply = message.reply_to_message
@@ -80,7 +82,9 @@ async def sticker_id(_, message: Message):
     await message.reply_text(f"`{reply.sticker.file_id}`")
 
 
-@app.on_message(filters.command("get_sticker") & ~filters.edited)
+@app.on_message(
+    filters.command("get_sticker")
+)
 @capture_err
 async def sticker_image(_, message: Message):
     r = message.reply_to_message
@@ -106,7 +110,8 @@ async def sticker_image(_, message: Message):
 
 
 @app2.on_message(
-    filters.command("kang", prefixes=USERBOT_PREFIX) & SUDOERS,
+    filters.command("kang", prefixes=USERBOT_PREFIX) 
+    & SUDOERS,
 )
 async def userbot_kang(_, message: Message):
     reply = message.reply_to_message
@@ -137,7 +142,9 @@ async def userbot_kang(_, message: Message):
         await m.delete()
 
 
-@app.on_message(filters.command("kang") & ~filters.edited)
+@app.on_message(
+    filters.command("kang")
+)
 @capture_err
 async def kang(client, message: Message):
     if not message.reply_to_message:

+ 13 - 4
wbb/modules/sudo.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -45,7 +45,10 @@ can even delete your account.
 """
 
 
-@app2.on_message(filters.command("useradd", prefixes=USERBOT_PREFIX) & SUDOERS)
+@app2.on_message(
+    filters.command("useradd", prefixes=USERBOT_PREFIX) 
+    & SUDOERS
+)
 @capture_err
 async def useradd(_, message: Message):
     if not message.reply_to_message:
@@ -75,7 +78,10 @@ async def useradd(_, message: Message):
     )
 
 
-@app2.on_message(filters.command("userdel", prefixes=USERBOT_PREFIX) & SUDOERS)
+@app2.on_message(
+    filters.command("userdel", prefixes=USERBOT_PREFIX) 
+    & SUDOERS
+)
 @capture_err
 async def userdel(_, message: Message):
     if not message.reply_to_message:
@@ -100,7 +106,10 @@ async def userdel(_, message: Message):
     )
 
 
-@app2.on_message(filters.command("sudoers", prefixes=USERBOT_PREFIX) & SUDOERS)
+@app2.on_message(
+    filters.command("sudoers", prefixes=USERBOT_PREFIX) 
+    & SUDOERS
+)
 @capture_err
 async def sudoers_list(_, message: Message):
     sudoers = await get_sudoers()

+ 19 - 7
wbb/modules/sudoers.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -92,7 +92,10 @@ DISK: {disk}%
 # Gban
 
 
-@app.on_message(filters.command("gban") & SUDOERS & ~filters.edited)
+@app.on_message(
+    filters.command("gban") 
+    & SUDOERS
+)
 @capture_err
 async def ban_globally(_, message):
     user_id, reason = await extract_user_and_reason(message)
@@ -120,7 +123,7 @@ async def ban_globally(_, message):
             number_of_chats += 1
             await asyncio.sleep(1)
         except FloodWait as e:
-            await asyncio.sleep(int(e.x))
+            await asyncio.sleep(int(e.value))
         except Exception:
             pass
     try:
@@ -159,7 +162,10 @@ __**New Global Ban**__
 # Ungban
 
 
-@app.on_message(filters.command("ungban") & SUDOERS & ~filters.edited)
+@app.on_message(
+    filters.command("ungban") 
+    & SUDOERS
+)
 @capture_err
 async def unban_globally(_, message):
     user_id = await extract_user(message)
@@ -178,7 +184,10 @@ async def unban_globally(_, message):
 # Broadcast
 
 
-@app.on_message(filters.command("broadcast") & SUDOERS & ~filters.edited)
+@app.on_message(
+    filters.command("broadcast") 
+    & SUDOERS
+)
 @capture_err
 async def broadcast_message(_, message):
     if len(message.command) < 2:
@@ -197,7 +206,7 @@ async def broadcast_message(_, message):
             await asyncio.sleep(sleep_time)
             sent += 1
         except FloodWait as e:
-            await asyncio.sleep(int(e.x))
+            await asyncio.sleep(int(e.value))
         except Exception:
             pass
     await m.edit(f"**Broadcasted Message In {sent} Chats.**")
@@ -206,7 +215,10 @@ async def broadcast_message(_, message):
 # Update
 
 
-@app.on_message(filters.command("update") & SUDOERS & ~filters.edited)
+@app.on_message(
+    filters.command("update") 
+    & SUDOERS
+)
 async def update_restart(_, message):
     try:
         out = subprocess.check_output(["git", "pull"]).decode("UTF-8")

+ 2 - 3
wbb/modules/taglogger.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -72,8 +72,7 @@ async def sendLog(message: Message):
 @app2.on_message(
     ~filters.me
     & ~filters.chat([LOG_GROUP_ID, BOT_ID])
-    & ~filters.private
-    & ~filters.edited,
+    & ~filters.private,
     group=taglog_group,
 )
 @capture_err

+ 27 - 1
wbb/modules/telegraph.py

@@ -1,3 +1,27 @@
+"""
+MIT License
+
+Copyright (c) present 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.
+"""
+
 from pyrogram import filters
 from pyrogram.types import Message
 
@@ -8,7 +32,9 @@ __MODULE__ = "Telegraph"
 __HELP__ = "/telegraph [Page name]: Paste styled text on telegraph."
 
 
-@app.on_message(filters.command("telegraph") & ~filters.edited)
+@app.on_message(
+    filters.command("telegraph")
+)
 @capture_err
 async def paste(_, message: Message):
     reply = message.reply_to_message

+ 6 - 4
wbb/modules/tts.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 """
 import traceback
-from asyncio import get_running_loop
+import asyncio
 from io import BytesIO
 
 from googletrans import Translator
@@ -43,7 +43,9 @@ def convert(text):
     return audio
 
 
-@app.on_message(filters.command("tts") & ~filters.edited)
+@app.on_message(
+    filters.command("tts")
+)
 async def text_to_speech(_, message: Message):
     if not message.reply_to_message:
         return await message.reply_text("Reply to some text ffs.")
@@ -52,7 +54,7 @@ async def text_to_speech(_, message: Message):
     m = await message.reply_text("Processing")
     text = message.reply_to_message.text
     try:
-        loop = get_running_loop()
+        loop = asyncio.get_running_loop()
         audio = await loop.run_in_executor(None, convert, text)
         await message.reply_audio(audio)
         await m.delete()

+ 9 - 11
wbb/modules/userbot.py

@@ -10,12 +10,12 @@ import re
 import subprocess
 import sys
 import traceback
-from asyncio import sleep
+import asyncio
 from html import escape
 from io import StringIO
 from time import time
 
-from pyrogram import filters
+from pyrogram import filters, enums
 from pyrogram.errors import MessageNotModified
 from pyrogram.types import Message, ReplyKeyboardMarkup
 
@@ -40,18 +40,18 @@ async def aexec(code, client, message):
     return await locals()["__aexec"](client, message)
 
 
-async def iter_edit(message: Message, text: str):
-    async for m in app2.iter_history(message.chat.id):
+async def get_edit(message: Message, text: str):
+    async for m in app2.get_chat_history(message.chat.id):
 
         # If no replies found, reply
-        if m.message_id == message.message_id:
+        if m.id == message.id:
             return 0
 
         if not m.from_user or not m.text or not m.reply_to_message:
             continue
 
         if (
-                (m.reply_to_message.message_id == message.message_id)
+                (m.reply_to_message.id == message.id)
                 and (m.from_user.id == message.from_user.id)
                 and ("→" in m.text)
         ):
@@ -74,7 +74,7 @@ async def executor(client, message: Message):
     except IndexError:
         return await message.delete()
 
-    if message.chat.type == "channel":
+    if message.chat.type == enums.ChatType.CHANNEL:
         return
 
     m = message
@@ -144,7 +144,7 @@ async def executor(client, message: Message):
 
     # Edit the output if input is edited
     if message.edit_date:
-        status_ = await iter_edit(message, final_output)
+        status_ = await get_edit(message, final_output)
         if status_ == 0:
             return await message.reply(final_output, quote=True)
         return
@@ -157,7 +157,6 @@ async def executor(client, message: Message):
     SUDOERS
     & ~filters.forwarded
     & ~filters.via_bot
-    & ~filters.edited
     & filters.command("sh", prefixes=USERBOT_PREFIX),
 )
 async def shellrunner(_, message: Message):
@@ -220,7 +219,7 @@ async def shellrunner(_, message: Message):
             await app2.send_document(
                 message.chat.id,
                 "output.txt",
-                reply_to_message_id=message.message_id,
+                reply_to_message_id=message.id,
                 caption=escape(text),
             )
             return os.remove("output.txt")
@@ -238,7 +237,6 @@ async def shellrunner(_, message: Message):
 @app2.on_message(
     SUDOERS
     & filters.command("reserve", prefixes=USERBOT_PREFIX)
-    & ~filters.edited
 )
 async def reserve_channel_handler(_, message: Message):
     if len(message.text.split()) != 2:

+ 8 - 3
wbb/modules/webss.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -56,8 +56,13 @@ async def take_screenshot(url: str, full: bool = False):
     return file
 
 
-@app2.on_message(filters.command("webss", USERBOT_PREFIX) & SUDOERS)
-@app.on_message(filters.command("webss") & ~filters.edited)
+@app2.on_message(
+    filters.command("webss", USERBOT_PREFIX) 
+    & SUDOERS
+)
+@app.on_message(
+    filters.command("webss")
+)
 @capture_err
 async def take_ss(_, message: Message):
     if len(message.command) < 2:

+ 1 - 1
wbb/utils/__init__.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 32 - 4
wbb/utils/constants.py

@@ -1,6 +1,30 @@
+"""
+MIT License
+
+Copyright (c) present 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.
+"""
+
 # New file
 
-from pyrogram.filters import command, edited
+from pyrogram import filters, enums
 from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
 
 from wbb import BOT_USERNAME, app
@@ -39,7 +63,9 @@ NOTE: Fillings only works in greetings module.
 """
 
 
-@app.on_message(command("markdownhelp") & ~edited)
+@app.on_message(
+    filters.command("markdownhelp")
+)
 async def mkdwnhelp(_, m: Message):
     keyb = InlineKeyboardMarkup(
         [
@@ -51,13 +77,15 @@ async def mkdwnhelp(_, m: Message):
             ]
         ]
     )
-    if m.chat.type != "private":
+    if m.chat.type != enums.ChatType.PRIVATE:
         await m.reply(
             "Click on the below button to get markdown usage syntax in pm!",
             reply_markup=keyb,
         )
     else:
         await m.reply(
-            MARKDOWN, parse_mode="html", disable_web_page_preview=True
+            MARKDOWN, 
+            parse_mode=enums.ParseMode.HTML, 
+            disable_web_page_preview=True
         )
     return

+ 1 - 1
wbb/utils/dbfunctions.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 24 - 0
wbb/utils/downloader.py

@@ -1,3 +1,27 @@
+"""
+MIT License
+
+Copyright (c) present 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.
+"""
+
 from os.path import abspath as absolute_path
 from time import time
 

+ 1 - 1
wbb/utils/files.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 1 - 1
wbb/utils/filter_groups.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 1 - 1
wbb/utils/formatter.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 6 - 5
wbb/utils/functions.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -21,7 +21,7 @@ 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.
 """
-from asyncio import gather
+import asyncio
 from datetime import datetime, timedelta
 from io import BytesIO
 from math import atan2, cos, radians, sin, sqrt
@@ -34,6 +34,7 @@ from sys import executable
 import aiofiles
 import speedtest
 from PIL import Image, ImageDraw, ImageFilter, ImageFont
+from pyrogram import enums
 from pyrogram.types import Message
 
 from wbb import aiohttpsession as aiosession
@@ -135,7 +136,7 @@ async def transfer_sh(file_or_message):
 
 async def calc_distance_from_ip(ip1: str, ip2: str) -> float:
     Radius_Earth = 6371.0088
-    data1, data2 = await gather(
+    data1, data2 = await asyncio.gather(
         get(f"http://ipinfo.io/{ip1}"),
         get(f"http://ipinfo.io/{ip2}"),
     )
@@ -199,9 +200,9 @@ async def extract_userid(message, text: str):
     if len(entities) < 2:
         return (await app.get_users(text)).id
     entity = entities[1]
-    if entity.type == "mention":
+    if entity.type == enums.MessageEntityType.MENTION:
         return (await app.get_users(text)).id
-    if entity.type == "text_mention":
+    if entity.type == enums.MessageEntityType.TEXT_MENTION:
         return entity.user.id
     return None
 

+ 5 - 5
wbb/utils/http.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -21,7 +21,7 @@ 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.
 """
-from asyncio import gather
+import asyncio
 
 from wbb import aiohttpsession as session
 
@@ -54,15 +54,15 @@ async def post(url: str, *args, **kwargs):
 
 
 async def multiget(url: str, times: int, *args, **kwargs):
-    return await gather(*[get(url, *args, **kwargs) for _ in range(times)])
+    return await asyncio.gather(*[get(url, *args, **kwargs) for _ in range(times)])
 
 
 async def multihead(url: str, times: int, *args, **kwargs):
-    return await gather(*[head(url, *args, **kwargs) for _ in range(times)])
+    return await asyncio.gather(*[head(url, *args, **kwargs) for _ in range(times)])
 
 
 async def multipost(url: str, times: int, *args, **kwargs):
-    return await gather(*[post(url, *args, **kwargs) for _ in range(times)])
+    return await asyncio.gather(*[post(url, *args, **kwargs) for _ in range(times)])
 
 
 async def resp_get(url: str, *args, **kwargs):

+ 7 - 4
wbb/utils/inlinefuncs.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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
@@ -33,13 +33,14 @@ from fuzzysearch import find_near_matches
 from motor import version as mongover
 from pykeyboard import InlineKeyboard
 from pyrogram import __version__ as pyrover
-from pyrogram import filters
+from pyrogram import filters, enums
 from pyrogram.raw.functions import Ping
 from pyrogram.types import (
     CallbackQuery,
     InlineKeyboardButton,
     InlineQueryResultArticle,
     InlineQueryResultPhoto,
+    InlineQueryResultCachedDocument,
     InputTextMessageContent,
 )
 from search_engine_parser import GoogleSearch
@@ -57,7 +58,6 @@ from wbb import (
 )
 from wbb.core.keyboard import ikb
 from wbb.core.tasks import _get_tasks_text, all_tasks, rm_task
-from wbb.core.types import InlineQueryResultCachedDocument
 from wbb.modules.info import get_chat_info, get_user_info
 from wbb.modules.music import download_youtube_audio
 from wbb.utils.functions import test_speedtest
@@ -450,7 +450,10 @@ async def music_inline_func(answers, query):
         messages = [
             m
             async for m in app2.search_messages(
-                chat_id, query, filter="audio", limit=100
+                chat_id, 
+                query, 
+                filter=enums.MessagesFilter.AUDIO, 
+                limit=100
             )
         ]
     except Exception as e:

+ 1 - 1
wbb/utils/json_prettify.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 1 - 1
wbb/utils/misc.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 1 - 1
wbb/utils/pastebin.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 1 - 1
wbb/utils/read_lines.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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

+ 24 - 0
wbb/utils/rss.py

@@ -1,3 +1,27 @@
+"""
+MIT License
+
+Copyright (c) present 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.
+"""
+
 class Feed:
     def __init__(self, feed):
         if not feed.get("entries"):

+ 1 - 1
wbb/utils/stickerset.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) 2021 TheHamkerCat
+Copyright (c) present 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