Bläddra i källkod

Revert "Upgrade to pyrogram 2.0 (#184)" (#185)

This reverts commit 5073053a159c665f0cd63cffc371d4b5daf176ea.
Akshay Rajput 4 år sedan
förälder
incheckning
752eca71ed
82 ändrade filer med 642 tillägg och 811 borttagningar
  1. 1 1
      LICENSE
  2. 1 0
      Procfile
  3. 0 2
      heroku.yml
  4. 1 1
      requirements.txt
  5. 1 1
      str_gen.py
  6. 2 2
      wbb/__init__.py
  7. 10 17
      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. 0 24
      wbb/core/tasks.py
  14. 313 0
      wbb/core/types/InlineQueryResult.py
  15. 6 0
      wbb/core/types/__init__.py
  16. 1 1
      wbb/modules/__init__.py
  17. 1 1
      wbb/modules/__main__.py
  18. 49 77
      wbb/modules/admin.py
  19. 4 1
      wbb/modules/admin_misc.py
  20. 1 1
      wbb/modules/alive.py
  21. 2 3
      wbb/modules/anonymize.py
  22. 1 0
      wbb/modules/antiservice.py
  23. 2 1
      wbb/modules/arq.py
  24. 3 28
      wbb/modules/autocorrect.py
  25. 8 12
      wbb/modules/blacklist.py
  26. 3 24
      wbb/modules/blacklist_chat.py
  27. 2 1
      wbb/modules/carbon.py
  28. 1 1
      wbb/modules/chat_watcher.py
  29. 7 11
      wbb/modules/chatbot.py
  30. 7 9
      wbb/modules/couple.py
  31. 2 1
      wbb/modules/create.py
  32. 1 27
      wbb/modules/crypto.py
  33. 2 31
      wbb/modules/dice.py
  34. 3 7
      wbb/modules/download_upload.py
  35. 5 11
      wbb/modules/filters.py
  36. 9 11
      wbb/modules/flood.py
  37. 9 15
      wbb/modules/global_stats.py
  38. 6 17
      wbb/modules/greetings.py
  39. 2 4
      wbb/modules/img_pdf.py
  40. 3 7
      wbb/modules/info.py
  41. 1 1
      wbb/modules/inline.py
  42. 7 10
      wbb/modules/karma.py
  43. 4 12
      wbb/modules/locks.py
  44. 15 35
      wbb/modules/misc.py
  45. 4 7
      wbb/modules/mongo_backup.py
  46. 6 12
      wbb/modules/music.py
  47. 9 32
      wbb/modules/notes.py
  48. 8 33
      wbb/modules/parse_preview.py
  49. 3 8
      wbb/modules/paste.py
  50. 6 21
      wbb/modules/pipes.py
  51. 5 4
      wbb/modules/pmpermit.py
  52. 2 3
      wbb/modules/purge_me.py
  53. 6 12
      wbb/modules/quotly.py
  54. 2 4
      wbb/modules/reddit.py
  55. 2 4
      wbb/modules/repo.py
  56. 6 11
      wbb/modules/reverse.py
  57. 8 7
      wbb/modules/rice.py
  58. 8 36
      wbb/modules/rss.py
  59. 5 12
      wbb/modules/stickers.py
  60. 4 13
      wbb/modules/sudo.py
  61. 7 19
      wbb/modules/sudoers.py
  62. 3 2
      wbb/modules/taglogger.py
  63. 1 27
      wbb/modules/telegraph.py
  64. 4 6
      wbb/modules/tts.py
  65. 11 9
      wbb/modules/userbot.py
  66. 3 8
      wbb/modules/webss.py
  67. 1 1
      wbb/utils/__init__.py
  68. 4 32
      wbb/utils/constants.py
  69. 1 1
      wbb/utils/dbfunctions.py
  70. 0 24
      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. 5 6
      wbb/utils/functions.py
  75. 5 5
      wbb/utils/http.py
  76. 4 7
      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. 0 24
      wbb/utils/rss.py
  82. 1 1
      wbb/utils/stickerset.py

+ 1 - 1
LICENSE

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

+ 1 - 0
Procfile

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

+ 0 - 2
heroku.yml

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

+ 1 - 1
requirements.txt

@@ -9,7 +9,7 @@ motor
 pillow
 psutil
 pykeyboard
-pyrogram
+pyrogram==1.4.16
 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(name="wbb", in_memory=True, api_id=API_ID, api_hash=API_HASH)
+i = c(":memory:", 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) present TheHamkerCat
+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
@@ -109,7 +109,7 @@ if not HEROKU:
         api_hash=API_HASH,
     )
 else:
