Преглед изворни кода

Added PMPERMIT & License Notice Across Files

TheHamkerCat пре 5 година
родитељ
комит
2b899b3ea5
49 измењених фајлова са 1314 додато и 81 уклоњено
  1. 24 1
      wbb/__init__.py
  2. 23 0
      wbb/__main__.py
  3. 1 0
      wbb/core/decorators/errors.py
  4. 1 0
      wbb/core/types/InlineKeyboardButtons.py
  5. 25 22
      wbb/core/types/InlineQueryResult.py
  6. 2 0
      wbb/core/types/__init__.py
  7. 23 0
      wbb/modules/__init__.py
  8. 23 0
      wbb/modules/__main__.py
  9. 23 0
      wbb/modules/admin.py
  10. 27 4
      wbb/modules/admin_misc.py
  11. 37 0
      wbb/modules/alive.py
  12. 23 0
      wbb/modules/bay.py
  13. 23 0
      wbb/modules/chatbot.py
  14. 23 0
      wbb/modules/couple.py
  15. 23 0
      wbb/modules/covid.py
  16. 29 2
      wbb/modules/devs.py
  17. 32 2
      wbb/modules/filters.py
  18. 27 16
      wbb/modules/global_stats.py
  19. 25 3
      wbb/modules/greetings.py
  20. 23 0
      wbb/modules/images.py
  21. 36 3
      wbb/modules/inline.py
  22. 23 0
      wbb/modules/karma.py
  23. 41 3
      wbb/modules/locks.py
  24. 23 0
      wbb/modules/misc.py
  25. 24 1
      wbb/modules/music.py
  26. 23 0
      wbb/modules/notes.py
  27. 23 0
      wbb/modules/ping.py
  28. 128 0
      wbb/modules/pmpermit.py
  29. 23 0
      wbb/modules/reddit.py
  30. 23 0
      wbb/modules/regex.py
  31. 23 0
      wbb/modules/repo.py
  32. 23 0
      wbb/modules/rice.py
  33. 23 0
      wbb/modules/stickers.py
  34. 23 0
      wbb/modules/sudoers.py
  35. 9 3
      wbb/modules/userbot.py
  36. 23 0
      wbb/modules/webss.py
  37. 23 0
      wbb/utils/__init__.py
  38. 48 1
      wbb/utils/dbfunctions.py
  39. 23 0
      wbb/utils/fetch.py
  40. 23 0
      wbb/utils/files.py
  41. 25 3
      wbb/utils/filter_groups.py
  42. 23 0
      wbb/utils/formatter.py
  43. 24 1
      wbb/utils/functions.py
  44. 81 16
      wbb/utils/inlinefuncs.py
  45. 23 0
      wbb/utils/json_prettify.py
  46. 23 0
      wbb/utils/misc.py
  47. 24 0
      wbb/utils/pastebin.py
  48. 23 0
      wbb/utils/read_lines.py
  49. 23 0
      wbb/utils/stickerset.py

+ 24 - 1
wbb/__init__.py

@@ -1,3 +1,26 @@
+"""
+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 pyrogram import Client
 from pyromod import listen
 from motor.motor_asyncio import AsyncIOMotorClient as MongoClient
@@ -85,4 +108,4 @@ app2.start()
 get_info(app, app2)
 SUDOERS.append(USERBOT_ID)
 # ARQ client
-arq = ARQ(ARQ_API_BASE_URL)
+arq = ARQ(ARQ_API_BASE_URL)

+ 23 - 0
wbb/__main__.py

@@ -1,3 +1,26 @@
+"""
+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.
+"""
 import asyncio
 import re
 import importlib

+ 1 - 0
wbb/core/decorators/errors.py

@@ -1,3 +1,4 @@
+""" WRITTEN BY @pokurt, https://github.com/pokurt"""
 import sys
 import traceback
 from functools import wraps

+ 1 - 0
wbb/core/types/InlineKeyboardButtons.py

@@ -5,6 +5,7 @@ import re
 
 matching = r"((http|https)\:\/\/)?[a-zA-Z0-9\.\/\?\:@\-_=#]+\.([a-zA-Z]){2,6}([a-zA-Z0-9\.\&\/\?\:@\-_=#])*"
 
+
 def InlineKeyboardButtonDict(response: dict):
     temp = []
     for name, value in response.items():

+ 25 - 22
wbb/core/types/InlineQueryResult.py

@@ -1,7 +1,6 @@
 from typing import Optional, List, Union
 from pyrogram import raw, types, utils
 from pyrogram.file_id import FileType, FileId, PHOTO_TYPES, DOCUMENT_TYPES
-from pyrogram.parser import Parser
 from pyrogram.types import InlineQueryResult
 import pyrogram
 
@@ -9,7 +8,7 @@ import pyrogram
 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 
+    Alternatively, you can use *input_message_content* to send a message
     with the specified content instead of the audio.
     Parameters:
         audio_url (``str``):
@@ -23,7 +22,7 @@ class InlineQueryResultAudio(InlineQueryResult):
 
         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.
@@ -49,10 +48,10 @@ class InlineQueryResultAudio(InlineQueryResult):
 
         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.
@@ -89,10 +88,10 @@ class InlineQueryResultAudio(InlineQueryResult):
         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")
 
+        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(
@@ -135,7 +134,8 @@ class InlineQueryResultAudio(InlineQueryResult):
             )
         )
 
-""" 
+
+"""
     CREDITS:
 
     THE CODE BELOW THIS LINE IS WRITTEN BY https://github.com/Mahesh0253. [https://t.me/DeletedUser420]
@@ -146,27 +146,27 @@ class InlineQueryResultAudio(InlineQueryResult):
 
 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. 
+
+    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.
@@ -175,10 +175,10 @@ class InlineQueryResultCachedDocument(InlineQueryResult):
             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.
     """
@@ -186,7 +186,7 @@ class InlineQueryResultCachedDocument(InlineQueryResult):
     def __init__(
         self,
         file_id: str,
-        title: str= None,
+        title: str = None,
         id: str = None,
         description: str = None,
         caption: str = "",
@@ -230,6 +230,7 @@ class InlineQueryResultCachedDocument(InlineQueryResult):
             )
         )
 
+
 def get_input_file_from_file_id(
     file_id: str,
     expected_file_type: FileType = None
@@ -243,10 +244,12 @@ def get_input_file_from_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')
+        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}")
+        raise ValueError(
+            f"This file_id can only be used for download: {file_id}")
 
     if file_type in PHOTO_TYPES:
         return raw.types.InputPhoto(

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

@@ -1,2 +1,4 @@
+# flake8: noqa
+
 from .InlineKeyboardButtons import InlineKeyboardButtonDict
 from .InlineQueryResult import InlineQueryResultCachedDocument, InlineQueryResultAudio

+ 23 - 0
wbb/modules/__init__.py

@@ -1,3 +1,26 @@
+"""
+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.
+"""
 import glob
 import importlib
 import sys

+ 23 - 0
wbb/modules/__main__.py

@@ -0,0 +1,23 @@
+"""
+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.
+"""

+ 23 - 0
wbb/modules/admin.py

@@ -1,3 +1,26 @@
+"""
+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 pyrogram import filters
 from pyrogram.types import ChatPermissions
 from wbb import SUDOERS, app, BOT_ID

+ 27 - 4
wbb/modules/admin_misc.py

@@ -1,7 +1,30 @@
+"""
+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 pyrogram import filters
 from wbb import SUDOERS, app
 from wbb.core.decorators.errors import capture_err
-from wbb.modules.admin import list_admins, member_permissions
+from wbb.modules.admin import member_permissions
 import os
 
 __MODULE__ = "Admin Miscs"
@@ -27,7 +50,7 @@ async def set_chat_title(_, message):
             await message.reply_text("**Usage:**\n/set_chat_title NEW NAME")
             return
         old_title = message.chat.title
-        new_title = message.text.split(None ,1)[1]
+        new_title = message.text.split(None, 1)[1]
         await message.chat.set_title(new_title)
         await message.reply_text(f"Successfully Changed Group Title From {old_title} To {new_title}")
     except Exception as e:
@@ -50,7 +73,7 @@ async def set_user_title(_, message):
         if len(message.command) < 2:
             await message.reply_text("**Usage:**\n/set_user_title NEW ADMINISTRATOR TITLE")
             return
-        title = message.text.split(None ,1)[1]
+        title = message.text.split(None, 1)[1]
         await app.set_administrator_title(chat_id, from_user.id, title)
         await message.reply_text(f"Successfully Changed {from_user.mention}'s Admin Title To {title}")
     except Exception as e:
@@ -77,7 +100,7 @@ async def set_chat_photo(_, message):
             return
         photo = await message.reply_to_message.download()
         await message.chat.set_photo(photo)
-        await message.reply_text(f"Successfully Changed Group Photo")
+        await message.reply_text("Successfully Changed Group Photo")
         os.remove(photo)
     except Exception as e:
         print(e)

+ 37 - 0
wbb/modules/alive.py

@@ -0,0 +1,37 @@
+"""
+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 wbb import app2, BOT_ID, SUDOERS
+from pyrogram import filters
+
+@app2.on_message(filters.command("alive", prefixes=".") & filters.user(SUDOERS))
+async def alive_command_func(_, message):
+    await message.delete()
+    results = await app2.get_inline_bot_results(BOT_ID, "alive")
+    await app2.send_inline_bot_result(
+            message.chat.id,
+            results.query_id,
+            results.results[0].id,
+            hide_via=True
+            )