-    app2 = Client(session_string=SESSION_STRING, api_id=API_ID, api_hash=API_HASH)
+    app2 = Client(SESSION_STRING, api_id=API_ID, api_hash=API_HASH)
 
 aiohttpsession = ClientSession()
 

+ 10 - 17
wbb/__main__.py

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

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

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

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

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

+ 1 - 1
wbb/core/filters.py

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

+ 1 - 1
wbb/core/keyboard.py

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

+ 1 - 1
wbb/core/sections.py

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

+ 0 - 24
wbb/core/tasks.py

@@ -1,27 +1,3 @@
-"""
-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
 

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

@@ -0,0 +1,313 @@
+"""
+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}")

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

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

+ 1 - 1
wbb/modules/__init__.py

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

+ 1 - 1
wbb/modules/__main__.py

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

+ 49 - 77
wbb/modules/admin.py

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

+ 4 - 1
wbb/modules/admin_misc.py

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

+ 2 - 3
wbb/modules/anonymize.py

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

+ 1 - 0
wbb/modules/antiservice.py

@@ -22,6 +22,7 @@ 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):

+ 2 - 1
wbb/modules/arq.py

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

+ 3 - 28
wbb/modules/autocorrect.py

@@ -1,27 +1,3 @@
-"""
-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
 
@@ -32,6 +8,7 @@ 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:
@@ -51,8 +28,7 @@ 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
@@ -72,8 +48,7 @@ async def autocorrect_ubot_toggle(_, message: Message):
 
 
 @app2.on_message(
-    filters.text 
-    & filters.user(USERBOT_ID),
+    filters.text & ~filters.edited & filters.user(USERBOT_ID),
     group=autocorrect_group,
 )
 async def autocorrect_ubot(_, message: Message):

+ 8 - 12
wbb/modules/blacklist.py

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

+ 3 - 24
wbb/modules/blacklist_chat.py

@@ -1,27 +1,3 @@
-"""
-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
 
@@ -49,6 +25,7 @@ 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):
@@ -70,6 +47,7 @@ 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):
@@ -91,6 +69,7 @@ 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):

+ 2 - 1
wbb/modules/carbon.py

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

+ 7 - 11
wbb/modules/chatbot.py

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

+ 7 - 9
wbb/modules/couple.py

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

+ 2 - 1
wbb/modules/create.py

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

+ 1 - 27
wbb/modules/crypto.py

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

+ 2 - 31
wbb/modules/dice.py

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

+ 3 - 7
wbb/modules/download_upload.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) present TheHamkerCat
+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
@@ -37,8 +37,7 @@ 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
@@ -106,10 +105,7 @@ 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")

+ 5 - 11
wbb/modules/filters.py

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

+ 9 - 11
wbb/modules/flood.py

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

+ 9 - 15
wbb/modules/global_stats.py

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

+ 6 - 17
wbb/modules/greetings.py

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

+ 2 - 4
wbb/modules/img_pdf.py

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

+ 3 - 7
wbb/modules/info.py

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

+ 7 - 10
wbb/modules/karma.py

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

+ 4 - 12
wbb/modules/locks.py

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

+ 15 - 35
wbb/modules/misc.py

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

+ 4 - 7
wbb/modules/mongo_backup.py

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

+ 6 - 12
wbb/modules/music.py

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

+ 9 - 32
wbb/modules/notes.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) present TheHamkerCat
+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
@@ -50,14 +50,8 @@ 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.private
-)
+@app2.on_message(filters.command("save", prefixes=USERBOT_PREFIX) & SUDOERS)
+@app.on_message(filters.command("save") & ~filters.edited & ~filters.private)
 @adminsOnly("can_change_info")
 async def save_notee(_, message):
     if len(message.command) < 2 or not message.reply_to_message:
@@ -91,14 +85,8 @@ 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.private
-)
+@app2.on_message(filters.command("notes", prefixes=USERBOT_PREFIX) & SUDOERS)
+@app.on_message(filters.command("notes") & ~filters.edited & ~filters.private)
 @capture_err
 async def get_notes(_, message):
     prefix = message.text.split()[0][0]
@@ -116,10 +104,7 @@ 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")
@@ -142,9 +127,7 @@ async def get_one_note_userbot(_, message):
 
 
 @app.on_message(
-    filters.regex(r"^#.+") 
-    & filters.text 
-    & ~filters.private
+    filters.regex(r"^#.+") & filters.text & ~filters.edited & ~filters.private
 )
 @capture_err
 async def get_one_note(_, message):
@@ -170,14 +153,8 @@ 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.private
-)
+@app2.on_message(filters.command("delete", prefixes=USERBOT_PREFIX) & SUDOERS)
+@app.on_message(filters.command("delete") & ~filters.edited & ~filters.private)
 @adminsOnly("can_change_info")
 async def del_note(_, message):
     if len(message.command) < 2:

+ 8 - 33
wbb/modules/parse_preview.py

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

+ 3 - 8
wbb/modules/paste.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) present TheHamkerCat
+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
@@ -38,13 +38,8 @@ __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")
-)
+@app2.on_message(filters.command("paste", prefixes=USERBOT_PREFIX) & SUDOERS)
+@app.on_message(filters.command("paste") & ~filters.edited)
 @capture_err
 async def paste_func(_, message: Message):
     if not message.reply_to_message:

+ 6 - 21
wbb/modules/pipes.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) present TheHamkerCat
+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
@@ -60,10 +60,7 @@ 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
@@ -71,10 +68,7 @@ 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
@@ -101,10 +95,7 @@ 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
-)
+@app.on_message(filters.command("activate_pipe") & SUDOERS & ~filters.edited)
 @capture_err
 async def activate_pipe_func(_, message: Message):
     global pipes_list_bot, pipes_list_userbot
@@ -134,10 +125,7 @@ async def activate_pipe_func(_, message: Message):
     await message.reply_text("Activated pipe.")
 
 
-@app.on_message(
-    filters.command("deactivate_pipe") 
-    & SUDOERS
-)
+@app.on_message(filters.command("deactivate_pipe") & SUDOERS & ~filters.edited)
 @capture_err
 async def deactivate_pipe_func(_, message: Message):
     global pipes_list_bot, pipes_list_userbot
@@ -159,10 +147,7 @@ async def deactivate_pipe_func(_, message: Message):
     await message.reply_text("Deactivated pipe.")
 
 
-@app.on_message(
-    filters.command("pipes") 
-    & SUDOERS
-)
+@app.on_message(filters.command("pipes") & SUDOERS & ~filters.edited)
 @capture_err
 async def show_pipes_func(_, message: Message):
     pipes_list_bot.update(pipes_list_userbot)

+ 5 - 4
wbb/modules/pmpermit.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) present TheHamkerCat
+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
@@ -40,6 +40,7 @@ flood = {}
     filters.private
     & filters.incoming
     & ~filters.service
+    & ~filters.edited
     & ~filters.me
     & ~filters.bot
     & ~filters.via_bot
@@ -50,7 +51,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.get_chat_history(user_id, limit=6):
+    async for m in app2.iter_history(user_id, limit=6):
         if m.reply_markup:
             await m.delete()
     if str(user_id) in flood:
@@ -97,7 +98,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.get_chat_history(user_id, limit=6):
+        async for m in app2.iter_history(user_id, limit=6):
             if m.reply_markup:
                 try:
                     await m.delete()