+ 23 - 0
wbb/modules/bay.py

@@ -1,3 +1,26 @@
+"""
+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.
+"""
 import os
 import requests
 import aiohttp

+ 23 - 0
wbb/modules/chatbot.py

@@ -1,3 +1,26 @@
+"""
+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 wbb import app, app2, arq, BOT_ID, SUDOERS, USERBOT_ID, USERBOT_USERNAME
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.filter_groups import chatbot_group

+ 23 - 0
wbb/modules/couple.py

@@ -1,3 +1,26 @@
+"""
+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 wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.dbfunctions import get_couple, save_couple

+ 23 - 0
wbb/modules/covid.py

@@ -1,3 +1,26 @@
+"""
+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 wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.json_prettify import json_prettify

+ 29 - 2
wbb/modules/devs.py

@@ -14,7 +14,8 @@ import subprocess
 from inspect import getfullargspec
 from wbb import app, SUDOERS
 from pyrogram import filters
-from pyrogram.types import Message
+from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
+from time import time
 
 __MODULE__ = "Devs"
 __HELP__ = "/eval - Execute Python Code\n/sh - Execute Shell Code"
@@ -41,6 +42,7 @@ async def executor(client, message):
     except IndexError:
         await message.delete()
         return
+    t1 = time()
     reply_to_id = message.message_id
     if message.reply_to_message:
         reply_to_id = message.reply_to_message.message_id
@@ -71,16 +73,41 @@ async def executor(client, message):
         filename = "output.txt"
         with open(filename, "w+", encoding="utf8") as out_file:
             out_file.write(str(evaluation.strip()))
+        t2 = time()
+        keyboard = InlineKeyboardMarkup(
+            [[
+                InlineKeyboardButton(
+                    text="⏳",
+                    callback_data=f"runtime {t2-t1} Seconds"
+                )
+            ]]
+        )
         await message.reply_document(
             document=filename,
             caption=cmd,
             disable_notification=True,
             reply_to_message_id=reply_to_id,
+            reply_markup=keyboard
         )
         os.remove(filename)
         await message.delete()
     else:
-        await edit_or_reply(message, text=final_output)
+        t2 = time()
+        keyboard = InlineKeyboardMarkup(
+            [[
+                InlineKeyboardButton(
+                    text="⏳",
+                    callback_data=f"runtime {t2-t1} Seconds"
+                )
+            ]]
+        )
+        await edit_or_reply(message, text=final_output, reply_markup=keyboard)
+
+
+@app.on_callback_query(filters.regex(r"runtime"))
+async def runtime_func_cq(_, cq):
+    runtime = cq.data.split(None, 1)[1]
+    await cq.answer(runtime, show_alert=True)
 
 
 @app.on_message(

+ 32 - 2
wbb/modules/filters.py

@@ -1,7 +1,31 @@
+"""
+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 wbb import app
 from wbb.modules.admin import member_permissions
 from wbb.utils.dbfunctions import (
-    save_filter, get_filters_names, get_filter, delete_filter
+    save_filter, get_filters_names, get_filter,
+    delete_filter, is_served_chat, add_served_chat
 )
 from pyrogram import filters
 from wbb.core.decorators.errors import capture_err
@@ -95,7 +119,13 @@ async def filters_re(_, message):
                     await message.reply_text(data, disable_web_page_preview=True)
                 else:
                     await message.reply_sticker(data)
+
+                """ CHAT WATCHER """
+                served_chat = await is_served_chat(chat_id)
+                if served_chat:
+                    return
+                await add_served_chat(chat_id)
                 return
-    # NOTE When the first letter of the message is an emoji it throws an error, that's why using this
+
     except Exception:
         pass

+ 27 - 16
wbb/modules/global_stats.py