@@ -176,7 +177,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.get_chat_history(user_id, limit=6):
+        async for m in app2.iter_history(user_id, limit=6):
             if m.reply_markup:
                 await m.delete()
         await app2.send_message(user_id, "Blocked, Go scam someone else.")

+ 2 - 3
wbb/modules/purge_me.py

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

+ 6 - 12
wbb/modules/quotly.py

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

+ 2 - 4
wbb/modules/reddit.py

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

+ 2 - 4
wbb/modules/repo.py

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

+ 6 - 11
wbb/modules/reverse.py

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

+ 8 - 7
wbb/modules/rice.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) present TheHamkerCat
+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
@@ -23,7 +23,7 @@ SOFTWARE.
 """
 from re import MULTILINE as RE_MULTILINE
 
-from pyrogram import filters, enums
+from pyrogram import filters
 from pyrogram.types import (
     InlineKeyboardButton,
     InlineKeyboardMarkup,
@@ -46,6 +46,7 @@ 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):
@@ -66,17 +67,17 @@ async def rice(_, message: Message):
             ]
         ),
         quote=True,
-        parse_mode=enums.ParseMode.MARKDOWN,
+        parse_mode="markdown",
     )
 
 
 @app.on_callback_query(filters.regex("forward"))
 async def callback_query_forward_rice(_, callback_query):
-    app.set_parse_mode(enums.ParseMode.MARKDOWN)
+    app.set_parse_mode("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 (enums.ChatMemberStatus.OWNER, enums.ChatMemberStatus.ADMINISTRATOR)):
+    if not (approver_status in ("creator", "administrator")):
         await callback_query.answer("Only admin can approve this!")
         return
     await callback_query.answer("Successfully approved")
@@ -84,7 +85,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.id
+        message_id = m_op.message_id
         media_group = await app.get_media_group(RICE_GROUP, message_id)
         arg_media = []
         for m in media_group:
@@ -123,7 +124,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 (enums.ChatMemberStatus.OWNER, enums.ChatMemberStatus.ADMINISTRATOR):
+    elif disprover_status in ("creator", "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")

+ 8 - 36
wbb/modules/rss.py

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

+ 5 - 12
wbb/modules/stickers.py

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

+ 4 - 13
wbb/modules/sudo.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) present TheHamkerCat
+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
@@ -45,10 +45,7 @@ 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:
@@ -78,10 +75,7 @@ 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:
@@ -106,10 +100,7 @@ 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()

+ 7 - 19
wbb/modules/sudoers.py

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

+ 3 - 2
wbb/modules/taglogger.py

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

+ 1 - 27
wbb/modules/telegraph.py

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

+ 4 - 6
wbb/modules/tts.py

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

+ 11 - 9
wbb/modules/userbot.py

@@ -10,12 +10,12 @@ import re
 import subprocess
 import sys
 import traceback
-import asyncio
+from asyncio import sleep
 from html import escape
 from io import StringIO
 from time import time
 
-from pyrogram import filters, enums
+from pyrogram import filters
 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 get_edit(message: Message, text: str):
-    async for m in app2.get_chat_history(message.chat.id):
+async def iter_edit(message: Message, text: str):
+    async for m in app2.iter_history(message.chat.id):
 
         # If no replies found, reply
-        if m.id == message.id:
+        if m.message_id == message.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.id == message.id)
+                (m.reply_to_message.message_id == message.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 == enums.ChatType.CHANNEL:
+    if message.chat.type == "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 get_edit(message, final_output)
+        status_ = await iter_edit(message, final_output)
         if status_ == 0:
             return await message.reply(final_output, quote=True)
         return
@@ -157,6 +157,7 @@ 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):
@@ -219,7 +220,7 @@ async def shellrunner(_, message: Message):
             await app2.send_document(
                 message.chat.id,
                 "output.txt",
-                reply_to_message_id=message.id,
+                reply_to_message_id=message.message_id,
                 caption=escape(text),
             )
             return os.remove("output.txt")
@@ -237,6 +238,7 @@ 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:

+ 3 - 8
wbb/modules/webss.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) present TheHamkerCat
+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
@@ -56,13 +56,8 @@ 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")
-)
+@app2.on_message(filters.command("webss", USERBOT_PREFIX) & SUDOERS)
+@app.on_message(filters.command("webss") & ~filters.edited)
 @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) present TheHamkerCat
+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

+ 4 - 32
wbb/utils/constants.py

@@ -1,30 +1,6 @@
-"""
-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 import filters, enums
+from pyrogram.filters import command, edited
 from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
 
 from wbb import BOT_USERNAME, app