@@ -1,12 +1,32 @@
+"""
+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 wbb import app, SUDOERS, BOT_ID, BOT_NAME
-from wbb.utils.filter_groups import global_stats_group
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.fetch import fetch
 from wbb.modules import ALL_MODULES
 from wbb.utils.dbfunctions import (
-    is_served_chat,
     get_served_chats,
-    add_served_chat,
     remove_served_chat,
     get_notes_count,
     get_filters_count,
@@ -15,18 +35,9 @@ from wbb.utils.dbfunctions import (
     get_gbans_count
 )
 from pyrogram import filters
-
 import asyncio
 
-
-@app.on_message(filters.text, group=global_stats_group)
-@capture_err
-async def chat_watcher(_, message):
-    chat_id = message.chat.id
-    served_chat = await is_served_chat(chat_id)
-    if served_chat:
-        return
-    await add_served_chat(chat_id)
+""" CHAT WATCHER IS IN filters.py"""
 
 
 @app.on_message(
@@ -48,9 +59,9 @@ async def global_stats(_, message):
     for chat in chats:
         served_chats.append(int(chat["chat_id"]))
     await m.edit(
-            f"__**Analysing Statistics, Should Take {len(served_chats)*6}+ Seconds.**__",
-            disable_web_page_preview=True
-            )
+        f"__**Generating Statistics Report, Should Take {len(served_chats)*6}+ Seconds.**__",
+        disable_web_page_preview=True
+    )
     for served_chat in served_chats:
         try:
             await app.get_chat_members(served_chat, BOT_ID)

+ 25 - 3
wbb/modules/greetings.py

@@ -1,4 +1,26 @@
-""" Kang with proper credits or /gbun """
+"""
+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.
+"""
 
 import asyncio
 import os
@@ -40,8 +62,8 @@ async def welcome(_, message: Message):
             if await is_gbanned_user(member.id):
                 await message.chat.kick_member(member.id)
                 await message.reply_text(f"{member.mention} was globally banned, and got removed,"
-                                          + " if you think this is a false gban, you can appeal"
-                                          + " for this ban in support chat.")
+                                         + " if you think this is a false gban, you can appeal"
+                                         + " for this ban in support chat.")
                 continue
             if member.is_bot:
                 continue  # ignore bots

+ 23 - 0
wbb/modules/images.py

@@ -1,3 +1,26 @@
+"""
+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.
+"""
 import urllib.request
 import json
 import asyncio

+ 36 - 3
wbb/modules/inline.py

@@ -1,9 +1,33 @@
+# flake8: noqa E405
+"""
+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.
+"""
+
 import re
 from wbb import app
 from wbb.utils.inlinefuncs import *
 from pyrogram import filters
 from pyrogram.errors.exceptions.bad_request_400 import QueryIdInvalid
-from wbb.core.types.InlineQueryResult import InlineQueryResultCachedDocument
 
 __MODULE__ = "Inline"
 __HELP__ = '''```
@@ -316,7 +340,6 @@ async def inline_query_handler(client, query):
                 cache_time=2
             )
 
-
         elif text.split()[0] == "wiki":
             if len(text.split()) < 2:
                 await client.answer_inline_query(
@@ -351,7 +374,17 @@ async def inline_query_handler(client, query):
                 cache_time=2
             )
             return
+        
+        elif text.split()[0] == "pmpermit":
+            user_id = query.from_user.id
+            answerss = await pmpermit_func(answers, user_id)
+            await client.answer_inline_query(
+                query.id,
+                results=answerss,
+                cache_time=2
+            )
+            return
 
-    except KeyError:
+    except TypeError:
         print(str(e) + " InLine")
         return

+ 23 - 0
wbb/modules/karma.py

@@ -1,3 +1,26 @@
+"""
+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 wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.dbfunctions import (update_karma, get_karma, get_karmas,

+ 41 - 3
wbb/modules/locks.py

@@ -1,3 +1,26 @@
+"""
+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 wbb import SUDOERS, app
 from wbb.modules.admin import member_permissions, current_chat_permissions
 from wbb.core.decorators.errors import capture_err
@@ -7,10 +30,12 @@ from pyrogram.errors.exceptions.bad_request_400 import ChatNotModified
 
 __MODULE__ = "Locks"
 __HELP__ = """
-Commands: /lock | /unlock
+Commands: /lock | /unlock | /locks [No Parameters Required]
 
-Parameters: 
-    messages | stickers | gifs | media | games | polls | inline | url | voice | commands | forwards
+Parameters:
+    messages | stickers | gifs | media | games | polls
+
+    inline  | link_previews | group_info | user_add | pin
 
 You can only pass the "all" parameter with /lock, not with /unlock
 
@@ -33,6 +58,7 @@ data = {
     "pin": "can_pin_messages"
 }
 
+
 async def tg_lock(message, permissions: list, perm: str, lock: bool):
     if lock:
         if perm not in permissions:
@@ -79,3 +105,15 @@ async def locks_func(_, message):
     elif parameter == "all" and state == "lock":
         await app.set_chat_permissions(chat_id, ChatPermissions())
         await message.reply_text("Locked Everything.")
+
+
+@app.on_message(filters.command("locks") & ~filters.private)
+async def locktypes(_, message):
+    permissions = await current_chat_permissions(message.chat.id)
+    if not permissions:
+        await message.reply_text("No Permissions.")
+        return
+    perms = ""
+    for i in permissions:
+        perms += f"__**{i}**__\n"
+    await message.reply_text(perms)

+ 23 - 0
wbb/modules/misc.py

@@ -1,3 +1,26 @@
+"""
+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.
+"""
 import secrets
 import string
 import aiohttp

+ 24 - 1
wbb/modules/music.py

@@ -1,3 +1,26 @@
+"""
+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 __future__ import unicode_literals
 from urllib.parse import urlparse
 import youtube_dl
@@ -7,7 +30,7 @@ import os
 from random import randint
 from hurry.filesize import size as format_size
 from pyrogram import filters
-from wbb import app, SUDOERS, arq, MAIN_CHATS
+from wbb import app, SUDOERS, arq
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.pastebin import paste
 from wbb.utils.functions import file_size_from_url

+ 23 - 0
wbb/modules/notes.py

@@ -1,3 +1,26 @@
+"""
+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 wbb import app
 from wbb.utils.dbfunctions import (
     save_note, get_note_names, get_note, delete_note

+ 23 - 0
wbb/modules/ping.py

@@ -1,3 +1,26 @@
+"""
+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 pyrogram import filters
 from wbb import app
 

+ 128 - 0
wbb/modules/pmpermit.py

@@ -0,0 +1,128 @@
+"""
+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 wbb import app, app2, BOT_ID, USERBOT_ID, SUDOERS
+from pyrogram import filters
+from wbb.utils.dbfunctions import is_pmpermit_approved, approve_pmpermit, disapprove_pmpermit
+from wbb.modules.chatbot import active_chats_ubot
+
+flood = {}
+
+
+@app2.on_message(filters.private & ~filters.edited & ~filters.me & ~filters.user(SUDOERS))
+async def pmpermit_func(_, message):
+    user_id = message.from_user.id
+    async for m in app2.iter_history(user_id, limit=10):
+        if m.reply_markup:
+            await m.delete()
+    if await is_pmpermit_approved(user_id):
+        return
+    if str(user_id) in flood:
+        flood[str(user_id)] += 1
+    else:
+        flood[str(user_id)] = 1
+    if flood[str(user_id)] > 5:
+        await app2.block_user(user_id)
+        await message.reply_text("SPAM DETECTED, USER BLOCKED.")
+        return
+    results = await app2.get_inline_bot_results(BOT_ID, "pmpermit")
+    await app2.send_inline_bot_result(
+            user_id,
+            results.query_id,
+            results.results[0].id,
+            hide_via=True
+            )
+
+
+@app2.on_message(filters.command("approve", prefixes=".") & filters.user(SUDOERS) & ~filters.via_bot)
+async def pm_approve(_, message):
+    if not message.reply_to_message:
+        await message.edit("Reply to a user's message to approve.")
+        return
+    user_id = message.reply_to_message.from_user.id
+    if await is_pmpermit_approved(user_id):
+        await message.edit("User is already approved to pm")
+        return
+    await approve_pmpermit(user_id)
+    await message.edit("User is approved to pm")
+
+
+@app2.on_message(filters.command("disapprove", prefixes=".") & filters.user(SUDOERS) & ~filters.via_bot)
+async def pm_disapprove(_, message):
+    if not message.reply_to_message:
+        await message.edit("Reply to a user's message to approve.")
+        return
+    user_id = message.reply_to_message.from_user.id
+    if not await is_pmpermit_approved(user_id):
+        await message.edit("User is already disapproved to pm")
+        return
+    await disapprove_pmpermit(user_id)
+    await message.edit("User is disapproved to pm")
+
+
+@app2.on_message(filters.command("block", prefixes=".") & filters.user(SUDOERS) & ~filters.via_bot)
+async def block_user_func(_, message):
+    if not message.reply_to_message:
+        await message.edit("Reply to a user's message to approve.")
+        return
+    user_id = message.reply_to_message.from_user.id
+    await app2.block_user(user_id)
+    await message.edit("Successfully blocked the user")
+
+
+@app2.on_message(filters.command("unblock", prefixes=".") & filters.user(SUDOERS) & ~filters.via_bot)
+async def unblock_user_func(_, message):
+    if not message.reply_to_message:
+        await message.edit("Reply to a user's message to approve.")
+        return
+    user_id = message.reply_to_message.from_user.id
+    await app2.unblock_user(user_id)
+    await message.edit("Successfully Unblocked the user")
+
+
+""" CALLBACK QUERY HANDLER """
+
+
+@app.on_callback_query(filters.regex("pmpermit"))
+async def pmpermit_cq(_, cq):
+    global active_chats_ubot
+    user_id = cq.from_user.id
+    if user_id == USERBOT_ID:
+        await cq.answer("It's For The Other Person.")
+        return
+    data = cq.data.split(None, 1)[1]
+    if data == "to_scam_you":
+        async for m in app2.iter_history(user_id, limit=10):
+            if m.reply_markup:
+                await m.delete()
+        await app2.send_message(user_id, "Blocked, Go scam someone else.")
+        await app2.block_user(user_id)
+
+    elif data == "approve_me":
+        await app2.send_message(user_id, "I'm busy right now, will approve you shortly, DO NOT SPAM.")
+
+    elif data == "chitchats":
+        await approve_pmpermit(user_id)
+        active_chats_ubot.append(user_id)
+        await app2.send_message(user_id, "Hello")

+ 23 - 0
wbb/modules/reddit.py

@@ -1,3 +1,26 @@
+"""
+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 pyrogram import filters
 from wbb import app, arq
 from wbb.core.decorators.errors import capture_err

+ 23 - 0
wbb/modules/regex.py

@@ -1,3 +1,26 @@
+"""
+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.
+"""
 import re
 import sre_constants
 from wbb import app

+ 23 - 0
wbb/modules/repo.py

@@ -1,3 +1,26 @@
+"""
+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 pyrogram import filters
 from wbb import app
 from wbb.core.decorators.errors import capture_err

+ 23 - 0
wbb/modules/rice.py

@@ -1,3 +1,26 @@
+"""
+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 pyrogram import filters
 from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
 from pyrogram.types import InputMediaPhoto, InputMediaVideo

+ 23 - 0
wbb/modules/stickers.py

@@ -1,3 +1,26 @@
+"""
+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.
+"""
 import os
 import imghdr
 from wbb import app, BOT_USERNAME

+ 23 - 0
wbb/modules/sudoers.py

@@ -1,3 +1,26 @@
+"""
+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.
+"""
 import time
 import os
 import subprocess

+ 9 - 3
wbb/modules/userbot.py

@@ -1,6 +1,6 @@
 """
     CREDITS:
-        THIS MODULE IS WRITTEN BY @Pokurt.
+        EVAL AND SH FUNCTION IN THIS MODULE IS WRITTEN BY @Pokurt.
         SOURCE:
             https://github.com/pokurt/Nana-Remix/blob/master/nana/plugins/devs.py
 """
@@ -17,7 +17,13 @@ from pyrogram import filters
 from pyrogram.types import Message
 
 __MODULE__ = "Userbot"
-__HELP__ = ".l - Execute Python Code\n.sh - Execute Shell Code"
+__HELP__ = """
+.alive - Send Alive Message.
+.l - Execute Python Code.
+.sh - Execute Shell Code.
+.approve | .disapprove - Approve Or Disapprove A User To PM You.
+.block | .unblock - Block Or Unblock A User.
+"""
 
 
 # Eval and Sh module from nana-remix
@@ -168,7 +174,7 @@ async def aexec2(code, client):
     return await locals()["__aexecc"](client)
 
 
-async def eval_executor_func(code):
+async def eval_executer_func(code):
     old_stderr = sys.stderr
     old_stdout = sys.stdout
     redirected_output = sys.stdout = StringIO()

+ 23 - 0
wbb/modules/webss.py

@@ -1,3 +1,26 @@
+"""
+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 wbb import app
 from wbb.core.decorators.errors import capture_err
 from pyrogram import filters

+ 23 - 0
wbb/utils/__init__.py

@@ -1,2 +1,25 @@
+"""
+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 .read_lines import random_line  # noqa: F401
 from .misc import paginate_modules   # noqa: F401

+ 48 - 1
wbb/utils/dbfunctions.py

@@ -1,7 +1,29 @@
+"""
+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 wbb import db
 from typing import Dict, List, Union
 
-
 notesdb = db.notes
 filtersdb = db.filters
 warnsdb = db.warns
@@ -11,6 +33,7 @@ gbansdb = db.gban
 coupledb = db.couple
 captchadb = db.captcha
 antiservicedb = db.antiservice
+pmpermitdb = db.pmpermit
 
 """ Notes functions """
 
@@ -446,3 +469,27 @@ async def antiservice_off(chat_id: int):
     if not is_antiservice:
         return
     return await antiservicedb.insert_one({"chat_id": chat_id})
+
+
+""" PM PERMIT """
+
+
+async def is_pmpermit_approved(user_id: int) -> bool:
+    user = await pmpermitdb.find_one({"user_id": user_id})
+    if not user:
+        return False
+    return True
+
+
+async def approve_pmpermit(user_id: int):
+    is_pmpermit = await is_pmpermit_approved(user_id)
+    if is_pmpermit:
+        return
+    return await pmpermitdb.inser_one({"user_id": user_id})
+
+
+async def disapprove_pmpermit(user_id: int):
+    is_pmpermit = await is_pmpermit_approved(user_id)
+    if not is_pmpermit:
+        return
+    return await pmpermitdb.delete_one({"user_id": user_id})

+ 23 - 0
wbb/utils/fetch.py

@@ -1,3 +1,26 @@
+"""
+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.
+"""
 import aiohttp
 
 

+ 23 - 0
wbb/utils/files.py

@@ -1,3 +1,26 @@
+"""
+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.
+"""
 import os
 from PIL import Image
 import math

+ 25 - 3
wbb/utils/filter_groups.py

@@ -1,8 +1,30 @@
+"""
+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.
+"""
 chat_filters_group = 1
 chatbot_group = 2
 karma_positive_group = 3
 karma_negative_group = 4
 regex_group = 5
-global_stats_group = 6
-welcome_captcha_group = 7
-antiflood_group = 8
+welcome_captcha_group = 6
+antiflood_group = 7

+ 23 - 0
wbb/utils/formatter.py

@@ -1,3 +1,26 @@
+"""
+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.
+"""
 def get_readable_time(seconds: int) -> str:
     count = 0
     ping_time = ""

+ 24 - 1
wbb/utils/functions.py

@@ -1,3 +1,26 @@
+"""
+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 PIL import Image, ImageDraw, ImageFont, ImageFilter
 from random import randint
 import speedtest
@@ -77,7 +100,7 @@ async def file_size_from_url(url: str) -> int:
     return size
 
 
-async def get_http_status_code(url: str)-> int:
+async def get_http_status_code(url: str) -> int:
     async with aiohttp.ClientSession() as session:
         async with session.head(url) as resp:
             return resp.status

+ 81 - 16
wbb/utils/inlinefuncs.py

@@ -1,3 +1,26 @@
+"""
+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.
+"""
 import aiohttp
 import json
 import sys
@@ -7,7 +30,6 @@ from pyrogram.types import (
     InputTextMessageContent,
     InlineKeyboardButton,
     InlineQueryResultPhoto,
-    InputMediaPhoto
 )
 from googletrans import Translator
 from search_engine_parser import GoogleSearch
@@ -15,17 +37,17 @@ from pykeyboard import InlineKeyboard
 from sys import version as pyver
 from motor import version as mongover
 from pyrogram import __version__ as pyrover, filters
-from time import time, ctime
-from wbb.modules.userbot import eval_executor_func
+from time import ctime
 from wbb.utils.fetch import fetch
+from wbb.modules.userbot import eval_executer_func
 from wbb.utils.functions import test_speedtest, get_http_status_code
 from wbb.utils.formatter import convert_seconds_to_minutes as time_convert
 from wbb.utils.pastebin import paste
 from wbb.core.types import InlineQueryResultCachedDocument
 from wbb import (
     arq, app, app2, USERBOT_USERNAME,
-    BOT_USERNAME, LOG_GROUP_ID, USERBOT_ID,
-    SUDOERS
+    BOT_USERNAME, USERBOT_ID,
+    SUDOERS, USERBOT_NAME
 )
 
 
@@ -408,16 +430,23 @@ async def eval_func(answers, text, user_id):
 
         return answers
     text = text[0:-1]
-    start_time = time()
-    result = await eval_executor_func(text)
+    result = await eval_executer_func(text)
+    res = result[0]
     output = result[1]
-    result = result[0]
-    msg = f"{result}"
-    end_time = time()
+    time_taken = result[2]
+    msg = f"{res}"
+    button = InlineKeyboard(row_width=1)
+    button.add(
+        InlineKeyboardButton(
+            text=f"{time_taken} Seconds",
+            callback_data="ok_lol"
+        )
+    )
     answers.append(
         InlineQueryResultArticle(
-            title=f"Took {round(end_time - start_time)} Seconds.",
+            title=f"Took {time_taken} Seconds.",
             description=output,
+            reply_markup=button,
             input_message_content=InputTextMessageContent(msg)
         ))
     return answers
@@ -642,7 +671,7 @@ async def speedtest_init(query):
 """ callback query for the function above """
 
 
-@app.on_callback_query(filters.regex(f"test_speedtest"))
+@app.on_callback_query(filters.regex("test_speedtest"))
 async def test_speedtest_cq(_, cq):
     if cq.from_user.id not in SUDOERS:
         await cq.answer("This Isn't For You!")
@@ -676,7 +705,10 @@ async def pastebin_func(answers, link):
         chat, message_id = int("-100" + link[4]), int(link[5])
     else:
         chat, message_id = link[3], link[4]
-    m = await app.get_messages(chat, message_ids=int(message_id))
+    try:
+        m = await app.get_messages(chat, message_ids=int(message_id))
+    except AttributeError:
+        m = await app2.get_messages(chat, message_ids=int(message_id))
     if m.text not in pastebin_cache:
         link = await paste(m.text)
         preview = link + "/preview.png"
@@ -688,8 +720,8 @@ async def pastebin_func(answers, link):
                 break
             status_code = await get_http_status_code(preview)
             await asyncio.sleep(0.2)
-            i += 1 
-        await app.send_photo(USERBOT_ID, preview) # To Pre-cache the media
+            i += 1
+        await app.send_photo(USERBOT_ID, preview)  # To Pre-cache the media
     else:
         link = pastebin_cache[m.text]
         preview = link + "/preview.png"
@@ -700,5 +732,38 @@ async def pastebin_func(answers, link):
             photo_url=preview,
             reply_markup=buttons
         )
-        )
+    )
+    return answers
+
+
+async def pmpermit_func(answers, user_id):
+    if user_id != USERBOT_ID:
+        return
+    caption = f"Hi, I'm {USERBOT_NAME}, What are you here for?, You'll be blocked if you send more than 5 messages."
+    buttons = InlineKeyboard(row_width=2)
+    buttons.add(
+            InlineKeyboardButton(
+                text="To Scam You",
+                callback_data="pmpermit to_scam_you"
+                ),
+            InlineKeyboardButton(
+                text="For promotion",
+                callback_data="pmpermit to_scam_you"
+                ),
+                InlineKeyboardButton(
+                text="ChitChats",
+                callback_data="pmpermit chitchats"
+                ),
+            InlineKeyboardButton(
+                text="Approve me",
+                callback_data="pmpermit approve_me"
+                )
+            )
+    answers.append(
+            InlineQueryResultArticle(
+                title="do_not_click_here",
+                reply_markup=buttons,
+                input_message_content=InputTextMessageContent(caption)
+                )
+            )
     return answers

+ 23 - 0
wbb/utils/json_prettify.py

@@ -1,3 +1,26 @@
+"""
+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.
+"""
 async def json_object_prettify(objecc):
     dicc = objecc.__dict__
     output = ""

+ 23 - 0
wbb/utils/misc.py

@@ -1,3 +1,26 @@
+"""
+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 math import ceil
 from pyrogram.types import InlineKeyboardButton
 from wbb import MOD_LOAD, MOD_NOLOAD

+ 24 - 0
wbb/utils/pastebin.py

@@ -1,5 +1,29 @@
+"""
+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.
+"""
 import socket
 
+
 async def _netcat(host, port, content):
     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     s.connect((host, port))

+ 23 - 0
wbb/utils/read_lines.py

@@ -1,3 +1,26 @@
+"""
+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.
+"""
 import random
 
 

+ 23 - 0
wbb/utils/stickerset.py

@@ -1,3 +1,26 @@
+"""
+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
 
 from pyrogram import Client, raw