@@ -63,9 +39,7 @@ NOTE: Fillings only works in greetings module.
 """
 
 
-@app.on_message(
-    filters.command("markdownhelp")
-)
+@app.on_message(command("markdownhelp") & ~edited)
 async def mkdwnhelp(_, m: Message):
     keyb = InlineKeyboardMarkup(
         [
@@ -77,15 +51,13 @@ async def mkdwnhelp(_, m: Message):
             ]
         ]
     )
-    if m.chat.type != enums.ChatType.PRIVATE:
+    if m.chat.type != "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=enums.ParseMode.HTML, 
-            disable_web_page_preview=True
+            MARKDOWN, parse_mode="html", disable_web_page_preview=True
         )
     return

+ 1 - 1
wbb/utils/dbfunctions.py

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

+ 0 - 24
wbb/utils/downloader.py

@@ -1,27 +1,3 @@
-"""
-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) present TheHamkerCat
+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

+ 1 - 1
wbb/utils/filter_groups.py

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

+ 1 - 1
wbb/utils/formatter.py

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

+ 5 - 6
wbb/utils/functions.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) present TheHamkerCat
+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
@@ -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.
 """
-import asyncio
+from asyncio import gather
 from datetime import datetime, timedelta
 from io import BytesIO
 from math import atan2, cos, radians, sin, sqrt
@@ -34,7 +34,6 @@ 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
@@ -136,7 +135,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 asyncio.gather(
+    data1, data2 = await gather(
         get(f"http://ipinfo.io/{ip1}"),
         get(f"http://ipinfo.io/{ip2}"),
     )
@@ -200,9 +199,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 == enums.MessageEntityType.MENTION:
+    if entity.type == "mention":
         return (await app.get_users(text)).id
-    if entity.type == enums.MessageEntityType.TEXT_MENTION:
+    if entity.type == "text_mention":
         return entity.user.id
     return None
 

+ 5 - 5
wbb/utils/http.py

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

+ 4 - 7
wbb/utils/inlinefuncs.py

@@ -1,7 +1,7 @@
 """
 MIT License
 
-Copyright (c) present TheHamkerCat
+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
@@ -33,14 +33,13 @@ 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, enums
+from pyrogram import filters
 from pyrogram.raw.functions import Ping
 from pyrogram.types import (
     CallbackQuery,
     InlineKeyboardButton,
     InlineQueryResultArticle,
     InlineQueryResultPhoto,
-    InlineQueryResultCachedDocument,
     InputTextMessageContent,
 )
 from search_engine_parser import GoogleSearch
@@ -58,6 +57,7 @@ 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,10 +450,7 @@ async def music_inline_func(answers, query):
         messages = [
             m
             async for m in app2.search_messages(
-                chat_id, 
-                query, 
-                filter=enums.MessagesFilter.AUDIO, 
-                limit=100
+                chat_id, query, filter="audio", limit=100
             )
         ]
     except Exception as e:

+ 1 - 1
wbb/utils/json_prettify.py

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

+ 1 - 1
wbb/utils/misc.py

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

+ 1 - 1
wbb/utils/pastebin.py

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

+ 1 - 1
wbb/utils/read_lines.py

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

+ 0 - 24
wbb/utils/rss.py

@@ -1,27 +1,3 @@
-"""
-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) present TheHamkerCat
+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