diff --git a/userbot/.unused/app.py b/userbot/.unused/app.py index d70930e..65a84b2 100644 --- a/userbot/.unused/app.py +++ b/userbot/.unused/app.py @@ -3,10 +3,10 @@ from flask import Flask app = Flask(__name__) -@app.route("/") +@app.route('/') def hello_world(): - return "This is Moon" + return 'This is Moon' -if __name__ == "__main__": +if __name__ == '__main__': app.run() diff --git a/userbot/images/icons.py b/userbot/images/icons.py index ba24af5..a621147 100644 --- a/userbot/images/icons.py +++ b/userbot/images/icons.py @@ -1,83 +1,80 @@ -import re -import requests import random +import re from io import BytesIO + +import requests from bs4 import BeautifulSoup as bs - from pyrogram import Client, filters -from pyrogram.types import Message, InputMediaPhoto from pyrogram.errors import RPCError - +from pyrogram.types import InputMediaPhoto, Message from utils.misc import modules_help, prefix -@Client.on_message(filters.command("icon", prefix) & filters.me) +@Client.on_message(filters.command('icon', prefix) & filters.me) async def search_icon(_, message: Message): if not len(message.command) == 2: - return await message.edit_text( - "Please provide some text to search icons from Flaticon.com." - ) + return await message.edit_text('Please provide some text to search icons from Flaticon.com.') query = message.text.split(maxsplit=1)[1] - await message.edit_text("Searching for icons...") - search_query = query.replace(" ", "%20") - url = f"https://www.flaticon.com/search?word={search_query}" + await message.edit_text('Searching for icons...') + search_query = query.replace(' ', '%20') + url = f'https://www.flaticon.com/search?word={search_query}' try: html_content = requests.get(url).text - soup = bs(html_content, "html.parser") + soup = bs(html_content, 'html.parser') results = soup.find_all( - "img", - src=re.compile(r"https://cdn-icons-png.flaticon.com/128/[0-9]+/[0-9]+.png"), + 'img', + src=re.compile(r'https://cdn-icons-png.flaticon.com/128/[0-9]+/[0-9]+.png'), ) if not results: - return await message.edit("No results found.") + return await message.edit('No results found.') random.shuffle(results) icons = [] for i in range(5): - icons.append(results[i]["src"].replace("128", "512")) + icons.append(results[i]['src'].replace('128', '512')) for icon in icons: await message.reply_document(icon) return await message.delete() except Exception as e: - await message.edit(f"An error occurred: {e}") - print(f"Error: {e}") + await message.edit(f'An error occurred: {e}') + print(f'Error: {e}') -@Client.on_message(filters.command("freepik", prefix) & filters.me) +@Client.on_message(filters.command('freepik', prefix) & filters.me) async def freepik_search(client: Client, message: Message): - parts = message.text.split(" ", 1) + parts = message.text.split(' ', 1) if len(parts) < 2: - await message.edit_text("Please provide a search query!") + await message.edit_text('Please provide a search query!') return query = parts[1] limit = 5 - if " ; " in query: - match, limit_str = query.split(" ; ", 1) + if ' ; ' in query: + match, limit_str = query.split(' ; ', 1) try: limit = int(limit_str) except ValueError: - await message.edit_text("Invalid limit! Using the default value of 5.") + await message.edit_text('Invalid limit! Using the default value of 5.') else: match = query - match = match.replace(" ", "%20") - await message.edit_text("Searching Freepik...") + match = match.replace(' ', '%20') + await message.edit_text('Searching Freepik...') try: - url = f"https://www.freepik.com/api/regular/search?locale=en&term={match}" + url = f'https://www.freepik.com/api/regular/search?locale=en&term={match}' json_content = requests.get(url).json() results = [] - for i in json_content["items"]: - results.append(i["preview"]["url"]) + for i in json_content['items']: + results.append(i['preview']['url']) if results is None: - return await message.edit_text("No results found.") + return await message.edit_text('No results found.') random.shuffle(results) img_urls = results[:limit] @@ -89,27 +86,25 @@ async def freepik_search(client: Client, message: Message): media_group.append(InputMediaPhoto(media=BytesIO(icon.content))) if not media_group: - await message.edit_text("No images could be downloaded.") + await message.edit_text('No images could be downloaded.') return try: await client.send_media_group(chat_id=message.chat.id, media=media_group) except RPCError: - await message.edit_text( - "Failed to send some images. Retrying individually..." - ) + await message.edit_text('Failed to send some images. Retrying individually...') for media in media_group: try: await message.reply_photo(photo=media.media) except Exception as e: - await message.edit_text(f"Error sending image: {e}") + await message.edit_text(f'Error sending image: {e}') except Exception as e: - await message.edit_text(f"Failed to fetch data: {e}") - print(f"Error: {e}") + await message.edit_text(f'Failed to fetch data: {e}') + print(f'Error: {e}') -modules_help["icons"] = { - "icon [query]": "Search for icons on Flaticon.", - "freepik [query] [limit]": "Search for images on Freepik. Limit is optional and defaults to 5.", +modules_help['icons'] = { + 'icon [query]': 'Search for icons on Flaticon.', + 'freepik [query] [limit]': 'Search for images on Freepik. Limit is optional and defaults to 5.', } diff --git a/userbot/images/imgur.py b/userbot/images/imgur.py index d37ee76..94e486c 100644 --- a/userbot/images/imgur.py +++ b/userbot/images/imgur.py @@ -1,52 +1,47 @@ -import os import base64 + import requests - - from pyrogram import Client, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix -@Client.on_message(filters.command(["imgur"], prefix) & filters.me) +@Client.on_message(filters.command(['imgur'], prefix) & filters.me) async def imgur(_, message: Message): # Check if a reply exists - msg = await message.edit_text("🎉 Please wait. trying to upload...") + msg = await message.edit_text('🎉 Please wait. trying to upload...') if message.reply_to_message and message.reply_to_message.photo: # Download the photo photo_path = await message.reply_to_message.download() # Read the photo file and encode as base64 - with open(photo_path, "rb") as file: + with open(photo_path, 'rb') as file: data = file.read() base64_data = base64.b64encode(data) # Set API endpoint and headers for image upload - url = "https://api.imgur.com/3/image" - headers = {"Authorization": "Client-ID a10ad04550b0648"} + url = 'https://api.imgur.com/3/image' + headers = {'Authorization': 'Client-ID a10ad04550b0648'} # Upload image to Imgur and get URL - response = requests.post(url, headers=headers, data={"image": base64_data}) + response = requests.post(url, headers=headers, data={'image': base64_data}) result = response.json() - await msg.edit_text(result["data"]["link"]) + await msg.edit_text(result['data']['link']) elif message.reply_to_message and message.reply_to_message.animation: # Download the animation (GIF) animation_path = await message.reply_to_message.download() # Read the animation file and encode as base64 - with open(animation_path, "rb") as file: + with open(animation_path, 'rb') as file: data = file.read() base64_data = base64.b64encode(data) # Set API endpoint and headers for animation upload - url = "https://api.imgur.com/3/image" - headers = {"Authorization": "Client-ID a10ad04550b0648"} + url = 'https://api.imgur.com/3/image' + headers = {'Authorization': 'Client-ID a10ad04550b0648'} # Upload animation to Imgur and get URL - response = requests.post(url, headers=headers, data={"image": base64_data}) + response = requests.post(url, headers=headers, data={'image': base64_data}) result = response.json() - await msg.edit_text(result["data"]["link"]) + await msg.edit_text(result['data']['link']) else: - await msg.edit_text( - "Please reply to a photo or animation (GIF) to upload to Imgur." - ) + await msg.edit_text('Please reply to a photo or animation (GIF) to upload to Imgur.') -modules_help["imgur"] = { - "imgur [img]*": "upload a photo or animation (GIF) to imgur", +modules_help['imgur'] = { + 'imgur [img]*': 'upload a photo or animation (GIF) to imgur', } diff --git a/userbot/images/ncode.py b/userbot/images/ncode.py index 65d1a00..9b80f06 100644 --- a/userbot/images/ncode.py +++ b/userbot/images/ncode.py @@ -1,55 +1,47 @@ -from pyrogram import Client, filters -from pyrogram.types import Message - -from utils.misc import prefix, modules_help - - -from pyrogram import Client, filters -from pyrogram.types import Message -from pyrogram.errors import MessageNotModified import os + import pygments from pygments.formatters import ImageFormatter from pygments.lexers import Python3Lexer +from pyrogram import Client, filters +from pyrogram.errors import MessageNotModified +from pyrogram.types import Message +from utils.misc import modules_help, prefix -@Client.on_message(filters.command("ncode", prefix) & filters.me) +@Client.on_message(filters.command('ncode', prefix) & filters.me) async def coder_print(client, message: Message): if message.reply_to_message: reply_message = message.reply_to_message if reply_message.media: download_path = await client.download_media(reply_message) - with open(download_path, "r") as file: + with open(download_path) as file: code = file.read() if os.path.exists(download_path): os.remove(download_path) pygments.highlight( - f"{code}", + f'{code}', Python3Lexer(), - ImageFormatter(font_name="DejaVu Sans Mono", line_numbers=True), - "result.png", + ImageFormatter(font_name='DejaVu Sans Mono', line_numbers=True), + 'result.png', ) try: - sent_message = await message.edit_text( - "Pasting this code on my page..." - ) + sent_message = await message.edit_text('Pasting this code on my page...') await client.send_document( chat_id=message.chat.id, - document="result.png", - caption="Code highlighted by Pygments", + document='result.png', + caption='Code highlighted by Pygments', reply_to_message_id=message.id, ) except MessageNotModified: pass await sent_message.delete() - if os.path.exists("result.png"): - os.remove("result.png") + if os.path.exists('result.png'): + os.remove('result.png') else: - return await message.reply_text("Please reply to a text or a file.") + return await message.reply_text('Please reply to a text or a file.') else: - return await message.reply_text("Please reply to a text or a file.") + return await message.reply_text('Please reply to a text or a file.') -modules_help["ncode"] = { - "ncode": "Highlight the code using Pygments and send it as an image." -} +modules_help['ncode'] = {'ncode': 'Highlight the code using Pygments and send it as an image.'} diff --git a/userbot/images/pinterest.py b/userbot/images/pinterest.py index abe0930..6c30718 100644 --- a/userbot/images/pinterest.py +++ b/userbot/images/pinterest.py @@ -1,13 +1,14 @@ -from pyrogram import Client, filters, enums -from pyrogram.types import Message, InputMediaPhoto -from io import BytesIO -from PIL import Image -import requests import asyncio +from io import BytesIO + +import requests +from PIL import Image +from pyrogram import Client, enums, filters +from pyrogram.types import InputMediaPhoto, Message from utils.misc import modules_help, prefix # Pinterest API URL -API_URL = "https://bk9.fun/pinterest/search?q=" +API_URL = 'https://bk9.fun/pinterest/search?q=' def resize_image(image_bytes): @@ -17,13 +18,13 @@ def resize_image(image_bytes): if img.size > max_size: img.thumbnail(max_size) output = BytesIO() - img.save(output, format="JPEG") + img.save(output, format='JPEG') output.seek(0) return output image_bytes.seek(0) # Reset pointer if not resized return image_bytes except Exception as e: - print(f"Error resizing image: {e}") + print(f'Error resizing image: {e}') return image_bytes @@ -34,69 +35,57 @@ async def download_image(url): img_bytes = BytesIO(response.content) return resize_image(img_bytes) except Exception as e: - print(f"Error downloading image: {e}") + print(f'Error downloading image: {e}') return None -@Client.on_message(filters.command("pinterest", prefix) & filters.me) +@Client.on_message(filters.command('pinterest', prefix) & filters.me) async def pinterest_search(client: Client, message: Message): if len(message.command) < 2: - await message.edit( - "Usage: `pinterest [number] `", parse_mode=enums.ParseMode.MARKDOWN - ) + await message.edit('Usage: `pinterest [number] `', parse_mode=enums.ParseMode.MARKDOWN) return num_pics = int(message.command[1]) if message.command[1].isdigit() else 10 - query = " ".join(message.command[2:]) + query = ' '.join(message.command[2:]) # Update status - status_message = await message.edit( - "Searching for images...", parse_mode=enums.ParseMode.MARKDOWN - ) + status_message = await message.edit('Searching for images...', parse_mode=enums.ParseMode.MARKDOWN) - url = f"{API_URL}{query}" + url = f'{API_URL}{query}' response = requests.get(url) if response.status_code == 200: data = response.json() - if data.get("status"): - urls = [item["images_url"] for item in data.get("BK9", [])[:num_pics]] + if data.get('status'): + urls = [item['images_url'] for item in data.get('BK9', [])[:num_pics]] images = [download_image(img_url) for img_url in urls] # Download images downloaded_images = await asyncio.gather(*images) - media = [ - InputMediaPhoto(media=img_bytes) - for img_bytes in downloaded_images - if img_bytes - ] + media = [InputMediaPhoto(media=img_bytes) for img_bytes in downloaded_images if img_bytes] if media: - await status_message.edit( - "Uploading pictures...", parse_mode=enums.ParseMode.MARKDOWN - ) + await status_message.edit('Uploading pictures...', parse_mode=enums.ParseMode.MARKDOWN) while media: batch = media[:10] media = media[10:] await message.reply_media_group(batch) await status_message.delete() # Delete status message after uploading else: - await status_message.edit( - "No valid images found.", parse_mode=enums.ParseMode.MARKDOWN - ) + await status_message.edit('No valid images found.', parse_mode=enums.ParseMode.MARKDOWN) else: await status_message.edit( - "No images found for the given query.", + 'No images found for the given query.', parse_mode=enums.ParseMode.MARKDOWN, ) else: await status_message.edit( - "An error occurred, please try again later.", + 'An error occurred, please try again later.', parse_mode=enums.ParseMode.MARKDOWN, ) -modules_help["pinterest"] = { - "pinterest [number]* [query]": "Get images from Pinterest. Default number of images is 10", +modules_help['pinterest'] = { + 'pinterest [number]* [query]': 'Get images from Pinterest. Default number of images is 10', } diff --git a/userbot/images/risearch.py b/userbot/images/risearch.py index 8dff45e..ed42b60 100644 --- a/userbot/images/risearch.py +++ b/userbot/images/risearch.py @@ -1,26 +1,27 @@ -from utils.misc import modules_help, prefix +import os + import requests +from modules.url import generate_screenshot from pyrogram import Client, filters from pyrogram.types import Message -from modules.url import generate_screenshot -import os +from utils.misc import modules_help, prefix # API endpoints for reverse image search engines SEARCH_ENGINES = { - "lens": "https://lens.google.com/uploadbyurl?url={image}", - "reverse": "https://www.google.com/searchbyimage?sbisrc=4chanx&image_url={image}&safe=off", - "tineye": "https://www.tineye.com/search?url={image}", - "bing": "https://www.bing.com/images/search?view=detailv2&iss=sbi&form=SBIVSP&sbisrc=UrlPaste&q=imgurl:{image}", - "yandex": "https://yandex.com/images/search?source=collections&&url={image}&rpt=imageview", - "saucenao": "https://saucenao.com/search.php?db=999&url={image}", + 'lens': 'https://lens.google.com/uploadbyurl?url={image}', + 'reverse': 'https://www.google.com/searchbyimage?sbisrc=4chanx&image_url={image}&safe=off', + 'tineye': 'https://www.tineye.com/search?url={image}', + 'bing': 'https://www.bing.com/images/search?view=detailv2&iss=sbi&form=SBIVSP&sbisrc=UrlPaste&q=imgurl:{image}', + 'yandex': 'https://yandex.com/images/search?source=collections&&url={image}&rpt=imageview', + 'saucenao': 'https://saucenao.com/search.php?db=999&url={image}', } -@Client.on_message(filters.command("risearch", prefix) & filters.reply) +@Client.on_message(filters.command('risearch', prefix) & filters.reply) async def reverse_image_search(client: Client, message: Message): if not message.reply_to_message or not message.reply_to_message.photo: await message.reply_text( - f"Please reply to an image with {prefix}risearch [engine] or {prefix}risearch." + f'Please reply to an image with {prefix}risearch [engine] or {prefix}risearch.' ) return @@ -31,16 +32,14 @@ async def reverse_image_search(client: Client, message: Message): else list(SEARCH_ENGINES.keys()) ) - invalid_engines = [ - engine for engine in engines_to_use if engine not in SEARCH_ENGINES - ] + invalid_engines = [engine for engine in engines_to_use if engine not in SEARCH_ENGINES] if invalid_engines: await message.reply_text( - f"Invalid engine(s): {', '.join(invalid_engines)}. Available: {', '.join(SEARCH_ENGINES.keys())}" + f'Invalid engine(s): {", ".join(invalid_engines)}. Available: {", ".join(SEARCH_ENGINES.keys())}' ) return - processing_message = await message.edit_text("Processing the image...") + processing_message = await message.edit_text('Processing the image...') try: # Download and upload the image @@ -48,7 +47,7 @@ async def reverse_image_search(client: Client, message: Message): img_url = upload_image(photo_path) print(img_url) if not img_url: - await processing_message.edit("Error: Could not upload the image.") + await processing_message.edit('Error: Could not upload the image.') return # Perform searches for the selected engines @@ -56,7 +55,7 @@ async def reverse_image_search(client: Client, message: Message): search_url = SEARCH_ENGINES[engine].format(image=img_url) await send_screenshot(client, message, search_url, engine) except Exception as e: - await processing_message.edit(f"An error occurred: {e}") + await processing_message.edit(f'An error occurred: {e}') finally: if photo_path and os.path.exists(photo_path): os.remove(photo_path) @@ -65,15 +64,13 @@ async def reverse_image_search(client: Client, message: Message): def upload_image(photo_path): """Uploads an image to tmpfiles.org and returns the direct download URL.""" try: - with open(photo_path, "rb") as image_file: - response = requests.post( - "https://tmpfiles.org/api/v1/upload", files={"file": image_file} - ) + with open(photo_path, 'rb') as image_file: + response = requests.post('https://tmpfiles.org/api/v1/upload', files={'file': image_file}) if response.status_code == 200: data = response.json() - url = data["data"]["url"] - pic_url = url.split("/")[-2] + "/" + url.split("/")[-1] - direct_download_url = url.replace(f"/{pic_url}", f"/dl/{pic_url}") + url = data['data']['url'] + pic_url = url.split('/')[-2] + '/' + url.split('/')[-1] + direct_download_url = url.replace(f'/{pic_url}', f'/dl/{pic_url}') print(direct_download_url) return direct_download_url else: @@ -89,17 +86,15 @@ async def send_screenshot(client, message, url, engine_name): await client.send_photo( message.chat.id, screenshot_data, - caption=f"{engine_name.capitalize()} Result\nURL: {url}", + caption=f'{engine_name.capitalize()} Result\nURL: {url}', reply_to_message_id=message.id, ) else: - await message.reply( - f"Failed to take screenshot for {engine_name.capitalize()}." - ) + await message.reply(f'Failed to take screenshot for {engine_name.capitalize()}.') # Add module details to help -modules_help["risearch"] = { - "risearch": f"Reply to a photo with `{prefix}risearch [engine]` (e.g., `{prefix}risearch lens`, `{prefix}risearch bing`) " - f"\nor use `{prefix}risearch` to analyze the image with all engines.", +modules_help['risearch'] = { + 'risearch': f'Reply to a photo with `{prefix}risearch [engine]` (e.g., `{prefix}risearch lens`, `{prefix}risearch bing`) ' + f'\nor use `{prefix}risearch` to analyze the image with all engines.', } diff --git a/userbot/images/unsplash.py b/userbot/images/unsplash.py index 5fa726f..ba97a6a 100644 --- a/userbot/images/unsplash.py +++ b/userbot/images/unsplash.py @@ -1,64 +1,60 @@ import asyncio -import json import os import shutil import aiohttp +import requests from pyrogram import Client, enums, filters from pyrogram.types import Message -import requests from utils.misc import modules_help, prefix class AioHttp: async def get_json(self, link): headers = { - "accept": "*/*", - "accept-language": "en-US", - "cache-control": "no-cache", - "client-geo-region": "global", - "dnt": "1", - "pragma": "no-cache", - "priority": "u=1, i", - "sec-ch-ua": '"Chromium";v="130", "Microsoft Edge";v="130", "Not?A_Brand";v="99"', - "sec-ch-ua-mobile": "?0", - "sec-ch-ua-platform": '"Windows"', - "sec-fetch-dest": "empty", - "sec-fetch-mode": "cors", - "sec-fetch-site": "same-origin", - "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0", + 'accept': '*/*', + 'accept-language': 'en-US', + 'cache-control': 'no-cache', + 'client-geo-region': 'global', + 'dnt': '1', + 'pragma': 'no-cache', + 'priority': 'u=1, i', + 'sec-ch-ua': '"Chromium";v="130", "Microsoft Edge";v="130", "Not?A_Brand";v="99"', + 'sec-ch-ua-mobile': '?0', + 'sec-ch-ua-platform': '"Windows"', + 'sec-fetch-dest': 'empty', + 'sec-fetch-mode': 'cors', + 'sec-fetch-site': 'same-origin', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0', } - async with aiohttp.ClientSession() as session: - async with session.get(link, headers=headers) as resp: - return await resp.json() + async with aiohttp.ClientSession() as session, session.get(link, headers=headers) as resp: + return await resp.json() -@Client.on_message(filters.command("unsplash", prefix) & filters.me) +@Client.on_message(filters.command('unsplash', prefix) & filters.me) async def unsplash(client: Client, message: Message): if len(message.command) > 1 and isinstance(message.command[1], str): keyword = message.command[1] - unsplash_dir = "downloads/unsplash/" + unsplash_dir = 'downloads/unsplash/' if not os.path.exists(unsplash_dir): os.makedirs(unsplash_dir) if len(message.command) > 2 and 2 <= int(message.command[2]) <= 10: - await message.edit( - "Getting Pictures", parse_mode=enums.ParseMode.HTML - ) + await message.edit('Getting Pictures', parse_mode=enums.ParseMode.HTML) count = int(message.command[2]) images = [] data = await AioHttp().get_json( - f"https://unsplash.com/napi/search/photos?page=1&per_page={count}&query={keyword}" + f'https://unsplash.com/napi/search/photos?page=1&per_page={count}&query={keyword}' ) while len(images) < count: for ia in range(len(images), count): - img = data["results"][ia]["urls"]["raw"] - if img.startswith("https://images.unsplash.com/photo"): + img = data['results'][ia]['urls']['raw'] + if img.startswith('https://images.unsplash.com/photo'): image_content = requests.get(img).content - with open(f"{unsplash_dir}/unsplash_{ia}.jpg", "wb") as f: + with open(f'{unsplash_dir}/unsplash_{ia}.jpg', 'wb') as f: f.write(image_content) - imgr = f"{unsplash_dir}/unsplash_{ia}.jpg" + imgr = f'{unsplash_dir}/unsplash_{ia}.jpg' images.append(imgr) else: images.append(img) @@ -72,23 +68,19 @@ async def unsplash(client: Client, message: Message): shutil.rmtree(unsplash_dir) return else: - await message.edit( - "Getting Picture", parse_mode=enums.ParseMode.HTML - ) + await message.edit('Getting Picture', parse_mode=enums.ParseMode.HTML) data = await AioHttp().get_json( - f"https://unsplash.com/napi/search/photos?page=1&per_page=1&query={keyword}" - ) - img = data["results"][0]["urls"]["raw"] - await asyncio.gather( - message.delete(), client.send_document(message.chat.id, str(img)) + f'https://unsplash.com/napi/search/photos?page=1&per_page=1&query={keyword}' ) + img = data['results'][0]['urls']['raw'] + await asyncio.gather(message.delete(), client.send_document(message.chat.id, str(img))) -modules_help["unsplash"] = { - "unsplash": f"[keyword]*", - "unsplash": f"[keyword]* [number of results you want]*\n" - "Makes a request to unsplash.com and sends the image with the keyword you provided.\n\n" - "Note:\n1. The number of results you can get is limited to 10.\n" - "2. Keyword is required and should be of one word only!.\n" - "3. Images are sent as document to maintain quality.", +modules_help['unsplash'] = { + 'unsplash': '[keyword]*', + 'unsplash': '[keyword]* [number of results you want]*\n' + 'Makes a request to unsplash.com and sends the image with the keyword you provided.\n\n' + 'Note:\n1. The number of results you can get is limited to 10.\n' + '2. Keyword is required and should be of one word only!.\n' + '3. Images are sent as document to maintain quality.', } diff --git a/userbot/images/unsplash2.py b/userbot/images/unsplash2.py index 856e187..36db6e2 100644 --- a/userbot/images/unsplash2.py +++ b/userbot/images/unsplash2.py @@ -1,12 +1,13 @@ -from pyrogram import Client, filters, enums -from pyrogram.types import Message, InputMediaPhoto -from io import BytesIO -from PIL import Image -import requests import asyncio +from io import BytesIO + +import requests +from PIL import Image +from pyrogram import Client, enums, filters +from pyrogram.types import InputMediaPhoto, Message from utils.misc import modules_help, prefix -API_URL = "https://bk9.fun/search/unsplash?q=" +API_URL = 'https://bk9.fun/search/unsplash?q=' def resize_image(image_bytes): @@ -16,13 +17,13 @@ def resize_image(image_bytes): if img.size > max_size: img.thumbnail(max_size) output = BytesIO() - img.save(output, format="JPEG") + img.save(output, format='JPEG') output.seek(0) return output image_bytes.seek(0) # Reset pointer if not resized return image_bytes except Exception as e: - print(f"Error resizing image: {e}") + print(f'Error resizing image: {e}') return image_bytes @@ -34,70 +35,58 @@ async def download_image(url): resized_img_bytes = resize_image(img_bytes) return resized_img_bytes except Exception as e: - print(f"Error downloading image: {e}") + print(f'Error downloading image: {e}') return None -@Client.on_message(filters.command(["unsplash2", "usp2"], prefix) & filters.me) +@Client.on_message(filters.command(['unsplash2', 'usp2'], prefix) & filters.me) async def imgsearch(client: Client, message: Message): if len(message.command) < 2: - await message.edit( - "Usage: `img [number] `", parse_mode=enums.ParseMode.MARKDOWN - ) + await message.edit('Usage: `img [number] `', parse_mode=enums.ParseMode.MARKDOWN) return num_pics = int(message.command[1]) if message.command[1].isdigit() else 10 - query = " ".join(message.command[2:]) + query = ' '.join(message.command[2:]) # Update status - status_message = await message.edit( - "Searching for images...", parse_mode=enums.ParseMode.MARKDOWN - ) + status_message = await message.edit('Searching for images...', parse_mode=enums.ParseMode.MARKDOWN) - url = f"{API_URL}{query}" + url = f'{API_URL}{query}' response = requests.get(url) if response.status_code == 200: data = response.json() - if data.get("status"): - urls = data.get("BK9", [])[:num_pics] + if data.get('status'): + urls = data.get('BK9', [])[:num_pics] images = [download_image(img_url) for img_url in urls] # Download images downloaded_images = await asyncio.gather(*images) - media = [ - InputMediaPhoto(media=img_bytes) - for img_bytes in downloaded_images - if img_bytes - ] + media = [InputMediaPhoto(media=img_bytes) for img_bytes in downloaded_images if img_bytes] if media: - await status_message.edit( - "Uploading pictures...", parse_mode=enums.ParseMode.MARKDOWN - ) + await status_message.edit('Uploading pictures...', parse_mode=enums.ParseMode.MARKDOWN) while media: batch = media[:10] media = media[10:] await message.reply_media_group(batch) await status_message.delete() # Delete status message after uploading else: - await status_message.edit( - "No valid images found.", parse_mode=enums.ParseMode.MARKDOWN - ) + await status_message.edit('No valid images found.', parse_mode=enums.ParseMode.MARKDOWN) else: await status_message.edit( - "No images found for the given query.", + 'No images found for the given query.', parse_mode=enums.ParseMode.MARKDOWN, ) else: await status_message.edit( - "An error occurred, please try again later.", + 'An error occurred, please try again later.', parse_mode=enums.ParseMode.MARKDOWN, ) -modules_help["unsplash2"] = { - "unsplash2 [number]* [query]": "Get HD images. Default number of images is 10", - "usp2 [number]* [query]": "Get HD images. Default number of images is 10", +modules_help['unsplash2'] = { + 'unsplash2 [number]* [query]': 'Get HD images. Default number of images is 10', + 'usp2 [number]* [query]': 'Get HD images. Default number of images is 10', } diff --git a/userbot/install.py b/userbot/install.py index 24560ff..3ecf9a2 100644 --- a/userbot/install.py +++ b/userbot/install.py @@ -1,23 +1,23 @@ -from datetime import datetime import sys -from pyrogram import Client +from datetime import datetime +from pyrogram import Client from utils import config common_params = { - "api_id": config.api_id, - "api_hash": config.api_hash, - "hide_password": True, - "test_mode": config.test_server, + 'api_id': config.api_id, + 'api_hash': config.api_hash, + 'hide_password': True, + 'test_mode': config.test_server, } -if __name__ == "__main__": +if __name__ == '__main__': if config.STRINGSESSION: - common_params["session_string"] = config.STRINGSESSION + common_params['session_string'] = config.STRINGSESSION - app = Client("my_account", **common_params) + app = Client('my_account', **common_params) - if config.db_type in ["mongo", "mongodb"]: + if config.db_type in ['mongo', 'mongodb']: from pymongo import MongoClient, errors db = MongoClient(config.db_url) @@ -26,27 +26,27 @@ if __name__ == "__main__": except errors.ConnectionFailure as e: raise RuntimeError( "MongoDB server isn't available! " - f"Provided url: {config.db_url}. " - "Enter valid URL and restart installation" + f'Provided url: {config.db_url}. ' + 'Enter valid URL and restart installation' ) from e - install_type = sys.argv[1] if len(sys.argv) > 1 else "3" - if install_type == "1": - restart = "pm2 restart Moon" - elif install_type == "2": - restart = "sudo systemctl restart Moon" + install_type = sys.argv[1] if len(sys.argv) > 1 else '3' + if install_type == '1': + restart = 'pm2 restart Moon' + elif install_type == '2': + restart = 'sudo systemctl restart Moon' else: - restart = "cd Moon-Userbot/ && python main.py" + restart = 'cd Moon-Userbot/ && python main.py' app.start() try: app.send_message( - "me", - f"[{datetime.now()}] Userbot launched! \n" - "Custom modules: @moonub_modules\n" - f"For restart, enter:\n" - f"{restart}", + 'me', + f'[{datetime.now()}] Userbot launched! \n' + 'Custom modules: @moonub_modules\n' + f'For restart, enter:\n' + f'{restart}', ) except Exception as e: - print(f"[ERROR]: Sending Message to me failed! {e}") + print(f'[ERROR]: Sending Message to me failed! {e}') app.stop() diff --git a/userbot/main.py b/userbot/main.py index 8e76c29..451e45c 100644 --- a/userbot/main.py +++ b/userbot/main.py @@ -39,92 +39,88 @@ # "pySmartDL", # ] # /// -import os import logging - -import sqlite3 +import os import platform +import sqlite3 import subprocess -from pyrogram import Client, idle, errors -from pyrogram.enums.parse_mode import ParseMode -from pyrogram.raw.functions.account import GetAuthorizations, DeleteAccount import requests - +from pyrogram import Client, errors, idle +from pyrogram.enums.parse_mode import ParseMode +from pyrogram.raw.functions.account import DeleteAccount, GetAuthorizations from utils import config from utils.db import db -from utils.misc import gitrepo, userbot_version -from utils.scripts import restart -from utils.rentry import rentry_cleanup_job +from utils.misc import userbot_version from utils.module import ModuleManager +from utils.rentry import rentry_cleanup_job +from utils.scripts import restart SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__)) -if SCRIPT_PATH != os.getcwd(): +if os.getcwd() != SCRIPT_PATH: os.chdir(SCRIPT_PATH) common_params = { - "api_id": config.api_id, - "api_hash": config.api_hash, - "hide_password": True, - "workdir": SCRIPT_PATH, - "app_version": userbot_version, - "device_model": f"mUserbot", - "system_version": platform.version() + " " + platform.machine(), - "sleep_threshold": 30, - "test_mode": config.test_server, - "parse_mode": ParseMode.HTML, + 'api_id': config.api_id, + 'api_hash': config.api_hash, + 'hide_password': True, + 'workdir': SCRIPT_PATH, + 'app_version': userbot_version, + 'device_model': 'mUserbot', + 'system_version': platform.version() + ' ' + platform.machine(), + 'sleep_threshold': 30, + 'test_mode': config.test_server, + 'parse_mode': ParseMode.HTML, } if config.STRINGSESSION: - common_params["session_string"] = config.STRINGSESSION + common_params['session_string'] = config.STRINGSESSION -app = Client("my_account", **common_params) +app = Client('my_account', **common_params) def load_missing_modules(): - all_modules = db.get("custom.modules", "allModules", []) + all_modules = db.get('custom.modules', 'allModules', []) if not all_modules: return - custom_modules_path = f"{SCRIPT_PATH}/modules/custom_modules" + custom_modules_path = f'{SCRIPT_PATH}/modules/custom_modules' os.makedirs(custom_modules_path, exist_ok=True) try: resp = requests.get( - "https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/full.txt", + 'https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/full.txt', timeout=10, ) if not resp.ok: logging.error( - "Failed to fetch custom modules list: HTTP %s", + 'Failed to fetch custom modules list: HTTP %s', resp.status_code, ) return f = resp.text except Exception as e: - logging.error("Failed to fetch custom modules list: %s", e) + logging.error('Failed to fetch custom modules list: %s', e) return - modules_dict = { - line.split("/")[-1].split()[0]: line.strip() for line in f.splitlines() - } + modules_dict = {line.split('/')[-1].split()[0]: line.strip() for line in f.splitlines()} for module_name in all_modules: - module_path = f"{custom_modules_path}/{module_name}.py" + module_path = f'{custom_modules_path}/{module_name}.py' if not os.path.exists(module_path) and module_name in modules_dict: - url = f"https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/{modules_dict[module_name]}.py" + url = f'https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/{modules_dict[module_name]}.py' resp = requests.get(url) if resp.ok: - with open(module_path, "wb") as f: + with open(module_path, 'wb') as f: f.write(resp.content) - logging.info("Loaded missing module: %s", module_name) + logging.info('Loaded missing module: %s', module_name) else: - logging.warning("Failed to load module: %s", module_name) + logging.warning('Failed to load module: %s', module_name) async def main(): logging.basicConfig( - format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", - handlers=[logging.FileHandler("moonlogs.txt"), logging.StreamHandler()], + format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', + handlers=[logging.FileHandler('moonlogs.txt'), logging.StreamHandler()], level=logging.INFO, ) DeleteAccount.__new__ = None @@ -132,49 +128,44 @@ async def main(): try: await app.start() except sqlite3.OperationalError as e: - if str(e) == "database is locked" and os.name == "posix": - logging.warning( - "Session file is locked. Trying to kill blocking process..." - ) - subprocess.run(["fuser", "-k", "my_account.session"], check=True) + if str(e) == 'database is locked' and os.name == 'posix': + logging.warning('Session file is locked. Trying to kill blocking process...') + subprocess.run(['fuser', '-k', 'my_account.session'], check=True) restart() raise except (errors.NotAcceptable, errors.Unauthorized) as e: logging.error( - "%s: %s\nMoving session file to my_account.session-old...", + '%s: %s\nMoving session file to my_account.session-old...', e.__class__.__name__, e, ) - os.rename("./my_account.session", "./my_account.session-old") + os.rename('./my_account.session', './my_account.session-old') restart() load_missing_modules() module_manager = ModuleManager.get_instance() await module_manager.load_modules(app) - if info := db.get("core.updater", "restart_info"): + if info := db.get('core.updater', 'restart_info'): text = { - "restart": "Restart completed!", - "update": "Update process completed!", - }[info["type"]] + 'restart': 'Restart completed!', + 'update': 'Update process completed!', + }[info['type']] try: - await app.edit_message_text(info["chat_id"], info["message_id"], text) + await app.edit_message_text(info['chat_id'], info['message_id'], text) except errors.RPCError: pass - db.remove("core.updater", "restart_info") + db.remove('core.updater', 'restart_info') # required for sessionkiller module - if db.get("core.sessionkiller", "enabled", False): + if db.get('core.sessionkiller', 'enabled', False): db.set( - "core.sessionkiller", - "auths_hashes", - [ - auth.hash - for auth in (await app.invoke(GetAuthorizations())).authorizations - ], + 'core.sessionkiller', + 'auths_hashes', + [auth.hash for auth in (await app.invoke(GetAuthorizations())).authorizations], ) - logging.info("Moon-Userbot started!") + logging.info('Moon-Userbot started!') app.loop.create_task(rentry_cleanup_job()) @@ -183,5 +174,5 @@ async def main(): await app.stop() -if __name__ == "__main__": +if __name__ == '__main__': app.run(main()) diff --git a/userbot/modules/1000-7.py b/userbot/modules/1000-7.py index 780e3cd..08740b7 100644 --- a/userbot/modules/1000-7.py +++ b/userbot/modules/1000-7.py @@ -2,20 +2,16 @@ from asyncio import sleep from pyrogram import Client, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix -digits = { - str(i): el - for i, el in enumerate(["0️⃣", "1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣"]) -} +digits = {str(i): el for i, el in enumerate(['0️⃣', '1️⃣', '2️⃣', '3️⃣', '4️⃣', '5️⃣', '6️⃣', '7️⃣', '8️⃣', '9️⃣'])} def prettify(val: int) -> str: - return "".join(digits[i] for i in str(val)) + return ''.join(digits[i] for i in str(val)) -@Client.on_message(filters.command("ghoul", prefix) & filters.me) +@Client.on_message(filters.command('ghoul', prefix) & filters.me) async def ghoul_counter(_, message: Message): await message.delete() @@ -33,9 +29,7 @@ async def ghoul_counter(_, message: Message): await msg.edit(prettify(counter)) await sleep(1) - await msg.edit("🤡 GHOUL 🤡") + await msg.edit('🤡 GHOUL 🤡') -modules_help["1000-7"] = { - "ghoul [count_from]": "counting from 1000 (or given [count_from] to 0 as a ghoul" -} +modules_help['1000-7'] = {'ghoul [count_from]': 'counting from 1000 (or given [count_from] to 0 as a ghoul'} diff --git a/userbot/modules/admintool.py b/userbot/modules/admintool.py index 7ca2ae5..5ccbe8e 100644 --- a/userbot/modules/admintool.py +++ b/userbot/modules/admintool.py @@ -16,60 +16,57 @@ from contextlib import suppress -from pyrogram.enums import ChatType from pyrogram import Client, ContinuePropagation, filters +from pyrogram.enums import ChatType from pyrogram.errors import ( - UserAdminInvalid, ChatAdminRequired, RPCError, + UserAdminInvalid, ) from pyrogram.raw import functions -from pyrogram.types import Message, ChatPermissions - +from pyrogram.types import ChatPermissions, Message from utils.db import db -from utils.scripts import format_exc, with_reply -from utils.misc import modules_help, prefix - from utils.handlers import ( - BanHandler, - UnbanHandler, - KickHandler, - KickDeletedAccountsHandler, - TimeMuteHandler, - TimeUnmuteHandler, - TimeMuteUsersHandler, - UnmuteHandler, - MuteHandler, - DemoteHandler, - PromoteHandler, AntiChannelsHandler, - DeleteHistoryHandler, AntiRaidHandler, + BanHandler, + DeleteHistoryHandler, + DemoteHandler, + KickDeletedAccountsHandler, + KickHandler, + MuteHandler, + PromoteHandler, + TimeMuteHandler, + TimeMuteUsersHandler, + TimeUnmuteHandler, + UnbanHandler, + UnmuteHandler, ) +from utils.misc import modules_help, prefix +from utils.scripts import format_exc, with_reply - -db_cache: dict = db.get_collection("core.ats") +db_cache: dict = db.get_collection('core.ats') def update_cache(): db_cache.clear() - db_cache.update(db.get_collection("core.ats")) + db_cache.update(db.get_collection('core.ats')) @Client.on_message(filters.group & ~filters.me) async def admintool_handler(_, message: Message): if message.sender_chat and ( - message.sender_chat.type == "supergroup" - or message.sender_chat.id == db_cache.get(f"linked{message.chat.id}", 0) + message.sender_chat.type == 'supergroup' + or message.sender_chat.id == db_cache.get(f'linked{message.chat.id}', 0) ): raise ContinuePropagation - if message.sender_chat and db_cache.get(f"antich{message.chat.id}", False): + if message.sender_chat and db_cache.get(f'antich{message.chat.id}', False): with suppress(RPCError): await message.delete() await message.chat.ban_member(message.sender_chat.id) - tmuted_users = db_cache.get(f"c{message.chat.id}", []) + tmuted_users = db_cache.get(f'c{message.chat.id}', []) if ( message.from_user and message.from_user.id in tmuted_users @@ -79,7 +76,7 @@ async def admintool_handler(_, message: Message): with suppress(RPCError): await message.delete() - if db_cache.get(f"antiraid{message.chat.id}", False): + if db_cache.get(f'antiraid{message.chat.id}', False): with suppress(RPCError): await message.delete() if message.from_user: @@ -87,11 +84,9 @@ async def admintool_handler(_, message: Message): elif message.sender_chat: await message.chat.ban_member(message.sender_chat.id) - if message.new_chat_members and db_cache.get( - f"welcome_enabled{message.chat.id}", False - ): + if message.new_chat_members and db_cache.get(f'welcome_enabled{message.chat.id}', False): await message.reply( - db_cache.get(f"welcome_text{message.chat.id}"), + db_cache.get(f'welcome_text{message.chat.id}'), disable_web_page_preview=True, ) @@ -111,88 +106,88 @@ async def get_user_and_name(message): ) -@Client.on_message(filters.command(["ban"], prefix) & filters.me) +@Client.on_message(filters.command(['ban'], prefix) & filters.me) async def ban_command(client: Client, message: Message): handler = BanHandler(client, message) await handler.handle_ban() -@Client.on_message(filters.command(["unban"], prefix) & filters.me) +@Client.on_message(filters.command(['unban'], prefix) & filters.me) async def unban_command(client: Client, message: Message): handler = UnbanHandler(client, message) await handler.handle_unban() -@Client.on_message(filters.command(["kick"], prefix) & filters.me) +@Client.on_message(filters.command(['kick'], prefix) & filters.me) async def kick_command(client: Client, message: Message): handler = KickHandler(client, message) await handler.handle_kick() -@Client.on_message(filters.command(["kickdel"], prefix) & filters.me) +@Client.on_message(filters.command(['kickdel'], prefix) & filters.me) async def kickdel_cmd(client: Client, message: Message): handler = KickDeletedAccountsHandler(client, message) await handler.kick_deleted_accounts() -@Client.on_message(filters.command(["tmute"], prefix) & filters.me) +@Client.on_message(filters.command(['tmute'], prefix) & filters.me) async def tmute_command(client: Client, message: Message): handler = TimeMuteHandler(client, message) await handler.handle_tmute() update_cache() -@Client.on_message(filters.command(["tunmute"], prefix) & filters.me) +@Client.on_message(filters.command(['tunmute'], prefix) & filters.me) async def tunmute_command(client: Client, message: Message): handler = TimeUnmuteHandler(client, message) await handler.handle_tunmute() update_cache() -@Client.on_message(filters.command(["tmute_users"], prefix) & filters.me) +@Client.on_message(filters.command(['tmute_users'], prefix) & filters.me) async def tunmute_users_command(client: Client, message: Message): handler = TimeMuteUsersHandler(client, message) await handler.list_tmuted_users() -@Client.on_message(filters.command(["unmute"], prefix) & filters.me) +@Client.on_message(filters.command(['unmute'], prefix) & filters.me) async def unmute_command(client: Client, message: Message): handler = UnmuteHandler(client, message) await handler.handle_unmute() -@Client.on_message(filters.command(["mute"], prefix) & filters.me) +@Client.on_message(filters.command(['mute'], prefix) & filters.me) async def mute_command(client: Client, message: Message): handler = MuteHandler(client, message) await handler.handle_mute() -@Client.on_message(filters.command(["demote"], prefix) & filters.me) +@Client.on_message(filters.command(['demote'], prefix) & filters.me) async def demote_command(client: Client, message: Message): handler = DemoteHandler(client, message) await handler.handle_demote() -@Client.on_message(filters.command(["promote"], prefix) & filters.me) +@Client.on_message(filters.command(['promote'], prefix) & filters.me) async def promote_command(client: Client, message: Message): handler = PromoteHandler(client, message) await handler.handle_promote() -@Client.on_message(filters.command(["antich"], prefix)) +@Client.on_message(filters.command(['antich'], prefix)) async def anti_channels(client: Client, message: Message): handler = AntiChannelsHandler(client, message) await handler.handle_anti_channels() update_cache() -@Client.on_message(filters.command(["delete_history", "dh"], prefix)) +@Client.on_message(filters.command(['delete_history', 'dh'], prefix)) async def delete_history(client: Client, message: Message): handler = DeleteHistoryHandler(client, message) await handler.handle_delete_history() -@Client.on_message(filters.command(["report_spam", "rs"], prefix)) +@Client.on_message(filters.command(['report_spam', 'rs'], prefix)) @with_reply async def report_spam(client: Client, message: Message): try: @@ -210,33 +205,33 @@ async def report_spam(client: Client, message: Message): except Exception as e: await message.edit(format_exc(e)) else: - await message.edit(f"Message from {name} was reported") + await message.edit(f'Message from {name} was reported') -@Client.on_message(filters.command("pin", prefix) & filters.me) +@Client.on_message(filters.command('pin', prefix) & filters.me) @with_reply async def pin(_, message: Message): try: await message.reply_to_message.pin() - await message.edit("Pinned!") + await message.edit('Pinned!') except Exception as e: await message.edit(format_exc(e)) -@Client.on_message(filters.command("unpin", prefix) & filters.me) +@Client.on_message(filters.command('unpin', prefix) & filters.me) @with_reply async def unpin(_, message: Message): try: await message.reply_to_message.unpin() - await message.edit("Unpinned!") + await message.edit('Unpinned!') except Exception as e: await message.edit(format_exc(e)) -@Client.on_message(filters.command("ro", prefix) & filters.me) +@Client.on_message(filters.command('ro', prefix) & filters.me) async def ro(client: Client, message: Message): if message.chat.type not in [ChatType.GROUP, ChatType.SUPERGROUP]: - await message.edit("Invalid chat type") + await message.edit('Invalid chat type') return try: @@ -250,42 +245,39 @@ async def ro(client: Client, message: Message): perms.can_invite_users, perms.can_pin_messages, ] - db.set("core.ats", f"ro{message.chat.id}", perms_list) + db.set('core.ats', f'ro{message.chat.id}', perms_list) try: await client.set_chat_permissions(message.chat.id, ChatPermissions()) except (UserAdminInvalid, ChatAdminRequired): - await message.edit("No rights") + await message.edit('No rights') else: - await message.edit( - "Read-only mode activated!\n" - f"Turn off with:{prefix}unro" - ) + await message.edit(f'Read-only mode activated!\nTurn off with:{prefix}unro') except Exception as e: await message.edit(format_exc(e)) -@Client.on_message(filters.command("unro", prefix) & filters.me) +@Client.on_message(filters.command('unro', prefix) & filters.me) async def unro(client: Client, message: Message): if message.chat.type not in [ChatType.GROUP, ChatType.SUPERGROUP]: - await message.edit("Invalid chat type") + await message.edit('Invalid chat type') return try: perms_list = db.get( - "core.ats", - f"ro{message.chat.id}", + 'core.ats', + f'ro{message.chat.id}', [True, True, False, False, False, False, False], ) common_perms = { - "can_send_messages": perms_list[0], - "can_send_media_messages": perms_list[1], - "can_send_polls": perms_list[2], - "can_add_web_page_previews": perms_list[3], - "can_change_info": perms_list[4], - "can_invite_users": perms_list[5], - "can_pin_messages": perms_list[6], + 'can_send_messages': perms_list[0], + 'can_send_media_messages': perms_list[1], + 'can_send_polls': perms_list[2], + 'can_add_web_page_previews': perms_list[3], + 'can_change_info': perms_list[4], + 'can_invite_users': perms_list[5], + 'can_pin_messages': perms_list[6], } perms = ChatPermissions(**common_perms) @@ -293,61 +285,58 @@ async def unro(client: Client, message: Message): try: await client.set_chat_permissions(message.chat.id, perms) except (UserAdminInvalid, ChatAdminRequired): - await message.edit("No rights") + await message.edit('No rights') else: - await message.edit("Read-only mode disabled!") + await message.edit('Read-only mode disabled!') except Exception as e: await message.edit(format_exc(e)) -@Client.on_message(filters.command("antiraid", prefix) & filters.me) +@Client.on_message(filters.command('antiraid', prefix) & filters.me) async def antiraid(client: Client, message: Message): handler = AntiRaidHandler(client, message) await handler.handle_antiraid() update_cache() -@Client.on_message(filters.command(["welcome", "wc"], prefix) & filters.me) +@Client.on_message(filters.command(['welcome', 'wc'], prefix) & filters.me) async def welcome(_, message: Message): if message.chat.type not in [ChatType.GROUP, ChatType.SUPERGROUP]: - return await message.edit("Unsupported chat type") + return await message.edit('Unsupported chat type') if len(message.command) > 1: text = message.text.split(maxsplit=1)[1] - db.set("core.ats", f"welcome_enabled{message.chat.id}", True) - db.set("core.ats", f"welcome_text{message.chat.id}", text) + db.set('core.ats', f'welcome_enabled{message.chat.id}', True) + db.set('core.ats', f'welcome_text{message.chat.id}', text) - await message.edit( - f"Welcome enabled in this chat\nText: {text}" - ) + await message.edit(f'Welcome enabled in this chat\nText: {text}') else: - db.set("core.ats", f"welcome_enabled{message.chat.id}", False) - await message.edit("Welcome disabled in this chat") + db.set('core.ats', f'welcome_enabled{message.chat.id}', False) + await message.edit('Welcome disabled in this chat') update_cache() -modules_help["admintool"] = { - "ban [reply]/[username/id]* [reason] [report_spam] [delete_history]": "ban user in chat", - "unban [reply]/[username/id]* [reason]": "unban user in chat", - "kick [reply]/[userid]* [reason] [report_spam] [delete_history]": "kick user out of chat", - "mute [reply]/[userid]* [reason] [1m]/[1h]/[1d]/[1w]": "mute user in chat", - "unmute [reply]/[userid]* [reason]": "unmute user in chat", - "promote [reply]/[userid]* [prefix]": "promote user in chat", - "demote [reply]/[userid]* [reason]": "demote user in chat", - "tmute [reply]/[username/id]* [reason]": "delete all new messages from user in chat", - "tunmute [reply]/[username/id]* [reason]": "stop deleting all messages from user in chat", - "tmute_users": "list of tmuted (.tmute) users", - "antich [enable/disable]": "turn on/off blocking channels in this chat", - "delete_history [reply]/[username/id]* [reason]": "delete history from member in chat", - "report_spam [reply]*": "report spam message in chat", - "pin [reply]*": "Pin replied message", - "unpin [reply]*": "Unpin replied message", - "ro": "enable read-only mode", - "unro": "disable read-only mode", - "antiraid [on|off]": "when enabled, anyone who writes message will be blocked. Useful in raids. " - "Running without arguments equals to toggling state", - "welcome [text]*": "enable auto-welcome to new users in groups. " - "Running without text equals to disable", - "kickdel": "Kick all deleted accounts", +modules_help['admintool'] = { + 'ban [reply]/[username/id]* [reason] [report_spam] [delete_history]': 'ban user in chat', + 'unban [reply]/[username/id]* [reason]': 'unban user in chat', + 'kick [reply]/[userid]* [reason] [report_spam] [delete_history]': 'kick user out of chat', + 'mute [reply]/[userid]* [reason] [1m]/[1h]/[1d]/[1w]': 'mute user in chat', + 'unmute [reply]/[userid]* [reason]': 'unmute user in chat', + 'promote [reply]/[userid]* [prefix]': 'promote user in chat', + 'demote [reply]/[userid]* [reason]': 'demote user in chat', + 'tmute [reply]/[username/id]* [reason]': 'delete all new messages from user in chat', + 'tunmute [reply]/[username/id]* [reason]': 'stop deleting all messages from user in chat', + 'tmute_users': 'list of tmuted (.tmute) users', + 'antich [enable/disable]': 'turn on/off blocking channels in this chat', + 'delete_history [reply]/[username/id]* [reason]': 'delete history from member in chat', + 'report_spam [reply]*': 'report spam message in chat', + 'pin [reply]*': 'Pin replied message', + 'unpin [reply]*': 'Unpin replied message', + 'ro': 'enable read-only mode', + 'unro': 'disable read-only mode', + 'antiraid [on|off]': 'when enabled, anyone who writes message will be blocked. Useful in raids. ' + 'Running without arguments equals to toggling state', + 'welcome [text]*': 'enable auto-welcome to new users in groups. Running without text equals to disable', + 'kickdel': 'Kick all deleted accounts', } diff --git a/userbot/modules/admlist.py b/userbot/modules/admlist.py index ba2bc49..58b9168 100644 --- a/userbot/modules/admlist.py +++ b/userbot/modules/admlist.py @@ -14,12 +14,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +from collections.abc import AsyncGenerator from time import perf_counter -from typing import AsyncGenerator, List, Optional, Union +from typing import Optional from pyrogram import Client, enums, filters, raw, types, utils from pyrogram.types.object import Object - from utils.misc import modules_help, prefix from utils.scripts import format_exc @@ -28,7 +28,7 @@ class Chat(Object): def __init__( self, *, - client: "Client" = None, + client: 'Client' = None, id: id, type: type, is_verified: bool = None, @@ -41,7 +41,7 @@ class Chat(Object): username: str = None, first_name: str = None, last_name: str = None, - photo: "types.ChatPhoto" = None, + photo: 'types.ChatPhoto' = None, bio: str = None, description: str = None, dc_id: int = None, @@ -51,12 +51,12 @@ class Chat(Object): sticker_set_name: str = None, can_set_sticker_set: bool = None, members_count: int = None, - restrictions: List["types.Restriction"] = None, - permissions: "types.ChatPermissions" = None, + restrictions: list['types.Restriction'] = None, + permissions: 'types.ChatPermissions' = None, distance: int = None, - linked_chat: "types.Chat" = None, - send_as_chat: "types.Chat" = None, - available_reactions: Optional["types.ChatReactions"] = None, + linked_chat: 'types.Chat' = None, + send_as_chat: 'types.Chat' = None, + available_reactions: Optional['types.ChatReactions'] = None, is_admin: bool = False, deactivated: bool = False, ): @@ -94,98 +94,82 @@ class Chat(Object): self.deactivated = deactivated @staticmethod - def _parse_user_chat(client, user: raw.types.User) -> "Chat": + def _parse_user_chat(client, user: raw.types.User) -> 'Chat': peer_id = user.id return Chat( id=peer_id, type=enums.ChatType.BOT if user.bot else enums.ChatType.PRIVATE, - is_verified=getattr(user, "verified", None), - is_restricted=getattr(user, "restricted", None), - is_scam=getattr(user, "scam", None), - is_fake=getattr(user, "fake", None), - is_support=getattr(user, "support", None), + is_verified=getattr(user, 'verified', None), + is_restricted=getattr(user, 'restricted', None), + is_scam=getattr(user, 'scam', None), + is_fake=getattr(user, 'fake', None), + is_support=getattr(user, 'support', None), username=user.username, first_name=user.first_name, last_name=user.last_name, photo=types.ChatPhoto._parse(client, user.photo, peer_id, user.access_hash), - restrictions=types.List( - [types.Restriction._parse(r) for r in user.restriction_reason] - ) - or None, - dc_id=getattr(getattr(user, "photo", None), "dc_id", None), + restrictions=types.List([types.Restriction._parse(r) for r in user.restriction_reason]) or None, + dc_id=getattr(getattr(user, 'photo', None), 'dc_id', None), client=client, ) @staticmethod - def _parse_chat_chat(client, chat: raw.types.Chat) -> "Chat": + def _parse_chat_chat(client, chat: raw.types.Chat) -> 'Chat': peer_id = -chat.id return Chat( id=peer_id, type=enums.ChatType.GROUP, title=chat.title, - is_creator=getattr(chat, "creator", None), - photo=types.ChatPhoto._parse( - client, getattr(chat, "photo", None), peer_id, 0 - ), - permissions=types.ChatPermissions._parse( - getattr(chat, "default_banned_rights", None) - ), - members_count=getattr(chat, "participants_count", None), - dc_id=getattr(getattr(chat, "photo", None), "dc_id", None), - has_protected_content=getattr(chat, "noforwards", None), + is_creator=getattr(chat, 'creator', None), + photo=types.ChatPhoto._parse(client, getattr(chat, 'photo', None), peer_id, 0), + permissions=types.ChatPermissions._parse(getattr(chat, 'default_banned_rights', None)), + members_count=getattr(chat, 'participants_count', None), + dc_id=getattr(getattr(chat, 'photo', None), 'dc_id', None), + has_protected_content=getattr(chat, 'noforwards', None), client=client, - is_admin=bool(getattr(chat, "admin_rights", False)), + is_admin=bool(getattr(chat, 'admin_rights', False)), deactivated=chat.deactivated, ) @staticmethod - def _parse_channel_chat(client, channel: raw.types.Channel) -> "Chat": + def _parse_channel_chat(client, channel: raw.types.Channel) -> 'Chat': peer_id = utils.get_channel_id(channel.id) - restriction_reason = getattr(channel, "restriction_reason", []) + restriction_reason = getattr(channel, 'restriction_reason', []) return Chat( id=peer_id, - type=( - enums.ChatType.SUPERGROUP - if getattr(channel, "megagroup", None) - else enums.ChatType.CHANNEL - ), - is_verified=getattr(channel, "verified", None), - is_restricted=getattr(channel, "restricted", None), - is_creator=getattr(channel, "creator", None), - is_scam=getattr(channel, "scam", None), - is_fake=getattr(channel, "fake", None), + type=(enums.ChatType.SUPERGROUP if getattr(channel, 'megagroup', None) else enums.ChatType.CHANNEL), + is_verified=getattr(channel, 'verified', None), + is_restricted=getattr(channel, 'restricted', None), + is_creator=getattr(channel, 'creator', None), + is_scam=getattr(channel, 'scam', None), + is_fake=getattr(channel, 'fake', None), title=channel.title, - username=getattr(channel, "username", None), + username=getattr(channel, 'username', None), photo=types.ChatPhoto._parse( client, - getattr(channel, "photo", None), + getattr(channel, 'photo', None), peer_id, - getattr(channel, "access_hash", 0), + getattr(channel, 'access_hash', 0), ), - restrictions=types.List( - [types.Restriction._parse(r) for r in restriction_reason] - ) - or None, - permissions=types.ChatPermissions._parse( - getattr(channel, "default_banned_rights", None) - ), - members_count=getattr(channel, "participants_count", None), - dc_id=getattr(getattr(channel, "photo", None), "dc_id", None), - has_protected_content=getattr(channel, "noforwards", None), - is_admin=bool(getattr(channel, "admin_rights", False)), + restrictions=types.List([types.Restriction._parse(r) for r in restriction_reason]) or None, + permissions=types.ChatPermissions._parse(getattr(channel, 'default_banned_rights', None)), + members_count=getattr(channel, 'participants_count', None), + dc_id=getattr(getattr(channel, 'photo', None), 'dc_id', None), + has_protected_content=getattr(channel, 'noforwards', None), + is_admin=bool(getattr(channel, 'admin_rights', False)), client=client, ) @staticmethod def _parse( client, - message: Union[raw.types.Message, raw.types.MessageService], + message: raw.types.Message | raw.types.MessageService, users: dict, chats: dict, is_chat: bool, - ) -> "Chat": + ) -> 'Chat': from_id = utils.get_raw_peer_id(message.from_id) peer_id = utils.get_raw_peer_id(message.peer_id) chat_id = (peer_id or from_id) if is_chat else (from_id or peer_id) @@ -211,9 +195,9 @@ class Dialog(Object): def __init__( self, *, - client: "Client" = None, - chat: "types.Chat", - top_message: "types.Message", + client: 'Client' = None, + chat: 'types.Chat', + top_message: 'types.Message', unread_messages_count: int, unread_mentions_count: int, unread_mark: bool, @@ -229,7 +213,7 @@ class Dialog(Object): self.is_pinned = is_pinned @staticmethod - def _parse(client, dialog: "raw.types.Dialog", messages, users, chats) -> "Dialog": + def _parse(client, dialog: 'raw.types.Dialog', messages, users, chats) -> 'Dialog': return Dialog( chat=Chat._parse_dialog(client, dialog.peer, users, chats), top_message=messages.get(utils.get_peer_id(dialog.peer)), @@ -241,9 +225,7 @@ class Dialog(Object): ) -async def get_dialogs( - self: "Client", limit: int = 0 -) -> Optional[AsyncGenerator["types.Dialog", None]]: +async def get_dialogs(self: 'Client', limit: int = 0) -> AsyncGenerator['types.Dialog', None] | None: current = 0 total = limit or (1 << 31) - 1 limit = min(100, total) @@ -287,7 +269,7 @@ async def get_dialogs( return -@Client.on_message(filters.command("admlist", prefix) & filters.me) +@Client.on_message(filters.command('admlist', prefix) & filters.me) async def admlist(client: Client, message: types.Message): await message.edit("Retrieving information... (it'll take some time)") @@ -298,48 +280,46 @@ async def admlist(client: Client, message: types.Message): owned_usernamed_chats = [] async for dialog in get_dialogs(client): chat = dialog.chat - if getattr(chat, "deactivated", False): + if getattr(chat, 'deactivated', False): continue - if getattr(chat, "is_creator", False) and getattr(chat, "username", None): + if getattr(chat, 'is_creator', False) and getattr(chat, 'username', None): owned_usernamed_chats.append(chat) - elif getattr(chat, "is_creator", False): + elif getattr(chat, 'is_creator', False): owned_chats.append(chat) - elif getattr(chat, "is_admin", False): + elif getattr(chat, 'is_admin', False): adminned_chats.append(chat) - text = "Adminned chats:\n" + text = 'Adminned chats:\n' for index, chat in enumerate(adminned_chats): - cid = str(chat.id).replace("-100", "") - text += f"{index + 1}. {chat.title}\n" + cid = str(chat.id).replace('-100', '') + text += f'{index + 1}. {chat.title}\n' - text += "\nOwned chats:\n" + text += '\nOwned chats:\n' for index, chat in enumerate(owned_chats): - cid = str(chat.id).replace("-100", "") - text += f"{index + 1}. {chat.title}\n" + cid = str(chat.id).replace('-100', '') + text += f'{index + 1}. {chat.title}\n' - text += "\nOwned chats with username:\n" + text += '\nOwned chats with username:\n' for index, chat in enumerate(owned_usernamed_chats): - cid = str(chat.id).replace("-100", "") - text += f"{index + 1}. {chat.title}\n" + cid = str(chat.id).replace('-100', '') + text += f'{index + 1}. {chat.title}\n' stop = perf_counter() - total_count = ( - len(adminned_chats) + len(owned_chats) + len(owned_usernamed_chats) - ) + total_count = len(adminned_chats) + len(owned_chats) + len(owned_usernamed_chats) await message.edit( - text + "\n" - f"Total: {total_count}" - f"\nAdminned chats: {len(adminned_chats)}\n" - f"Owned chats: {len(owned_chats)}\n" - f"Owned chats with username: {len(owned_usernamed_chats)}\n\n" - f"Done in {round(stop - start, 3)} seconds.", + text + '\n' + f'Total: {total_count}' + f'\nAdminned chats: {len(adminned_chats)}\n' + f'Owned chats: {len(owned_chats)}\n' + f'Owned chats with username: {len(owned_usernamed_chats)}\n\n' + f'Done in {round(stop - start, 3)} seconds.', ) except Exception as e: await message.edit(format_exc(e)) return -@Client.on_message(filters.command("admcount", prefix) & filters.me) +@Client.on_message(filters.command('admcount', prefix) & filters.me) async def admcount(client: Client, message: types.Message): await message.edit("Retrieving information... (it'll take some time)") @@ -350,31 +330,31 @@ async def admcount(client: Client, message: types.Message): owned_usernamed_chats = 0 async for dialog in get_dialogs(client): chat = dialog.chat - if getattr(chat, "deactivated", False): + if getattr(chat, 'deactivated', False): continue - if getattr(chat, "is_creator", False) and getattr(chat, "username", None): + if getattr(chat, 'is_creator', False) and getattr(chat, 'username', None): owned_usernamed_chats += 1 - elif getattr(chat, "is_creator", False): + elif getattr(chat, 'is_creator', False): owned_chats += 1 - elif getattr(chat, "is_admin", False): + elif getattr(chat, 'is_admin', False): adminned_chats += 1 stop = perf_counter() total_count = adminned_chats + owned_chats + owned_usernamed_chats await message.edit( - f"Total: {total_count}" - f"\nAdminned chats: {adminned_chats}\n" - f"Owned chats: {owned_chats}\n" - f"Owned chats with username: {owned_usernamed_chats}\n\n" - f"Done in {round(stop - start, 3)} seconds.\n\n" - f"Get full list: {prefix}admlist", + f'Total: {total_count}' + f'\nAdminned chats: {adminned_chats}\n' + f'Owned chats: {owned_chats}\n' + f'Owned chats with username: {owned_usernamed_chats}\n\n' + f'Done in {round(stop - start, 3)} seconds.\n\n' + f'Get full list: {prefix}admlist', ) except Exception as e: await message.edit(format_exc(e)) return -modules_help["admlist"] = { - "admcount": "Get count of adminned and owned chats", - "admlist": "Get list of adminned and owned chats", +modules_help['admlist'] = { + 'admcount': 'Get count of adminned and owned chats', + 'admlist': 'Get list of adminned and owned chats', } diff --git a/userbot/modules/afk.py b/userbot/modules/afk.py index 00af2e4..4794225 100644 --- a/userbot/modules/afk.py +++ b/userbot/modules/afk.py @@ -17,72 +17,62 @@ import datetime from pyrogram import Client, filters, types - from utils.db import db from utils.misc import modules_help, prefix # avoid using global variables afk_info = db.get( - "core.afk", - "afk_info", + 'core.afk', + 'afk_info', { - "start": 0, - "is_afk": False, - "reason": "", + 'start': 0, + 'is_afk': False, + 'reason': '', }, ) -is_afk = filters.create(lambda _, __, ___: afk_info["is_afk"]) +is_afk = filters.create(lambda _, __, ___: afk_info['is_afk']) is_support = filters.create(lambda _, __, message: message.chat.is_support) @Client.on_message( - is_afk - & (filters.private | filters.mentioned) - & ~filters.channel - & ~filters.me - & ~filters.bot - & ~is_support + is_afk & (filters.private | filters.mentioned) & ~filters.channel & ~filters.me & ~filters.bot & ~is_support ) async def afk_handler(_, message: types.Message): - start = datetime.datetime.fromtimestamp(afk_info["start"]) + start = datetime.datetime.fromtimestamp(afk_info['start']) end = datetime.datetime.now().replace(microsecond=0) afk_time = end - start - await message.reply( - f"I'm AFK {afk_time}\nReason: {afk_info['reason']}" - ) + await message.reply(f"I'm AFK {afk_time}\nReason: {afk_info['reason']}") -@Client.on_message(filters.command("afk", prefix) & filters.me) +@Client.on_message(filters.command('afk', prefix) & filters.me) async def afk(_, message): if len(message.text.split()) >= 2: - reason = message.text.split(" ", maxsplit=1)[1] + reason = message.text.split(' ', maxsplit=1)[1] else: - reason = "None" + reason = 'None' - afk_info["start"] = int(datetime.datetime.now().timestamp()) - afk_info["is_afk"] = True - afk_info["reason"] = reason + afk_info['start'] = int(datetime.datetime.now().timestamp()) + afk_info['is_afk'] = True + afk_info['reason'] = reason - await message.edit(f"I'm going AFK.\n" f"Reason: {reason}") + await message.edit(f"I'm going AFK.\nReason: {reason}") - db.set("core.afk", "afk_info", afk_info) + db.set('core.afk', 'afk_info', afk_info) -@Client.on_message(filters.command("unafk", prefix) & filters.me) +@Client.on_message(filters.command('unafk', prefix) & filters.me) async def unafk(_, message): - if afk_info["is_afk"]: - start = datetime.datetime.fromtimestamp(afk_info["start"]) + if afk_info['is_afk']: + start = datetime.datetime.fromtimestamp(afk_info['start']) end = datetime.datetime.now().replace(microsecond=0) afk_time = end - start - await message.edit( - f"I'm not AFK anymore.\n" f"I was afk {afk_time}" - ) - afk_info["is_afk"] = False + await message.edit(f"I'm not AFK anymore.\nI was afk {afk_time}") + afk_info['is_afk'] = False else: await message.edit("You weren't afk") - db.set("core.afk", "afk_info", afk_info) + db.set('core.afk', 'afk_info', afk_info) -modules_help["afk"] = {"afk [reason]": "Go to afk", "unafk": "Get out of AFK"} +modules_help['afk'] = {'afk [reason]': 'Go to afk', 'unafk': 'Get out of AFK'} diff --git a/userbot/modules/aimage.py b/userbot/modules/aimage.py index c24a5cd..e144afa 100644 --- a/userbot/modules/aimage.py +++ b/userbot/modules/aimage.py @@ -1,129 +1,116 @@ import os + from PIL import Image - -from pyrogram import Client, filters, enums +from pyrogram import Client, enums, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix from utils.scripts import format_exc, import_library -genai = import_library("google.generativeai", "google-generativeai") +genai = import_library('google.generativeai', 'google-generativeai') from utils.config import gemini_key genai.configure(api_key=gemini_key) generation_config_cook = { - "temperature": 0.35, - "top_p": 0.95, - "top_k": 40, - "max_output_tokens": 1024, + 'temperature': 0.35, + 'top_p': 0.95, + 'top_k': 40, + 'max_output_tokens': 1024, } -model = genai.GenerativeModel("gemini-1.5-flash-latest") -model_cook = genai.GenerativeModel( - model_name="gemini-1.5-flash-latest", generation_config=generation_config_cook -) +model = genai.GenerativeModel('gemini-1.5-flash-latest') +model_cook = genai.GenerativeModel(model_name='gemini-1.5-flash-latest', generation_config=generation_config_cook) -@Client.on_message(filters.command("getai", prefix) & filters.me) +@Client.on_message(filters.command('getai', prefix) & filters.me) async def getai(_, message: Message): try: - await message.edit_text("Please Wait...") + await message.edit_text('Please Wait...') try: base_img = await message.reply_to_message.download() except AttributeError: - return await message.edit_text("Please reply to an image...") + return await message.edit_text('Please reply to an image...') img = Image.open(base_img) - prompt = "Get details of given image, be as accurate as possible." + prompt = 'Get details of given image, be as accurate as possible.' response = model.generate_content([prompt, img]) - await message.edit_text( - f"**Detail Of Image:** {response.text}", parse_mode=enums.ParseMode.MARKDOWN - ) + await message.edit_text(f'**Detail Of Image:** {response.text}', parse_mode=enums.ParseMode.MARKDOWN) os.remove(base_img) return except Exception as e: - await message.edit_text(f"An error occurred: {format_exc(e)}") + await message.edit_text(f'An error occurred: {format_exc(e)}') -@Client.on_message(filters.command("aicook", prefix) & filters.me) +@Client.on_message(filters.command('aicook', prefix) & filters.me) async def aicook(_, message: Message): if message.reply_to_message: try: - await message.edit_text("Cooking...") + await message.edit_text('Cooking...') try: base_img = await message.reply_to_message.download() except AttributeError: - return await message.edit_text( - "Please reply to an image..." - ) + return await message.edit_text('Please reply to an image...') img = Image.open(base_img) cook_img = [ - "Accurately identify the baked good in the image and provide an appropriate and recipe consistent with your analysis. ", + 'Accurately identify the baked good in the image and provide an appropriate and recipe consistent with your analysis. ', img, ] response = model_cook.generate_content(cook_img) - await message.edit_text( - f"{response.text}", parse_mode=enums.ParseMode.MARKDOWN - ) + await message.edit_text(f'{response.text}', parse_mode=enums.ParseMode.MARKDOWN) os.remove(base_img) return except Exception as e: await message.edit_text(str(e)) - return await message.edit_text("Please reply to an image...") + return await message.edit_text('Please reply to an image...') -@Client.on_message(filters.command("aiseller", prefix) & filters.me) +@Client.on_message(filters.command('aiseller', prefix) & filters.me) async def aiseller(_, message: Message): if message.reply_to_message: try: - await message.edit_text("Generating...") + await message.edit_text('Generating...') if len(message.command) > 1: taud = message.text.split(maxsplit=1)[1] else: return await message.edit_text( - f"Usage: {prefix}aiseller [target audience] [reply to product image]" + f'Usage: {prefix}aiseller [target audience] [reply to product image]' ) try: base_img = await message.reply_to_message.download() except AttributeError: - return await message.edit_text( - "Please reply to an image..." - ) + return await message.edit_text('Please reply to an image...') img = Image.open(base_img) sell_img = [ - "Given an image of a product and its target audience, write an engaging marketing description", - "Product Image: ", + 'Given an image of a product and its target audience, write an engaging marketing description', + 'Product Image: ', img, - "Target Audience: ", + 'Target Audience: ', taud, ] response = model.generate_content(sell_img) - await message.edit_text( - f"{response.text}", parse_mode=enums.ParseMode.MARKDOWN - ) + await message.edit_text(f'{response.text}', parse_mode=enums.ParseMode.MARKDOWN) os.remove(base_img) return except Exception: await message.edit_text( - f"Usage: {prefix}aiseller [target audience] [reply to product image]" + f'Usage: {prefix}aiseller [target audience] [reply to product image]' ) - return await message.edit_text("Please reply to an image...") + return await message.edit_text('Please reply to an image...') -modules_help["aimage"] = { - "getai [reply to image]*": "Get details of image with Ai", - "aicook [reply to image]*": "Generate Cooking instrunctions of the given food image", - "aiseller [target audience] [reply to product image]*": "Generate a promotional message for the given image product for the given target audience", +modules_help['aimage'] = { + 'getai [reply to image]*': 'Get details of image with Ai', + 'aicook [reply to image]*': 'Generate Cooking instrunctions of the given food image', + 'aiseller [target audience] [reply to product image]*': 'Generate a promotional message for the given image product for the given target audience', } diff --git a/userbot/modules/amogus.py b/userbot/modules/amogus.py index 514f1ad..9c1f698 100644 --- a/userbot/modules/amogus.py +++ b/userbot/modules/amogus.py @@ -1,51 +1,45 @@ from io import BytesIO from random import randint - -from pyrogram import Client, filters, enums -from pyrogram.types import Message - -from requests import get -from PIL import Image, ImageFont, ImageDraw from textwrap import wrap +from PIL import Image, ImageDraw, ImageFont +from pyrogram import Client, enums, filters +from pyrogram.types import Message +from requests import get from utils.misc import modules_help, prefix -@Client.on_message(filters.command("amogus", prefix) & filters.me) +@Client.on_message(filters.command('amogus', prefix) & filters.me) async def amogus(client: Client, message: Message): - text = " ".join(message.command[1:]) + text = ' '.join(message.command[1:]) await message.edit( - "amgus, tun tun tun tun tun tun tun tudududn tun tun...", + 'amgus, tun tun tun tun tun tun tun tudududn tun tun...', parse_mode=enums.ParseMode.HTML, ) clr = randint(1, 12) - url = "https://raw.githubusercontent.com/The-MoonTg-project/AmongUs/master/" - font = ImageFont.truetype(BytesIO(get(url + "bold.ttf").content), 60) - imposter = Image.open(BytesIO(get(f"{url}{clr}.png").content)) + url = 'https://raw.githubusercontent.com/The-MoonTg-project/AmongUs/master/' + font = ImageFont.truetype(BytesIO(get(url + 'bold.ttf').content), 60) + imposter = Image.open(BytesIO(get(f'{url}{clr}.png').content)) - text_ = "\n".join(["\n".join(wrap(part, 30)) for part in text.split("\n")]) - bbox = ImageDraw.Draw(Image.new("RGB", (1, 1))).multiline_textbbox( - (0, 0), text_, font, stroke_width=2 - ) + text_ = '\n'.join(['\n'.join(wrap(part, 30)) for part in text.split('\n')]) + bbox = ImageDraw.Draw(Image.new('RGB', (1, 1))).multiline_textbbox((0, 0), text_, font, stroke_width=2) # w, h = bbox[2] - bbox[0], bbox[3] - bbox[1] w, h = bbox[2], bbox[3] - text = Image.new("RGBA", (w + 30, h + 30)) - ImageDraw.Draw(text).multiline_text( - (15, 15), text_, "#FFF", font, stroke_width=2, stroke_fill="#000" - ) + text = Image.new('RGBA', (w + 30, h + 30)) + ImageDraw.Draw(text).multiline_text((15, 15), text_, '#FFF', font, stroke_width=2, stroke_fill='#000') w = imposter.width + text.width + 10 h = max(imposter.height, text.height) - image = Image.new("RGBA", (w, h)) + image = Image.new('RGBA', (w, h)) image.paste(imposter, (0, h - imposter.height), imposter) image.paste(text, (w - text.width, 0), text) image.thumbnail((512, 512)) output = BytesIO() - output.name = "imposter.webp" + output.name = 'imposter.webp' image.save(output) output.seek(0) @@ -53,6 +47,4 @@ async def amogus(client: Client, message: Message): await client.send_sticker(message.chat.id, output) -modules_help["amogus"] = { - "amogus [text]": "amgus, tun tun tun tun tun tun tun tudududn tun tun" -} +modules_help['amogus'] = {'amogus [text]': 'amgus, tun tun tun tun tun tun tun tudududn tun tun'} diff --git a/userbot/modules/amongus.py b/userbot/modules/amongus.py index 8ecaad6..addb938 100644 --- a/userbot/modules/amongus.py +++ b/userbot/modules/amongus.py @@ -5,92 +5,78 @@ from io import BytesIO from random import choice, randint from textwrap import wrap -from PIL import Image, ImageDraw, ImageFont -from click import edit import requests -from pyrogram import Client, filters, enums +from PIL import Image, ImageDraw, ImageFont +from pyrogram import Client, filters from pyrogram.types import Message - -from utils.scripts import edit_or_reply, ReplyCheck from utils.misc import modules_help, prefix +from utils.scripts import ReplyCheck, edit_or_reply async def amongus_gen(text: str, clr: int) -> str: - url = ( - "https://github.com/TgCatUB/CatUserbot-Resources/raw/master/Resources/Amongus/" - ) + url = 'https://github.com/TgCatUB/CatUserbot-Resources/raw/master/Resources/Amongus/' font = ImageFont.truetype( BytesIO( - requests.get( - "https://github.com/TgCatUB/CatUserbot-Resources/raw/master/Resources/fonts/bold.ttf" - ).content + requests.get('https://github.com/TgCatUB/CatUserbot-Resources/raw/master/Resources/fonts/bold.ttf').content ), 60, ) - imposter = Image.open(BytesIO(requests.get(f"{url}{clr}.png").content)) - text_ = "\n".join("\n".join(wrap(part, 30)) for part in text.split("\n")) - bbox = ImageDraw.Draw(Image.new("RGB", (1, 1))).multiline_textbbox( - (0, 0), text_, font, stroke_width=2 - ) + imposter = Image.open(BytesIO(requests.get(f'{url}{clr}.png').content)) + text_ = '\n'.join('\n'.join(wrap(part, 30)) for part in text.split('\n')) + bbox = ImageDraw.Draw(Image.new('RGB', (1, 1))).multiline_textbbox((0, 0), text_, font, stroke_width=2) w, h = bbox[2], bbox[3] - text = Image.new("RGBA", (w + 30, h + 30)) - ImageDraw.Draw(text).multiline_text( - (15, 15), text_, "#FFF", font, stroke_width=2, stroke_fill="#000" - ) + text = Image.new('RGBA', (w + 30, h + 30)) + ImageDraw.Draw(text).multiline_text((15, 15), text_, '#FFF', font, stroke_width=2, stroke_fill='#000') w = imposter.width + text.width + 10 h = max(imposter.height, text.height) - image = Image.new("RGBA", (w, h)) + image = Image.new('RGBA', (w, h)) image.paste(imposter, (0, h - imposter.height), imposter) image.paste(text, (w - text.width, 0), text) image.thumbnail((512, 512)) output = BytesIO() - output.name = "imposter.webp" - image.save(output, "WebP") + output.name = 'imposter.webp' + image.save(output, 'WebP') output.seek(0) return output async def get_imposter_img(text: str) -> BytesIO: background = requests.get( - f"https://github.com/TgCatUB/CatUserbot-Resources/raw/master/Resources/imposter/impostor{randint(1, 22)}.png" + f'https://github.com/TgCatUB/CatUserbot-Resources/raw/master/Resources/imposter/impostor{randint(1, 22)}.png' ).content font = requests.get( - "https://github.com/TgCatUB/CatUserbot-Resources/raw/master/Resources/fonts/roboto_regular.ttf" + 'https://github.com/TgCatUB/CatUserbot-Resources/raw/master/Resources/fonts/roboto_regular.ttf' ).content font = BytesIO(font) font = ImageFont.truetype(font, 30) - image = Image.new("RGBA", (1, 1), (0, 0, 0, 0)) + image = Image.new('RGBA', (1, 1), (0, 0, 0, 0)) draw = ImageDraw.Draw(image) - bbox = ImageDraw.Draw(Image.new("RGB", (1, 1))).multiline_textbbox( - (0, 0), text, font, stroke_width=2 - ) + bbox = ImageDraw.Draw(Image.new('RGB', (1, 1))).multiline_textbbox((0, 0), text, font, stroke_width=2) w, h = bbox[2], bbox[3] image = Image.open(BytesIO(background)) x, y = image.size draw = ImageDraw.Draw(image) - draw.multiline_text( - ((x - w) // 2, (y - h) // 2), text=text, font=font, fill="white", align="center" - ) + draw.multiline_text(((x - w) // 2, (y - h) // 2), text=text, font=font, fill='white', align='center') output = BytesIO() - output.name = "impostor.png" - image.save(output, "PNG") + output.name = 'impostor.png' + image.save(output, 'PNG') output.seek(0) return output -@Client.on_message(filters.command("amongus", prefix) & filters.me) +@Client.on_message(filters.command('amongus', prefix) & filters.me) async def amongus_cmd(client: Client, message: Message): - text = " ".join(message.command[1:]) if len(message.command) > 1 else "" + text = ' '.join(message.command[1:]) if len(message.command) > 1 else '' reply = message.reply_to_message - await message.edit("tun tun tun...") + await message.edit('tun tun tun...') if not text and reply: - text = reply.text or reply.caption or "" + text = reply.text or reply.caption or '' - clr = re.findall(r"-c\d+", text) + clr = re.findall(r'-c\d+', text) try: clr = clr[0] - clr = clr.replace("-c", "") - text = text.replace(f"-c{clr}", "") + clr = clr.replace('-c', '') + text = text.replace(f'-c{clr}', '') clr = int(clr) if clr > 12 or clr < 1: clr = randint(1, 12) @@ -99,9 +85,9 @@ async def amongus_cmd(client: Client, message: Message): if not text: if not reply: - text = f"{message.from_user.first_name} Was a traitor!" + text = f'{message.from_user.first_name} Was a traitor!' else: - text = f"{reply.from_user.first_name} Was a traitor!" + text = f'{reply.from_user.first_name} Was a traitor!' imposter_file = await amongus_gen(text, clr) await message.delete() @@ -112,22 +98,22 @@ async def amongus_cmd(client: Client, message: Message): ) -@Client.on_message(filters.command("imposter", prefix) & filters.me) +@Client.on_message(filters.command('imposter', prefix) & filters.me) async def imposter_cmd(client: Client, message: Message): remain = randint(1, 2) - imps = ["wasn't the impostor", "was the impostor"] + imps = ["wasn't the impostor", 'was the impostor'] if message.reply_to_message: user = message.reply_to_message.from_user - text = f"{user.first_name} {choice(imps)}." + text = f'{user.first_name} {choice(imps)}.' else: args = message.text.split()[1:] if args: - text = " ".join(args) + text = ' '.join(args) else: - text = f"{message.from_user.first_name} {choice(imps)}." + text = f'{message.from_user.first_name} {choice(imps)}.' - text += f"\n{remain} impostor(s) remain." + text += f'\n{remain} impostor(s) remain.' imposter_file = await get_imposter_img(text) await message.delete() await client.send_photo( @@ -137,9 +123,9 @@ async def imposter_cmd(client: Client, message: Message): ) -@Client.on_message(filters.command(["imp", "impn"], prefix) & filters.me) +@Client.on_message(filters.command(['imp', 'impn'], prefix) & filters.me) async def imp_animation(client: Client, message: Message): - name = " ".join(message.command[1:]) if len(message.command) > 1 else "" + name = ' '.join(message.command[1:]) if len(message.command) > 1 else '' if not name: reply = message.reply_to_message if reply: @@ -148,61 +134,55 @@ async def imp_animation(client: Client, message: Message): name = message.from_user.first_name cmd = message.command[0].lower() - text1 = await edit_or_reply(message, "Uhmm... Something is wrong here!!") + text1 = await edit_or_reply(message, 'Uhmm... Something is wrong here!!') await asyncio.sleep(2) await text1.delete() - stcr1 = await client.send_sticker(message.chat.id, "CAADAQADRwADnjOcH98isYD5RJTwAg") - text2 = await message.reply( - f"{message.from_user.first_name}: I have to call discussion" - ) + stcr1 = await client.send_sticker(message.chat.id, 'CAADAQADRwADnjOcH98isYD5RJTwAg') + text2 = await message.reply(f'{message.from_user.first_name}: I have to call discussion') await asyncio.sleep(3) await stcr1.delete() await text2.delete() - stcr2 = await client.send_sticker(message.chat.id, "CAADAQADRgADnjOcH9odHIXtfgmvAg") - text3 = await message.reply( - f"{message.from_user.first_name}: We have to eject the imposter or will lose" - ) + stcr2 = await client.send_sticker(message.chat.id, 'CAADAQADRgADnjOcH9odHIXtfgmvAg') + text3 = await message.reply(f'{message.from_user.first_name}: We have to eject the imposter or will lose') await asyncio.sleep(3) await stcr2.delete() await text3.delete() - stcr3 = await client.send_sticker(message.chat.id, "CAADAQADOwADnjOcH77v3Ap51R7gAg") - text4 = await message.reply("Others: Where???") + stcr3 = await client.send_sticker(message.chat.id, 'CAADAQADOwADnjOcH77v3Ap51R7gAg') + text4 = await message.reply('Others: Where???') await asyncio.sleep(2) - await text4.edit("Others: Who??") + await text4.edit('Others: Who??') await asyncio.sleep(2) - await text4.edit( - f"{message.from_user.first_name}: Its {name}, I saw {name} using vent" - ) + await text4.edit(f'{message.from_user.first_name}: Its {name}, I saw {name} using vent') await asyncio.sleep(3) - await text4.edit(f"Others: Okay.. Vote {name}") + await text4.edit(f'Others: Okay.. Vote {name}') await asyncio.sleep(2) await stcr3.delete() await text4.delete() - stcr4 = await client.send_sticker(message.chat.id, "CAADAQADLwADnjOcH-wxu-ehy6NRAg") - event = await message.reply(f"{name} is ejected.......") + stcr4 = await client.send_sticker(message.chat.id, 'CAADAQADLwADnjOcH-wxu-ehy6NRAg') + event = await message.reply(f'{name} is ejected.......') # Ejection animation for _ in range(9): await asyncio.sleep(0.5) curr_pos = _ + 1 - spaces_before = "ㅤ" * curr_pos - await event.edit(f"{spaces_before}ඞ{'ㅤ' * (9 - curr_pos)}") + spaces_before = 'ㅤ' * curr_pos + await event.edit(f'{spaces_before}ඞ{"ㅤ" * (9 - curr_pos)}') await asyncio.sleep(0.5) - await event.edit("ㅤㅤㅤㅤㅤㅤㅤㅤㅤ") + await event.edit('ㅤㅤㅤㅤㅤㅤㅤㅤㅤ') await asyncio.sleep(0.2) await stcr4.delete() - if cmd == "imp": + if cmd == 'imp': text = f".    。    •   ゚  。   .\n .      .     。   。 .  \n\n .    。   ඞ 。 .    •     •\n\n ゚{name} was an Imposter. 。 .     。 . 。 . \n  . 。   . \n ' 0 Impostor remains   。 .   . 。 . 。   . 。   . . . , 。\n  ゚   .  . ,   。   .   . 。" - sticker_id = "CAADAQADLQADnjOcH39IqwyR6Q_0Ag" + sticker_id = 'CAADAQADLQADnjOcH39IqwyR6Q_0Ag' else: text = f".    。    •   ゚  。   .\n .      .     。   。 .  \n\n .    。   ඞ 。 .    •     •\n\n ゚{name} was not an Imposter. 。 .     。 . 。 . \n  . 。   . \n ' 1 Impostor remains   。 .   . 。 . 。   . 。   . . . , 。\n  ゚   .  . ,   。   .   . 。" - sticker_id = "CAADAQADQAADnjOcH-WOkB8DEctJAg" + sticker_id = 'CAADAQADQAADnjOcH-WOkB8DEctJAg' await event.edit(text) await asyncio.sleep(4) @@ -210,9 +190,9 @@ async def imp_animation(client: Client, message: Message): await client.send_sticker(message.chat.id, sticker_id) -modules_help["amongus"] = { - "amongus": "Create Among Us themed sticker [text/reply] [-c1 to -c12 for colors]", - "imposter": "Create Among Us imposter image [username/reply]", - "imp": "Create Among Us ejection animation (imposter)", - "impn": "Create Among Us ejection animation (not imposter)", +modules_help['amongus'] = { + 'amongus': 'Create Among Us themed sticker [text/reply] [-c1 to -c12 for colors]', + 'imposter': 'Create Among Us imposter image [username/reply]', + 'imp': 'Create Among Us ejection animation (imposter)', + 'impn': 'Create Among Us ejection animation (not imposter)', } diff --git a/userbot/modules/animations.py b/userbot/modules/animations.py index 8e80c2d..53c1b11 100644 --- a/userbot/modules/animations.py +++ b/userbot/modules/animations.py @@ -1,478 +1,465 @@ -import asyncio -from collections import deque -from pyrogram import Client, filters, enums -from pyrogram.types import Message -from utils.misc import modules_help, prefix - -mention = ( - f"Moon" -) - - -@Client.on_message(filters.command("stupid", prefix) & filters.me) -async def stupid(_, message: Message): - animation_interval = 0.5 - animation_ttl = range(0, 14) - await message.edit_text("stupid boy") - animation_chars = [ - "YOUR BRAIN ➡️ 🧠\n\n🧠 (^_^)🗑", - "YOUR BRAIN ➡️ 🧠\n\n🧠 (^_^) 🗑", - "YOUR BRAIN ➡️ 🧠\n\n🧠 (^_^) 🗑", - "YOUR BRAIN ➡️ 🧠\n\n🧠 (^_^) 🗑", - "YOUR BRAIN ➡️ 🧠\n\n🧠 (^_^) 🗑", - "YOUR BRAIN ➡️ 🧠\n\n🧠< (^_^ <) 🗑", - "YOUR BRAIN ➡️ 🧠\n\n(> ^_^)>🧠 🗑", - "YOUR BRAIN ➡️ 🧠\n\n (> ^_^)>🧠 🗑", - "YOUR BRAIN ➡️ 🧠\n\n (> ^_^)>🧠 🗑", - "YOUR BRAIN ➡️ 🧠\n\n (> ^_^)>🧠 🗑", - "YOUR BRAIN ➡️ 🧠\n\n (> ^_^)>🧠 🗑", - "YOUR BRAIN ➡️ 🧠\n\n (> ^_^)>🧠🗑", - "YOUR BRAIN ➡️ 🧠\n\n (> ^_^)>🗑", - "YOUR BRAIN ➡️ 🧠\n\n < (^_^ <)🗑", - ] - - for i in animation_ttl: - - await asyncio.sleep(animation_interval) - await message.edit_text( - animation_chars[i % 14], parse_mode=enums.ParseMode.HTML - ) - - -@Client.on_message(filters.command("bombs", prefix) & filters.me) -async def bombs(_, message: Message): - - await message.edit_text("▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n") - await asyncio.sleep(0.5) - await message.edit_text("💣💣💣💣 \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n") - await asyncio.sleep(0.5) - await message.edit_text("▪️▪️▪️▪️ \n💣💣💣💣 \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n") - await asyncio.sleep(0.5) - await message.edit_text("▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n💣💣💣💣 \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n") - await asyncio.sleep(0.5) - await message.edit_text("▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n💣💣💣💣 \n▪️▪️▪️▪️ \n") - await asyncio.sleep(0.5) - await message.edit_text("▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n💣💣💣💣 \n") - await asyncio.sleep(1) - await message.edit_text("▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n💥💥💥💥 \n") - await asyncio.sleep(0.5) - await message.edit_text("▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n💥💥💥💥 \n💥💥💥💥 \n") - await asyncio.sleep(0.5) - await message.edit_text("▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n😵😵😵😵 \n") - await asyncio.sleep(0.5) - await message.edit_text("RIP PLOXXX......") - await asyncio.sleep(2) - - -@Client.on_message(filters.command("call", prefix) & filters.me) -async def cell(_, message: Message): - - animation_interval = 3 - animation_ttl = range(0, 18) - await message.edit_text("Calling Pavel Durov (ceo of telegram)......") - animation_chars = [ - "Connecting To Telegram Headquarters...", - "Call Connected.", - "Telegram: Hello This is Telegram HQ. Who is this?", - f"Me: Yo this is Moon ,Please Connect me to my lil bro,Pavel Durov ", - "User Authorised.", - "Calling Shivamani At +916969696969", - "Private Call Connected...", - "Me: Hello Sir, Please Ban This Telegram Account.", - "Shivamani : May I Know Who Is This?", - f"Me: Yo Brah, I Am Moon", - "Shivamani : OMG!!! Long time no see, Wassup cat...\nI'll Make Sure That Guy Account Will Get Blocked Within 24Hrs.", - "Me: Thanks, See You Later Brah.", - "Shivamani : Please Don't Thank Brah, Telegram Is Our's. Just Gimme A Call When You Become Free.", - "Me: Is There Any Issue/Emergency???", - "Shivamani : Yes Sur, There Is A Bug In Telegram v69.6.9.\nI Am Not Able To Fix It. If Possible, Please Help Fix The Bug.", - "Me: Send Me The App On My Telegram Account, I Will Fix The Bug & Send You.", - "Shivamani : Sure Sur \nTC Bye Bye :)", - "Private Call Disconnected.", - ] - for i in animation_ttl: - await asyncio.sleep(animation_interval) - await message.edit_text(animation_chars[i % 18]) - - -@Client.on_message(filters.command("wtf", prefix) & filters.me) -async def wtf(_, message: Message): - - animation_interval = 0.8 - animation_ttl = range(0, 5) - await message.edit_text("wtf") - animation_chars = [ - "What", - "What The", - "What The F", - "What The F Brah", - "What The F Brah\nhttps://telegra.ph//file/f3b760e4a99340d331f9b.jpg", - ] - for i in animation_ttl: - - await asyncio.sleep(animation_interval) - await message.edit_text(animation_chars[i % 5], parse_mode=enums.ParseMode.HTML) - - -@Client.on_message(filters.command("ding", prefix) & filters.me) -async def ding(_, message: Message): - animation_interval = 0.3 - animation_ttl = range(0, 30) - animation_chars = [ - "🔴⬛⬛⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜", - "⬜⬜⬛⬜⬜\n⬜⬛⬜⬜⬜\n🔴⬜⬜⬜⬜", - "⬜⬜⬛⬜⬜\n⬜⬜⬛⬜⬜\n⬜⬜🔴⬜⬜", - "⬜⬜⬛⬜⬜\n⬜⬜⬜⬛⬜\n⬜⬜⬜⬜🔴", - "⬜⬜⬛⬛🔴\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜", - "⬜⬜⬛⬜⬜\n⬜⬜⬜⬛⬜\n⬜⬜⬜⬜🔴", - "⬜⬜⬛⬜⬜\n⬜⬜⬛⬜⬜\n⬜⬜🔴⬜⬜", - "⬜⬜⬛⬜⬜\n⬜⬛⬜⬜⬜\n🔴⬜⬜⬜⬜", - "🔴⬛⬛⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜", - "⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜\n⬜ Moon IS BEST ⬜\n⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜", - ] - - await message.edit_text("ding..dong..ding..dong ...") - await asyncio.sleep(4) - for i in animation_ttl: - await asyncio.sleep(animation_interval) - await message.edit_text( - animation_chars[i % 10], parse_mode=enums.ParseMode.HTML - ) - - -@Client.on_message(filters.command("hypo", prefix) & filters.me) -async def hypo(_, message: Message): - animation_interval = 0.3 - animation_ttl = range(0, 15) - await message.edit_text("hypo....") - animation_chars = [ - "⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜", - "⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬛⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜", - "⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬛⬛⬛⬜⬜\n⬜⬜⬛⬜⬛⬜⬜\n⬜⬜⬛⬛⬛⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜", - "⬜⬜⬜⬜⬜⬜⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬜⬜⬜⬜⬜⬜", - "⬛⬛⬛⬛⬛⬛⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬛⬛⬛⬛⬛⬛", - "⬛⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜⬛", - "⬜⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛⬜", - "⬜⬜⬜⬜⬜⬜⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬜⬜⬜⬜⬜⬜", - "⬛⬛⬛⬛⬛⬛⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬜⬛⬛⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬛⬛⬜⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬛⬛⬛⬛⬛⬛", - "⬜⬜⬜⬜⬜⬜⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬜⬜⬜⬜⬜⬜", - "⬛⬛⬛⬛⬛⬛⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬜⬛⬛⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬛⬛⬜⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬛⬛⬛⬛⬛⬛", - "⬜⬜⬜⬜⬜⬜⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬜⬜⬜⬜⬜⬜", - "⬛⬛⬛⬛⬛\n⬛⬜⬜⬜⬛\n⬛⬜⬛⬜⬛\n⬛⬜⬜⬜⬛\n⬛⬛⬛⬛⬛", - "⬜⬜⬜\n⬜⬛⬜\n⬜⬜⬜", - "[👉🔴👈])", - ] - for i in animation_ttl: - await asyncio.sleep(animation_interval) - await message.edit_text(animation_chars[i % 15]) - - -@Client.on_message(filters.command("gangster", prefix) & filters.me) -async def gangster(_, message: Message): - await message.edit_text("EVERyBOdy") - await asyncio.sleep(0.3) - await message.edit_text("iZ") - await asyncio.sleep(0.2) - await message.edit_text("GangSTur") - await asyncio.sleep(0.5) - await message.edit_text("UNtIL ") - await asyncio.sleep(0.2) - await message.edit_text("I") - await asyncio.sleep(0.3) - await message.edit_text("ArRivE") - await asyncio.sleep(0.3) - await message.edit_text("🔥🔥🔥") - await asyncio.sleep(0.3) - await message.edit_text("EVERyBOdy iZ GangSTur UNtIL I ArRivE 🔥🔥🔥") - - -@Client.on_message(filters.command("charge", prefix) & filters.me) -async def timer_blankx(_, message: Message): - txt = ( - message.text[10:] - + "\n\nTesla Wireless Charging (beta) Started...\nDevice Detected: Apple iPad 13\nBattery Percentage: " - ) - j = 10 - k = j - for j in range(j): - await message.edit_text(txt + str(k), parse_mode=enums.ParseMode.HTML) - k = k + 10 - await asyncio.sleep(1) - await asyncio.sleep(1) - await message.edit_text( - "Tesla Wireless Charging (beta) Completed...\nDevice Detected: Apple iPad 13 (Space Grey Varient)\nBattery Percentage: [100%](https://telegra.ph/file/a45aa7450c8eefed599d9.mp4) ", - link_preview=True, - parse_mode=enums.ParseMode.HTML, - ) - - -@Client.on_message(filters.command("kill", prefix) & filters.me) -async def kill(_, message: Message): - animation_interval = 0.3 - animation_ttl = range(0, 103) - animation_chars = [ - "Fiiiiire", - "( ・ิω・ิ)︻デ═一-->", - "---->____________⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠", - "------>__________⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠", - "-------->⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠_________", - "---------->⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠_______", - "------------>⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠_____", - "-------------->⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠____", - "------------------>", - "------>;(^。^)ノ", - "( ̄ー ̄) DED", - "Target killed successfully (°̥̥̥̥̥̥̥̥•̀.̫•́°̥̥̥̥̥̥̥)", - ] - - await message.edit_text("You're goonnaa diieeeee!") - await asyncio.sleep(3) - for i in animation_ttl: - await asyncio.sleep(animation_interval) - await message.edit_text( - animation_chars[i % 103], parse_mode=enums.ParseMode.HTML - ) - - -@Client.on_message(filters.command("earth", prefix) & filters.me) -async def earth(_, message: Message): - deq = deque(list("🌏🌍🌎🌎🌍🌏🌍🌎")) - for _ in range(48): - await asyncio.sleep(0.1) - await message.edit_text("".join(deq)) - deq.rotate(1) - - -@Client.on_message(filters.command("think", prefix) & filters.me) -async def think(_, message: Message): - deq = deque(list("🤔🧐🤔🧐🤔🧐")) - for _ in range(48): - await asyncio.sleep(0.1) - await message.edit_text("".join(deq)) - deq.rotate(1) - - -@Client.on_message(filters.command("lmao", prefix) & filters.me) -async def lmao(_, message: Message): - deq = deque(list("😂🤣😂🤣😂🤣")) - for _ in range(48): - await asyncio.sleep(0.1) - await message.edit_text("".join(deq)) - deq.rotate(1) - - -@Client.on_message(filters.command("clock", prefix) & filters.me) -async def clock(_, message: Message): - deq = deque(list("🕙🕘🕗🕖🕕🕔🕓🕒🕑🕐🕛")) - for _ in range(48): - await asyncio.sleep(0.1) - await message.edit_text("".join(deq)) - deq.rotate(1) - - -@Client.on_message(filters.command("heart", prefix) & filters.me) -async def heart(_, message: Message): - deq = deque(list("❤️🧡💛💚💙💜🖤")) - for _ in range(48): - await asyncio.sleep(0.1) - await message.edit_text("".join(deq)) - deq.rotate(1) - - -@Client.on_message(filters.command("gym", prefix) & filters.me) -async def gym(_, message: Message): - deq = deque(list("🏃‍🏋‍🤸‍🏃‍🏋‍🤸‍🏃‍🏋‍🤸‍")) - for _ in range(48): - await asyncio.sleep(0.1) - await message.edit_text("".join(deq)) - deq.rotate(1) - - -@Client.on_message(filters.command("moon", prefix) & filters.me) -async def moon(_, message: Message): - deq = deque(list("🌗🌘🌑🌒🌓🌔🌕🌖‍")) - for _ in range(48): - await asyncio.sleep(0.1) - await message.edit_text("".join(deq)) - deq.rotate(1) - - -@Client.on_message(filters.command("stars", prefix) & filters.me) -async def stars(_, message: Message): - deq = deque(list("🦋✨🦋✨🦋✨🦋✨‍")) - for _ in range(48): - await asyncio.sleep(0.1) - await message.edit_text("".join(deq)) - deq.rotate(1) - - -@Client.on_message(filters.command("boxs", prefix) & filters.me) -async def boxs(_, message: Message): - deq = deque(list("🟥🟧🟨🟩🟦🟪🟫⬛⬜")) - for _ in range(48): - await asyncio.sleep(0.1) - await message.edit_text("".join(deq)) - deq.rotate(1) - - -@Client.on_message(filters.command("rain", prefix) & filters.me) -async def rain(_, message: Message): - deq = deque(list("🌬☁️🌩🌨🌧🌦🌥⛅🌤")) - for _ in range(48): - await asyncio.sleep(0.1) - await message.edit_text("".join(deq)) - deq.rotate(1) - - -@Client.on_message(filters.command("bird", prefix) & filters.me) -async def bird(_, message: Message): - deq = deque(list("𓅰𓅬𓅭𓅮𓅯")) - for _ in range(48): - await asyncio.sleep(0.1) - await message.edit_text("".join(deq)) - deq.rotate(1) - - -@Client.on_message(filters.command("fish", prefix) & filters.me) -async def fish(_, message: Message): - deq = deque(list("𓆝𓆟𓆞𓆝𓆟")) - for _ in range(48): - await asyncio.sleep(0.1) - await message.edit_text("".join(deq)) - deq.rotate(1) - - -@Client.on_message(filters.command("goat", prefix) & filters.me) -async def goat(_, message: Message): - deq = deque(list("𓃖𓃗𓃘𓃙𓃚𓃛𓃜")) - for _ in range(48): - await asyncio.sleep(0.1) - await message.edit_text("".join(deq)) - deq.rotate(1) - - -@Client.on_message(filters.command("smoon", prefix) & filters.me) -async def smoon(_, message: Message): - animation_interval = 0.2 - animation_ttl = range(101) - animation_chars = [ - "🌗🌗🌗🌗🌗\n🌓🌓🌓🌓🌓\n🌗🌗🌗🌗🌗\n🌓🌓🌓🌓🌓\n🌗🌗🌗🌗🌗", - "🌘🌘🌘🌘🌘\n🌔🌔🌔🌔🌔\n🌘🌘🌘🌘🌘\n🌔🌔🌔🌔🌔\n🌘🌘🌘🌘🌘", - "🌑🌑🌑🌑🌑\n🌕🌕🌕🌕🌕\n🌑🌑🌑🌑🌑\n🌕🌕🌕🌕🌕\n🌑🌑🌑🌑🌑", - "🌒🌒🌒🌒🌒\n🌖🌖🌖🌖🌖\n🌒🌒🌒🌒🌒\n🌖🌖🌖🌖🌖\n🌒🌒🌒🌒🌒", - "🌓🌓🌓🌓🌓\n🌗🌗🌗🌗🌗\n🌓🌓🌓🌓🌓\n🌗🌗🌗🌗🌗\n🌓🌓🌓🌓🌓", - "🌔🌔🌔🌔🌔\n🌘🌘🌘🌘🌘\n🌔🌔🌔🌔🌔\n🌘🌘🌘🌘🌘\n🌔🌔🌔🌔🌔", - "🌕🌕🌕🌕🌕\n🌑🌑🌑🌑🌑\n🌕🌕🌕🌕🌕\n🌑🌑🌑🌑🌑\n🌕🌕🌕🌕🌕", - "🌖🌖🌖🌖🌖\n🌒🌒🌒🌒🌒\n🌖🌖🌖🌖🌖\n🌒🌒🌒🌒🌒\n🌖🌖🌖🌖🌖", - ] - - await message.edit_text("smoon...") - await asyncio.sleep(3) - for i in animation_ttl: - await asyncio.sleep(animation_interval) - await message.edit_text(animation_chars[i % 8]) - - -@Client.on_message(filters.command("deploy", prefix) & filters.me) -async def deploy(_, message: Message): - animation_interval = 3 - animation_ttl = range(101) - animation_chars = [ - "Heroku Connecting To Latest Github Build ", - f"Build started by user {mention}", - f"Deploy 535a74f0 by user {mention}", - "Restarting Heroku Server...", - "State changed from up to starting", - "Stopping all processes with SIGTERM", - "Process exited with status 143", - "Starting process with command python3 -m userbot", - "State changed from starting to up", - "INFO:Userbot:Logged in as 557667062", - "INFO:Userbot:Successfully loaded all plugins", - "Build Succeeded", - ] - - await message.edit_text( - "Deploying...", parse_mode=enums.ParseMode.HTML - ) - await asyncio.sleep(3) - for i in animation_ttl: - await asyncio.sleep(animation_interval) - await message.edit_text( - animation_chars[i % 12], parse_mode=enums.ParseMode.HTML - ) - - -@Client.on_message(filters.command("tmoon", prefix) & filters.me) -async def tmoon(_, message: Message): - animation_interval = 0.2 - animation_ttl = range(96) - animation_chars = [ - "🌗", - "🌘", - "🌑", - "🌒", - "🌓", - "🌔", - "🌕", - "🌖", - "🌗", - "🌘", - "🌑", - "🌒", - "🌓", - "🌔", - "🌕", - "🌖", - "🌗", - "🌘", - "🌑", - "🌒", - "🌓", - "🌔", - "🌕", - "🌖", - "🌗", - "🌘", - "🌑", - "🌒", - "🌓", - "🌔", - "🌕", - "🌖", - ] - - await message.edit_text("tmoon...") - await asyncio.sleep(3) - for i in animation_ttl: - await asyncio.sleep(animation_interval) - await message.edit_text(animation_chars[i % 32]) - - -modules_help["animations"] = { - "stupid": " stupid animation", - "gangster": "YO! Gangster animation", - "hypo": "checkout yourself ~_+", - "charge": "Apple iPad charging animation", - "ding": "ding.dong.ding animation", - "wtf": "wtf animation must use if you want tell wtf", - "call": "call to durov", - "bombs": "bombing animation", - "kill": "fireee animation = target killed ~_- ", - "deploy": "Fake heroku deploy animation", - "gym": "Fun animation try yourself to know more", - "boxs": "Fun animation try yourself to know more", - "stars": "Fun animation try yourself to know more", - "goat": "Fun animation try yourself to know more", - "bird": "Fun animation try yourself to know more", - "rain": "Fun animation try yourself to know more", - "fish": "Fun animation try yourself to know more", - "heart": "Fun animation try yourself to know more", - "clock": "Fun animation try yourself to know more", - "lmao": "Fun animation try yourself to know more", - "think": "Fun animation try yourself to know more", - "earth": "Fun animation try yourself to know more", - "moon": "Fun animation try yourself to know more", - "smoon": "Fun animation try yourself to know more", - "tmoon": "Fun animation try yourself to know more", -} +import asyncio +from collections import deque + +from pyrogram import Client, enums, filters +from pyrogram.types import Message +from utils.misc import modules_help, prefix + +mention = 'Moon' + + +@Client.on_message(filters.command('stupid', prefix) & filters.me) +async def stupid(_, message: Message): + animation_interval = 0.5 + animation_ttl = range(0, 14) + await message.edit_text('stupid boy') + animation_chars = [ + 'YOUR BRAIN ➡️ 🧠\n\n🧠 (^_^)🗑', + 'YOUR BRAIN ➡️ 🧠\n\n🧠 (^_^) 🗑', + 'YOUR BRAIN ➡️ 🧠\n\n🧠 (^_^) 🗑', + 'YOUR BRAIN ➡️ 🧠\n\n🧠 (^_^) 🗑', + 'YOUR BRAIN ➡️ 🧠\n\n🧠 (^_^) 🗑', + 'YOUR BRAIN ➡️ 🧠\n\n🧠< (^_^ <) 🗑', + 'YOUR BRAIN ➡️ 🧠\n\n(> ^_^)>🧠 🗑', + 'YOUR BRAIN ➡️ 🧠\n\n (> ^_^)>🧠 🗑', + 'YOUR BRAIN ➡️ 🧠\n\n (> ^_^)>🧠 🗑', + 'YOUR BRAIN ➡️ 🧠\n\n (> ^_^)>🧠 🗑', + 'YOUR BRAIN ➡️ 🧠\n\n (> ^_^)>🧠 🗑', + 'YOUR BRAIN ➡️ 🧠\n\n (> ^_^)>🧠🗑', + 'YOUR BRAIN ➡️ 🧠\n\n (> ^_^)>🗑', + 'YOUR BRAIN ➡️ 🧠\n\n < (^_^ <)🗑', + ] + + for i in animation_ttl: + await asyncio.sleep(animation_interval) + await message.edit_text(animation_chars[i % 14], parse_mode=enums.ParseMode.HTML) + + +@Client.on_message(filters.command('bombs', prefix) & filters.me) +async def bombs(_, message: Message): + + await message.edit_text('▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n') + await asyncio.sleep(0.5) + await message.edit_text('💣💣💣💣 \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n') + await asyncio.sleep(0.5) + await message.edit_text('▪️▪️▪️▪️ \n💣💣💣💣 \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n') + await asyncio.sleep(0.5) + await message.edit_text('▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n💣💣💣💣 \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n') + await asyncio.sleep(0.5) + await message.edit_text('▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n💣💣💣💣 \n▪️▪️▪️▪️ \n') + await asyncio.sleep(0.5) + await message.edit_text('▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n💣💣💣💣 \n') + await asyncio.sleep(1) + await message.edit_text('▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n💥💥💥💥 \n') + await asyncio.sleep(0.5) + await message.edit_text('▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n💥💥💥💥 \n💥💥💥💥 \n') + await asyncio.sleep(0.5) + await message.edit_text('▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n▪️▪️▪️▪️ \n😵😵😵😵 \n') + await asyncio.sleep(0.5) + await message.edit_text('RIP PLOXXX......') + await asyncio.sleep(2) + + +@Client.on_message(filters.command('call', prefix) & filters.me) +async def cell(_, message: Message): + + animation_interval = 3 + animation_ttl = range(0, 18) + await message.edit_text('Calling Pavel Durov (ceo of telegram)......') + animation_chars = [ + 'Connecting To Telegram Headquarters...', + 'Call Connected.', + 'Telegram: Hello This is Telegram HQ. Who is this?', + 'Me: Yo this is Moon ,Please Connect me to my lil bro,Pavel Durov ', + 'User Authorised.', + 'Calling Shivamani At +916969696969', + 'Private Call Connected...', + 'Me: Hello Sir, Please Ban This Telegram Account.', + 'Shivamani : May I Know Who Is This?', + 'Me: Yo Brah, I Am Moon', + "Shivamani : OMG!!! Long time no see, Wassup cat...\nI'll Make Sure That Guy Account Will Get Blocked Within 24Hrs.", + 'Me: Thanks, See You Later Brah.', + "Shivamani : Please Don't Thank Brah, Telegram Is Our's. Just Gimme A Call When You Become Free.", + 'Me: Is There Any Issue/Emergency???', + 'Shivamani : Yes Sur, There Is A Bug In Telegram v69.6.9.\nI Am Not Able To Fix It. If Possible, Please Help Fix The Bug.', + 'Me: Send Me The App On My Telegram Account, I Will Fix The Bug & Send You.', + 'Shivamani : Sure Sur \nTC Bye Bye :)', + 'Private Call Disconnected.', + ] + for i in animation_ttl: + await asyncio.sleep(animation_interval) + await message.edit_text(animation_chars[i % 18]) + + +@Client.on_message(filters.command('wtf', prefix) & filters.me) +async def wtf(_, message: Message): + + animation_interval = 0.8 + animation_ttl = range(0, 5) + await message.edit_text('wtf') + animation_chars = [ + 'What', + 'What The', + 'What The F', + 'What The F Brah', + 'What The F Brah\nhttps://telegra.ph//file/f3b760e4a99340d331f9b.jpg', + ] + for i in animation_ttl: + await asyncio.sleep(animation_interval) + await message.edit_text(animation_chars[i % 5], parse_mode=enums.ParseMode.HTML) + + +@Client.on_message(filters.command('ding', prefix) & filters.me) +async def ding(_, message: Message): + animation_interval = 0.3 + animation_ttl = range(0, 30) + animation_chars = [ + '🔴⬛⬛⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜', + '⬜⬜⬛⬜⬜\n⬜⬛⬜⬜⬜\n🔴⬜⬜⬜⬜', + '⬜⬜⬛⬜⬜\n⬜⬜⬛⬜⬜\n⬜⬜🔴⬜⬜', + '⬜⬜⬛⬜⬜\n⬜⬜⬜⬛⬜\n⬜⬜⬜⬜🔴', + '⬜⬜⬛⬛🔴\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜', + '⬜⬜⬛⬜⬜\n⬜⬜⬜⬛⬜\n⬜⬜⬜⬜🔴', + '⬜⬜⬛⬜⬜\n⬜⬜⬛⬜⬜\n⬜⬜🔴⬜⬜', + '⬜⬜⬛⬜⬜\n⬜⬛⬜⬜⬜\n🔴⬜⬜⬜⬜', + '🔴⬛⬛⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜', + '⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜\n⬜ Moon IS BEST ⬜\n⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜', + ] + + await message.edit_text('ding..dong..ding..dong ...') + await asyncio.sleep(4) + for i in animation_ttl: + await asyncio.sleep(animation_interval) + await message.edit_text(animation_chars[i % 10], parse_mode=enums.ParseMode.HTML) + + +@Client.on_message(filters.command('hypo', prefix) & filters.me) +async def hypo(_, message: Message): + animation_interval = 0.3 + animation_ttl = range(0, 15) + await message.edit_text('hypo....') + animation_chars = [ + '⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜', + '⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬛⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜', + '⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬛⬛⬛⬜⬜\n⬜⬜⬛⬜⬛⬜⬜\n⬜⬜⬛⬛⬛⬜⬜\n⬜⬜⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜⬜⬜', + '⬜⬜⬜⬜⬜⬜⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬜⬜⬜⬜⬜⬜', + '⬛⬛⬛⬛⬛⬛⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬛⬛⬛⬛⬛⬛', + '⬛⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜⬛', + '⬜⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛⬜', + '⬜⬜⬜⬜⬜⬜⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬜⬜⬜⬜⬜⬜', + '⬛⬛⬛⬛⬛⬛⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬜⬛⬛⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬛⬛⬜⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬛⬛⬛⬛⬛⬛', + '⬜⬜⬜⬜⬜⬜⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬜⬜⬜⬜⬜⬜', + '⬛⬛⬛⬛⬛⬛⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬜⬛⬛⬛⬜⬛\n⬛⬜⬛⬜⬛⬜⬛\n⬛⬜⬛⬛⬛⬜⬛\n⬛⬜⬜⬜⬜⬜⬛\n⬛⬛⬛⬛⬛⬛⬛', + '⬜⬜⬜⬜⬜⬜⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬜⬛⬜⬛⬜\n⬜⬛⬜⬜⬜⬛⬜\n⬜⬛⬛⬛⬛⬛⬜\n⬜⬜⬜⬜⬜⬜⬜', + '⬛⬛⬛⬛⬛\n⬛⬜⬜⬜⬛\n⬛⬜⬛⬜⬛\n⬛⬜⬜⬜⬛\n⬛⬛⬛⬛⬛', + '⬜⬜⬜\n⬜⬛⬜\n⬜⬜⬜', + '[👉🔴👈])', + ] + for i in animation_ttl: + await asyncio.sleep(animation_interval) + await message.edit_text(animation_chars[i % 15]) + + +@Client.on_message(filters.command('gangster', prefix) & filters.me) +async def gangster(_, message: Message): + await message.edit_text('EVERyBOdy') + await asyncio.sleep(0.3) + await message.edit_text('iZ') + await asyncio.sleep(0.2) + await message.edit_text('GangSTur') + await asyncio.sleep(0.5) + await message.edit_text('UNtIL ') + await asyncio.sleep(0.2) + await message.edit_text('I') + await asyncio.sleep(0.3) + await message.edit_text('ArRivE') + await asyncio.sleep(0.3) + await message.edit_text('🔥🔥🔥') + await asyncio.sleep(0.3) + await message.edit_text('EVERyBOdy iZ GangSTur UNtIL I ArRivE 🔥🔥🔥') + + +@Client.on_message(filters.command('charge', prefix) & filters.me) +async def timer_blankx(_, message: Message): + txt = ( + message.text[10:] + + '\n\nTesla Wireless Charging (beta) Started...\nDevice Detected: Apple iPad 13\nBattery Percentage: ' + ) + j = 10 + k = j + for j in range(j): + await message.edit_text(txt + str(k), parse_mode=enums.ParseMode.HTML) + k = k + 10 + await asyncio.sleep(1) + await asyncio.sleep(1) + await message.edit_text( + 'Tesla Wireless Charging (beta) Completed...\nDevice Detected: Apple iPad 13 (Space Grey Varient)\nBattery Percentage: [100%](https://telegra.ph/file/a45aa7450c8eefed599d9.mp4) ', + link_preview=True, + parse_mode=enums.ParseMode.HTML, + ) + + +@Client.on_message(filters.command('kill', prefix) & filters.me) +async def kill(_, message: Message): + animation_interval = 0.3 + animation_ttl = range(0, 103) + animation_chars = [ + 'Fiiiiire', + '( ・ิω・ิ)︻デ═一-->', + '---->____________⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠', + '------>__________⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠', + '-------->⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠_________', + '---------->⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠_______', + '------------>⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠_____', + '-------------->⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠____', + '------------------>', + '------>;(^。^)ノ', + '( ̄ー ̄) DED', + 'Target killed successfully (°̥̥̥̥̥̥̥̥•̀.̫•́°̥̥̥̥̥̥̥)', + ] + + await message.edit_text("You're goonnaa diieeeee!") + await asyncio.sleep(3) + for i in animation_ttl: + await asyncio.sleep(animation_interval) + await message.edit_text(animation_chars[i % 103], parse_mode=enums.ParseMode.HTML) + + +@Client.on_message(filters.command('earth', prefix) & filters.me) +async def earth(_, message: Message): + deq = deque(list('🌏🌍🌎🌎🌍🌏🌍🌎')) + for _ in range(48): + await asyncio.sleep(0.1) + await message.edit_text(''.join(deq)) + deq.rotate(1) + + +@Client.on_message(filters.command('think', prefix) & filters.me) +async def think(_, message: Message): + deq = deque(list('🤔🧐🤔🧐🤔🧐')) + for _ in range(48): + await asyncio.sleep(0.1) + await message.edit_text(''.join(deq)) + deq.rotate(1) + + +@Client.on_message(filters.command('lmao', prefix) & filters.me) +async def lmao(_, message: Message): + deq = deque(list('😂🤣😂🤣😂🤣')) + for _ in range(48): + await asyncio.sleep(0.1) + await message.edit_text(''.join(deq)) + deq.rotate(1) + + +@Client.on_message(filters.command('clock', prefix) & filters.me) +async def clock(_, message: Message): + deq = deque(list('🕙🕘🕗🕖🕕🕔🕓🕒🕑🕐🕛')) + for _ in range(48): + await asyncio.sleep(0.1) + await message.edit_text(''.join(deq)) + deq.rotate(1) + + +@Client.on_message(filters.command('heart', prefix) & filters.me) +async def heart(_, message: Message): + deq = deque(list('❤️🧡💛💚💙💜🖤')) + for _ in range(48): + await asyncio.sleep(0.1) + await message.edit_text(''.join(deq)) + deq.rotate(1) + + +@Client.on_message(filters.command('gym', prefix) & filters.me) +async def gym(_, message: Message): + deq = deque(list('🏃‍🏋‍🤸‍🏃‍🏋‍🤸‍🏃‍🏋‍🤸‍')) + for _ in range(48): + await asyncio.sleep(0.1) + await message.edit_text(''.join(deq)) + deq.rotate(1) + + +@Client.on_message(filters.command('moon', prefix) & filters.me) +async def moon(_, message: Message): + deq = deque(list('🌗🌘🌑🌒🌓🌔🌕🌖‍')) + for _ in range(48): + await asyncio.sleep(0.1) + await message.edit_text(''.join(deq)) + deq.rotate(1) + + +@Client.on_message(filters.command('stars', prefix) & filters.me) +async def stars(_, message: Message): + deq = deque(list('🦋✨🦋✨🦋✨🦋✨‍')) + for _ in range(48): + await asyncio.sleep(0.1) + await message.edit_text(''.join(deq)) + deq.rotate(1) + + +@Client.on_message(filters.command('boxs', prefix) & filters.me) +async def boxs(_, message: Message): + deq = deque(list('🟥🟧🟨🟩🟦🟪🟫⬛⬜')) + for _ in range(48): + await asyncio.sleep(0.1) + await message.edit_text(''.join(deq)) + deq.rotate(1) + + +@Client.on_message(filters.command('rain', prefix) & filters.me) +async def rain(_, message: Message): + deq = deque(list('🌬☁️🌩🌨🌧🌦🌥⛅🌤')) + for _ in range(48): + await asyncio.sleep(0.1) + await message.edit_text(''.join(deq)) + deq.rotate(1) + + +@Client.on_message(filters.command('bird', prefix) & filters.me) +async def bird(_, message: Message): + deq = deque(list('𓅰𓅬𓅭𓅮𓅯')) + for _ in range(48): + await asyncio.sleep(0.1) + await message.edit_text(''.join(deq)) + deq.rotate(1) + + +@Client.on_message(filters.command('fish', prefix) & filters.me) +async def fish(_, message: Message): + deq = deque(list('𓆝𓆟𓆞𓆝𓆟')) + for _ in range(48): + await asyncio.sleep(0.1) + await message.edit_text(''.join(deq)) + deq.rotate(1) + + +@Client.on_message(filters.command('goat', prefix) & filters.me) +async def goat(_, message: Message): + deq = deque(list('𓃖𓃗𓃘𓃙𓃚𓃛𓃜')) + for _ in range(48): + await asyncio.sleep(0.1) + await message.edit_text(''.join(deq)) + deq.rotate(1) + + +@Client.on_message(filters.command('smoon', prefix) & filters.me) +async def smoon(_, message: Message): + animation_interval = 0.2 + animation_ttl = range(101) + animation_chars = [ + '🌗🌗🌗🌗🌗\n🌓🌓🌓🌓🌓\n🌗🌗🌗🌗🌗\n🌓🌓🌓🌓🌓\n🌗🌗🌗🌗🌗', + '🌘🌘🌘🌘🌘\n🌔🌔🌔🌔🌔\n🌘🌘🌘🌘🌘\n🌔🌔🌔🌔🌔\n🌘🌘🌘🌘🌘', + '🌑🌑🌑🌑🌑\n🌕🌕🌕🌕🌕\n🌑🌑🌑🌑🌑\n🌕🌕🌕🌕🌕\n🌑🌑🌑🌑🌑', + '🌒🌒🌒🌒🌒\n🌖🌖🌖🌖🌖\n🌒🌒🌒🌒🌒\n🌖🌖🌖🌖🌖\n🌒🌒🌒🌒🌒', + '🌓🌓🌓🌓🌓\n🌗🌗🌗🌗🌗\n🌓🌓🌓🌓🌓\n🌗🌗🌗🌗🌗\n🌓🌓🌓🌓🌓', + '🌔🌔🌔🌔🌔\n🌘🌘🌘🌘🌘\n🌔🌔🌔🌔🌔\n🌘🌘🌘🌘🌘\n🌔🌔🌔🌔🌔', + '🌕🌕🌕🌕🌕\n🌑🌑🌑🌑🌑\n🌕🌕🌕🌕🌕\n🌑🌑🌑🌑🌑\n🌕🌕🌕🌕🌕', + '🌖🌖🌖🌖🌖\n🌒🌒🌒🌒🌒\n🌖🌖🌖🌖🌖\n🌒🌒🌒🌒🌒\n🌖🌖🌖🌖🌖', + ] + + await message.edit_text('smoon...') + await asyncio.sleep(3) + for i in animation_ttl: + await asyncio.sleep(animation_interval) + await message.edit_text(animation_chars[i % 8]) + + +@Client.on_message(filters.command('deploy', prefix) & filters.me) +async def deploy(_, message: Message): + animation_interval = 3 + animation_ttl = range(101) + animation_chars = [ + 'Heroku Connecting To Latest Github Build ', + f'Build started by user {mention}', + f'Deploy 535a74f0 by user {mention}', + 'Restarting Heroku Server...', + 'State changed from up to starting', + 'Stopping all processes with SIGTERM', + 'Process exited with status 143', + 'Starting process with command python3 -m userbot', + 'State changed from starting to up', + 'INFO:Userbot:Logged in as 557667062', + 'INFO:Userbot:Successfully loaded all plugins', + 'Build Succeeded', + ] + + await message.edit_text('Deploying...', parse_mode=enums.ParseMode.HTML) + await asyncio.sleep(3) + for i in animation_ttl: + await asyncio.sleep(animation_interval) + await message.edit_text(animation_chars[i % 12], parse_mode=enums.ParseMode.HTML) + + +@Client.on_message(filters.command('tmoon', prefix) & filters.me) +async def tmoon(_, message: Message): + animation_interval = 0.2 + animation_ttl = range(96) + animation_chars = [ + '🌗', + '🌘', + '🌑', + '🌒', + '🌓', + '🌔', + '🌕', + '🌖', + '🌗', + '🌘', + '🌑', + '🌒', + '🌓', + '🌔', + '🌕', + '🌖', + '🌗', + '🌘', + '🌑', + '🌒', + '🌓', + '🌔', + '🌕', + '🌖', + '🌗', + '🌘', + '🌑', + '🌒', + '🌓', + '🌔', + '🌕', + '🌖', + ] + + await message.edit_text('tmoon...') + await asyncio.sleep(3) + for i in animation_ttl: + await asyncio.sleep(animation_interval) + await message.edit_text(animation_chars[i % 32]) + + +modules_help['animations'] = { + 'stupid': ' stupid animation', + 'gangster': 'YO! Gangster animation', + 'hypo': 'checkout yourself ~_+', + 'charge': 'Apple iPad charging animation', + 'ding': 'ding.dong.ding animation', + 'wtf': 'wtf animation must use if you want tell wtf', + 'call': 'call to durov', + 'bombs': 'bombing animation', + 'kill': 'fireee animation = target killed ~_- ', + 'deploy': 'Fake heroku deploy animation', + 'gym': 'Fun animation try yourself to know more', + 'boxs': 'Fun animation try yourself to know more', + 'stars': 'Fun animation try yourself to know more', + 'goat': 'Fun animation try yourself to know more', + 'bird': 'Fun animation try yourself to know more', + 'rain': 'Fun animation try yourself to know more', + 'fish': 'Fun animation try yourself to know more', + 'heart': 'Fun animation try yourself to know more', + 'clock': 'Fun animation try yourself to know more', + 'lmao': 'Fun animation try yourself to know more', + 'think': 'Fun animation try yourself to know more', + 'earth': 'Fun animation try yourself to know more', + 'moon': 'Fun animation try yourself to know more', + 'smoon': 'Fun animation try yourself to know more', + 'tmoon': 'Fun animation try yourself to know more', +} diff --git a/userbot/modules/anime/anilist.py b/userbot/modules/anime/anilist.py index be6d6a6..2e41419 100644 --- a/userbot/modules/anime/anilist.py +++ b/userbot/modules/anime/anilist.py @@ -1,78 +1,73 @@ import os -import requests + import aiofiles - -from pyrogram import Client, filters, enums -from pyrogram.types import Message, InputMediaPhoto +import requests +from pyrogram import Client, enums, filters from pyrogram.errors import MediaCaptionTooLong - -from utils.misc import prefix, modules_help +from pyrogram.types import InputMediaPhoto, Message +from utils.misc import modules_help, prefix from utils.scripts import format_exc -url = "https://api.safone.co" +url = 'https://api.safone.co' headers = { - "Accept-Language": "en-US,en;q=0.9", - "Connection": "keep-alive", - "DNT": "1", - "Referer": "https://api.safone.co/docs", - "Sec-Fetch-Dest": "empty", - "Sec-Fetch-Mode": "cors", - "Sec-Fetch-Site": "same-origin", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36", - "accept": "application/json", - "sec-ch-ua": '"Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"', - "sec-ch-ua-mobile": "?0", - "sec-ch-ua-platform": '"Linux"', + 'Accept-Language': 'en-US,en;q=0.9', + 'Connection': 'keep-alive', + 'DNT': '1', + 'Referer': 'https://api.safone.co/docs', + 'Sec-Fetch-Dest': 'empty', + 'Sec-Fetch-Mode': 'cors', + 'Sec-Fetch-Site': 'same-origin', + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36', + 'accept': 'application/json', + 'sec-ch-ua': '"Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"', + 'sec-ch-ua-mobile': '?0', + 'sec-ch-ua-platform': '"Linux"', } -@Client.on_message(filters.command("anime_search", prefix) & filters.me) +@Client.on_message(filters.command('anime_search', prefix) & filters.me) async def anime_search(client: Client, message: Message): try: chat_id = message.chat.id - await message.edit_text("Processing...") + await message.edit_text('Processing...') if len(message.command) > 1: query = message.text.split(maxsplit=1)[1] else: - message.edit_text( - "What should i search? You didn't provided me with any value to search" - ) + message.edit_text("What should i search? You didn't provided me with any value to search") - response = requests.get( - url=f"{url}/anime/search?query={query}", headers=headers, timeout=5 - ) + response = requests.get(url=f'{url}/anime/search?query={query}', headers=headers, timeout=5) if response.status_code != 200: - await message.edit_text("Something went wrong") + await message.edit_text('Something went wrong') return result = response.json() - averageScore = result["averageScore"] + averageScore = result['averageScore'] try: - coverImage_url = result["imageUrl"] + coverImage_url = result['imageUrl'] coverImage = requests.get(url=coverImage_url).content - async with aiofiles.open("coverImage.jpg", mode="wb") as f: + async with aiofiles.open('coverImage.jpg', mode='wb') as f: await f.write(coverImage) except Exception: coverImage = None - title = result["title"]["english"] - trailer = result["trailer"]["id"] - description = result["description"] - episodes = result["episodes"] - genres = ", ".join(result["genres"]) - isAdult = result["isAdult"] - status = result["status"] - studios = ", ".join(result["studios"]) + title = result['title']['english'] + trailer = result['trailer']['id'] + description = result['description'] + episodes = result['episodes'] + genres = ', '.join(result['genres']) + isAdult = result['isAdult'] + status = result['status'] + studios = ', '.join(result['studios']) await message.delete() await client.send_media_group( chat_id, [ InputMediaPhoto( - "coverImage.jpg", + 'coverImage.jpg', caption=f"Title: {title}\nAverage Score: {averageScore}\nStatus: {status}\nGenres: {genres}\nEpisodes: {episodes}\nIs Adult: {isAdult}\nStudios: {studios}\nDescription: {description}\nTrailer: Click Here", ) ], @@ -85,7 +80,7 @@ async def anime_search(client: Client, message: Message): chat_id, [ InputMediaPhoto( - "coverImage.jpg", + 'coverImage.jpg', caption=f"Title: {title}\nAverage Score: {averageScore}\nStatus: {status}\nGenres: {genres}\nEpisodes: {episodes}\nIs Adult: {isAdult}\nStudios: {studios}\nDescription: {description}\nTrailer: Click Here", ) ], @@ -93,56 +88,52 @@ async def anime_search(client: Client, message: Message): except Exception as e: await message.edit_text(format_exc(e)) finally: - if os.path.exists("coverImage.jpg"): - os.remove("coverImage.jpg") + if os.path.exists('coverImage.jpg'): + os.remove('coverImage.jpg') -@Client.on_message(filters.command("manga_search", prefix) & filters.me) +@Client.on_message(filters.command('manga_search', prefix) & filters.me) async def manga_search(client: Client, message: Message): try: chat_id = message.chat.id - await message.edit_text("Processing...") + await message.edit_text('Processing...') if len(message.command) > 1: query = message.text.split(maxsplit=1)[1] else: - message.edit_text( - "What should i search? You didn't provided me with any value to search" - ) + message.edit_text("What should i search? You didn't provided me with any value to search") - response = requests.get( - url=f"{url}/anime/manga?query={query}", headers=headers, timeout=5 - ) + response = requests.get(url=f'{url}/anime/manga?query={query}', headers=headers, timeout=5) if response.status_code != 200: - await message.edit_text("Something went wrong") + await message.edit_text('Something went wrong') return result = response.json() - averageScore = result["averageScore"] + averageScore = result['averageScore'] try: - coverImage_url = result["imageUrl"] + coverImage_url = result['imageUrl'] coverImage = requests.get(url=coverImage_url).content - async with aiofiles.open("coverImage.jpg", mode="wb") as f: + async with aiofiles.open('coverImage.jpg', mode='wb') as f: await f.write(coverImage) except Exception: coverImage = None - title = result["title"]["english"] - trailer = result["trailer"]["id"] - description = result["description"] - chapters = result["chapters"] - genres = ", ".join(result["genres"]) - isAdult = result["isAdult"] - status = result["status"] - studios = ", ".join(result["studios"]) + title = result['title']['english'] + trailer = result['trailer']['id'] + description = result['description'] + chapters = result['chapters'] + genres = ', '.join(result['genres']) + isAdult = result['isAdult'] + status = result['status'] + studios = ', '.join(result['studios']) await message.delete() await client.send_media_group( chat_id, [ InputMediaPhoto( - "coverImage.jpg", + 'coverImage.jpg', caption=f"Title: {title}\nAverage Score: {averageScore}\nStatus: {status}\nGenres: {genres}\nChapters: {chapters}\nIs Adult: {isAdult}\nStudios: {studios}\nDescription: {description}\nTrailer: Click Here", ) ], @@ -155,7 +146,7 @@ async def manga_search(client: Client, message: Message): chat_id, [ InputMediaPhoto( - "coverImage.jpg", + 'coverImage.jpg', caption=f"Title: {title}\nAverage Score: {averageScore}\nStatus: {status}\nGenres: {genres}\nChapters: {chapters}\nIs Adult: {isAdult}\nStudios: {studios}\nDescription: {description}\nTrailer: Click Here", ) ], @@ -163,54 +154,50 @@ async def manga_search(client: Client, message: Message): except Exception as e: await message.edit_text(format_exc(e)) finally: - if os.path.exists("coverImage.jpg"): - os.remove("coverImage.jpg") + if os.path.exists('coverImage.jpg'): + os.remove('coverImage.jpg') -@Client.on_message(filters.command("character", prefix) & filters.me) +@Client.on_message(filters.command('character', prefix) & filters.me) async def character(client: Client, message: Message): try: chat_id = message.chat.id - await message.edit_text("Processing...") + await message.edit_text('Processing...') if len(message.command) > 1: query = message.text.split(maxsplit=1)[1] else: - message.edit_text( - "What should i search? You didn't provided me with any value to search" - ) + message.edit_text("What should i search? You didn't provided me with any value to search") - response = requests.get( - url=f"{url}/anime/character?query={query}", headers=headers, timeout=5 - ) + response = requests.get(url=f'{url}/anime/character?query={query}', headers=headers, timeout=5) if response.status_code != 200: - await message.edit_text("Something went wrong") + await message.edit_text('Something went wrong') return result = response.json() try: - coverImage_url = result["image"]["large"] + coverImage_url = result['image']['large'] coverImage = requests.get(url=coverImage_url).content - async with aiofiles.open("coverImage.jpg", mode="wb") as f: + async with aiofiles.open('coverImage.jpg', mode='wb') as f: await f.write(coverImage) except Exception: coverImage = None - age = result["age"] - description = result["description"] - height = result["height"] - name = result["name"]["full"] - native_name = result["name"]["native"] - read_more = result["siteUrl"] + age = result['age'] + description = result['description'] + height = result['height'] + name = result['name']['full'] + native_name = result['name']['native'] + read_more = result['siteUrl'] await message.delete() await client.send_media_group( chat_id, [ InputMediaPhoto( - "coverImage.jpg", - caption=f"**Name:** `{name}`\n**Native Name:** `{native_name}`\n**Age:** `{age}`\n**Height:** {height}\n**Description:** `{description}`[read more...]({read_more})", + 'coverImage.jpg', + caption=f'**Name:** `{name}`\n**Native Name:** `{native_name}`\n**Age:** `{age}`\n**Height:** {height}\n**Description:** `{description}`[read more...]({read_more})', parse_mode=enums.ParseMode.MARKDOWN, ) ], @@ -223,8 +210,8 @@ async def character(client: Client, message: Message): chat_id, [ InputMediaPhoto( - "coverImage.jpg", - caption=f"**Name:** `{name}`\n**Native Name:** `{native_name}`\n**Age:** `{age}`\n**Height:** {height}\n**Description:** `{description}`[read more...]({read_more})", + 'coverImage.jpg', + caption=f'**Name:** `{name}`\n**Native Name:** `{native_name}`\n**Age:** `{age}`\n**Height:** {height}\n**Description:** `{description}`[read more...]({read_more})', parse_mode=enums.ParseMode.MARKDOWN, ) ], @@ -232,12 +219,12 @@ async def character(client: Client, message: Message): except Exception as e: await message.edit_text(format_exc(e)) finally: - if os.path.exists("coverImage.jpg"): - os.remove("coverImage.jpg") + if os.path.exists('coverImage.jpg'): + os.remove('coverImage.jpg') -modules_help["anilist"] = { - "anime_search": "Search for anime on Anilist", - "manga_search": "Search for manga on Anilist", - "character": "Search for character on Anilist", +modules_help['anilist'] = { + 'anime_search': 'Search for anime on Anilist', + 'manga_search': 'Search for manga on Anilist', + 'character': 'Search for character on Anilist', } diff --git a/userbot/modules/anime/anime.py b/userbot/modules/anime/anime.py index eff5f64..0b6554a 100644 --- a/userbot/modules/anime/anime.py +++ b/userbot/modules/anime/anime.py @@ -1,11 +1,12 @@ -from pyrogram import Client, filters, enums +from io import BytesIO + +from aiohttp import ClientSession +from pyrogram import Client, enums, filters from pyrogram.types import Message # noinspection PyUnresolvedReferences from utils.misc import modules_help, prefix from utils.scripts import format_exc -from aiohttp import ClientSession -from io import BytesIO session = ClientSession() @@ -25,8 +26,10 @@ class Post: if self.large_file_url else ( self.source - if self.source and "pximg" not in self.source - else await self.pximg if self.source else None + if self.source and 'pximg' not in self.source + else await self.pximg + if self.source + else None ) ) ) @@ -41,16 +44,14 @@ class Post: async def random(): - async with session.get( - url="https://danbooru.donmai.us/posts/random.json" - ) as response: - return Post(await response.json(encoding="utf-8"), session) + async with session.get(url='https://danbooru.donmai.us/posts/random.json') as response: + return Post(await response.json(encoding='utf-8'), session) -@Client.on_message(filters.command(["arnd", "arandom"], prefix) & filters.me) +@Client.on_message(filters.command(['arnd', 'arandom'], prefix) & filters.me) async def anime_handler(client: Client, message: Message): try: - await message.edit("Searching art", parse_mode=enums.ParseMode.HTML) + await message.edit('Searching art', parse_mode=enums.ParseMode.HTML) ra = await random() img = await ra.image await message.reply_photo( @@ -63,7 +64,7 @@ async def anime_handler(client: Client, message: Message): await message.edit(format_exc(e), parse_mode=enums.ParseMode.HTML) -modules_help["anime"] = { - "arnd": "Random anime art (May get caught 18+)", - "arandom": "Random anime art (May get caught 18+)", +modules_help['anime'] = { + 'arnd': 'Random anime art (May get caught 18+)', + 'arandom': 'Random anime art (May get caught 18+)', } diff --git a/userbot/modules/anime/neko.py b/userbot/modules/anime/neko.py index 4ba8545..519ef58 100644 --- a/userbot/modules/anime/neko.py +++ b/userbot/modules/anime/neko.py @@ -17,40 +17,38 @@ import asyncio import requests -from pyrogram import Client, filters, enums +from pyrogram import Client, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix from utils.scripts import format_exc def get_neko_media(query): - return requests.get(f"https://nekos.life/api/v2/img/{query}").json()["url"] + return requests.get(f'https://nekos.life/api/v2/img/{query}').json()['url'] -@Client.on_message(filters.command("neko", prefix) & filters.me) +@Client.on_message(filters.command('neko', prefix) & filters.me) async def neko(_, message: Message): if len(message.command) == 1: await message.edit( - "Neko type isn't provided\n" - f"You can get available neko types with {prefix}neko_types" + f"Neko type isn't provided\nYou can get available neko types with {prefix}neko_types" ) query = message.command[1] - await message.edit("Loading...") + await message.edit('Loading...') try: - await message.edit(f"{get_neko_media(query)}", disable_web_page_preview=False) + await message.edit(f'{get_neko_media(query)}', disable_web_page_preview=False) except Exception as e: await message.edit(format_exc(e)) -@Client.on_message(filters.command(["nekotypes", "neko_types"], prefix) & filters.me) +@Client.on_message(filters.command(['nekotypes', 'neko_types'], prefix) & filters.me) async def neko_types_func(_, message: Message): neko_types = """hug kiss tickle lewd neko pat lizard 8ball cat chat fact smug woof gasm goose cuddle avatar slap gecg feed fox_girl meow wallpaper spank waifu ngif name owoify spoiler why""" - await message.edit(" ".join(f"{n}" for n in neko_types.split())) + await message.edit(' '.join(f'{n}' for n in neko_types.split())) -@Client.on_message(filters.command(["nekospam", "neko_spam"], prefix) & filters.me) +@Client.on_message(filters.command(['nekospam', 'neko_spam'], prefix) & filters.me) async def neko_spam(client: Client, message: Message): query = message.command[1] amount = int(message.command[2]) @@ -65,8 +63,8 @@ async def neko_spam(client: Client, message: Message): await asyncio.sleep(0.1) -modules_help["neko"] = { - "neko [type]*": "Get neko media", - "neko_types": "Available neko types", - "neko_spam [type]* [amount]*": "Start spam with neko media", +modules_help['neko'] = { + 'neko [type]*': 'Get neko media', + 'neko_types': 'Available neko types', + 'neko_spam [type]* [amount]*': 'Start spam with neko media', } diff --git a/userbot/modules/aniquotes.py b/userbot/modules/aniquotes.py index 867c88f..3b304df 100644 --- a/userbot/modules/aniquotes.py +++ b/userbot/modules/aniquotes.py @@ -1,13 +1,12 @@ -from random import choice, randint +from random import randint -from pyrogram import Client, filters, enums +from pyrogram import Client, enums, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix from utils.scripts import format_exc -@Client.on_message(filters.command(["aniq", "aq"], prefix) & filters.me) +@Client.on_message(filters.command(['aniq', 'aq'], prefix) & filters.me) async def aniquotes_handler(client: Client, message: Message): if message.reply_to_message and message.reply_to_message.text: query = message.reply_to_message.text[:512] @@ -17,27 +16,25 @@ async def aniquotes_handler(client: Client, message: Message): query = message.text.split(maxsplit=1)[1][:512] else: return await message.edit( - "[💮 Aniquotes] Please enter text to create sticker.", + '[💮 Aniquotes] Please enter text to create sticker.', parse_mode=enums.ParseMode.HTML, ) try: await message.delete() - result = await client.get_inline_bot_results("@quotafbot", query) + result = await client.get_inline_bot_results('@quotafbot', query) return await message.reply_inline_bot_result( query_id=result.query_id, result_id=result.results[randint(1, 2)].id, - reply_to_message_id=( - message.reply_to_message.id if message.reply_to_message else None - ), + reply_to_message_id=(message.reply_to_message.id if message.reply_to_message else None), ) except Exception as e: return await message.reply( - f"[💮 Aniquotes]\n{format_exc(e)}", + f'[💮 Aniquotes]\n{format_exc(e)}', parse_mode=enums.ParseMode.HTML, ) -modules_help["aniquotes"] = { - "aq [text]": "Create animated sticker with text", +modules_help['aniquotes'] = { + 'aq [text]': 'Create animated sticker with text', } diff --git a/userbot/modules/antipm.py b/userbot/modules/antipm.py index 9ce1b23..97e9bda 100644 --- a/userbot/modules/antipm.py +++ b/userbot/modules/antipm.py @@ -19,14 +19,11 @@ import os from pyrogram import Client, filters from pyrogram.raw import functions from pyrogram.types import Message - from utils.config import pm_limit from utils.db import db from utils.misc import modules_help, prefix -anti_pm_enabled = filters.create( - lambda _, __, ___: db.get("core.antipm", "status", False) -) +anti_pm_enabled = filters.create(lambda _, __, ___: db.get('core.antipm', 'status', False)) in_contact_list = filters.create(lambda _, __, message: message.from_user.is_contact) @@ -35,14 +32,7 @@ is_support = filters.create(lambda _, __, message: message.chat.is_support) USER_WARNINGS = {} -@Client.on_message( - filters.private - & ~filters.me - & ~filters.bot - & ~in_contact_list - & ~is_support - & anti_pm_enabled -) +@Client.on_message(filters.private & ~filters.me & ~filters.bot & ~in_contact_list & ~is_support & anti_pm_enabled) async def anti_pm_handler(client: Client, message: Message): user_id = message.from_user.id ids = message.chat.id @@ -50,7 +40,7 @@ async def anti_pm_handler(client: Client, message: Message): u_n = b_f.first_name user = await client.get_users(ids) u_f = user.first_name - default_text = db.get("core.antipm", "antipm_msg", None) + default_text = db.get('core.antipm', 'antipm_msg', None) if default_text is None: default_text = f"""Hello, {u_f}! This is the Assistant Of {u_n}. @@ -61,23 +51,19 @@ Do not spam further messages else I may have to block you! Currently You Have {USER_WARNINGS.get(user_id, 0)} Warnings. """ else: - default_text = default_text.format( - user=u_f, my_name=u_n, warns=USER_WARNINGS.get(user_id, 0) - ) + default_text = default_text.format(user=u_f, my_name=u_n, warns=USER_WARNINGS.get(user_id, 0)) - if db.get("core.antipm", "spamrep", False): + if db.get('core.antipm', 'spamrep', False): user_info = await client.resolve_peer(ids) await client.invoke(functions.messages.ReportSpam(peer=user_info)) - if db.get("core.antipm", "block", False): + if db.get('core.antipm', 'block', False): await client.block_user(user_id) - if db.get("core.antipm", f"disallowusers{ids}") == user_id != db.get( - "core.antipm", f"allowusers{ids}" - ) or db.get("core.antipm", f"disallowusers{ids}") != user_id != db.get( - "core.antipm", f"allowusers{ids}" - ): - default_pic = db.get("core.antipm", "antipm_pic", None) + if db.get('core.antipm', f'disallowusers{ids}') == user_id != db.get('core.antipm', f'allowusers{ids}') or db.get( + 'core.antipm', f'disallowusers{ids}' + ) != user_id != db.get('core.antipm', f'allowusers{ids}'): + default_pic = db.get('core.antipm', 'antipm_pic', None) if default_pic and os.path.exists(default_pic): await client.send_photo(message.chat.id, default_pic, caption=default_text) else: @@ -91,166 +77,146 @@ Do not spam further messages else I may have to block you! if USER_WARNINGS[user_id] > pm_limit: await client.send_message( message.chat.id, - "Ehm...! That was your Last warn, Bye Bye see you L0L", + 'Ehm...! That was your Last warn, Bye Bye see you L0L', ) await client.block_user(user_id) del USER_WARNINGS[user_id] -@Client.on_message(filters.command(["antipm", "anti_pm"], prefix) & filters.me) +@Client.on_message(filters.command(['antipm', 'anti_pm'], prefix) & filters.me) async def anti_pm(_, message: Message): if len(message.command) == 1: - if db.get("core.antipm", "status", False): - await message.edit( - "Anti-PM status: enabled\n" - f"Disable with: {prefix}antipm disable" - ) + if db.get('core.antipm', 'status', False): + await message.edit(f'Anti-PM status: enabled\nDisable with: {prefix}antipm disable') else: - await message.edit( - "Anti-PM status: disabled\n" - f"Enable with: {prefix}antipm enable" - ) - elif message.command[1] in ["enable", "on", "1", "yes", "true"]: - db.set("core.antipm", "status", True) - await message.edit("Anti-PM enabled!") - elif message.command[1] in ["disable", "off", "0", "no", "false"]: - db.set("core.antipm", "status", False) - await message.edit("Anti-PM disabled!") + await message.edit(f'Anti-PM status: disabled\nEnable with: {prefix}antipm enable') + elif message.command[1] in ['enable', 'on', '1', 'yes', 'true']: + db.set('core.antipm', 'status', True) + await message.edit('Anti-PM enabled!') + elif message.command[1] in ['disable', 'off', '0', 'no', 'false']: + db.set('core.antipm', 'status', False) + await message.edit('Anti-PM disabled!') else: - await message.edit(f"Usage: {prefix}antipm [enable|disable]") + await message.edit(f'Usage: {prefix}antipm [enable|disable]') -@Client.on_message(filters.command(["antipm_report"], prefix) & filters.me) +@Client.on_message(filters.command(['antipm_report'], prefix) & filters.me) async def antipm_report(_, message: Message): if len(message.command) == 1: - if db.get("core.antipm", "spamrep", False): + if db.get('core.antipm', 'spamrep', False): await message.edit( - "Spam-reporting enabled.\n" - f"Disable with: {prefix}antipm_report disable" + f'Spam-reporting enabled.\nDisable with: {prefix}antipm_report disable' ) else: await message.edit( - "Spam-reporting disabled.\n" - f"Enable with: {prefix}antipm_report enable" + f'Spam-reporting disabled.\nEnable with: {prefix}antipm_report enable' ) - elif message.command[1] in ["enable", "on", "1", "yes", "true"]: - db.set("core.antipm", "spamrep", True) - await message.edit("Spam-reporting enabled!") - elif message.command[1] in ["disable", "off", "0", "no", "false"]: - db.set("core.antipm", "spamrep", False) - await message.edit("Spam-reporting disabled!") + elif message.command[1] in ['enable', 'on', '1', 'yes', 'true']: + db.set('core.antipm', 'spamrep', True) + await message.edit('Spam-reporting enabled!') + elif message.command[1] in ['disable', 'off', '0', 'no', 'false']: + db.set('core.antipm', 'spamrep', False) + await message.edit('Spam-reporting disabled!') else: - await message.edit(f"Usage: {prefix}antipm_report [enable|disable]") + await message.edit(f'Usage: {prefix}antipm_report [enable|disable]') -@Client.on_message(filters.command(["antipm_block"], prefix) & filters.me) +@Client.on_message(filters.command(['antipm_block'], prefix) & filters.me) async def antipm_block(_, message: Message): if len(message.command) == 1: - if db.get("core.antipm", "block", False): + if db.get('core.antipm', 'block', False): await message.edit( - "Blocking users enabled.\n" - f"Disable with: {prefix}antipm_block disable" + f'Blocking users enabled.\nDisable with: {prefix}antipm_block disable' ) else: await message.edit( - "Blocking users disabled.\n" - f"Enable with: {prefix}antipm_block enable" + f'Blocking users disabled.\nEnable with: {prefix}antipm_block enable' ) - elif message.command[1] in ["enable", "on", "1", "yes", "true"]: - db.set("core.antipm", "block", True) - await message.edit("Blocking users enabled!") - elif message.command[1] in ["disable", "off", "0", "no", "false"]: - db.set("core.antipm", "block", False) - await message.edit("Blocking users disabled!") + elif message.command[1] in ['enable', 'on', '1', 'yes', 'true']: + db.set('core.antipm', 'block', True) + await message.edit('Blocking users enabled!') + elif message.command[1] in ['disable', 'off', '0', 'no', 'false']: + db.set('core.antipm', 'block', False) + await message.edit('Blocking users disabled!') else: - await message.edit(f"Usage: {prefix}antipm_block [enable|disable]") + await message.edit(f'Usage: {prefix}antipm_block [enable|disable]') -@Client.on_message(filters.command(["a"], prefix) & filters.me) +@Client.on_message(filters.command(['a'], prefix) & filters.me) async def add_contact(_, message: Message): ids = message.chat.id - db.set("core.antipm", f"allowusers{ids}", ids) + db.set('core.antipm', f'allowusers{ids}', ids) if ids in USER_WARNINGS: del USER_WARNINGS[ids] - await message.edit("User Approved!") + await message.edit('User Approved!') -@Client.on_message(filters.command(["d"], prefix) & filters.me) +@Client.on_message(filters.command(['d'], prefix) & filters.me) async def del_contact(_, message: Message): ids = message.chat.id - db.set("core.antipm", f"disallowusers{ids}", ids) - db.remove("core.antipm", f"allowusers{ids}") - await message.edit("User DisApproved!") + db.set('core.antipm', f'disallowusers{ids}', ids) + db.remove('core.antipm', f'allowusers{ids}') + await message.edit('User DisApproved!') -@Client.on_message(filters.command(["setantipmmsg", "sam"], prefix) & filters.me) +@Client.on_message(filters.command(['setantipmmsg', 'sam'], prefix) & filters.me) async def set_antipm_msg(_, message: Message): if not message.reply_to_message: - db.set("core.antipm", "antipm_msg", None) - await message.edit("antipm message set to default.") + db.set('core.antipm', 'antipm_msg', None) + await message.edit('antipm message set to default.') return msg = message.reply_to_message afk_msg = msg.text or msg.caption if not afk_msg: - return await message.edit( - "Reply to a text or caption message to set it as your antipm message." - ) + return await message.edit('Reply to a text or caption message to set it as your antipm message.') if len(afk_msg) > 200: - return await message.edit( - "antipm message is too long. It should be less than 200 characters." - ) + return await message.edit('antipm message is too long. It should be less than 200 characters.') - if "{user}" not in afk_msg: - return await message.edit( - "antipm message must contain {user} to mention the user." - ) - if "{my_name}" not in afk_msg: - return await message.edit( - "antipm message must contain {my_name} to mention your name." - ) - if "{warns}" not in afk_msg: - return await message.edit( - "antipm message must contain {warns} to mention the warns count." - ) + if '{user}' not in afk_msg: + return await message.edit('antipm message must contain {user} to mention the user.') + if '{my_name}' not in afk_msg: + return await message.edit('antipm message must contain {my_name} to mention your name.') + if '{warns}' not in afk_msg: + return await message.edit('antipm message must contain {warns} to mention the warns count.') - old_afk_msg = db.get("core.antipm", "antipm_msg", None) + old_afk_msg = db.get('core.antipm', 'antipm_msg', None) if old_afk_msg: - db.remove("core.antipm", "antipm_msg") - db.set("core.antipm", "antipm_msg", afk_msg) - await message.edit(f"antipm message set to:\n\n{afk_msg}") + db.remove('core.antipm', 'antipm_msg') + db.set('core.antipm', 'antipm_msg', afk_msg) + await message.edit(f'antipm message set to:\n\n{afk_msg}') -@Client.on_message(filters.command(["setantipmpic", "sap"], prefix) & filters.me) +@Client.on_message(filters.command(['setantipmpic', 'sap'], prefix) & filters.me) async def set_antipm_pic(_, message: Message): if not message.reply_to_message or not message.reply_to_message.photo: - db.set("core.antipm", "antipm_pic", None) - await message.edit("antipm picture set to default.") + db.set('core.antipm', 'antipm_pic', None) + await message.edit('antipm picture set to default.') return - await message.edit("Setting antipm picture...") + await message.edit('Setting antipm picture...') - photo = await message.reply_to_message.download("antipm_pic.jpg") + photo = await message.reply_to_message.download('antipm_pic.jpg') - old_antipm_pic = db.get("core.antipm", "antipm_pic", None) + old_antipm_pic = db.get('core.antipm', 'antipm_pic', None) if old_antipm_pic: - db.remove("core.antipm", "antipm_pic") - db.set("core.antipm", "antipm_pic", photo) - await message.edit("antipm picture set successfully.") + db.remove('core.antipm', 'antipm_pic') + db.set('core.antipm', 'antipm_pic', photo) + await message.edit('antipm picture set successfully.') -modules_help["antipm"] = { - "antipm [enable|disable]*": "Enable Pm permit", - "antipm_report [enable|disable]*": "Enable spam reporting", - "antipm_block [enable|disable]*": "Enable user blocking", - "setantipmmsg [reply to message]*": "Set antipm message. Use {user} to mention the user and {my_name} to mention your name and {warns} to mention the warns count.", - "sam [reply to message]*": "Set antipm message. Use {user} to mention the user and {my_name} to mention your name and {warns} to mention the warns count.", - "setantipmpic [reply to photo]*": "Set antipm picture.", - "sap [reply to photo]*": "Set antipm picture.", - "a": "Approve User", - "d": "DisApprove User", +modules_help['antipm'] = { + 'antipm [enable|disable]*': 'Enable Pm permit', + 'antipm_report [enable|disable]*': 'Enable spam reporting', + 'antipm_block [enable|disable]*': 'Enable user blocking', + 'setantipmmsg [reply to message]*': 'Set antipm message. Use {user} to mention the user and {my_name} to mention your name and {warns} to mention the warns count.', + 'sam [reply to message]*': 'Set antipm message. Use {user} to mention the user and {my_name} to mention your name and {warns} to mention the warns count.', + 'setantipmpic [reply to photo]*': 'Set antipm picture.', + 'sap [reply to photo]*': 'Set antipm picture.', + 'a': 'Approve User', + 'd': 'DisApprove User', } diff --git a/userbot/modules/blackbox.py b/userbot/modules/blackbox.py index 7b176a4..0a6bbf0 100644 --- a/userbot/modules/blackbox.py +++ b/userbot/modules/blackbox.py @@ -1,10 +1,8 @@ -import uuid import re +import uuid from aiohttp import ClientSession, FormData - from pyrogram import Client, filters - from utils.misc import modules_help, prefix @@ -12,15 +10,14 @@ def id_generator() -> str: return str(uuid.uuid4()) -@Client.on_message(filters.command(["bbox", "blackbox"], prefix) & filters.me) +@Client.on_message(filters.command(['bbox', 'blackbox'], prefix) & filters.me) async def blackbox(client, message): m = message - msg = await m.edit_text("🔍") + msg = await m.edit_text('🔍') if len(m.text.split()) == 1: return await msg.edit_text( - "Type some query buddy 🐼\n" - f"{prefix}blackbox text with reply to the photo or just text" + f'Type some query buddy 🐼\n{prefix}blackbox text with reply to the photo or just text' ) else: try: @@ -30,105 +27,95 @@ async def blackbox(client, message): image = None if m.reply_to_message and ( - m.reply_to_message.photo - or ( - m.reply_to_message.sticker - and not m.reply_to_message.sticker.is_video - ) + m.reply_to_message.photo or (m.reply_to_message.sticker and not m.reply_to_message.sticker.is_video) ): - file_name = f"blackbox_{m.chat.id}.jpeg" + file_name = f'blackbox_{m.chat.id}.jpeg' file_path = await m.reply_to_message.download(file_name=file_name) - with open(file_path, "rb") as file: + with open(file_path, 'rb') as file: image = file.read() if image: data = FormData() - data.add_field("fileName", file_name) - data.add_field("userId", user_id) - data.add_field( - "image", image, filename=file_name, content_type="image/jpeg" - ) - api_url = "https://www.blackbox.ai/api/upload" + data.add_field('fileName', file_name) + data.add_field('userId', user_id) + data.add_field('image', image, filename=file_name, content_type='image/jpeg') + api_url = 'https://www.blackbox.ai/api/upload' try: async with session.post(api_url, data=data) as response: response_json = await response.json() except Exception as e: - return await msg.edit(f"❌ Error: {str(e)}") + return await msg.edit(f'❌ Error: {str(e)}') messages = [ { - "role": "user", - "content": response_json["response"] + "\n#\n" + prompt, + 'role': 'user', + 'content': response_json['response'] + '\n#\n' + prompt, } ] data = { - "messages": messages, - "user_id": user_id, - "codeModelMode": True, - "agentMode": {}, - "trendingAgentMode": {}, + 'messages': messages, + 'user_id': user_id, + 'codeModelMode': True, + 'agentMode': {}, + 'trendingAgentMode': {}, } - headers = {"Content-Type": "application/json"} - url = "https://www.blackbox.ai/api/chat" + headers = {'Content-Type': 'application/json'} + url = 'https://www.blackbox.ai/api/chat' try: - async with session.post( - url, headers=headers, json=data - ) as response: + async with session.post(url, headers=headers, json=data) as response: response_text = await response.text() except Exception as e: - return await msg.edit(f"❌ Error: {str(e)}") + return await msg.edit(f'❌ Error: {str(e)}') cleaned_response_text = re.sub( - r"^\$?@?\$?v=undefined-rv\d+@?\$?|\$?@?\$?v=v\d+\.\d+-rv\d+@?\$?", - "", + r'^\$?@?\$?v=undefined-rv\d+@?\$?|\$?@?\$?v=v\d+\.\d+-rv\d+@?\$?', + '', response_text, ) text = cleaned_response_text.strip()[2:] - if "$~~~$" in text: - text = re.sub(r"\$~~~\$.*?\$~~~\$", "", text, flags=re.DOTALL) - rdata = {"reply": text} + if '$~~~$' in text: + text = re.sub(r'\$~~~\$.*?\$~~~\$', '', text, flags=re.DOTALL) + rdata = {'reply': text} - return await msg.edit_text(text=rdata["reply"]) + return await msg.edit_text(text=rdata['reply']) else: reply = m.reply_to_message if reply and reply.text: - prompt = f"Old conversation:\n{reply.text}\n\nQuestion:\n{prompt}" - messages = [{"role": "user", "content": prompt}] + prompt = f'Old conversation:\n{reply.text}\n\nQuestion:\n{prompt}' + messages = [{'role': 'user', 'content': prompt}] data = { - "messages": messages, - "user_id": user_id, - "codeModelMode": True, - "agentMode": {}, - "trendingAgentMode": {}, + 'messages': messages, + 'user_id': user_id, + 'codeModelMode': True, + 'agentMode': {}, + 'trendingAgentMode': {}, } - headers = {"Content-Type": "application/json"} - url = "https://www.blackbox.ai/api/chat" + headers = {'Content-Type': 'application/json'} + url = 'https://www.blackbox.ai/api/chat' try: - async with session.post( - url, headers=headers, json=data - ) as response: + async with session.post(url, headers=headers, json=data) as response: response_text = await response.text() except Exception as e: - return await msg.edit(f"❌ Error: {str(e)}") + return await msg.edit(f'❌ Error: {str(e)}') cleaned_response_text = re.sub( - r"^\$?@?\$?v=undefined-rv\d+@?\$?|\$?@?\$?v=v\d+\.\d+-rv\d+@?\$?", - "", + r'^\$?@?\$?v=undefined-rv\d+@?\$?|\$?@?\$?v=v\d+\.\d+-rv\d+@?\$?', + '', response_text, ) text = cleaned_response_text.strip()[2:] - if "$~~~$" in text: - text = re.sub(r"\$~~~\$.*?\$~~~\$", "", text, flags=re.DOTALL) - rdata = {"reply": text} + if '$~~~$' in text: + text = re.sub(r'\$~~~\$.*?\$~~~\$', '', text, flags=re.DOTALL) + rdata = {'reply': text} - return await msg.edit_text(text=rdata["reply"]) + return await msg.edit_text(text=rdata['reply']) except Exception as e: - return await msg.edit(f"�� Error: {str(e)}") + return await msg.edit(f'�� Error: {str(e)}') finally: await session.close() -modules_help["blackbox"] = { - "blackbox [query]*": "Ask anything to Blackbox", - "bbox [query]*": "Ask anything to Blackbox", +modules_help['blackbox'] = { + 'blackbox [query]*': 'Ask anything to Blackbox', + 'bbox [query]*': 'Ask anything to Blackbox', } diff --git a/userbot/modules/calculator.py b/userbot/modules/calculator.py index 08927bf..f25afd7 100644 --- a/userbot/modules/calculator.py +++ b/userbot/modules/calculator.py @@ -2,15 +2,14 @@ import asyncio from pyrogram import Client, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix -@Client.on_message(filters.command("calc", prefix) & filters.me) +@Client.on_message(filters.command('calc', prefix) & filters.me) async def calc(_, message: Message): if len(message.command) <= 1: return - args = " ".join(message.command[1:]) + args = ' '.join(message.command[1:]) try: result = str(eval(args)) @@ -19,28 +18,24 @@ async def calc(_, message: Message): for x in range(0, len(result), 4096): if i == 0: await message.edit( - f"{args}={result[x:x + 4000]}", - parse_mode="HTML", + f'{args}={result[x : x + 4000]}', + parse_mode='HTML', ) else: - await message.reply( - f"{result[x:x + 4096]}", parse_mode="HTML" - ) + await message.reply(f'{result[x : x + 4096]}', parse_mode='HTML') i += 1 await asyncio.sleep(0.18) else: - await message.edit( - f"{args}={result}", parse_mode="HTML" - ) + await message.edit(f'{args}={result}', parse_mode='HTML') except Exception as e: - await message.edit(f"{args}=={e}", parse_mode="HTML") + await message.edit(f'{args}=={e}', parse_mode='HTML') -modules_help["calculator"] = { - "calc [expression]*": "solve a math problem\n" - "+ – addition\n" - "– – subtraction\n" - "* – multiplication\n" - "/ – division\n" - "** – degree" +modules_help['calculator'] = { + 'calc [expression]*': 'solve a math problem\n' + '+ – addition\n' + '– – subtraction\n' + '* – multiplication\n' + '/ – division\n' + '** – degree' } diff --git a/userbot/modules/cdxl.py b/userbot/modules/cdxl.py index 19c1597..a869d75 100644 --- a/userbot/modules/cdxl.py +++ b/userbot/modules/cdxl.py @@ -1,57 +1,52 @@ -import base64, os +import os from pyrogram import Client, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix from utils.scripts import format_exc, import_library -clarifai = import_library("clarifai") +clarifai = import_library('clarifai') from clarifai.client.model import Model -@Client.on_message(filters.command("cdxl", prefix) & filters.me) +@Client.on_message(filters.command('cdxl', prefix) & filters.me) async def cdxl(c: Client, message: Message): try: chat_id = message.chat.id - await message.edit_text("Please Wait...") + await message.edit_text('Please Wait...') if len(message.command) > 1: prompt = message.text.split(maxsplit=1)[1] elif message.reply_to_message: prompt = message.reply_to_message.text else: - await message.edit_text( - f"Usage: {prefix}vdxl [prompt/reply to prompt]" - ) + await message.edit_text(f'Usage: {prefix}vdxl [prompt/reply to prompt]') return inference_params = dict(width=1024, height=1024, steps=50, cfg_scale=9.0) model_prediction = Model( - "https://clarifai.com/stability-ai/stable-diffusion-2/models/stable-diffusion-xl" - ).predict_by_bytes( - prompt.encode(), input_type="text", inference_params=inference_params - ) + 'https://clarifai.com/stability-ai/stable-diffusion-2/models/stable-diffusion-xl' + ).predict_by_bytes(prompt.encode(), input_type='text', inference_params=inference_params) output_base64 = model_prediction.outputs[0].data.image.base64 - with open("sdxl_out.png", "wb") as f: + with open('sdxl_out.png', 'wb') as f: f.write(output_base64) await message.delete() await c.send_photo( chat_id, - photo=f"sdxl_out.png", - caption=f"Prompt:{prompt}", + photo='sdxl_out.png', + caption=f'Prompt:{prompt}', ) - os.remove(f"sdxl_out.png") + os.remove('sdxl_out.png') except Exception as e: - await message.edit_text(f"An error occurred: {format_exc(e)}") + await message.edit_text(f'An error occurred: {format_exc(e)}') -modules_help["cdxl"] = { - "cdxl [prompt/reply to prompt]*": "Text to Image with SDXL model", +modules_help['cdxl'] = { + 'cdxl [prompt/reply to prompt]*': 'Text to Image with SDXL model', } diff --git a/userbot/modules/chatbot.py b/userbot/modules/chatbot.py index 5d606f1..fb49eeb 100644 --- a/userbot/modules/chatbot.py +++ b/userbot/modules/chatbot.py @@ -1,49 +1,48 @@ from pyrogram import Client, enums, filters from pyrogram.types import Message - -from utils.misc import modules_help, prefix from utils.config import cohere_key from utils.db import db +from utils.misc import modules_help, prefix from utils.scripts import format_exc, import_library, restart -cohere = import_library("cohere") +cohere = import_library('cohere') co = cohere.Client(cohere_key) chatai_users = db.getaiusers() -@Client.on_message(filters.command("addai", prefix) & filters.me) +@Client.on_message(filters.command('addai', prefix) & filters.me) async def adduser(_, message: Message): if len(message.command) > 1: user_id = message.text.split(maxsplit=1)[1] if user_id.isdigit(): user_id = int(user_id) db.addaiuser(user_id) - await message.edit_text("User ID Added") + await message.edit_text('User ID Added') restart() else: - await message.edit_text("User ID is invalid.") + await message.edit_text('User ID is invalid.') return else: - await message.edit_text(f"Usage: {prefix}addai [user_id]") + await message.edit_text(f'Usage: {prefix}addai [user_id]') return -@Client.on_message(filters.command("remai", prefix) & filters.me) +@Client.on_message(filters.command('remai', prefix) & filters.me) async def remuser(_, message: Message): if len(message.command) > 1: user_id = message.text.split(maxsplit=1)[1] if user_id.isdigit(): user_id = int(user_id) db.remaiuser(user_id) - await message.edit_text("User ID Removed") + await message.edit_text('User ID Removed') restart() else: - await message.edit_text("User ID is invalid.") + await message.edit_text('User ID is invalid.') return else: - await message.edit_text(f"Usage: {prefix}remai [user_id]") + await message.edit_text(f'Usage: {prefix}remai [user_id]') return @@ -62,44 +61,40 @@ async def chatbot(_, message: Message): prompt = message.text - db.add_chat_history(user_id, {"role": "USER", "message": prompt}) + db.add_chat_history(user_id, {'role': 'USER', 'message': prompt}) response = co.chat( chat_history=chat_history, - model="command-r-plus", + model='command-r-plus', message=prompt, temperature=0.3, - connectors=[{"id": "web-search", "options": {"site": "wikipedia.com"}}], - prompt_truncation="AUTO", + connectors=[{'id': 'web-search', 'options': {'site': 'wikipedia.com'}}], + prompt_truncation='AUTO', ) - db.add_chat_history(user_id, {"role": "CHATBOT", "message": response.text}) + db.add_chat_history(user_id, {'role': 'CHATBOT', 'message': response.text}) - await message.reply_text( - f"{response.text}", parse_mode=enums.ParseMode.MARKDOWN - ) + await message.reply_text(f'{response.text}', parse_mode=enums.ParseMode.MARKDOWN) except Exception as e: - await message.reply_text(f"An error occurred: {format_exc(e)}") + await message.reply_text(f'An error occurred: {format_exc(e)}') -@Client.on_message(filters.command("chatoff", prefix) & filters.me) +@Client.on_message(filters.command('chatoff', prefix) & filters.me) async def chatoff(_, message: Message): - db.remove("core.chatbot", "chatai_users") - await message.reply_text("ChatBot is off now") + db.remove('core.chatbot', 'chatai_users') + await message.reply_text('ChatBot is off now') restart() -@Client.on_message(filters.command("listai", prefix) & filters.me) +@Client.on_message(filters.command('listai', prefix) & filters.me) async def listai(_, message: Message): - await message.edit_text( - f"User ID's Currently in AI ChatBot List:\n {chatai_users}" - ) + await message.edit_text(f"User ID's Currently in AI ChatBot List:\n {chatai_users}") -modules_help["chatbot"] = { - "addai [user_id]*": "Add A user to AI ChatBot List", - "remai [user_id]*": "Remove A user from AI ChatBot List", - "listai": "List A user from AI ChatBot List", - "chatoff": "Turn off AI ChatBot", +modules_help['chatbot'] = { + 'addai [user_id]*': 'Add A user to AI ChatBot List', + 'remai [user_id]*': 'Remove A user from AI ChatBot List', + 'listai': 'List A user from AI ChatBot List', + 'chatoff': 'Turn off AI ChatBot', } diff --git a/userbot/modules/circle.py b/userbot/modules/circle.py index 45eea7b..fb45b48 100644 --- a/userbot/modules/circle.py +++ b/userbot/modules/circle.py @@ -3,38 +3,37 @@ import os from io import BytesIO from PIL import Image, ImageDraw, ImageFilter, ImageOps -from pyrogram import Client, filters, enums +from pyrogram import Client, enums, filters from pyrogram.types import Message # noinspection PyUnresolvedReferences from utils.misc import modules_help, prefix # noinspection PyUnresolvedReferences -from utils.scripts import import_library, format_exc +from utils.scripts import format_exc, import_library - -VideoFileClip = import_library("moviepy", "moviepy==2.2.1").VideoFileClip +VideoFileClip = import_library('moviepy', 'moviepy==2.2.1').VideoFileClip im = None def process_img(filename): global im - im = Image.open(f"downloads/{filename}") + im = Image.open(f'downloads/{filename}') w, h = im.size - img = Image.new("RGBA", (w, h), (0, 0, 0, 0)) + img = Image.new('RGBA', (w, h), (0, 0, 0, 0)) img.paste(im, (0, 0)) m = min(w, h) img = img.crop(((w - m) // 2, (h - m) // 2, (w + m) // 2, (h + m) // 2)) w, h = img.size - mask = Image.new("L", (w, h), 0) + mask = Image.new('L', (w, h), 0) draw = ImageDraw.Draw(mask) draw.ellipse((10, 10, w - 10, h - 10), fill=255) mask = mask.filter(ImageFilter.GaussianBlur(2)) img = ImageOps.fit(img, (w, h)) img.putalpha(mask) im = BytesIO() - im.name = "img.webp" + im.name = 'img.webp' img.save(im) im.seek(0) @@ -44,103 +43,91 @@ video = None def process_vid(filename): global video - video = VideoFileClip(f"downloads/{filename}") + video = VideoFileClip(f'downloads/{filename}') w, h = video.size m = min(w, h) box = { - "x1": (w - m) // 2, - "y1": (h - m) // 2, - "x2": (w + m) // 2, - "y2": (h + m) // 2, + 'x1': (w - m) // 2, + 'y1': (h - m) // 2, + 'x2': (w + m) // 2, + 'y2': (h + m) // 2, } video = video.cropped(**box) -@Client.on_message(filters.command(["circle", "round"], prefix) & filters.me) +@Client.on_message(filters.command(['circle', 'round'], prefix) & filters.me) async def circle(_, message: Message): try: if not message.reply_to_message: return await message.reply( - "Reply is required for this command", + 'Reply is required for this command', parse_mode=enums.ParseMode.HTML, ) if message.reply_to_message.photo: - filename = "circle.jpg" - typ = "photo" + filename = 'circle.jpg' + typ = 'photo' elif message.reply_to_message.sticker: if message.reply_to_message.sticker.is_video: return await message.reply( - "Video stickers is not supported", + 'Video stickers is not supported', parse_mode=enums.ParseMode.HTML, ) - filename = "circle.webp" - typ = "photo" + filename = 'circle.webp' + typ = 'photo' elif message.reply_to_message.video: - filename = "circle.mp4" - typ = "video" + filename = 'circle.mp4' + typ = 'video' elif message.reply_to_message.document: _filename = message.reply_to_message.document.file_name.casefold() - if _filename.endswith(".png"): - filename = "circle.png" - typ = "photo" - elif _filename.endswith(".jpg"): - filename = "circle.jpg" - typ = "photo" - elif _filename.endswith(".jpeg"): - filename = "circle.jpeg" - typ = "photo" - elif _filename.endswith(".webp"): - filename = "circle.webp" - typ = "photo" - elif _filename.endswith(".mp4"): - filename = "circle.mp4" - typ = "video" + if _filename.endswith('.png'): + filename = 'circle.png' + typ = 'photo' + elif _filename.endswith('.jpg'): + filename = 'circle.jpg' + typ = 'photo' + elif _filename.endswith('.jpeg'): + filename = 'circle.jpeg' + typ = 'photo' + elif _filename.endswith('.webp'): + filename = 'circle.webp' + typ = 'photo' + elif _filename.endswith('.mp4'): + filename = 'circle.mp4' + typ = 'video' else: - return await message.reply( - "Invalid file type", parse_mode=enums.ParseMode.HTML - ) + return await message.reply('Invalid file type', parse_mode=enums.ParseMode.HTML) else: - return await message.reply( - "Invalid file type", parse_mode=enums.ParseMode.HTML - ) + return await message.reply('Invalid file type', parse_mode=enums.ParseMode.HTML) - if typ == "photo": - await message.edit( - "Processing image📷", parse_mode=enums.ParseMode.HTML - ) - await message.reply_to_message.download(f"downloads/{filename}") + if typ == 'photo': + await message.edit('Processing image📷', parse_mode=enums.ParseMode.HTML) + await message.reply_to_message.download(f'downloads/{filename}') await asyncio.get_event_loop().run_in_executor(None, process_img, filename) await message.delete() - return await message.reply_sticker( - sticker=im, reply_to_message_id=message.reply_to_message.id - ) + return await message.reply_sticker(sticker=im, reply_to_message_id=message.reply_to_message.id) else: - await message.edit( - "Processing video🎥", parse_mode=enums.ParseMode.HTML - ) - await message.reply_to_message.download(f"downloads/{filename}") + await message.edit('Processing video🎥', parse_mode=enums.ParseMode.HTML) + await message.reply_to_message.download(f'downloads/{filename}') await asyncio.get_event_loop().run_in_executor(None, process_vid, filename) - await message.edit("Saving video📼", parse_mode=enums.ParseMode.HTML) - await asyncio.get_event_loop().run_in_executor( - None, video.write_videofile, "downloads/result.mp4" - ) + await message.edit('Saving video📼', parse_mode=enums.ParseMode.HTML) + await asyncio.get_event_loop().run_in_executor(None, video.write_videofile, 'downloads/result.mp4') await message.delete() await message.reply_video_note( - video_note="downloads/result.mp4", + video_note='downloads/result.mp4', duration=int(video.duration), reply_to_message_id=message.reply_to_message.id, ) if isinstance(video, VideoFileClip): video.close() - os.remove(f"downloads/{filename}") - os.remove("downloads/result.mp4") + os.remove(f'downloads/{filename}') + os.remove('downloads/result.mp4') except Exception as e: await message.reply(format_exc(e), parse_mode=enums.ParseMode.HTML) -modules_help["circle"] = { - "round": "Round a photo or video.", - "circle": "Circle a photo or video.", +modules_help['circle'] = { + 'round': 'Round a photo or video.', + 'circle': 'Circle a photo or video.', } diff --git a/userbot/modules/clear_notifs.py b/userbot/modules/clear_notifs.py index 1b3fe2a..37677d0 100644 --- a/userbot/modules/clear_notifs.py +++ b/userbot/modules/clear_notifs.py @@ -17,11 +17,10 @@ from pyrogram import Client, filters from pyrogram.raw import functions from pyrogram.types import Message - from utils.misc import modules_help, prefix -@Client.on_message(filters.command(["clear_@"], prefix) & filters.me) +@Client.on_message(filters.command(['clear_@'], prefix) & filters.me) async def solo_mention_clear(client: Client, message: Message): await message.delete() peer = await client.resolve_peer(message.chat.id) @@ -29,24 +28,20 @@ async def solo_mention_clear(client: Client, message: Message): await client.invoke(request) -@Client.on_message(filters.command(["clear_all_@"], prefix) & filters.me) +@Client.on_message(filters.command(['clear_all_@'], prefix) & filters.me) async def global_mention_clear(client: Client, message: Message): counter: int = 0 - await message.edit_text( - f"Clearing all mentions...\n\nCleared: {counter} chats" - ) + await message.edit_text(f'Clearing all mentions...\n\nCleared: {counter} chats') async for dialog in client.get_dialogs(): peer = await client.resolve_peer(dialog.chat.id) request = functions.messages.ReadMentions(peer=peer) await client.invoke(request) counter += 1 - await message.edit_text( - f"Clearing all mentions...\n\nCleared: {counter} chats" - ) + await message.edit_text(f'Clearing all mentions...\n\nCleared: {counter} chats') await message.delete() -@Client.on_message(filters.command(["clear_reacts"], prefix) & filters.me) +@Client.on_message(filters.command(['clear_reacts'], prefix) & filters.me) async def solo_reaction_clear(client: Client, message: Message): await message.delete() peer = await client.resolve_peer(message.chat.id) @@ -54,26 +49,22 @@ async def solo_reaction_clear(client: Client, message: Message): await client.invoke(request) -@Client.on_message(filters.command(["clear_all_reacts"], prefix) & filters.me) +@Client.on_message(filters.command(['clear_all_reacts'], prefix) & filters.me) async def global_reaction_clear(client: Client, message: Message): counter: int = 0 - await message.edit_text( - f"Clearing all reactions...\n\nCleared: {counter} chats" - ) + await message.edit_text(f'Clearing all reactions...\n\nCleared: {counter} chats') async for dialog in client.get_dialogs(): peer = await client.resolve_peer(dialog.chat.id) request = functions.messages.ReadReactions(peer=peer) await client.invoke(request) counter += 1 - await message.edit_text( - f"Clearing all reactions...\n\nCleared: {counter} chats" - ) + await message.edit_text(f'Clearing all reactions...\n\nCleared: {counter} chats') await message.delete() -modules_help["clear_notifs"] = { - "clear_@": "clear all mentions in this chat", - "clear_all_@": "clear all mentions in all chats", - "clear_reacts": "clear all reactions in this chat", - "clear_all_reacts": "clear all reactions in all chats (except private chats)", +modules_help['clear_notifs'] = { + 'clear_@': 'clear all mentions in this chat', + 'clear_all_@': 'clear all mentions in all chats', + 'clear_reacts': 'clear all reactions in this chat', + 'clear_all_reacts': 'clear all reactions in all chats (except private chats)', } diff --git a/userbot/modules/cohere.py b/userbot/modules/cohere.py index fa26034..f9c7eeb 100644 --- a/userbot/modules/cohere.py +++ b/userbot/modules/cohere.py @@ -1,26 +1,24 @@ import asyncio -from json import tool -from utils.scripts import import_library -from utils.config import cohere_key -cohere = import_library("cohere") +from utils.config import cohere_key +from utils.scripts import import_library + +cohere = import_library('cohere') import cohere co = cohere.Client(cohere_key) -from utils.misc import modules_help, prefix -from utils.scripts import format_exc -from utils.db import db -from utils.rentry import paste as rentry_paste - - -from pyrogram import Client, filters, enums -from pyrogram.types import Message +from pyrogram import Client, enums, filters from pyrogram.errors import MessageTooLong +from pyrogram.types import Message +from utils.db import db +from utils.misc import modules_help, prefix +from utils.rentry import paste as rentry_paste +from utils.scripts import format_exc -@Client.on_message(filters.command("cohere", prefix) & filters.me) +@Client.on_message(filters.command('cohere', prefix) & filters.me) async def cohere(c: Client, message: Message): try: user_id = message.from_user.id @@ -31,104 +29,94 @@ async def cohere(c: Client, message: Message): elif message.reply_to_message: prompt = message.reply_to_message.text else: - await message.edit_text( - f"Usage: {prefix}cohere [prompt/reply to message]" - ) + await message.edit_text(f'Usage: {prefix}cohere [prompt/reply to message]') return - db.add_chat_history(user_id, {"role": "USER", "message": prompt}) + db.add_chat_history(user_id, {'role': 'USER', 'message': prompt}) - await message.edit_text("Umm, lemme think...") + await message.edit_text('Umm, lemme think...') response = co.chat_stream( chat_history=chat_history, - model="command-r-plus", + model='command-r-plus', message=prompt, temperature=0.8, - tools=[{"name": "internet_search"}], + tools=[{'name': 'internet_search'}], connectors=[], - prompt_truncation="OFF", + prompt_truncation='OFF', ) - output = "" - tool_message = "" + output = '' + tool_message = '' data = [] for event in response: - if event.event_type == "tool-calls-chunk": + if event.event_type == 'tool-calls-chunk': if event.tool_call_delta and event.tool_call_delta.text is None: - tool_message += "" + tool_message += '' else: tool_message += event.text - if event.event_type == "search-results": + if event.event_type == 'search-results': data.append(event.documents) - if event.event_type == "text-generation": + if event.event_type == 'text-generation': output += event.text - if output == "": + if output == '': output = "I can't seem to find an answer to that" - db.add_chat_history(user_id, {"role": "CHATBOT", "message": output}) + db.add_chat_history(user_id, {'role': 'CHATBOT', 'message': output}) - await message.edit_text(f"{tool_message}") + await message.edit_text(f'{tool_message}') await asyncio.sleep(5) try: data = data[0] - references = "" + references = '' reference_dict = {} for item in data: - title = item["title"] - url = item["url"] + title = item['title'] + url = item['url'] if title not in reference_dict: reference_dict[title] = url i = 1 for title, url in reference_dict.items(): - references += f"**{i}.** [{title}]({url})\n" + references += f'**{i}.** [{title}]({url})\n' i += 1 await message.edit_text( - f"**Question:**`{prompt}`\n**Answer:** {output}\n\n**References:**\n{references}", + f'**Question:**`{prompt}`\n**Answer:** {output}\n\n**References:**\n{references}', parse_mode=enums.ParseMode.MARKDOWN, disable_web_page_preview=True, ) except IndexError: - references = "" + references = '' await message.edit_text( - f"**Question:**`{prompt}`\n**Answer:** {output}\n", + f'**Question:**`{prompt}`\n**Answer:** {output}\n', parse_mode=enums.ParseMode.MARKDOWN, disable_web_page_preview=True, ) except MessageTooLong: - await message.edit_text( - "Output is too long... Pasting to rentry..." - ) + await message.edit_text('Output is too long... Pasting to rentry...') try: - output = output + "\n\n" + references if references else output - rentry_url, edit_code = await rentry_paste( - text=output, return_edit=True - ) + output = output + '\n\n' + references if references else output + rentry_url, edit_code = await rentry_paste(text=output, return_edit=True) except RuntimeError: - await message.edit_text( - "Error: Failed to paste to rentry" - ) + await message.edit_text('Error: Failed to paste to rentry') return await c.send_message( - "me", + 'me', f"Here's your edit code for Url: {rentry_url}\nEdit code: {edit_code}", disable_web_page_preview=True, ) await message.edit_text( - f"Output: {rentry_url}\nNote: Edit Code has been sent to your saved messages", + f'Output: {rentry_url}\nNote: Edit Code has been sent to your saved messages', disable_web_page_preview=True, ) except Exception as e: - await message.edit_text(f"An error occurred: {format_exc(e)}") + await message.edit_text(f'An error occurred: {format_exc(e)}') -modules_help["cohere"] = { - "cohere": "Chat with cohere ai" - + "\nSupports Chat History\n" - + "Supports real time internet search" +modules_help['cohere'] = { + 'cohere': 'Chat with cohere ai' + '\nSupports Chat History\n' + 'Supports real time internet search' } diff --git a/userbot/modules/demotivator.py b/userbot/modules/demotivator.py index 2fc6647..fbea5d2 100644 --- a/userbot/modules/demotivator.py +++ b/userbot/modules/demotivator.py @@ -1,93 +1,64 @@ import random from io import BytesIO -from pyrogram import Client, filters, enums +from pyrogram import Client, enums, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix from utils.scripts import import_library -requests = import_library("requests") -PIL = import_library("PIL", "pillow") +requests = import_library('requests') +PIL = import_library('PIL', 'pillow') from PIL import Image, ImageDraw, ImageFont -@Client.on_message(filters.command(["dem"], prefix) & filters.me) +@Client.on_message(filters.command(['dem'], prefix) & filters.me) async def demotivator(client: Client, message: Message): - await message.edit( - "Process of demotivation...", parse_mode=enums.ParseMode.HTML - ) - font = requests.get( - "https://github.com/The-MoonTg-project/files/blob/main/Times%20New%20Roman.ttf?raw=true" - ) + await message.edit('Process of demotivation...', parse_mode=enums.ParseMode.HTML) + font = requests.get('https://github.com/The-MoonTg-project/files/blob/main/Times%20New%20Roman.ttf?raw=true') f = font.content - template_dem = requests.get( - "https://raw.githubusercontent.com/files/main/demotivator.png" - ) + template_dem = requests.get('https://raw.githubusercontent.com/files/main/demotivator.png') if message.reply_to_message: - words = ["random", "text", "typing", "fuck"] + words = ['random', 'text', 'typing', 'fuck'] if message.reply_to_message.photo: - donwloads = await client.download_media( - message.reply_to_message.photo.file_id - ) - photo = Image.open(f"{donwloads}") + donwloads = await client.download_media(message.reply_to_message.photo.file_id) + photo = Image.open(f'{donwloads}') resize_photo = photo.resize((469, 312)) - text = ( - message.text.split(" ", maxsplit=1)[1] - if len(message.text.split()) > 1 - else random.choice(words) - ) + text = message.text.split(' ', maxsplit=1)[1] if len(message.text.split()) > 1 else random.choice(words) im = Image.open(BytesIO(template_dem.content)) im.paste(resize_photo, (65, 48)) text_font = ImageFont.truetype(BytesIO(f), 22) text_draw = ImageDraw.Draw(im) - text_draw.multiline_text( - (299, 412), text, font=text_font, fill=(255, 255, 255), anchor="ms" - ) - im.save(f"downloads/{message.id}.png") - await message.reply_to_message.reply_photo(f"downloads/{message.id}.png") + text_draw.multiline_text((299, 412), text, font=text_font, fill=(255, 255, 255), anchor='ms') + im.save(f'downloads/{message.id}.png') + await message.reply_to_message.reply_photo(f'downloads/{message.id}.png') await message.delete() elif message.reply_to_message.sticker: if not message.reply_to_message.sticker.is_animated: - donwloads = await client.download_media( - message.reply_to_message.sticker.file_id - ) - photo = Image.open(f"{donwloads}") + donwloads = await client.download_media(message.reply_to_message.sticker.file_id) + photo = Image.open(f'{donwloads}') resize_photo = photo.resize((469, 312)) - text = ( - message.text.split(" ", maxsplit=1)[1] - if len(message.text.split()) > 1 - else random.choice(words) - ) + text = message.text.split(' ', maxsplit=1)[1] if len(message.text.split()) > 1 else random.choice(words) im = Image.open(BytesIO(template_dem.content)) im.paste(resize_photo, (65, 48)) text_font = ImageFont.truetype(BytesIO(f), 22) text_draw = ImageDraw.Draw(im) - text_draw.multiline_text( - (299, 412), text, font=text_font, fill=(255, 255, 255), anchor="ms" - ) - im.save(f"downloads/{message.id}.png") - await message.reply_to_message.reply_photo( - f"downloads/{message.id}.png" - ) + text_draw.multiline_text((299, 412), text, font=text_font, fill=(255, 255, 255), anchor='ms') + im.save(f'downloads/{message.id}.png') + await message.reply_to_message.reply_photo(f'downloads/{message.id}.png') await message.delete() else: await message.edit( - "Animated stickers are not supported", + 'Animated stickers are not supported', parse_mode=enums.ParseMode.HTML, ) else: await message.edit( - "Need to answer the photo/sticker", + 'Need to answer the photo/sticker', parse_mode=enums.ParseMode.HTML, ) else: - await message.edit( - "Need to answer the photo/sticker", parse_mode=enums.ParseMode.HTML - ) + await message.edit('Need to answer the photo/sticker', parse_mode=enums.ParseMode.HTML) -modules_help["demotivator"] = { - "dem [text]*": "Reply to the picture to make a demotivator out of it" -} +modules_help['demotivator'] = {'dem [text]*': 'Reply to the picture to make a demotivator out of it'} diff --git a/userbot/modules/destroy.py b/userbot/modules/destroy.py index 0765f86..d85e1e2 100644 --- a/userbot/modules/destroy.py +++ b/userbot/modules/destroy.py @@ -1,60 +1,54 @@ import os -from pyrogram import Client, filters, enums -from pyrogram.types import Message +from pyrogram import Client, enums, filters +from pyrogram.types import Message from utils.misc import modules_help, prefix from utils.scripts import import_library -lottie = import_library("lottie") +lottie = import_library('lottie') from lottie.exporters import exporters from lottie.importers import importers -@Client.on_message(filters.command("destroy", prefix) & filters.me) +@Client.on_message(filters.command('destroy', prefix) & filters.me) async def destroy_sticker(client: Client, message: Message): """Destroy animated stickers by modifying their animation properties""" try: reply = message.reply_to_message if not reply or not reply.sticker or not reply.sticker.is_animated: return await message.edit( - "**Please reply to an animated sticker!**", + '**Please reply to an animated sticker!**', parse_mode=enums.ParseMode.MARKDOWN, ) - edit_msg = await message.edit( - "**🔄 Destroying sticker...**", parse_mode=enums.ParseMode.MARKDOWN - ) + edit_msg = await message.edit('**🔄 Destroying sticker...**', parse_mode=enums.ParseMode.MARKDOWN) # Download sticker tgs_path = await reply.download() if not tgs_path or not os.path.exists(tgs_path): - return await edit_msg.edit( - "**❌ Download failed!**", parse_mode=enums.ParseMode.MARKDOWN - ) + return await edit_msg.edit('**❌ Download failed!**', parse_mode=enums.ParseMode.MARKDOWN) # Conversion process - json_path = "temp.json" - output_path = "MoonUB.tgs" + json_path = 'temp.json' + output_path = 'MoonUB.tgs' importer = importers.get_from_filename(tgs_path) if not importer: - return await edit_msg.edit( - "**❌ JSON conversion failed!**", parse_mode=enums.ParseMode.MARKDOWN - ) + return await edit_msg.edit('**❌ JSON conversion failed!**', parse_mode=enums.ParseMode.MARKDOWN) animation = importer.process(tgs_path) exporter = exporters.get_from_filename(json_path) exporter.process(animation, json_path) # Modify JSON data - with open(json_path, "r+") as f: + with open(json_path, 'r+') as f: content = f.read() modified = ( - content.replace("[1]", "[2]") - .replace("[2]", "[3]") - .replace("[3]", "[4]") - .replace("[4]", "[5]") - .replace("[5]", "[6]") + content.replace('[1]', '[2]') + .replace('[2]', '[3]') + .replace('[3]', '[4]') + .replace('[4]', '[5]') + .replace('[5]', '[6]') ) f.seek(0) f.write(modified) @@ -70,7 +64,7 @@ async def destroy_sticker(client: Client, message: Message): await edit_msg.delete() except Exception as e: - await message.edit(f"**❌ Error:** `{e}`", parse_mode=enums.ParseMode.MARKDOWN) + await message.edit(f'**❌ Error:** `{e}`', parse_mode=enums.ParseMode.MARKDOWN) finally: # Cleanup temporary files for file_path in [tgs_path, json_path, output_path]: @@ -78,7 +72,7 @@ async def destroy_sticker(client: Client, message: Message): try: os.remove(file_path) except Exception as clean_error: - print(f"Cleanup error: {clean_error}") + print(f'Cleanup error: {clean_error}') -modules_help["destroy"] = {"destroy [reply]": "Modify and destroy animated stickers"} +modules_help['destroy'] = {'destroy [reply]': 'Modify and destroy animated stickers'} diff --git a/userbot/modules/dice.py b/userbot/modules/dice.py index 472d038..44bebf7 100644 --- a/userbot/modules/dice.py +++ b/userbot/modules/dice.py @@ -1,33 +1,26 @@ -from pyrogram import Client, filters, enums +import asyncio + +from pyrogram import Client, enums, filters from pyrogram.types import Message from utils.misc import modules_help, prefix from utils.scripts import format_exc -import asyncio -@Client.on_message(filters.command("dice", prefix) & filters.me) +@Client.on_message(filters.command('dice', prefix) & filters.me) async def dice_text(client: Client, message: Message): try: value = int(message.command[1]) if value not in range(1, 7): raise AssertionError except (ValueError, IndexError, AssertionError): - return await message.edit( - "Invalid value", parse_mode=enums.ParseMode.HTML - ) + return await message.edit('Invalid value', parse_mode=enums.ParseMode.HTML) try: - message.dice = type("bruh", (), {"value": 0})() + message.dice = type('bruh', (), {'value': 0})() while message.dice.value != value: - message = ( - await asyncio.gather( - message.delete(), client.send_dice(message.chat.id) - ) - )[1] + message = (await asyncio.gather(message.delete(), client.send_dice(message.chat.id)))[1] except Exception as e: await message.edit(format_exc(e), parse_mode=enums.ParseMode.HTML) -modules_help["dice"] = { - "dice [1-6]*": "Generate dice with specified value. Works only in groups" -} +modules_help['dice'] = {'dice [1-6]*': 'Generate dice with specified value. Works only in groups'} diff --git a/userbot/modules/direct.py b/userbot/modules/direct.py index 4f9b75f..aca8a95 100644 --- a/userbot/modules/direct.py +++ b/userbot/modules/direct.py @@ -3,7 +3,7 @@ # Licensed under the Raphielscape Public License, Version 1.d (the "License"); # you may not use this file except in compliance with the License. # -""" Userbot module containing various sites direct links generators""" +"""Userbot module containing various sites direct links generators""" import json import re @@ -14,139 +14,135 @@ from subprocess import PIPE, Popen import requests from bs4 import BeautifulSoup from humanize import naturalsize - from pyrogram import Client, enums, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix def subprocess_run(cmd): - reply = "" + reply = '' cmd_args = cmd.split() subproc = Popen( cmd_args, stdout=PIPE, stderr=PIPE, universal_newlines=True, - executable="bash", + executable='bash', ) talk = subproc.communicate() exitCode = subproc.returncode if exitCode != 0: reply += ( - "```An error was detected while running the subprocess:\n" - f"exit code: {exitCode}\n" - f"stdout: {talk[0]}\n" - f"stderr: {talk[1]}```" + '```An error was detected while running the subprocess:\n' + f'exit code: {exitCode}\n' + f'stdout: {talk[0]}\n' + f'stderr: {talk[1]}```' ) return reply return talk -@Client.on_message(filters.command("direct", prefix) & filters.me) +@Client.on_message(filters.command('direct', prefix) & filters.me) async def direct_link_generator(_, m: Message): if len(m.command) > 1: message = m.text.split(maxsplit=1)[1] elif m.reply_to_message: message = m.reply_to_message.text else: - await m.edit(f"Usage: {prefix}direct [url]") + await m.edit(f'Usage: {prefix}direct [url]') return - reply = "" - links = re.findall(r"\bhttps?://.*\.\S+", message) + reply = '' + links = re.findall(r'\bhttps?://.*\.\S+', message) if not links: - reply = "`No links found!`" + reply = '`No links found!`' await m.edit(reply, parse_mode=enums.ParseMode.MARKDOWN) for link in links: - if "drive.google.com" in link: + if 'drive.google.com' in link: reply += gdrive(link) - elif "yadi.sk" in link: + elif 'yadi.sk' in link: reply += yandex_disk(link) - elif "cloud.mail.ru" in link: + elif 'cloud.mail.ru' in link: reply += cm_ru(link) - elif "mediafire.com" in link: + elif 'mediafire.com' in link: reply += mediafire(link) - elif "sourceforge.net" in link: + elif 'sourceforge.net' in link: reply += sourceforge(link) - elif "osdn.net" in link: + elif 'osdn.net' in link: reply += osdn(link) - elif "androidfilehost.com" in link: + elif 'androidfilehost.com' in link: reply += androidfilehost(link) else: - reply += re.findall(r"\bhttps?://(.*?[^/]+)", link)[0] + " is not supported" + reply += re.findall(r'\bhttps?://(.*?[^/]+)', link)[0] + ' is not supported' await m.edit(reply, parse_mode=enums.ParseMode.MARKDOWN) def gdrive(url: str) -> str: """GDrive direct links generator""" - drive = "https://drive.google.com" + drive = 'https://drive.google.com' try: - link = re.findall(r"\bhttps?://drive\.google\.com\S+", url)[0] + link = re.findall(r'\bhttps?://drive\.google\.com\S+', url)[0] except IndexError: - reply = "`No Google drive links found`\n" + reply = '`No Google drive links found`\n' return reply - file_id = "" - reply = "" - if link.find("view") != -1: - file_id = link.split("/")[-2] - elif link.find("open?id=") != -1: - file_id = link.split("open?id=")[1].strip() - elif link.find("uc?id=") != -1: - file_id = link.split("uc?id=")[1].strip() - url = f"{drive}/uc?export=download&id={file_id}" + file_id = '' + reply = '' + if link.find('view') != -1: + file_id = link.split('/')[-2] + elif link.find('open?id=') != -1: + file_id = link.split('open?id=')[1].strip() + elif link.find('uc?id=') != -1: + file_id = link.split('uc?id=')[1].strip() + url = f'{drive}/uc?export=download&id={file_id}' download = requests.get(url, stream=True, allow_redirects=False) cookies = download.cookies try: # In case of small file size, Google downloads directly - dl_url = download.headers["location"] - page = BeautifulSoup(download.content, "html.parser") - if "accounts.google.com" in dl_url: # non-public file - reply += "`Link is not public!`\n" + dl_url = download.headers['location'] + page = BeautifulSoup(download.content, 'html.parser') + if 'accounts.google.com' in dl_url: # non-public file + reply += '`Link is not public!`\n' return reply - name = "Direct Download Link" + name = 'Direct Download Link' except KeyError: # In case of download warning page - page = BeautifulSoup(download.content, "html.parser") + page = BeautifulSoup(download.content, 'html.parser') if download.headers is not None: - dl_url = download.headers.get("location") - page_element = page.find("a", {"id": "uc-download-link"}) + dl_url = download.headers.get('location') + page_element = page.find('a', {'id': 'uc-download-link'}) if page_element is not None: - export = drive + page_element.get("href") - name = page.find("span", {"class": "uc-name-size"}).text - response = requests.get( - export, stream=True, allow_redirects=False, cookies=cookies - ) - dl_url = response.headers["location"] - if "accounts.google.com" in dl_url: - name = page.find("span", {"class": "uc-name-size"}).text - reply += "Link is not public!" + export = drive + page_element.get('href') + name = page.find('span', {'class': 'uc-name-size'}).text + response = requests.get(export, stream=True, allow_redirects=False, cookies=cookies) + dl_url = response.headers['location'] + if 'accounts.google.com' in dl_url: + name = page.find('span', {'class': 'uc-name-size'}).text + reply += 'Link is not public!' return reply - if "=sharing" in dl_url: - name = page.find("span", {"class": "uc-name-size"}).text - reply += "```Provide GDrive Link not directc sharing of GDrive!```" + if '=sharing' in dl_url: + name = page.find('span', {'class': 'uc-name-size'}).text + reply += '```Provide GDrive Link not directc sharing of GDrive!```' return reply - reply += f"[{name}]({dl_url})\n" + reply += f'[{name}]({dl_url})\n' return reply def yandex_disk(url: str) -> str: """Yandex.Disk direct links generator Based on https://github.com/wldhx/yadisk-direct""" - reply = "" + reply = '' try: - link = re.findall(r"\bhttps?://.*yadi\.sk\S+", url)[0] + link = re.findall(r'\bhttps?://.*yadi\.sk\S+', url)[0] except IndexError: - reply = "`No Yandex.Disk links found`\n" + reply = '`No Yandex.Disk links found`\n' return reply - api = "https://cloud-api.yandex.net/v1/disk/public/resources/download?public_key={}" + api = 'https://cloud-api.yandex.net/v1/disk/public/resources/download?public_key={}' try: - dl_url = requests.get(api.format(link)).json()["href"] - name = dl_url.split("filename=")[1].split("&disposition")[0] - reply += f"[{name}]({dl_url})\n" + dl_url = requests.get(api.format(link)).json()['href'] + name = dl_url.split('filename=')[1].split('&disposition')[0] + reply += f'[{name}]({dl_url})\n' except KeyError: - reply += "`Error: File not found / Download limit reached`\n" + reply += '`Error: File not found / Download limit reached`\n' return reply return reply @@ -154,13 +150,13 @@ def yandex_disk(url: str) -> str: def cm_ru(url: str) -> str: """cloud.mail.ru direct links generator Using https://github.com/JrMasterModelBuilder/cmrudl.py""" - reply = "" + reply = '' try: - link = re.findall(r"\bhttps?://.*cloud\.mail\.ru\S+", url)[0] + link = re.findall(r'\bhttps?://.*cloud\.mail\.ru\S+', url)[0] except IndexError: - reply = "`No cloud.mail.ru links found`\n" + reply = '`No cloud.mail.ru links found`\n' return reply - cmd = f"bin/cmrudl -s {link}" + cmd = f'bin/cmrudl -s {link}' result = subprocess_run(cmd) try: result = result[0].splitlines()[-1] @@ -170,121 +166,116 @@ def cm_ru(url: str) -> str: return reply except IndexError: return reply - dl_url = data["download"] - name = data["file_name"] - size = naturalsize(int(data["file_size"])) - reply += f"[{name} ({size})]({dl_url})\n" + dl_url = data['download'] + name = data['file_name'] + size = naturalsize(int(data['file_size'])) + reply += f'[{name} ({size})]({dl_url})\n' return reply def mediafire(url: str) -> str: """MediaFire direct links generator""" try: - link = re.findall(r"\bhttps?://.*mediafire\.com\S+", url)[0] + link = re.findall(r'\bhttps?://.*mediafire\.com\S+', url)[0] except IndexError: - reply = "`No MediaFire links found`\n" + reply = '`No MediaFire links found`\n' return reply - reply = "" - page = BeautifulSoup(requests.get(link).content, "lxml") - info = page.find("a", {"aria-label": "Download file"}) - dl_url = info.get("href") - size = re.findall(r"\(.*\)", info.text)[0] - name = page.find("div", {"class": "filename"}).text - reply += f"[{name} {size}]({dl_url})\n" + reply = '' + page = BeautifulSoup(requests.get(link).content, 'lxml') + info = page.find('a', {'aria-label': 'Download file'}) + dl_url = info.get('href') + size = re.findall(r'\(.*\)', info.text)[0] + name = page.find('div', {'class': 'filename'}).text + reply += f'[{name} {size}]({dl_url})\n' return reply def sourceforge(url: str) -> str: """SourceForge direct links generator""" try: - link = re.findall(r"\bhttps?://.*sourceforge\.net\S+", url)[0] + link = re.findall(r'\bhttps?://.*sourceforge\.net\S+', url)[0] except IndexError: - reply = "`No SourceForge links found`\n" + reply = '`No SourceForge links found`\n' return reply - file_path = re.findall(r"files(.*)/download", link)[0] - reply = f"Mirrors for __{file_path.split('/')[-1]}__\n" - project = re.findall(r"projects?/(.*?)/files", link)[0] - mirrors = ( - f"https://sourceforge.net/settings/mirror_choices?" - f"projectname={project}&filename={file_path}" - ) - page = BeautifulSoup(requests.get(mirrors).content, "html.parser") - info = page.find("ul", {"id": "mirrorList"}).findAll("li") + file_path = re.findall(r'files(.*)/download', link)[0] + reply = f'Mirrors for __{file_path.split("/")[-1]}__\n' + project = re.findall(r'projects?/(.*?)/files', link)[0] + mirrors = f'https://sourceforge.net/settings/mirror_choices?projectname={project}&filename={file_path}' + page = BeautifulSoup(requests.get(mirrors).content, 'html.parser') + info = page.find('ul', {'id': 'mirrorList'}).findAll('li') for mirror in info[1:]: - name = re.findall(r"\((.*)\)", mirror.text.strip())[0] - dl_url = ( - f'https://{mirror["id"]}.dl.sourceforge.net/project/{project}/{file_path}' - ) - reply += f"[{name}]({dl_url}) " + name = re.findall(r'\((.*)\)', mirror.text.strip())[0] + dl_url = f'https://{mirror["id"]}.dl.sourceforge.net/project/{project}/{file_path}' + reply += f'[{name}]({dl_url}) ' return reply def osdn(url: str) -> str: """OSDN direct links generator""" - osdn_link = "https://osdn.net" + osdn_link = 'https://osdn.net' try: - link = re.findall(r"\bhttps?://.*osdn\.net\S+", url)[0] + link = re.findall(r'\bhttps?://.*osdn\.net\S+', url)[0] except IndexError: - reply = "`No OSDN links found`\n" + reply = '`No OSDN links found`\n' return reply - page = BeautifulSoup(requests.get(link, allow_redirects=True).content, "lxml") - info = page.find("a", {"class": "mirror_link"}) - link = urllib.parse.unquote(osdn_link + info["href"]) - reply = f"Mirrors for __{link.split('/')[-1]}__\n" - mirrors = page.find("form", {"id": "mirror-select-form"}).findAll("tr") + page = BeautifulSoup(requests.get(link, allow_redirects=True).content, 'lxml') + info = page.find('a', {'class': 'mirror_link'}) + link = urllib.parse.unquote(osdn_link + info['href']) + reply = f'Mirrors for __{link.split("/")[-1]}__\n' + mirrors = page.find('form', {'id': 'mirror-select-form'}).findAll('tr') for data in mirrors[1:]: - mirror = data.find("input")["value"] - name = re.findall(r"\((.*)\)", data.findAll("td")[-1].text.strip())[0] - dl_url = re.sub(r"m=(.*)&f", f"m={mirror}&f", link) - reply += f"[{name}]({dl_url}) " + mirror = data.find('input')['value'] + name = re.findall(r'\((.*)\)', data.findAll('td')[-1].text.strip())[0] + dl_url = re.sub(r'm=(.*)&f', f'm={mirror}&f', link) + reply += f'[{name}]({dl_url}) ' return reply def androidfilehost(url: str) -> str: """AFH direct links generator""" try: - link = re.findall(r"\bhttps?://.*androidfilehost.*fid.*\S+", url)[0] + link = re.findall(r'\bhttps?://.*androidfilehost.*fid.*\S+', url)[0] except IndexError: - reply = "`No AFH links found`\n" + reply = '`No AFH links found`\n' return reply - fid = re.findall(r"\?fid=(.*)", link)[0] + fid = re.findall(r'\?fid=(.*)', link)[0] session = requests.Session() user_agent = useragent() - headers = {"user-agent": user_agent} + headers = {'user-agent': user_agent} res = session.get(link, headers=headers, allow_redirects=True) headers = { - "origin": "https://androidfilehost.com", - "accept-encoding": "gzip, deflate, br", - "accept-language": "en-US,en;q=0.9", - "user-agent": user_agent, - "content-type": "application/x-www-form-urlencoded; charset=UTF-8", - "x-mod-sbb-ctype": "xhr", - "accept": "*/*", - "referer": f"https://androidfilehost.com/?fid={fid}", - "authority": "androidfilehost.com", - "x-requested-with": "XMLHttpRequest", + 'origin': 'https://androidfilehost.com', + 'accept-encoding': 'gzip, deflate, br', + 'accept-language': 'en-US,en;q=0.9', + 'user-agent': user_agent, + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + 'x-mod-sbb-ctype': 'xhr', + 'accept': '*/*', + 'referer': f'https://androidfilehost.com/?fid={fid}', + 'authority': 'androidfilehost.com', + 'x-requested-with': 'XMLHttpRequest', } - data = {"submit": "submit", "action": "getdownloadmirrors", "fid": f"{fid}"} + data = {'submit': 'submit', 'action': 'getdownloadmirrors', 'fid': f'{fid}'} mirrors = None - reply = "" + reply = '' error = "`Error: Can't find Mirrors for the link`\n" try: req = session.post( - "https://androidfilehost.com/libs/otf/mirrors.otf.php", + 'https://androidfilehost.com/libs/otf/mirrors.otf.php', headers=headers, data=data, cookies=res.cookies, ) - mirrors = req.json()["MIRRORS"] + mirrors = req.json()['MIRRORS'] except (json.decoder.JSONDecodeError, TypeError): reply += error if not mirrors: reply += error return reply for item in mirrors: - name = item["name"] - dl_url = item["url"] - reply += f"[{name}]({dl_url}) " + name = item['name'] + dl_url = item['url'] + reply += f'[{name}]({dl_url}) ' return reply @@ -294,20 +285,19 @@ def useragent(): """ useragents = BeautifulSoup( requests.get( - "https://developers.whatismybrowser.com/" - "useragents/explore/operating_system_name/android/" + 'https://developers.whatismybrowser.com/useragents/explore/operating_system_name/android/' ).content, - "lxml", - ).findAll("td", {"class": "useragent"}) + 'lxml', + ).findAll('td', {'class': 'useragent'}) if not useragents: - return "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3" + return 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3' user_agent = choice(useragents) return user_agent.text -modules_help["direct"] = { - "direct": "Url/reply to Url\ +modules_help['direct'] = { + 'direct': 'Url/reply to Url\ \n\nSyntax : .direct [url/reply] \ \nUsage : Generates direct download link from supported URL(s)\ -\n\nSupported websites : Google Drive - MEGA.nz - Cloud Mail - Yandex.Disk - AFH - MediaFire - SourceForge - OSDN" +\n\nSupported websites : Google Drive - MEGA.nz - Cloud Mail - Yandex.Disk - AFH - MediaFire - SourceForge - OSDN' } diff --git a/userbot/modules/duckduckgo.py b/userbot/modules/duckduckgo.py index 257b322..1308dfc 100644 --- a/userbot/modules/duckduckgo.py +++ b/userbot/modules/duckduckgo.py @@ -1,16 +1,14 @@ -from pyrogram import Client, filters -from pyrogram.types import Message -from utils.misc import modules_help, requirements_list, prefix - - -@Client.on_message(filters.command("duck", prefix) & filters.me) -async def duckgo(client: Client, message: Message): - input_str = " ".join(message.command[1:]) - sample_url = "https://duckduckgo.com/?q={}".format(input_str.replace(" ", "+")) - if sample_url: - link = sample_url.rstrip() - await message.edit_text( - "Let me 🦆 DuckDuckGo that for you:\n🔎 [{}]({})".format(input_str, link) - ) - else: - await message.edit_text("something is wrong. please try again later.") +from pyrogram import Client, filters +from pyrogram.types import Message +from utils.misc import prefix + + +@Client.on_message(filters.command('duck', prefix) & filters.me) +async def duckgo(client: Client, message: Message): + input_str = ' '.join(message.command[1:]) + sample_url = 'https://duckduckgo.com/?q={}'.format(input_str.replace(' ', '+')) + if sample_url: + link = sample_url.rstrip() + await message.edit_text(f'Let me 🦆 DuckDuckGo that for you:\n🔎 [{input_str}]({link})') + else: + await message.edit_text('something is wrong. please try again later.') diff --git a/userbot/modules/durov.py b/userbot/modules/durov.py index e01d165..010709d 100644 --- a/userbot/modules/durov.py +++ b/userbot/modules/durov.py @@ -1,17 +1,16 @@ from random import randint -from pyrogram import Client, filters, enums +from pyrogram import Client, enums, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix -@Client.on_message(filters.command("durov", prefix) & filters.me) +@Client.on_message(filters.command('durov', prefix) & filters.me) async def durov(_, message: Message): await message.edit( - f"Random post from channel: https://t.me/durov/{randint(21, 36500)}", + f'Random post from channel: https://t.me/durov/{randint(21, 36500)}', parse_mode=enums.ParseMode.HTML, ) -modules_help["durov"] = {"durov": "Send random post from durov channel"} +modules_help['durov'] = {'durov': 'Send random post from durov channel'} diff --git a/userbot/modules/example.py b/userbot/modules/example.py index b4a1b65..ca3da04 100644 --- a/userbot/modules/example.py +++ b/userbot/modules/example.py @@ -16,7 +16,6 @@ from pyrogram import Client, enums, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix # if your module has packages from PyPi @@ -29,30 +28,26 @@ from utils.misc import modules_help, prefix # if it isn't installed -@Client.on_message(filters.command("example_edit", prefix) & filters.me) +@Client.on_message(filters.command('example_edit', prefix) & filters.me) async def example_edit(client: Client, message: Message): try: - await message.edit("This is an example module") + await message.edit('This is an example module') except Exception as e: - await message.edit( - f"[{e.error_code}: {enums.MessageType.TEXT}] - {e.error_details}" - ) + await message.edit(f'[{e.error_code}: {enums.MessageType.TEXT}] - {e.error_details}') -@Client.on_message(filters.command("example_send", prefix) & filters.me) +@Client.on_message(filters.command('example_send', prefix) & filters.me) async def example_send(client: Client, message: Message): try: - await client.send_message(message.chat.id, "This is an example module") + await client.send_message(message.chat.id, 'This is an example module') except Exception as e: - await message.edit( - f"[{e.error_code}: {enums.MessageType.TEXT}] - {e.error_details}" - ) + await message.edit(f'[{e.error_code}: {enums.MessageType.TEXT}] - {e.error_details}') # This adds instructions for your module -modules_help["example"] = { - "example_send": "example send", - "example_edit": "example edit", +modules_help['example'] = { + 'example_send': 'example send', + 'example_edit': 'example edit', } # modules_help["example"] = { "example_send [text]": "example send" } diff --git a/userbot/modules/f.py b/userbot/modules/f.py index 40ea2eb..61ef22f 100644 --- a/userbot/modules/f.py +++ b/userbot/modules/f.py @@ -4,55 +4,49 @@ from random import randint import aiohttp from pyrogram import Client, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix async def download_sticker(url, filename): headers = { - "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", - "accept-language": "en-US,en;q=0.9;q=0.8", - "cache-control": "no-cache", - "dnt": "1", - "pragma": "no-cache", - "priority": "u=0, i", - "sec-ch-ua": '"Not)A;Brand";v="8", "Chromium";v="138", "Microsoft Edge";v="138"', - "sec-ch-ua-mobile": "?0", - "sec-ch-ua-platform": '"Windows"', - "sec-fetch-dest": "document", - "sec-fetch-mode": "navigate", - "sec-fetch-site": "none", - "sec-fetch-user": "?1", - "upgrade-insecure-requests": "1", - "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0", + 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', + 'accept-language': 'en-US,en;q=0.9;q=0.8', + 'cache-control': 'no-cache', + 'dnt': '1', + 'pragma': 'no-cache', + 'priority': 'u=0, i', + 'sec-ch-ua': '"Not)A;Brand";v="8", "Chromium";v="138", "Microsoft Edge";v="138"', + 'sec-ch-ua-mobile': '?0', + 'sec-ch-ua-platform': '"Windows"', + 'sec-fetch-dest': 'document', + 'sec-fetch-mode': 'navigate', + 'sec-fetch-site': 'none', + 'sec-fetch-user': '?1', + 'upgrade-insecure-requests': '1', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0', } - cookies = {"country": "US", "lang": "en"} + cookies = {'country': 'US', 'lang': 'en'} - async with aiohttp.ClientSession() as session: - async with session.get(url, headers=headers, cookies=cookies) as response: - if response.status == 200: - with open(filename, "wb") as f: - f.write(await response.read()) + async with aiohttp.ClientSession() as session, session.get(url, headers=headers, cookies=cookies) as response: + if response.status == 200: + with open(filename, 'wb') as f: + f.write(await response.read()) -@Client.on_message(filters.command(["f"], prefix) & filters.me) +@Client.on_message(filters.command(['f'], prefix) & filters.me) async def random_stiker(client: Client, message: Message): await message.delete() random = randint(1, 63) - index = f"00{random}" if random < 10 else f"0{random}" - sticker = ( - f"https://www.chpic.su/_data/stickers/f/FforRespect/FforRespect_{index}.webp" - ) - await download_sticker(sticker, "f.webp") - if os.path.exists("f.webp"): + index = f'00{random}' if random < 10 else f'0{random}' + sticker = f'https://www.chpic.su/_data/stickers/f/FforRespect/FforRespect_{index}.webp' + await download_sticker(sticker, 'f.webp') + if os.path.exists('f.webp'): await client.send_document( message.chat.id, - "f.webp", - reply_to_message_id=message.reply_to_message.id - if message.reply_to_message - else None, + 'f.webp', + reply_to_message_id=message.reply_to_message.id if message.reply_to_message else None, ) - os.remove("f.webp") + os.remove('f.webp') -modules_help["f"] = {"f": "Send f to pay respect"} +modules_help['f'] = {'f': 'Send f to pay respect'} diff --git a/userbot/modules/fakeactions.py b/userbot/modules/fakeactions.py index 71c1ba8..dade85c 100644 --- a/userbot/modules/fakeactions.py +++ b/userbot/modules/fakeactions.py @@ -1,26 +1,26 @@ from asyncio import sleep -from pyrogram import Client, filters, enums +from pyrogram import Client, enums, filters from pyrogram.raw import functions -from pyrogram.types import Message, InputReplyToMessage +from pyrogram.types import InputReplyToMessage, Message from utils.misc import modules_help, prefix from utils.scripts import format_exc commands = { - "ftype": enums.ChatAction.TYPING, - "faudio": enums.ChatAction.UPLOAD_AUDIO, - "fvideo": enums.ChatAction.UPLOAD_VIDEO, - "fphoto": enums.ChatAction.UPLOAD_PHOTO, - "fdocument": enums.ChatAction.UPLOAD_DOCUMENT, - "flocation": enums.ChatAction.FIND_LOCATION, - "frvideo": enums.ChatAction.RECORD_VIDEO, - "frvoice": enums.ChatAction.RECORD_AUDIO, - "frvideor": enums.ChatAction.RECORD_VIDEO_NOTE, - "fvideor": enums.ChatAction.UPLOAD_VIDEO_NOTE, - "fgame": enums.ChatAction.PLAYING, - "fcontact": enums.ChatAction.CHOOSE_CONTACT, - "fstop": enums.ChatAction.CANCEL, - "fscrn": "screenshot", + 'ftype': enums.ChatAction.TYPING, + 'faudio': enums.ChatAction.UPLOAD_AUDIO, + 'fvideo': enums.ChatAction.UPLOAD_VIDEO, + 'fphoto': enums.ChatAction.UPLOAD_PHOTO, + 'fdocument': enums.ChatAction.UPLOAD_DOCUMENT, + 'flocation': enums.ChatAction.FIND_LOCATION, + 'frvideo': enums.ChatAction.RECORD_VIDEO, + 'frvoice': enums.ChatAction.RECORD_AUDIO, + 'frvideor': enums.ChatAction.RECORD_VIDEO_NOTE, + 'fvideor': enums.ChatAction.UPLOAD_VIDEO_NOTE, + 'fgame': enums.ChatAction.PLAYING, + 'fcontact': enums.ChatAction.CHOOSE_CONTACT, + 'fstop': enums.ChatAction.CANCEL, + 'fscrn': 'screenshot', } @@ -39,12 +39,10 @@ async def fakeactions_handler(client: Client, message: Message): action = commands[cmd] try: - if action != "screenshot": + if action != 'screenshot': if sec and action != enums.ChatAction.CANCEL: while sec > 0: - await client.send_chat_action( - chat_id=message.chat.id, action=action - ) + await client.send_chat_action(chat_id=message.chat.id, action=action) await sleep(1) sec -= 1 return await client.send_chat_action(chat_id=message.chat.id, action=action) @@ -53,36 +51,30 @@ async def fakeactions_handler(client: Client, message: Message): await client.invoke( functions.messages.SendScreenshotNotification( peer=await client.resolve_peer(message.chat.id), - reply_to=InputReplyToMessage( - reply_to_message_id=message.reply_to_message.id - ), + reply_to=InputReplyToMessage(reply_to_message_id=message.reply_to_message.id), random_id=client.rnd_id(), ) ) await sleep(0.1) except AttributeError: - return await client.send_message( - "me", f"Error in fakeactions" "reply to message is required" - ) + return await client.send_message('me', 'Error in fakeactionsreply to message is required') except Exception as e: - return await client.send_message( - "me", f"Error in fakeactions" f" module:\n" + format_exc(e) - ) + return await client.send_message('me', 'Error in fakeactions module:\n' + format_exc(e)) -modules_help["fakeactions"] = { - "ftype [sec]": "Typing... action", - "faudio [sec]": "Sending voice... action", - "fvideo [sec]": "Sending video... action", - "fphoto [sec]": "Sending photo... action", - "fdocument [sec]": "Sending document... action", - "flocation [sec]": "Find location... action", - "fcontact [sec]": "Sending contact... action", - "frvideo [sec]": "Recording video... action", - "frvoice [sec]": "Recording voice... action", - "frvideor [sec]": "Recording round video... action", - "fvideor [sec]": "Uploading round video... action", - "fgame [sec]": "Playing game... action", - "fstop": "Stop actions", - "fscrn [amount] [reply_to_message]*": "Make screenshot action", +modules_help['fakeactions'] = { + 'ftype [sec]': 'Typing... action', + 'faudio [sec]': 'Sending voice... action', + 'fvideo [sec]': 'Sending video... action', + 'fphoto [sec]': 'Sending photo... action', + 'fdocument [sec]': 'Sending document... action', + 'flocation [sec]': 'Find location... action', + 'fcontact [sec]': 'Sending contact... action', + 'frvideo [sec]': 'Recording video... action', + 'frvoice [sec]': 'Recording voice... action', + 'frvideor [sec]': 'Recording round video... action', + 'fvideor [sec]': 'Uploading round video... action', + 'fgame [sec]': 'Playing game... action', + 'fstop': 'Stop actions', + 'fscrn [amount] [reply_to_message]*': 'Make screenshot action', } diff --git a/userbot/modules/filters.py b/userbot/modules/filters.py index b1f66eb..95e68a7 100644 --- a/userbot/modules/filters.py +++ b/userbot/modules/filters.py @@ -22,18 +22,17 @@ from pyrogram.types import ( InputMediaVideo, Message, ) - from utils.db import db from utils.misc import modules_help, prefix from utils.scripts import format_exc def get_filters_chat(chat_id): - return db.get("core.filters", f"{chat_id}", {}) + return db.get('core.filters', f'{chat_id}', {}) def set_filters_chat(chat_id, filters_): - return db.set("core.filters", f"{chat_id}", filters_) + return db.set('core.filters', f'{chat_id}', filters_) async def contains_filter(_, __, m): @@ -48,21 +47,17 @@ contains = filters.create(contains_filter) async def filters_main_handler(client: Client, message: Message): value = get_filters_chat(message.chat.id)[message.text.lower()] try: - await client.get_messages(int(value["CHAT_ID"]), int(value["MESSAGE_ID"])) + await client.get_messages(int(value['CHAT_ID']), int(value['MESSAGE_ID'])) except errors.RPCError as exc: raise ContinuePropagation from exc - if value.get("MEDIA_GROUP"): - messages_grouped = await client.get_media_group( - int(value["CHAT_ID"]), int(value["MESSAGE_ID"]) - ) + if value.get('MEDIA_GROUP'): + messages_grouped = await client.get_media_group(int(value['CHAT_ID']), int(value['MESSAGE_ID'])) media_grouped_list = [] for _ in messages_grouped: if _.photo: if _.caption: - media_grouped_list.append( - InputMediaPhoto(_.photo.file_id, _.caption.HTML) - ) + media_grouped_list.append(InputMediaPhoto(_.photo.file_id, _.caption.HTML)) else: media_grouped_list.append(InputMediaPhoto(_.photo.file_id)) elif _.video: @@ -76,20 +71,14 @@ async def filters_main_handler(client: Client, message: Message): ) ) else: - media_grouped_list.append( - InputMediaVideo(_.video.file_id, _.caption.HTML) - ) + media_grouped_list.append(InputMediaVideo(_.video.file_id, _.caption.HTML)) elif _.video.thumbs: - media_grouped_list.append( - InputMediaVideo(_.video.file_id, _.video.thumbs[0].file_id) - ) + media_grouped_list.append(InputMediaVideo(_.video.file_id, _.video.thumbs[0].file_id)) else: media_grouped_list.append(InputMediaVideo(_.video.file_id)) elif _.audio: if _.caption: - media_grouped_list.append( - InputMediaAudio(_.audio.file_id, _.caption.HTML) - ) + media_grouped_list.append(InputMediaAudio(_.audio.file_id, _.caption.HTML)) else: media_grouped_list.append(InputMediaAudio(_.audio.file_id)) elif _.document: @@ -103,77 +92,54 @@ async def filters_main_handler(client: Client, message: Message): ) ) else: - media_grouped_list.append( - InputMediaDocument(_.document.file_id, _.caption.HTML) - ) + media_grouped_list.append(InputMediaDocument(_.document.file_id, _.caption.HTML)) elif _.document.thumbs: - media_grouped_list.append( - InputMediaDocument( - _.document.file_id, _.document.thumbs[0].file_id - ) - ) + media_grouped_list.append(InputMediaDocument(_.document.file_id, _.document.thumbs[0].file_id)) else: media_grouped_list.append(InputMediaDocument(_.document.file_id)) - await client.send_media_group( - message.chat.id, media_grouped_list, reply_to_message_id=message.id - ) + await client.send_media_group(message.chat.id, media_grouped_list, reply_to_message_id=message.id) else: await client.copy_message( message.chat.id, - int(value["CHAT_ID"]), - int(value["MESSAGE_ID"]), + int(value['CHAT_ID']), + int(value['MESSAGE_ID']), reply_to_message_id=message.id, ) raise ContinuePropagation -@Client.on_message(filters.command(["filter"], prefix) & filters.me) +@Client.on_message(filters.command(['filter'], prefix) & filters.me) async def filter_handler(client: Client, message: Message): try: if len(message.text.split()) < 2: - return await message.edit( - f"Usage: {prefix}filter [name] (Reply required)" - ) + return await message.edit(f'Usage: {prefix}filter [name] (Reply required)') name = message.text.split(maxsplit=1)[1].lower() chat_filters = get_filters_chat(message.chat.id) if name in chat_filters.keys(): - return await message.edit( - f"Filter {name} already exists." - ) + return await message.edit(f'Filter {name} already exists.') if not message.reply_to_message: - return await message.edit("Reply to message please.") + return await message.edit('Reply to message please.') try: - chat = await client.get_chat(db.get("core.notes", "chat_id", 0)) + chat = await client.get_chat(db.get('core.notes', 'chat_id', 0)) except (errors.RPCError, ValueError, KeyError): # group is not accessible or isn't created - chat = await client.create_supergroup( - "Userbot_Notes_Filters", "Don't touch this group, please" - ) - db.set("core.notes", "chat_id", chat.id) + chat = await client.create_supergroup('Userbot_Notes_Filters', "Don't touch this group, please") + db.set('core.notes', 'chat_id', chat.id) chat_id = chat.id if message.reply_to_message.media_group_id: - get_media_group = [ - _.id - for _ in await client.get_media_group( - message.chat.id, message.reply_to_message.id - ) - ] + get_media_group = [_.id for _ in await client.get_media_group(message.chat.id, message.reply_to_message.id)] try: - message_id = await client.forward_messages( - chat_id, message.chat.id, get_media_group - ) + message_id = await client.forward_messages(chat_id, message.chat.id, get_media_group) except errors.ChatForwardsRestricted: - await message.edit( - "Forwarding messages is restricted by chat admins" - ) + await message.edit('Forwarding messages is restricted by chat admins') return filter_ = { - "MESSAGE_ID": str(message_id[1].id), - "MEDIA_GROUP": True, - "CHAT_ID": str(chat_id), + 'MESSAGE_ID': str(message_id[1].id), + 'MEDIA_GROUP': True, + 'CHAT_ID': str(chat_id), } else: try: @@ -181,44 +147,42 @@ async def filter_handler(client: Client, message: Message): except errors.ChatForwardsRestricted: message_id = await message.copy(chat_id) filter_ = { - "MEDIA_GROUP": False, - "MESSAGE_ID": str(message_id.id), - "CHAT_ID": str(chat_id), + 'MEDIA_GROUP': False, + 'MESSAGE_ID': str(message_id.id), + 'CHAT_ID': str(chat_id), } chat_filters.update({name: filter_}) set_filters_chat(message.chat.id, chat_filters) return await message.edit( - f"Filter {name} has been added.", + f'Filter {name} has been added.', ) except Exception as e: return await message.edit(format_exc(e)) -@Client.on_message(filters.command(["filters"], prefix) & filters.me) +@Client.on_message(filters.command(['filters'], prefix) & filters.me) async def filters_handler(_, message: Message): try: - text = "" + text = '' for index, a in enumerate(get_filters_chat(message.chat.id).items(), start=1): key, _ = a - key = key.replace("<", "").replace(">", "") - text += f"{index}. {key}\n" - text = f"Your filters in current chat:\n\n" f"{text}" + key = key.replace('<', '').replace('>', '') + text += f'{index}. {key}\n' + text = f'Your filters in current chat:\n\n{text}' text = text[:4096] return await message.edit(text) except Exception as e: return await message.edit(format_exc(e)) -@Client.on_message( - filters.command(["delfilter", "filterdel", "fdel"], prefix) & filters.me -) +@Client.on_message(filters.command(['delfilter', 'filterdel', 'fdel'], prefix) & filters.me) async def filter_del_handler(_, message: Message): try: if len(message.text.split()) < 2: return await message.edit( - f"Usage: {prefix}fdel [name]", + f'Usage: {prefix}fdel [name]', ) name = message.text.split(maxsplit=1)[1].lower() chat_filters = get_filters_chat(message.chat.id) @@ -229,18 +193,18 @@ async def filter_del_handler(_, message: Message): del chat_filters[name] set_filters_chat(message.chat.id, chat_filters) return await message.edit( - f"Filter {name} has been deleted.", + f'Filter {name} has been deleted.', ) except Exception as e: return await message.edit(format_exc(e)) -@Client.on_message(filters.command(["fsearch"], prefix) & filters.me) +@Client.on_message(filters.command(['fsearch'], prefix) & filters.me) async def filter_search_handler(_, message: Message): try: if len(message.text.split()) < 2: return await message.edit( - f"Usage: {prefix}fsearch [name]", + f'Usage: {prefix}fsearch [name]', ) name = message.text.split(maxsplit=1)[1].lower() chat_filters = get_filters_chat(message.chat.id) @@ -248,17 +212,14 @@ async def filter_search_handler(_, message: Message): return await message.edit( f"Filter {name} doesn't exists.", ) - return await message.edit( - f"Trigger:\n{name}\nAnswer:\n{chat_filters[name]}" - ) + return await message.edit(f'Trigger:\n{name}\nAnswer:\n{chat_filters[name]}') except Exception as e: return await message.edit(format_exc(e)) -modules_help["filters"] = { - "filter [name]": "Create filter (Reply required)", - "filters": "List of all triggers", - "fdel [name]": "Delete filter by name", - "fsearch [name]": "Info filter by name", +modules_help['filters'] = { + 'filter [name]': 'Create filter (Reply required)', + 'filters': 'List of all triggers', + 'fdel [name]': 'Delete filter by name', + 'fsearch [name]': 'Info filter by name', } diff --git a/userbot/modules/fliptext.py b/userbot/modules/fliptext.py index 662c07d..619de2a 100644 --- a/userbot/modules/fliptext.py +++ b/userbot/modules/fliptext.py @@ -1,98 +1,95 @@ -import asyncio from pyrogram import Client, filters -from pyrogram.raw import functions from pyrogram.types import Message from utils.misc import modules_help, prefix -from utils.scripts import format_exc REPLACEMENT_MAP = { - "a": "ɐ", - "b": "q", - "c": "ɔ", - "d": "p", - "e": "ǝ", - "f": "ɟ", - "g": "ƃ", - "h": "ɥ", - "i": "ᴉ", - "j": "ɾ", - "k": "ʞ", - "l": "l", - "m": "ɯ", - "n": "u", - "o": "o", - "p": "d", - "q": "b", - "r": "ɹ", - "s": "s", - "t": "ʇ", - "u": "n", - "v": "ʌ", - "w": "ʍ", - "x": "x", - "y": "ʎ", - "z": "z", - "A": "∀", - "B": "B", - "C": "Ɔ", - "D": "D", - "E": "Ǝ", - "F": "Ⅎ", - "G": "פ", - "H": "H", - "I": "I", - "J": "ſ", - "K": "K", - "L": "˥", - "M": "W", - "N": "N", - "O": "O", - "P": "Ԁ", - "Q": "Q", - "R": "R", - "S": "S", - "T": "┴", - "U": "∩", - "V": "Λ", - "W": "M", - "X": "X", - "Y": "⅄", - "Z": "Z", - "0": "0", - "1": "Ɩ", - "2": "ᄅ", - "3": "Ɛ", - "4": "ㄣ", - "5": "ϛ", - "6": "9", - "7": "ㄥ", - "8": "8", - "9": "6", - ",": "'", - ".": "˙", - "?": "¿", - "!": "¡", - '"': ",,", - "'": ",", - "(": ")", - ")": "(", - "[": "]", - "]": "[", - "{": "}", - "}": "{", - "<": ">", - ">": "<", - "&": "⅋", - "_": "‾", + 'a': 'ɐ', + 'b': 'q', + 'c': 'ɔ', + 'd': 'p', + 'e': 'ǝ', + 'f': 'ɟ', + 'g': 'ƃ', + 'h': 'ɥ', + 'i': 'ᴉ', + 'j': 'ɾ', + 'k': 'ʞ', + 'l': 'l', + 'm': 'ɯ', + 'n': 'u', + 'o': 'o', + 'p': 'd', + 'q': 'b', + 'r': 'ɹ', + 's': 's', + 't': 'ʇ', + 'u': 'n', + 'v': 'ʌ', + 'w': 'ʍ', + 'x': 'x', + 'y': 'ʎ', + 'z': 'z', + 'A': '∀', + 'B': 'B', + 'C': 'Ɔ', + 'D': 'D', + 'E': 'Ǝ', + 'F': 'Ⅎ', + 'G': 'פ', + 'H': 'H', + 'I': 'I', + 'J': 'ſ', + 'K': 'K', + 'L': '˥', + 'M': 'W', + 'N': 'N', + 'O': 'O', + 'P': 'Ԁ', + 'Q': 'Q', + 'R': 'R', + 'S': 'S', + 'T': '┴', + 'U': '∩', + 'V': 'Λ', + 'W': 'M', + 'X': 'X', + 'Y': '⅄', + 'Z': 'Z', + '0': '0', + '1': 'Ɩ', + '2': 'ᄅ', + '3': 'Ɛ', + '4': 'ㄣ', + '5': 'ϛ', + '6': '9', + '7': 'ㄥ', + '8': '8', + '9': '6', + ',': "'", + '.': '˙', + '?': '¿', + '!': '¡', + '"': ',,', + "'": ',', + '(': ')', + ')': '(', + '[': ']', + ']': '[', + '{': '}', + '}': '{', + '<': '>', + '>': '<', + '&': '⅋', + '_': '‾', } -@Client.on_message(filters.command("flip", prefix) & filters.me) +@Client.on_message(filters.command('flip', prefix) & filters.me) async def flip(client: Client, message: Message): - text = " ".join(message.command[1:]) - final_str = "" + text = ' '.join(message.command[1:]) + final_str = '' for char in text: - if char in REPLACEMENT_MAP.keys(): + if char in REPLACEMENT_MAP: new_char = REPLACEMENT_MAP[char] else: new_char = char @@ -103,4 +100,4 @@ async def flip(client: Client, message: Message): await message.edit(text) -modules_help["fliptext"] = {"flip [amount]*": "flip text upside down"} +modules_help['fliptext'] = {'flip [amount]*': 'flip text upside down'} diff --git a/userbot/modules/flux.py b/userbot/modules/flux.py index fd6c31b..7e44db3 100644 --- a/userbot/modules/flux.py +++ b/userbot/modules/flux.py @@ -1,52 +1,51 @@ import os -import io import time -import requests -from pyrogram import filters, Client -from pyrogram.types import Message +import requests +from pyrogram import Client, filters +from pyrogram.types import Message from utils.misc import modules_help, prefix from utils.scripts import format_exc, progress def schellwithflux(args): - API_URL = "https://randydev-ryuzaki-api.hf.space/api/v1/akeno/fluxai" - payload = {"user_id": 1191668125, "args": args} # Please don't edit here + API_URL = 'https://randydev-ryuzaki-api.hf.space/api/v1/akeno/fluxai' + payload = {'user_id': 1191668125, 'args': args} # Please don't edit here response = requests.post(API_URL, json=payload) if response.status_code != 200: - print(f"Error status {response.status_code}") + print(f'Error status {response.status_code}') return None return response.content -@Client.on_message(filters.command("fluxai", prefix) & filters.me) +@Client.on_message(filters.command('fluxai', prefix) & filters.me) async def imgfluxai_(client: Client, message: Message): - question = message.text.split(" ", 1)[1] if len(message.command) > 1 else None + question = message.text.split(' ', 1)[1] if len(message.command) > 1 else None if not question: - return await message.reply_text("Please provide a question for Flux.") + return await message.reply_text('Please provide a question for Flux.') try: image_bytes = schellwithflux(question) if image_bytes is None: - return await message.reply_text("Failed to generate an image.") - pro = await message.reply_text("Generating image, please wait...") + return await message.reply_text('Failed to generate an image.') + pro = await message.reply_text('Generating image, please wait...') # Write the image bytes directly to a file - with open("flux_gen.jpg", "wb") as f: + with open('flux_gen.jpg', 'wb') as f: f.write(image_bytes) - ok = await pro.edit_text("Uploading image...") + ok = await pro.edit_text('Uploading image...') await message.reply_photo( - "flux_gen.jpg", + 'flux_gen.jpg', progress=progress, - progress_args=(ok, time.time(), "Uploading image..."), + progress_args=(ok, time.time(), 'Uploading image...'), ) await ok.delete() - if os.path.exists("flux_gen.jpg"): - os.remove("flux_gen.jpg") + if os.path.exists('flux_gen.jpg'): + os.remove('flux_gen.jpg') except Exception as e: await message.edit_text(format_exc(e)) -modules_help["fluxai"] = { - "fluxai [prompt]*": "text to image fluxai", +modules_help['fluxai'] = { + 'fluxai [prompt]*': 'text to image fluxai', } diff --git a/userbot/modules/gemini.py b/userbot/modules/gemini.py index b564924..5432f6e 100644 --- a/userbot/modules/gemini.py +++ b/userbot/modules/gemini.py @@ -1,72 +1,62 @@ # This scripts contains use cases for userbots # This is used on my Moon-Userbot: https://github.com/The-MoonTg-project/Moon-Userbot # YOu can check it out for uses example -import os -from pyrogram import Client, filters, enums -from pyrogram.types import Message +from pyrogram import Client, enums, filters from pyrogram.errors import MessageTooLong - -from utils.misc import modules_help, prefix -from utils.scripts import format_exc, import_library +from pyrogram.types import Message from utils.config import gemini_key +from utils.misc import modules_help, prefix from utils.rentry import paste as rentry_paste +from utils.scripts import format_exc, import_library -genai = import_library("google.generativeai", "google-generativeai") +genai = import_library('google.generativeai', 'google-generativeai') genai.configure(api_key=gemini_key) -model = genai.GenerativeModel("gemini-2.0-flash") +model = genai.GenerativeModel('gemini-2.0-flash') -@Client.on_message(filters.command("gemini", prefix) & filters.me) +@Client.on_message(filters.command('gemini', prefix) & filters.me) async def say(client: Client, message: Message): try: - await message.edit_text("Please Wait...") + await message.edit_text('Please Wait...') if len(message.command) > 1: prompt = message.text.split(maxsplit=1)[1] elif message.reply_to_message: prompt = message.reply_to_message.text else: - await message.edit_text( - f"Usage: {prefix}gemini [prompt/reply to message]" - ) + await message.edit_text(f'Usage: {prefix}gemini [prompt/reply to message]') return chat = model.start_chat() response = chat.send_message(prompt) await message.edit_text( - f"**Question:**`{prompt}`\n**Answer:** {response.text}", + f'**Question:**`{prompt}`\n**Answer:** {response.text}', parse_mode=enums.ParseMode.MARKDOWN, ) except MessageTooLong: - await message.edit_text( - "Output is too long... Pasting to rentry..." - ) + await message.edit_text('Output is too long... Pasting to rentry...') try: - rentry_url, edit_code = await rentry_paste( - text=response.text, return_edit=True - ) + rentry_url, edit_code = await rentry_paste(text=response.text, return_edit=True) except RuntimeError: - await message.edit_text( - "Error: Failed to paste to rentry" - ) + await message.edit_text('Error: Failed to paste to rentry') return await client.send_message( - "me", + 'me', f"Here's your edit code for Url: {rentry_url}\nEdit code: {edit_code}", disable_web_page_preview=True, ) await message.edit_text( - f"Output: {rentry_url}\nNote: Edit Code has been sent to your saved messages", + f'Output: {rentry_url}\nNote: Edit Code has been sent to your saved messages', disable_web_page_preview=True, ) except Exception as e: - await message.edit_text(f"An error occurred: {format_exc(e)}") + await message.edit_text(f'An error occurred: {format_exc(e)}') -modules_help["gemini"] = { - "gemini [prompt]*": "Ask questions with Gemini Ai", +modules_help['gemini'] = { + 'gemini [prompt]*': 'Ask questions with Gemini Ai', } diff --git a/userbot/modules/google.py b/userbot/modules/google.py index c1a811c..3832822 100644 --- a/userbot/modules/google.py +++ b/userbot/modules/google.py @@ -16,32 +16,27 @@ from pyrogram import Client, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix -@Client.on_message(filters.command(["google", "g"], prefix) & filters.me) +@Client.on_message(filters.command(['google', 'g'], prefix) & filters.me) async def webshot(_, message: Message): - user_request = " ".join(message.command[1:]) + user_request = ' '.join(message.command[1:]) - if user_request == "": + if user_request == '': if message.reply_to_message: reply_user_request = message.reply_to_message.text - request = reply_user_request.replace(" ", "+") - full_request = f"https://lmgtfy.app/?s=g&iie=1&q={request}" + request = reply_user_request.replace(' ', '+') + full_request = f'https://lmgtfy.app/?s=g&iie=1&q={request}' await message.edit( - f"{reply_user_request}", + f'{reply_user_request}', disable_web_page_preview=True, ) else: - request = user_request.replace(" ", "+") - full_request = f"https://lmgtfy.app/?s=g&iie=1&q={request}" - await message.edit( - f"{user_request}", disable_web_page_preview=True - ) + request = user_request.replace(' ', '+') + full_request = f'https://lmgtfy.app/?s=g&iie=1&q={request}' + await message.edit(f'{user_request}', disable_web_page_preview=True) -modules_help["google"] = { - "google [request]": "To teach the interlocutor to use Google. Request isn't required." -} +modules_help['google'] = {'google [request]': "To teach the interlocutor to use Google. Request isn't required."} diff --git a/userbot/modules/hearts.py b/userbot/modules/hearts.py index 23e9ee0..ab8d95e 100644 --- a/userbot/modules/hearts.py +++ b/userbot/modules/hearts.py @@ -1,13 +1,13 @@ -import random import asyncio +import random from pyrogram import Client, filters -from pyrogram.types import Message from pyrogram.errors.exceptions.flood_420 import FloodWait +from pyrogram.types import Message from utils.misc import modules_help, prefix -R = "❤️" -W = "🤍" +R = '❤️' +W = '🤍' heart_list = [ W * 9, @@ -20,7 +20,7 @@ heart_list = [ W * 4 + R + W * 4, W * 9, ] -joined_heart = "\n".join(heart_list) +joined_heart = '\n'.join(heart_list) heartlet_len = joined_heart.count(R) @@ -37,7 +37,7 @@ async def _wrap_edit(message: Message, text: str): async def phase1(message: Message): """Big scroll""" - BIG_SCROLL = "🧡💛💚💙💜🖤🤎" + BIG_SCROLL = '🧡💛💚💙💜🖤🤎' await _wrap_edit(message, joined_heart) for heart in BIG_SCROLL: await _wrap_edit(message, joined_heart.replace(R, heart)) @@ -46,9 +46,9 @@ async def phase1(message: Message): async def phase2(message: Message): """Per-heart randomiser""" - ALL = ["❤️"] + list("🧡💛💚💙💜🤎🖤") # don't include white heart + ALL = ['❤️'] + list('🧡💛💚💙💜🤎🖤') # don't include white heart - format_heart = joined_heart.replace(R, "{}") + format_heart = joined_heart.replace(R, '{}') for _ in range(5): heart = format_heart.format(*random.choices(ALL, k=heartlet_len)) await _wrap_edit(message, heart) @@ -69,12 +69,12 @@ async def phase3(message: Message): async def phase4(message: Message): """Matrix shrinking""" for i in range(7, 0, -1): - heart_matrix = "\n".join([R * i] * i) + heart_matrix = '\n'.join([R * i] * i) await _wrap_edit(message, heart_matrix) await asyncio.sleep(SLEEP) -@Client.on_message(filters.command("hearts", prefix) & filters.me) +@Client.on_message(filters.command('hearts', prefix) & filters.me) async def hearts(client: Client, message: Message): await phase1(message) await phase2(message) @@ -82,12 +82,10 @@ async def hearts(client: Client, message: Message): await phase4(message) await asyncio.sleep(SLEEP * 3) - final_caption = " ".join(message.command[1:]) + final_caption = ' '.join(message.command[1:]) if not final_caption: - final_caption = "💕 by @moonuserbot" + final_caption = '💕 by @moonuserbot' await message.edit(final_caption) -modules_help["hearts"] = { - "hearts": "Heart animation. May cause floodwaits, use at your own risk!" -} +modules_help['hearts'] = {'hearts': 'Heart animation. May cause floodwaits, use at your own risk!'} diff --git a/userbot/modules/help.py b/userbot/modules/help.py index 9a7ccf9..4089299 100644 --- a/userbot/modules/help.py +++ b/userbot/modules/help.py @@ -13,18 +13,17 @@ from pyrogram import Client, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix -from utils.scripts import format_module_help, with_reply from utils.module import ModuleManager +from utils.scripts import format_module_help, with_reply module_manager = ModuleManager.get_instance() -@Client.on_message(filters.command(["help", "h"], prefix) & filters.me) +@Client.on_message(filters.command(['help', 'h'], prefix) & filters.me) async def help_cmd(_, message: Message): if not module_manager.help_navigator: - await message.edit("Help system is not initialized yet. Please wait...") + await message.edit('Help system is not initialized yet. Please wait...') return if len(message.command) == 1: @@ -41,43 +40,42 @@ async def help_cmd(_, message: Message): cmd_desc = commands[command] module_found = True return await message.edit( - f"Help for command {prefix}{command_name}\n" - f"Module: {module_name} ({prefix}help {module_name})\n\n" - f"{prefix}{cmd[0]}" - f"{' ' + cmd[1] + '' if len(cmd) > 1 else ''}" - f" — {cmd_desc}", + f'Help for command {prefix}{command_name}\n' + f'Module: {module_name} ({prefix}help {module_name})\n\n' + f'{prefix}{cmd[0]}' + f'{" " + cmd[1] + "" if len(cmd) > 1 else ""}' + f' — {cmd_desc}', ) if not module_found: - await message.edit(f"Module or command {command_name} not found") + await message.edit(f'Module or command {command_name} not found') -@Client.on_message(filters.command(["pn", "pp", "pq"], prefix) & filters.me) +@Client.on_message(filters.command(['pn', 'pp', 'pq'], prefix) & filters.me) @with_reply async def handle_navigation(_, message: Message): if not module_manager.help_navigator: - await message.edit("Help system is not initialized yet. Please wait...") + await message.edit('Help system is not initialized yet. Please wait...') return reply_message = message.reply_to_message - if reply_message and "Help Page No:" in message.reply_to_message.text: + if reply_message and 'Help Page No:' in message.reply_to_message.text: cmd = message.command[0].lower() - if cmd == "pn": + if cmd == 'pn': if module_manager.help_navigator.next_page(): await module_manager.help_navigator.send_page(reply_message) return await message.delete() - await message.edit("No more pages available.") - elif cmd == "pp": + await message.edit('No more pages available.') + elif cmd == 'pp': if module_manager.help_navigator.prev_page(): await module_manager.help_navigator.send_page(reply_message) return await message.delete() - return await message.edit("This is the first page.") - elif cmd == "pq": + return await message.edit('This is the first page.') + elif cmd == 'pq': await reply_message.delete() - return await message.edit("Help closed.") + return await message.edit('Help closed.') -modules_help["help"] = { - "help [module/command name]": "Get common/module/command help", - "pn/pp/pq": "Navigate through help pages" - + " (pn: next page, pp: previous page, pq: quit help)", +modules_help['help'] = { + 'help [module/command name]': 'Get common/module/command help', + 'pn/pp/pq': 'Navigate through help pages' + ' (pn: next page, pp: previous page, pq: quit help)', } diff --git a/userbot/modules/huggingface.py b/userbot/modules/huggingface.py index 3f9427c..e93b071 100644 --- a/userbot/modules/huggingface.py +++ b/userbot/modules/huggingface.py @@ -1,16 +1,14 @@ -import os -import io -import time -import aiohttp import asyncio +import io import logging -from PIL import Image - -from pyrogram import filters, Client, enums -from pyrogram.types import Message - +import os +import time from concurrent.futures import ThreadPoolExecutor +import aiohttp +from PIL import Image +from pyrogram import Client, enums, filters +from pyrogram.types import Message from utils.db import db from utils.misc import modules_help, prefix from utils.scripts import format_exc @@ -20,47 +18,41 @@ logger = logging.getLogger(__name__) async def query_huggingface(payload): - api_key = db.get("custom.hf", "api_key", None) - model = db.get("custom.hf", "current_model", None) + api_key = db.get('custom.hf', 'api_key', None) + model = db.get('custom.hf', 'current_model', None) if not api_key: - raise ValueError( - f"API key not set. Use {prefix}set_hf api to set it." - ) + raise ValueError(f'API key not set. Use {prefix}set_hf api to set it.') if not model: - raise ValueError( - f"Model not set. Use {prefix}set_hf model to set it." - ) + raise ValueError(f'Model not set. Use {prefix}set_hf model to set it.') - api_url = f"https://api-inference.huggingface.co/models/{model}" - headers = {"Authorization": f"Bearer {api_key}"} + api_url = f'https://api-inference.huggingface.co/models/{model}' + headers = {'Authorization': f'Bearer {api_key}'} timeout = aiohttp.ClientTimeout(total=120) start_time = time.time() retries = 3 for attempt in range(1, retries + 1): try: - async with aiohttp.ClientSession(timeout=timeout) as session: - async with session.post( - api_url, headers=headers, json=payload - ) as response: - fetch_time = int((time.time() - start_time) * 1000) - if response.status != 200: - error_text = await response.text() - logger.error(f"API Error {response.status}: {error_text}") - return None, fetch_time - return await response.read(), fetch_time - except asyncio.TimeoutError: - logger.error(f"TimeoutError: Attempt {attempt}/{retries} timed out.") + async with ( + aiohttp.ClientSession(timeout=timeout) as session, + session.post(api_url, headers=headers, json=payload) as response, + ): + fetch_time = int((time.time() - start_time) * 1000) + if response.status != 200: + error_text = await response.text() + logger.error(f'API Error {response.status}: {error_text}') + return None, fetch_time + return await response.read(), fetch_time + except TimeoutError: + logger.error(f'TimeoutError: Attempt {attempt}/{retries} timed out.') if attempt == retries: raise except asyncio.CancelledError: - logger.error( - "Request was cancelled. Ensure the task is not being forcefully terminated." - ) + logger.error('Request was cancelled. Ensure the task is not being forcefully terminated.') raise except aiohttp.ClientError as e: - logger.error(f"Network Error: {e}") + logger.error(f'Network Error: {e}') if attempt == retries: raise finally: @@ -70,157 +62,129 @@ async def query_huggingface(payload): async def save_image(image_bytes, path): loop = asyncio.get_event_loop() with ThreadPoolExecutor() as pool: - await loop.run_in_executor( - pool, lambda: Image.open(io.BytesIO(image_bytes)).save(path) - ) + await loop.run_in_executor(pool, lambda: Image.open(io.BytesIO(image_bytes)).save(path)) -@Client.on_message(filters.command(["set_hf"], prefix) & filters.me) +@Client.on_message(filters.command(['set_hf'], prefix) & filters.me) async def manage_huggingface(_, message: Message): """Manage Hugging Face API key and models.""" subcommand = message.command[1].lower() if len(message.command) > 1 else None arg = message.command[2] if len(message.command) > 2 else None - if subcommand == "api": + if subcommand == 'api': if arg: - db.set("custom.hf", "api_key", arg) - return await message.edit_text( - f"Hugging Face API key set successfully.\nAPI Key: {arg}" - ) - return await message.edit_text(f"Usage: {prefix}hf api ") + db.set('custom.hf', 'api_key', arg) + return await message.edit_text(f'Hugging Face API key set successfully.\nAPI Key: {arg}') + return await message.edit_text(f'Usage: {prefix}hf api ') - if subcommand == "model": + if subcommand == 'model': if arg: - models = db.get("custom.hf", "models", []) + models = db.get('custom.hf', 'models', []) if arg not in models: models.append(arg) - db.set("custom.hf", "models", models) - db.set("custom.hf", "current_model", arg) - return await message.edit_text( - f"Model '{arg}' added and set as the current model." - ) - return await message.edit_text(f"Usage: {prefix}hf model ") + db.set('custom.hf', 'models', models) + db.set('custom.hf', 'current_model', arg) + return await message.edit_text(f"Model '{arg}' added and set as the current model.") + return await message.edit_text(f'Usage: {prefix}hf model ') - if subcommand == "select": - models = db.get("custom.hf", "models", []) - if arg and arg.lower() == "all": - db.set("custom.hf", "current_model", "all") - model_list = "\n".join([f"*{i + 1}. {m}" for i, m in enumerate(models)]) + if subcommand == 'select': + models = db.get('custom.hf', 'models', []) + if arg and arg.lower() == 'all': + db.set('custom.hf', 'current_model', 'all') + model_list = '\n'.join([f'*{i + 1}. {m}' for i, m in enumerate(models)]) return await message.edit_text( - f"All models selected:\n{model_list}\n\n" - f"Images will be generated from all models." + f'All models selected:\n{model_list}\n\nImages will be generated from all models.' ) if arg: try: index = int(arg) - 1 if 0 <= index < len(models): - db.set("custom.hf", "current_model", models[index]) + db.set('custom.hf', 'current_model', models[index]) return await message.edit_text(f"Model set to '{models[index]}'.") - return await message.edit_text("Invalid model number.") + return await message.edit_text('Invalid model number.') except ValueError: - return await message.edit_text( - "Invalid model number. Use a valid integer." - ) - return await message.edit_text(f"Usage: {prefix}hf select ") + return await message.edit_text('Invalid model number. Use a valid integer.') + return await message.edit_text(f'Usage: {prefix}hf select ') - if subcommand == "delete" and arg: + if subcommand == 'delete' and arg: try: index = int(arg) - 1 - models = db.get("custom.hf", "models", []) + models = db.get('custom.hf', 'models', []) if 0 <= index < len(models): removed_model = models.pop(index) - db.set("custom.hf", "models", models) - if db.get("custom.hf", "current_model") == removed_model: - db.set( - "custom.hf", "current_model", models[0] if models else "None" - ) + db.set('custom.hf', 'models', models) + if db.get('custom.hf', 'current_model') == removed_model: + db.set('custom.hf', 'current_model', models[0] if models else 'None') return await message.edit_text(f"Model '{removed_model}' deleted.") - return await message.edit_text("Invalid model number.") + return await message.edit_text('Invalid model number.') except ValueError: - return await message.edit_text("Invalid model number. Use a valid integer.") + return await message.edit_text('Invalid model number. Use a valid integer.') - api_key = db.get("custom.hf", "api_key", None) - models = db.get("custom.hf", "models", []) - current_model = db.get("custom.hf", "current_model", "Not set") - model_list = "\n".join( - [ - f"{'*' if m == current_model or current_model == 'all' else ''}{i + 1}. {m}" - for i, m in enumerate(models) - ] + api_key = db.get('custom.hf', 'api_key', None) + models = db.get('custom.hf', 'models', []) + current_model = db.get('custom.hf', 'current_model', 'Not set') + model_list = '\n'.join( + [f'{"*" if m == current_model or current_model == "all" else ""}{i + 1}. {m}' for i, m in enumerate(models)] ) settings = ( - f"Hugging Face settings:\n" - f"API Key:\n{api_key if api_key else 'Not set'}\n\n" - f"Available Models:\n{model_list}" + f'Hugging Face settings:\n' + f'API Key:\n{api_key if api_key else "Not set"}\n\n' + f'Available Models:\n{model_list}' ) usage_message = ( - f"{settings}\n\nUsage:\n" - f"{prefix}set_hf api, model, select, delete, select all" + f'{settings}\n\nUsage:\n' + f'{prefix}set_hf api, model, select, delete, select all' ) await message.edit_text(usage_message) -@Client.on_message(filters.command(["hf", "hface", "huggingface"], prefix)) +@Client.on_message(filters.command(['hf', 'hface', 'huggingface'], prefix)) async def imgflux_(_, message: Message): - prompt = message.text.split(" ", 1)[1] if len(message.command) > 1 else None + prompt = message.text.split(' ', 1)[1] if len(message.command) > 1 else None if not prompt: - usage_message = ( - f"Usage: {prefix}{message.command[0]} [custom prompt]" - ) - return await ( - message.edit_text if message.from_user.is_self else message.reply_text - )(usage_message) + usage_message = f'Usage: {prefix}{message.command[0]} [custom prompt]' + return await (message.edit_text if message.from_user.is_self else message.reply_text)(usage_message) - processing_message = await ( - message.edit_text if message.from_user.is_self else message.reply_text - )("Processing...") + processing_message = await (message.edit_text if message.from_user.is_self else message.reply_text)('Processing...') try: - current_model = db.get("custom.hf", "current_model", None) - models = db.get("custom.hf", "models", []) - models_to_use = models if current_model == "all" else [current_model] + current_model = db.get('custom.hf', 'current_model', None) + models = db.get('custom.hf', 'models', []) + models_to_use = models if current_model == 'all' else [current_model] generated_images = [] for model in models_to_use: - db.set("custom.hf", "current_model", model) - payload = {"inputs": prompt} + db.set('custom.hf', 'current_model', model) + payload = {'inputs': prompt} image_bytes, fetch_time = await query_huggingface(payload) if not image_bytes: - logger.warning(f"Failed to fetch image for model: {model}") + logger.warning(f'Failed to fetch image for model: {model}') continue - image_path = f"hf_flux_gen_{model.replace('/', '_')}.jpg" + image_path = f'hf_flux_gen_{model.replace("/", "_")}.jpg' await save_image(image_bytes, image_path) generated_images.append((image_path, model, fetch_time)) if not generated_images: - return await processing_message.edit_text( - "Failed to generate an image for all models." - ) + return await processing_message.edit_text('Failed to generate an image for all models.') for image_path, model_name, fetch_time in generated_images: - caption = ( - f"**Model:**\n> {model_name}\n" - f"**Prompt used:**\n> {prompt}\n\n" - f"**Fetching Time:** {fetch_time} ms" - ) - await message.reply_photo( - image_path, caption=caption, parse_mode=enums.ParseMode.MARKDOWN - ) + caption = f'**Model:**\n> {model_name}\n**Prompt used:**\n> {prompt}\n\n**Fetching Time:** {fetch_time} ms' + await message.reply_photo(image_path, caption=caption, parse_mode=enums.ParseMode.MARKDOWN) os.remove(image_path) except Exception as e: - logger.error(f"Unexpected Error: {e}") + logger.error(f'Unexpected Error: {e}') await processing_message.edit_text(format_exc(e)) finally: await processing_message.delete() -modules_help["huggingface"] = { - "hf [prompt]*": "Generate an AI image using Hugging Face model(s).", - "set_hf *": "Set the Hugging Face API key.", - "set_hf model *": "Add and set a Hugging Face model.", - "set_hf select *": "Select a specific model or all models for use.", - "set_hf delete *": "Delete a model from the list.", +modules_help['huggingface'] = { + 'hf [prompt]*': 'Generate an AI image using Hugging Face model(s).', + 'set_hf *': 'Set the Hugging Face API key.', + 'set_hf model *': 'Add and set a Hugging Face model.', + 'set_hf select *': 'Select a specific model or all models for use.', + 'set_hf delete *': 'Delete a model from the list.', } diff --git a/userbot/modules/id.py b/userbot/modules/id.py index 5a5d65b..be07263 100644 --- a/userbot/modules/id.py +++ b/userbot/modules/id.py @@ -16,73 +16,72 @@ from pyrogram import Client, enums, filters from pyrogram.types import Message, MessageOriginHiddenUser - from utils.misc import modules_help, prefix -@Client.on_message(filters.command("id", prefix) & filters.me) +@Client.on_message(filters.command('id', prefix) & filters.me) async def ids(_, message: Message): - text = "\n".join( + text = '\n'.join( [ - f"Chat ID: `{message.chat.id}`", - f"Chat DC ID: `{message.chat.dc_id}`\n", - f"Message ID: `{message.id}`", + f'Chat ID: `{message.chat.id}`', + f'Chat DC ID: `{message.chat.dc_id}`\n', + f'Message ID: `{message.id}`', ( - f"Your ID: `{message.from_user.id}`" + f'Your ID: `{message.from_user.id}`' if message.from_user - else f"Channel/Group ID: `{message.sender_chat.id}`" + else f'Channel/Group ID: `{message.sender_chat.id}`' ), ( - f"Your DC ID: `{message.from_user.dc_id}`" + f'Your DC ID: `{message.from_user.dc_id}`' if message.from_user - else f"Channel/Group ID: `{message.sender_chat.id}`" + else f'Channel/Group ID: `{message.sender_chat.id}`' ), ] ) if rtm := message.reply_to_message: # print(rtm) - text += f"\n\nReplied Message ID: `{rtm.id}`" + text += f'\n\nReplied Message ID: `{rtm.id}`' if user := rtm.from_user: - text = "\n".join( + text = '\n'.join( [ text, - f"Replied User ID: `{user.id}`", - f"Replied User DC ID: `{user.dc_id}`", + f'Replied User ID: `{user.id}`', + f'Replied User DC ID: `{user.dc_id}`', ] ) else: - text = "\n".join( + text = '\n'.join( [ text, - f"Replied Chat ID: `{rtm.sender_chat.id}`", - f"Replied Chat DC ID: `{rtm.sender_chat.dc_id}`", + f'Replied Chat ID: `{rtm.sender_chat.id}`', + f'Replied Chat DC ID: `{rtm.sender_chat.dc_id}`', ] ) if rtm.forward_origin and rtm.forward_origin.date: if isinstance(rtm.forward_origin, MessageOriginHiddenUser): - text = "\n".join( + text = '\n'.join( [ text, - "\nForwarded from a hidden user.", + '\nForwarded from a hidden user.', ] ) elif ffc := rtm.forward_origin.sender_user: - text = "\n".join( + text = '\n'.join( [ text, - f"\nForwarded Message ID: `{getattr(rtm.forward_origin, 'message_id', None)}`", - f"Forwarded from Chat ID: `{ffc.id}`", - f"Forwarded from Chat DC ID: `{ffc.dc_id}`", + f'\nForwarded Message ID: `{getattr(rtm.forward_origin, "message_id", None)}`', + f'Forwarded from Chat ID: `{ffc.id}`', + f'Forwarded from Chat DC ID: `{ffc.dc_id}`', ] ) - await message.edit("**__" + text + "__**", parse_mode=enums.ParseMode.MARKDOWN) + await message.edit('**__' + text + '__**', parse_mode=enums.ParseMode.MARKDOWN) -modules_help["id"] = { - "id": "simply run or reply to message", +modules_help['id'] = { + 'id': 'simply run or reply to message', } diff --git a/userbot/modules/joindate.py b/userbot/modules/joindate.py index 8a1d2c1..df87dfd 100644 --- a/userbot/modules/joindate.py +++ b/userbot/modules/joindate.py @@ -1,44 +1,36 @@ -import asyncio -import os +import os from datetime import datetime + from pyrogram import Client, filters -from pyrogram.raw import functions from pyrogram.types import Message from utils.misc import modules_help, prefix -from utils.scripts import format_exc -@Client.on_message(filters.command("joindate", prefix) & filters.me) +@Client.on_message(filters.command('joindate', prefix) & filters.me) async def joindate(client: Client, message: Message): - await message.edit(f"One moment...") - members = [] - cgetmsg = await client.get_messages(message.chat.id, 1) - async for m in client.iter_chat_members(message.chat.id): - members.append( - ( - m.user.first_name, - m.joined_date or cgetmsg.date, - ) - ) + await message.edit('One moment...') + members = [] + cgetmsg = await client.get_messages(message.chat.id, 1) + async for m in client.iter_chat_members(message.chat.id): + members.append( + ( + m.user.first_name, + m.joined_date or cgetmsg.date, + ) + ) - members.sort(key=lambda member: member[1]) + members.sort(key=lambda member: member[1]) - with open("joined_date.txt", "w", encoding="utf8") as f: - f.write("Join Date First Name\n") - for member in members: - f.write( - str(datetime.fromtimestamp(member[1]).strftime("%y-%m-%d %H:%M")) - + f" {member[0]}\n" - ) + with open('joined_date.txt', 'w', encoding='utf8') as f: + f.write('Join Date First Name\n') + for member in members: + f.write(str(datetime.fromtimestamp(member[1]).strftime('%y-%m-%d %H:%M')) + f' {member[0]}\n') - await message.delete() - await client.send_document(message.chat.id, "joined_date.txt") - os.remove("joined_date.txt") + await message.delete() + await client.send_document(message.chat.id, 'joined_date.txt') + os.remove('joined_date.txt') - -modules_help["joindate"] = { - "joindate": "Get a list of all chat members and sort them by the date they joined the group" - +modules_help['joindate'] = { + 'joindate': 'Get a list of all chat members and sort them by the date they joined the group' } - diff --git a/userbot/modules/kokodrilo_explodando.py b/userbot/modules/kokodrilo_explodando.py index 6c8dae0..7f07a2c 100644 --- a/userbot/modules/kokodrilo_explodando.py +++ b/userbot/modules/kokodrilo_explodando.py @@ -1,22 +1,23 @@ -from pyrogram import Client, filters -from pyrogram.types import Message - -from utils.misc import modules_help, prefix -import asyncio, random - - -@Client.on_message(filters.command("kokodrilo", prefix) & filters.me) -async def kokodrilo_explodando(_, message: Message): - amount = 1 - if len(message.command) > 1: - amount = int(message.command[1]) - for _ in range(amount): - await message.edit("🐊") - await asyncio.sleep(random.uniform(1, 2.5)) - await message.edit("💥") - await asyncio.sleep(1.8) - - -modules_help["kokodrilo_explodando"] = { - "kokodrilo [number of explosions]": "kOkOdRiLo ExPlOrAdO", -} +import asyncio +import random + +from pyrogram import Client, filters +from pyrogram.types import Message +from utils.misc import modules_help, prefix + + +@Client.on_message(filters.command('kokodrilo', prefix) & filters.me) +async def kokodrilo_explodando(_, message: Message): + amount = 1 + if len(message.command) > 1: + amount = int(message.command[1]) + for _ in range(amount): + await message.edit('🐊') + await asyncio.sleep(random.uniform(1, 2.5)) + await message.edit('💥') + await asyncio.sleep(1.8) + + +modules_help['kokodrilo_explodando'] = { + 'kokodrilo [number of explosions]': 'kOkOdRiLo ExPlOrAdO', +} diff --git a/userbot/modules/leave_chat.py b/userbot/modules/leave_chat.py index 2fbfde9..aa473d8 100644 --- a/userbot/modules/leave_chat.py +++ b/userbot/modules/leave_chat.py @@ -18,20 +18,19 @@ import asyncio from pyrogram import Client, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix -@Client.on_message(filters.command(["leave_chat", "lc"], prefix) & filters.me) +@Client.on_message(filters.command(['leave_chat', 'lc'], prefix) & filters.me) async def leave_chat(_, message: Message): - if message.chat.type != "private": - await message.edit("Goodbye...") + if message.chat.type != 'private': + await message.edit('Goodbye...') await asyncio.sleep(3) await message.chat.leave() else: - await message.edit("Not supported in private chats") + await message.edit('Not supported in private chats') -modules_help["leave_chat"] = { - "leave_chat": "Quit chat", +modules_help['leave_chat'] = { + 'leave_chat': 'Quit chat', } diff --git a/userbot/modules/loader.py b/userbot/modules/loader.py index 46a8042..c5dee70 100644 --- a/userbot/modules/loader.py +++ b/userbot/modules/loader.py @@ -23,318 +23,296 @@ import sys import requests from pyrogram import Client, filters from pyrogram.types import Message - +from utils.db import db from utils.misc import modules_help, prefix from utils.scripts import restart -from utils.db import db - BASE_PATH = os.path.abspath(os.getcwd()) CATEGORIES = [ - "ai", - "dl", - "admin", - "anime", - "fun", - "images", - "info", - "misc", - "music", - "news", - "paste", - "rev", - "tts", - "utils", + 'ai', + 'dl', + 'admin', + 'anime', + 'fun', + 'images', + 'info', + 'misc', + 'music', + 'news', + 'paste', + 'rev', + 'tts', + 'utils', ] -@Client.on_message(filters.command(["modhash", "mh"], prefix) & filters.me) +@Client.on_message(filters.command(['modhash', 'mh'], prefix) & filters.me) async def get_mod_hash(_, message: Message): if len(message.command) == 1: return url = message.command[1].lower() resp = requests.get(url) if not resp.ok: - await message.edit( - f"Troubleshooting with downloading module {url}" - ) + await message.edit(f'Troubleshooting with downloading module {url}') return await message.edit( - f"Module hash: {hashlib.sha256(resp.content).hexdigest()}\n" - f"Link: {url}\nFile: {url.split('/')[-1]}", + f'Module hash: {hashlib.sha256(resp.content).hexdigest()}\n' + f'Link: {url}\nFile: {url.split("/")[-1]}', ) -@Client.on_message(filters.command(["loadmod", "lm"], prefix) & filters.me) +@Client.on_message(filters.command(['loadmod', 'lm'], prefix) & filters.me) async def loadmod(_, message: Message): if ( not ( message.reply_to_message and message.reply_to_message.document - and message.reply_to_message.document.file_name.endswith(".py") + and message.reply_to_message.document.file_name.endswith('.py') ) and len(message.command) == 1 ): - await message.edit("Specify module to download") + await message.edit('Specify module to download') return if len(message.command) > 1: - await message.edit("Fetching module...") + await message.edit('Fetching module...') url = message.command[1].lower() - if url.startswith( - "https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/" - ): - module_name = url.split("/")[-1].split(".")[0] - elif "." not in url: + if url.startswith('https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/'): + module_name = url.split('/')[-1].split('.')[0] + elif '.' not in url: module_name = url.lower() try: f = requests.get( - "https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/full.txt" + 'https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/full.txt' ).text except Exception: - return await message.edit("Failed to fetch custom modules list") - modules_dict = {line.split("/")[-1].split()[0]: line.strip() for line in f.splitlines()} + return await message.edit('Failed to fetch custom modules list') + modules_dict = {line.split('/')[-1].split()[0]: line.strip() for line in f.splitlines()} if module_name in modules_dict: - url = f"https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/{modules_dict[module_name]}.py" + url = f'https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/{modules_dict[module_name]}.py' else: - await message.edit( - f"Module {module_name} is not found" - ) + await message.edit(f'Module {module_name} is not found') return else: modules_hashes = requests.get( - "https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/modules_hashes.txt" + 'https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/modules_hashes.txt' ).text resp = requests.get(url) if not resp.ok: await message.edit( - f"Troubleshooting with downloading module {url}", + f'Troubleshooting with downloading module {url}', ) return if hashlib.sha256(resp.content).hexdigest() not in modules_hashes: return await message.edit( - "Only " - "verified modules or from the official " - "" - "custom_modules repository are supported!", + 'Only ' + 'verified modules or from the official ' + '' + 'custom_modules repository are supported!', disable_web_page_preview=True, ) - module_name = url.split("/")[-1].split(".")[0] + module_name = url.split('/')[-1].split('.')[0] resp = requests.get(url) if not resp.ok: - await message.edit(f"Module {module_name} is not found") + await message.edit(f'Module {module_name} is not found') return - if not os.path.exists(f"{BASE_PATH}/modules/custom_modules"): - os.mkdir(f"{BASE_PATH}/modules/custom_modules") + if not os.path.exists(f'{BASE_PATH}/modules/custom_modules'): + os.mkdir(f'{BASE_PATH}/modules/custom_modules') - with open(f"./modules/custom_modules/{module_name}.py", "wb") as f: + with open(f'./modules/custom_modules/{module_name}.py', 'wb') as f: f.write(resp.content) else: file_name = await message.reply_to_message.download() module_name = message.reply_to_message.document.file_name[:-3] - with open(file_name, "rb") as f: + with open(file_name, 'rb') as f: content = f.read() modules_hashes = requests.get( - "https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/modules_hashes.txt" + 'https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/modules_hashes.txt' ).text if hashlib.sha256(content).hexdigest() not in modules_hashes: os.remove(file_name) return await message.edit( - "Only " - "verified modules or from the official " - "" - "custom_modules repository are supported!", + 'Only ' + 'verified modules or from the official ' + '' + 'custom_modules repository are supported!', disable_web_page_preview=True, ) - os.rename(file_name, f"./modules/custom_modules/{module_name}.py") + os.rename(file_name, f'./modules/custom_modules/{module_name}.py') - all_modules = db.get("custom.modules", "allModules", []) + all_modules = db.get('custom.modules', 'allModules', []) if module_name not in all_modules: all_modules.append(module_name) - db.set("custom.modules", "allModules", all_modules) - await message.edit( - f"The module {module_name} is loaded!\nRestarting..." - ) + db.set('custom.modules', 'allModules', all_modules) + await message.edit(f'The module {module_name} is loaded!\nRestarting...') db.set( - "core.updater", - "restart_info", + 'core.updater', + 'restart_info', { - "type": "restart", - "chat_id": message.chat.id, - "message_id": message.id, + 'type': 'restart', + 'chat_id': message.chat.id, + 'message_id': message.id, }, ) restart() -@Client.on_message(filters.command(["unloadmod", "ulm"], prefix) & filters.me) +@Client.on_message(filters.command(['unloadmod', 'ulm'], prefix) & filters.me) async def unload_mods(_, message: Message): if len(message.command) <= 1: return module_name = message.command[1].lower() - if module_name.startswith( - "https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/" - ): - module_name = module_name.split("/")[-1].split(".")[0] + if module_name.startswith('https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/'): + module_name = module_name.split('/')[-1].split('.')[0] - if os.path.exists(f"{BASE_PATH}/modules/custom_modules/{module_name}.py"): - os.remove(f"{BASE_PATH}/modules/custom_modules/{module_name}.py") - if module_name == "musicbot": + if os.path.exists(f'{BASE_PATH}/modules/custom_modules/{module_name}.py'): + os.remove(f'{BASE_PATH}/modules/custom_modules/{module_name}.py') + if module_name == 'musicbot': subprocess.run( - [sys.executable, "-m", "pip", "uninstall", "-y", "requirements.txt"], - cwd=f"{BASE_PATH}/musicbot", + [sys.executable, '-m', 'pip', 'uninstall', '-y', 'requirements.txt'], + cwd=f'{BASE_PATH}/musicbot', ) - shutil.rmtree(f"{BASE_PATH}/musicbot") - all_modules = db.get("custom.modules", "allModules", []) + shutil.rmtree(f'{BASE_PATH}/musicbot') + all_modules = db.get('custom.modules', 'allModules', []) if module_name in all_modules: all_modules.remove(module_name) - db.set("custom.modules", "allModules", all_modules) - await message.edit( - f"The module {module_name} removed!\nRestarting..." - ) + db.set('custom.modules', 'allModules', all_modules) + await message.edit(f'The module {module_name} removed!\nRestarting...') db.set( - "core.updater", - "restart_info", + 'core.updater', + 'restart_info', { - "type": "restart", - "chat_id": message.chat.id, - "message_id": message.id, + 'type': 'restart', + 'chat_id': message.chat.id, + 'message_id': message.id, }, ) restart() - elif os.path.exists(f"{BASE_PATH}/modules/{module_name}.py"): - await message.edit( - "It is forbidden to remove built-in modules, it will disrupt the updater" - ) + elif os.path.exists(f'{BASE_PATH}/modules/{module_name}.py'): + await message.edit('It is forbidden to remove built-in modules, it will disrupt the updater') else: - await message.edit(f"Module {module_name} is not found") + await message.edit(f'Module {module_name} is not found') -@Client.on_message(filters.command(["loadallmods", "lmall"], prefix) & filters.me) +@Client.on_message(filters.command(['loadallmods', 'lmall'], prefix) & filters.me) async def load_all_mods(_, message: Message): - await message.edit("Fetching info...") + await message.edit('Fetching info...') - if not os.path.exists(f"{BASE_PATH}/modules/custom_modules"): - os.mkdir(f"{BASE_PATH}/modules/custom_modules") + if not os.path.exists(f'{BASE_PATH}/modules/custom_modules'): + os.mkdir(f'{BASE_PATH}/modules/custom_modules') try: - f = requests.get( - "https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/full.txt" - ).text + f = requests.get('https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/full.txt').text except Exception: - return await message.edit("Failed to fetch custom modules list") + return await message.edit('Failed to fetch custom modules list') modules_list = f.splitlines() - await message.edit("Loading modules...") + await message.edit('Loading modules...') for module_name in modules_list: - url = f"https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/{module_name}.py" + url = f'https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/{module_name}.py' resp = requests.get(url) if not resp.ok: continue - with open( - f"./modules/custom_modules/{module_name.split('/')[1]}.py", "wb" - ) as f: + with open(f'./modules/custom_modules/{module_name.split("/")[1]}.py', 'wb') as f: f.write(resp.content) await message.edit( - f"Successfully loaded new modules: {len(modules_list)}\nRestarting...", + f'Successfully loaded new modules: {len(modules_list)}\nRestarting...', ) db.set( - "core.updater", - "restart_info", + 'core.updater', + 'restart_info', { - "type": "restart", - "chat_id": message.chat.id, - "message_id": message.id, + 'type': 'restart', + 'chat_id': message.chat.id, + 'message_id': message.id, }, ) restart() -@Client.on_message(filters.command(["unloadallmods", "ulmall"], prefix) & filters.me) +@Client.on_message(filters.command(['unloadallmods', 'ulmall'], prefix) & filters.me) async def unload_all_mods(_, message: Message): - await message.edit("Fetching info...") + await message.edit('Fetching info...') - if not os.path.exists(f"{BASE_PATH}/modules/custom_modules"): + if not os.path.exists(f'{BASE_PATH}/modules/custom_modules'): return await message.edit("You don't have any modules installed") - shutil.rmtree(f"{BASE_PATH}/modules/custom_modules") - db.set("custom.modules", "allModules", []) - await message.edit("Successfully unloaded all modules!\nRestarting...") + shutil.rmtree(f'{BASE_PATH}/modules/custom_modules') + db.set('custom.modules', 'allModules', []) + await message.edit('Successfully unloaded all modules!\nRestarting...') db.set( - "core.updater", - "restart_info", + 'core.updater', + 'restart_info', { - "type": "restart", - "chat_id": message.chat.id, - "message_id": message.id, + 'type': 'restart', + 'chat_id': message.chat.id, + 'message_id': message.id, }, ) restart() -@Client.on_message(filters.command(["updateallmods"], prefix) & filters.me) +@Client.on_message(filters.command(['updateallmods'], prefix) & filters.me) async def updateallmods(_, message: Message): - await message.edit("Updating modules...") + await message.edit('Updating modules...') - if not os.path.exists(f"{BASE_PATH}/modules/custom_modules"): - os.mkdir(f"{BASE_PATH}/modules/custom_modules") + if not os.path.exists(f'{BASE_PATH}/modules/custom_modules'): + os.mkdir(f'{BASE_PATH}/modules/custom_modules') - modules_installed = list(os.walk("modules/custom_modules"))[0][2] + modules_installed = list(os.walk('modules/custom_modules'))[0][2] if not modules_installed: return await message.edit("You don't have any modules installed") for module_name in modules_installed: - if not module_name.endswith(".py"): + if not module_name.endswith('.py'): continue try: - f = requests.get( - "https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/full.txt" - ).text + f = requests.get('https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/full.txt').text except Exception: - return await message.edit("Failed to fetch custom modules list") - modules_dict = {line.split("/")[-1].split()[0]: line.strip() for line in f.splitlines()} + return await message.edit('Failed to fetch custom modules list') + modules_dict = {line.split('/')[-1].split()[0]: line.strip() for line in f.splitlines()} if module_name in modules_dict: resp = requests.get( - f"https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/{modules_dict[module_name]}.py" + f'https://raw.githubusercontent.com/The-MoonTg-project/custom_modules/main/{modules_dict[module_name]}.py' ) if not resp.ok: modules_installed.remove(module_name) continue - with open(f"./modules/custom_modules/{module_name}", "wb") as f: + with open(f'./modules/custom_modules/{module_name}', 'wb') as f: f.write(resp.content) - await message.edit(f"Successfully updated {len(modules_installed)} modules") + await message.edit(f'Successfully updated {len(modules_installed)} modules') -modules_help["loader"] = { - "loadmod [module_name]*": "Download module.\n" - "Only modules from the official custom_modules repository and proven " - "modules whose hashes are in modules_hashes.txt are supported", - "unloadmod [module_name]*": "Delete module", - "modhash [link]*": "Get module hash by link", - "loadallmods": "Load all custom modules (use it at your own risk)", - "unloadallmods": "Unload all custom modules", - "updateallmods": "Update all custom modules" - "\n\n* - required argument" - "\n short cmds:" - "\n loadmod - lm" - "\n unloadmod - ulm" - "\n modhash - mh" - "\n loadallmods - lmall" - "\n unloadallmods - ulmall", +modules_help['loader'] = { + 'loadmod [module_name]*': 'Download module.\n' + 'Only modules from the official custom_modules repository and proven ' + 'modules whose hashes are in modules_hashes.txt are supported', + 'unloadmod [module_name]*': 'Delete module', + 'modhash [link]*': 'Get module hash by link', + 'loadallmods': 'Load all custom modules (use it at your own risk)', + 'unloadallmods': 'Unload all custom modules', + 'updateallmods': 'Update all custom modules' + '\n\n* - required argument' + '\n short cmds:' + '\n loadmod - lm' + '\n unloadmod - ulm' + '\n modhash - mh' + '\n loadallmods - lmall' + '\n unloadallmods - ulmall', } diff --git a/userbot/modules/markitdown.py b/userbot/modules/markitdown.py index 10b5243..6061e2a 100644 --- a/userbot/modules/markitdown.py +++ b/userbot/modules/markitdown.py @@ -15,37 +15,35 @@ #  along with this program.  If not, see . import os + from pyrogram import Client, filters from pyrogram.types import Message - from utils.misc import modules_help -from utils.scripts import prefix, import_library, with_reply +from utils.scripts import import_library, prefix, with_reply -import_library("markitdown") +import_library('markitdown') from markitdown import MarkItDown -@Client.on_message(filters.command(["markitdown", "mkdn"], prefix) & filters.me) +@Client.on_message(filters.command(['markitdown', 'mkdn'], prefix) & filters.me) @with_reply async def markitdown(client: Client, message: Message): if message.reply_to_message.document: - await message.edit("Converting to Markdown...") + await message.edit('Converting to Markdown...') file = await message.reply_to_message.download() - file_name = (message.reply_to_message.document.file_name).split(".")[0] + ".md" + file_name = (message.reply_to_message.document.file_name).split('.')[0] + '.md' markitdown = MarkItDown() result = markitdown.convert(file) - with open(file_name, "w") as f: + with open(file_name, 'w') as f: f.write(result.text_content) - await message.edit("Uploading...") - await client.send_document( - message.chat.id, file_name, reply_to_message_id=message.reply_to_message.id - ) + await message.edit('Uploading...') + await client.send_document(message.chat.id, file_name, reply_to_message_id=message.reply_to_message.id) os.remove(file) os.remove(file_name) await message.delete() else: - await message.edit("Reply to a document to convert it to Markdown.") + await message.edit('Reply to a document to convert it to Markdown.') -modules_help["markitdown"] = {"markitdown": "Convert a document to Markdown."} +modules_help['markitdown'] = {'markitdown': 'Convert a document to Markdown.'} diff --git a/userbot/modules/mention.py b/userbot/modules/mention.py index 05db582..b1d1719 100644 --- a/userbot/modules/mention.py +++ b/userbot/modules/mention.py @@ -17,26 +17,23 @@ from pyrogram import Client, filters from pyrogram.types import Message from pyrogram.types.user_and_chats.user import Link - from utils.misc import modules_help, prefix def custom_mention(user, custom_text): return Link( - f"tg://user?id={user.id}", + f'tg://user?id={user.id}', custom_text, user._client.parse_mode, ) -@Client.on_message(filters.command("mention", prefix) & filters.me) +@Client.on_message(filters.command('mention', prefix) & filters.me) async def example_edit(client: Client, message: Message): chat_id = message.chat.id if message.reply_to_message and not len(message.text.split()) > 1: user = message.reply_to_message.from_user - custom_text = ( - message.text.split(maxsplit=1)[1] if len(message.text.split()) > 1 else None - ) + custom_text = message.text.split(maxsplit=1)[1] if len(message.text.split()) > 1 else None if custom_text: await message.edit(custom_mention(user, custom_text)) else: @@ -46,27 +43,23 @@ async def example_edit(client: Client, message: Message): if len(message.text.split()) > 1: user_id = message.text.split()[1] if user_id.isdigit(): - text = ( - message.text.split(maxsplit=2)[2] - if len(message.text.split()) > 2 - else None - ) + text = message.text.split(maxsplit=2)[2] if len(message.text.split()) > 2 else None if text: - men = Link(f"tg://user?id={user_id}", text, client.parse_mode) + men = Link(f'tg://user?id={user_id}', text, client.parse_mode) else: men = (await client.get_users(user_id)).mention await message.edit(men) else: - await message.edit("Invalid user_id") + await message.edit('Invalid user_id') await message.delete() else: - await message.edit("Reply to a message or provide a user_id") + await message.edit('Reply to a message or provide a user_id') await message.delete() -modules_help["mention"] = { - "mention": "Mention the user you replied to.", - "mention [custom_text]": "Mention the user you replied to with custom text.", - "mention [user_id] [custom_text]": "Mention a user by their user_id with custom text.", - "mention [user_id]": "Mention a user by their user_id.", +modules_help['mention'] = { + 'mention': 'Mention the user you replied to.', + 'mention [custom_text]': 'Mention the user you replied to with custom text.', + 'mention [user_id] [custom_text]': 'Mention a user by their user_id with custom text.', + 'mention [user_id]': 'Mention a user by their user_id.', } diff --git a/userbot/modules/mirror_flip.py b/userbot/modules/mirror_flip.py index c635094..93f27c9 100644 --- a/userbot/modules/mirror_flip.py +++ b/userbot/modules/mirror_flip.py @@ -1,14 +1,12 @@ # original module https://raw.githubusercontent.com/KeyZenD/modules/master/MirrorFlipV2.py | t.me/the_kzd import os - -from pyrogram import Client, filters, enums +from pyrogram import Client, enums, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix from utils.scripts import import_library -PIL = import_library("PIL", "pillow") +PIL = import_library('PIL', 'pillow') from PIL import Image, ImageOps @@ -19,7 +17,7 @@ async def make(client, message, o): downloads = await client.download_media(reply.photo.file_id) else: downloads = await client.download_media(reply.sticker.file_id) - path = f"{downloads}" + path = f'{downloads}' img = Image.open(path) await message.delete() w, h = img.size @@ -41,21 +39,19 @@ async def make(client, message, o): return await reply.reply_sticker(sticker=path) os.remove(path) - return await message.edit( - "Need to answer the photo/sticker", parse_mode=enums.ParseMode.HTML - ) + return await message.edit('Need to answer the photo/sticker', parse_mode=enums.ParseMode.HTML) -@Client.on_message(filters.command(["ll", "rr", "dd", "uu"], prefix) & filters.me) +@Client.on_message(filters.command(['ll', 'rr', 'dd', 'uu'], prefix) & filters.me) async def mirror_flip(client: Client, message: Message): - await message.edit("Processing...", parse_mode=enums.ParseMode.HTML) - param = {"ll": 1, "rr": 2, "dd": 3, "uu": 4}[message.command[0]] + await message.edit('Processing...', parse_mode=enums.ParseMode.HTML) + param = {'ll': 1, 'rr': 2, 'dd': 3, 'uu': 4}[message.command[0]] await make(client, message, param) -modules_help["mirror_flip"] = { - "ll [reply on photo or sticker]*": "reflects the left side", - "rr [reply on photo or sticker]*": "reflects the right side", - "uu [reply on photo or sticker]*": "reflects the top", - "dd [reply on photo or sticker]*": "reflects the bottom", +modules_help['mirror_flip'] = { + 'll [reply on photo or sticker]*': 'reflects the left side', + 'rr [reply on photo or sticker]*': 'reflects the right side', + 'uu [reply on photo or sticker]*': 'reflects the top', + 'dd [reply on photo or sticker]*': 'reflects the bottom', } diff --git a/userbot/modules/misc/autobackup.py b/userbot/modules/misc/autobackup.py index bfbc297..9c44111 100644 --- a/userbot/modules/misc/autobackup.py +++ b/userbot/modules/misc/autobackup.py @@ -1,8 +1,8 @@ -from pyrogram import Client, filters, enums -from pyrogram.types import Message - from os import listdir +from pyrogram import Client, enums, filters +from pyrogram.types import Message + # noinspection PyUnresolvedReferences from utils.misc import modules_help, prefix @@ -10,7 +10,7 @@ from utils.misc import modules_help, prefix from utils.scripts import format_exc -@Client.on_message(filters.command(["lback"], prefix) & filters.me) +@Client.on_message(filters.command(['lback'], prefix) & filters.me) async def backup_database_cmd(_: Client, message: Message): """ Backup the database. @@ -18,42 +18,40 @@ async def backup_database_cmd(_: Client, message: Message): if len(message.command) == 1: await message.edit("[😇] I think you didn't specify the name of the bot.") return - await message.edit_text( - "I'm copying the database...", parse_mode=enums.ParseMode.HTML - ) + await message.edit_text("I'm copying the database...", parse_mode=enums.ParseMode.HTML) try: name = message.command[1].lower() - folders = listdir("/root/") + folders = listdir('/root/') if name not in folders: - await message.edit("[😇] There is no such bot in the root folder.") + await message.edit('[😇] There is no such bot in the root folder.') return - folder = listdir("/root/" + name) + folder = listdir('/root/' + name) for file in folder: - if file.endswith((".db", ".sqlite", ".sqlite3")): + if file.endswith(('.db', '.sqlite', '.sqlite3')): await message.reply_document( - document="/root/" + name + "/" + file, - caption="Bot Database " + name + "", + document='/root/' + name + '/' + file, + caption='Bot Database ' + name + '', parse_mode=enums.ParseMode.HTML, ) return await message.delete() - folder = listdir("/root/" + name + "/assets") + folder = listdir('/root/' + name + '/assets') for file in folder: - if file.endswith((".db", ".sqlite", ".sqlite3")): + if file.endswith(('.db', '.sqlite', '.sqlite3')): await message.reply_document( - document="/root/" + name + "/assets/" + file, - caption="Bot Database " + name + "", + document='/root/' + name + '/assets/' + file, + caption='Bot Database ' + name + '', parse_mode=enums.ParseMode.HTML, ) return await message.delete() - await message.edit("[😇] Database not found.") + await message.edit('[😇] Database not found.') except Exception as ex: await message.edit_text( - "Failed to back up the database!\n\n" f"{format_exc(ex)}", + f'Failed to back up the database!\n\n{format_exc(ex)}', parse_mode=enums.ParseMode.HTML, ) -modules_help["autobackup"] = { - "lback [name]*": "Backup database from folder", - "lbackall": "Backup all databases", +modules_help['autobackup'] = { + 'lback [name]*': 'Backup database from folder', + 'lbackall': 'Backup all databases', } diff --git a/userbot/modules/misc/autofwd.py b/userbot/modules/misc/autofwd.py index 03f1bc9..070667a 100644 --- a/userbot/modules/misc/autofwd.py +++ b/userbot/modules/misc/autofwd.py @@ -15,140 +15,129 @@ #  along with this program.  If not, see . from pyrogram import Client, filters -from pyrogram.types import Message from pyrogram.errors import MessageTooLong - -from utils.misc import modules_help, prefix +from pyrogram.types import Message from utils.db import db +from utils.misc import modules_help, prefix def addtrg(channel_id): - channel_ids = db.get("custom.autofwd", "chatto", default=[]) + channel_ids = db.get('custom.autofwd', 'chatto', default=[]) if channel_id not in channel_ids: channel_ids.append(channel_id) - db.set("custom.autofwd", "chatto", channel_ids) + db.set('custom.autofwd', 'chatto', channel_ids) def rmtrg(channel_id): - channel_ids = db.get("custom.autofwd", "chatto", default=[]) + channel_ids = db.get('custom.autofwd', 'chatto', default=[]) if channel_id in channel_ids: channel_ids.remove(channel_id) - db.set("custom.autofwd", "chatto", channel_ids) + db.set('custom.autofwd', 'chatto', channel_ids) def addsrc(channel_id): - channel_ids = db.get("custom.autofwd", "chatsrc", default=[]) + channel_ids = db.get('custom.autofwd', 'chatsrc', default=[]) if channel_id not in channel_ids: channel_ids.append(channel_id) - db.set("custom.autofwd", "chatsrc", channel_ids) + db.set('custom.autofwd', 'chatsrc', channel_ids) def rmsrc(channel_id): - channel_ids = db.get("custom.autofwd", "chatsrc", default=[]) + channel_ids = db.get('custom.autofwd', 'chatsrc', default=[]) if channel_id in channel_ids: channel_ids.remove(channel_id) - db.set("custom.autofwd", "chatsrc", channel_ids) + db.set('custom.autofwd', 'chatsrc', channel_ids) def getfwd_data(): - source_chats = db.get("custom.autofwd", "chatsrc") - target_chats = db.get("custom.autofwd", "chatto") + source_chats = db.get('custom.autofwd', 'chatsrc') + target_chats = db.get('custom.autofwd', 'chatto') return source_chats, target_chats -@Client.on_message(filters.command(["addfwd_src", "addfwd_to"], prefix) & filters.me) +@Client.on_message(filters.command(['addfwd_src', 'addfwd_to'], prefix) & filters.me) async def addfwd(_, message: Message): - if message.command[0] == "addfwd_src": + if message.command[0] == 'addfwd_src': if len(message.command) > 1: channel_id = message.text.split(maxsplit=1)[1] - if not channel_id.startswith("-100"): - channel_id = "-100" + channel_id + if not channel_id.startswith('-100'): + channel_id = '-100' + channel_id # chat id should be integer if not channel_id.isdigit(): try: channel_id = int(channel_id) except Exception: - return await message.edit_text("Chat id should be in integer") + return await message.edit_text('Chat id should be in integer') addsrc(channel_id=channel_id) - await message.edit_text( - f"Auto Forwarding Enabled for Chat with id: {channel_id}" - ) + await message.edit_text(f'Auto Forwarding Enabled for Chat with id: {channel_id}') else: - await message.edit_text("Chat id not provided!") + await message.edit_text('Chat id not provided!') return - elif message.command[0] == "addfwd_to": + elif message.command[0] == 'addfwd_to': if len(message.command) > 1: channel_id = message.text.split(maxsplit=1)[1] - if not channel_id.startswith("-100"): - channel_id = "-100" + channel_id + if not channel_id.startswith('-100'): + channel_id = '-100' + channel_id # chat id should be integer if not channel_id.isdigit(): try: channel_id = int(channel_id) except Exception: - return await message.edit_text("Chat id should be in integer") + return await message.edit_text('Chat id should be in integer') addtrg(channel_id=channel_id) - await message.edit_text( - f"Auto Forwarding Enabled to Chat with id: {channel_id}" - ) + await message.edit_text(f'Auto Forwarding Enabled to Chat with id: {channel_id}') else: - await message.edit_text("Chat id not provided!") + await message.edit_text('Chat id not provided!') return -@Client.on_message(filters.command(["delfwd_src", "delfwd_to"], prefix) & filters.me) +@Client.on_message(filters.command(['delfwd_src', 'delfwd_to'], prefix) & filters.me) async def delfwd(_, message: Message): - if message.command[0] == "delfwd_src": + if message.command[0] == 'delfwd_src': if len(message.command) > 1: channel_id = message.text.split(maxsplit=1)[1] - if not channel_id.startswith("-100"): - channel_id = "-100" + channel_id + if not channel_id.startswith('-100'): + channel_id = '-100' + channel_id # chat id should be integer if not channel_id.isdigit(): try: channel_id = int(channel_id) except Exception: - return await message.edit_text("Chat id should be in integer") + return await message.edit_text('Chat id should be in integer') rmsrc(channel_id=channel_id) - await message.edit_text( - f"Auto Forwarding Disabled for Chat with id: {channel_id}" - ) + await message.edit_text(f'Auto Forwarding Disabled for Chat with id: {channel_id}') else: - await message.edit_text("Chat id not provided!") + await message.edit_text('Chat id not provided!') return - elif message.command[0] == "delfwd_to": + elif message.command[0] == 'delfwd_to': if len(message.command) > 1: channel_id = message.text.split(maxsplit=1)[1] - if not channel_id.startswith("-100"): - channel_id = "-100" + channel_id + if not channel_id.startswith('-100'): + channel_id = '-100' + channel_id # chat id should be integer if not channel_id.isdigit(): try: channel_id = int(channel_id) except Exception: - return await message.edit_text("Chat id should be in integer") + return await message.edit_text('Chat id should be in integer') rmtrg(channel_id=channel_id) - await message.edit_text( - f"Auto Forwarding Disabled to Chat with id: {channel_id}" - ) + await message.edit_text(f'Auto Forwarding Disabled to Chat with id: {channel_id}') else: - await message.edit_text("Chat id not provided!") + await message.edit_text('Chat id not provided!') return -@Client.on_message(filters.command("autofwd", prefix) & filters.me) +@Client.on_message(filters.command('autofwd', prefix) & filters.me) async def autofwd(_, message: Message): source_chats, target_chats = getfwd_data() - return await message.edit_text( - f"Source Chats: {source_chats}\nTarget Chats: {target_chats}" - ) + return await message.edit_text(f'Source Chats: {source_chats}\nTarget Chats: {target_chats}') @Client.on_message(filters.channel | filters.group) async def autofwd_main(client: Client, message: Message): chat_id = message.chat.id - source_chats = db.get("custom.autofwd", "chatsrc") - target_chats = db.get("custom.autofwd", "chatto") + source_chats = db.get('custom.autofwd', 'chatsrc') + target_chats = db.get('custom.autofwd', 'chatto') if source_chats is not None and chat_id in source_chats: if target_chats is not None: @@ -158,20 +147,20 @@ async def autofwd_main(client: Client, message: Message): except Exception as e: try: await client.send_message( - "me", - f"Auto Forwarding Failed for Chat with id: {chat_id} to {chat}\n\n{e}", + 'me', + f'Auto Forwarding Failed for Chat with id: {chat_id} to {chat}\n\n{e}', ) except MessageTooLong: await client.send_message( - "me", - f"Auto Forwarding Failed for Chat with id: {chat_id} to {chat}, Please check logs!", + 'me', + f'Auto Forwarding Failed for Chat with id: {chat_id} to {chat}, Please check logs!', ) -modules_help["autofwd"] = { - "autofwd": "Retrieve Data of auto fwd", - "addfwd_src [channel_id]*": "Enable auto forwarding for a channel", - "addfwd_to [channel_id]*": "Enable auto forwarding to a channel", - "delfwd_src [channel_id]*": "Disable auto forwarding for a channel", - "delfwd_to [channel_id]*": "Disable auto forwarding to a channel", +modules_help['autofwd'] = { + 'autofwd': 'Retrieve Data of auto fwd', + 'addfwd_src [channel_id]*': 'Enable auto forwarding for a channel', + 'addfwd_to [channel_id]*': 'Enable auto forwarding to a channel', + 'delfwd_src [channel_id]*': 'Disable auto forwarding for a channel', + 'delfwd_to [channel_id]*': 'Disable auto forwarding to a channel', } diff --git a/userbot/modules/misc/backup.py b/userbot/modules/misc/backup.py index 49ffb2f..0b1acde 100644 --- a/userbot/modules/misc/backup.py +++ b/userbot/modules/misc/backup.py @@ -1,106 +1,95 @@ import os - import shutil -from pyrogram import Client, filters, enums +from pyrogram import Client, enums, filters from pyrogram.types import Message +from utils import config +from utils.db import db # noinspection PyUnresolvedReferences from utils.misc import modules_help, prefix from utils.scripts import format_exc, restart -from utils.db import db -from utils import config -if config.db_type in ["mongodb", "mongo"]: +if config.db_type in ['mongodb', 'mongo']: import bson def dump_mongo(collections, path, db_): for coll in collections: - with open(os.path.join(path, f"{coll}.bson"), "wb+") as f: + with open(os.path.join(path, f'{coll}.bson'), 'wb+') as f: for doc in db_[coll].find(): f.write(bson.BSON.encode(doc)) def restore_mongo(path, db_): for coll in os.listdir(path): - if coll.endswith(".bson"): - with open(os.path.join(path, coll), "rb+") as f: - db_[coll.split(".")[0]].insert_many(bson.decode_all(f.read())) + if coll.endswith('.bson'): + with open(os.path.join(path, coll), 'rb+') as f: + db_[coll.split('.')[0]].insert_many(bson.decode_all(f.read())) -@Client.on_message(filters.command(["backup", "back"], prefix) & filters.me) +@Client.on_message(filters.command(['backup', 'back'], prefix) & filters.me) async def backup(client: Client, message: Message): """ Backup the database """ try: - if not os.path.exists("backups/"): - os.mkdir("backups/") + if not os.path.exists('backups/'): + os.mkdir('backups/') - await message.edit( - "Backing up database...", parse_mode=enums.ParseMode.HTML - ) + await message.edit('Backing up database...', parse_mode=enums.ParseMode.HTML) - if config.db_type in ["mongo", "mongodb"]: - dump_mongo(db._database.list_collection_names(), "backups/", db._database) + if config.db_type in ['mongo', 'mongodb']: + dump_mongo(db._database.list_collection_names(), 'backups/', db._database) return await message.edit( - f"Database backed up to: backups/ folder", + 'Database backed up to: backups/ folder', parse_mode=enums.ParseMode.HTML, ) else: - shutil.copy(config.db_name, f"backups/{config.db_name}") + shutil.copy(config.db_name, f'backups/{config.db_name}') await client.send_document( - "me", - caption=f"Database backup complete!\nType: " - f".restore in response to this message to restore the database.", - document=f"backups/{config.db_name}", + 'me', + caption='Database backup complete!\nType: ' + '.restore in response to this message to restore the database.', + document=f'backups/{config.db_name}', parse_mode=enums.ParseMode.HTML, ) return await message.edit( - "Database backed up successfully! (Check your favorites)", + 'Database backed up successfully! (Check your favorites)', parse_mode=enums.ParseMode.HTML, ) except Exception as e: await message.edit(format_exc(e), parse_mode=enums.ParseMode.HTML) -@Client.on_message(filters.command(["restore", "res"], prefix) & filters.me) +@Client.on_message(filters.command(['restore', 'res'], prefix) & filters.me) async def restore(client: Client, message: Message): """ Restore the database """ try: - await message.edit( - "Restoring database...", parse_mode=enums.ParseMode.HTML - ) - if config.db_type in ["mongo", "mongodb"]: - restore_mongo("backups/", db._database) + await message.edit('Restoring database...', parse_mode=enums.ParseMode.HTML) + if config.db_type in ['mongo', 'mongodb']: + restore_mongo('backups/', db._database) return await message.edit( - f"Database restored from: backups/ folder", + 'Database restored from: backups/ folder', parse_mode=enums.ParseMode.HTML, ) else: if not message.reply_to_message or not message.reply_to_message.document: return await message.edit( - "Reply to a document to restore the database.", + 'Reply to a document to restore the database.', parse_mode=enums.ParseMode.HTML, ) - elif not message.reply_to_message.document.file_name.casefold().endswith( - (".db", ".sqlite", ".sqlite3") - ): + elif not message.reply_to_message.document.file_name.casefold().endswith(('.db', '.sqlite', '.sqlite3')): return await message.edit( - "Reply to a database file to restore the database.", + 'Reply to a database file to restore the database.', parse_mode=enums.ParseMode.HTML, ) - await message.reply_to_message.download( - f"backups/{message.reply_to_message.document.file_name}" - ) - shutil.copy( - f"backups/{message.reply_to_message.document.file_name}", config.db_name - ) + await message.reply_to_message.download(f'backups/{message.reply_to_message.document.file_name}') + shutil.copy(f'backups/{message.reply_to_message.document.file_name}', config.db_name) await message.edit( - "Database restored successfully!", + 'Database restored successfully!', parse_mode=enums.ParseMode.HTML, ) restart() @@ -108,104 +97,96 @@ async def restore(client: Client, message: Message): await message.edit(format_exc(e), parse_mode=enums.ParseMode.HTML) -@Client.on_message(filters.command(["backupmods", "bms"], prefix) & filters.me) +@Client.on_message(filters.command(['backupmods', 'bms'], prefix) & filters.me) async def backupmods(client: Client, message: Message): """ Backup the modules """ try: - if not os.path.exists("backups/"): - os.mkdir("backups/") + if not os.path.exists('backups/'): + os.mkdir('backups/') - await message.edit( - "Backing up modules...", parse_mode=enums.ParseMode.HTML - ) + await message.edit('Backing up modules...', parse_mode=enums.ParseMode.HTML) from utils.misc import modules_help for mod in modules_help: - if os.path.isfile(f"modules/custom_modules/{mod}.py"): - f = open(f"backups/{mod}.py", "wb") - f.write(open(f"modules/custom_modules/{mod}.py", "rb").read()) + if os.path.isfile(f'modules/custom_modules/{mod}.py'): + f = open(f'backups/{mod}.py', 'wb') + f.write(open(f'modules/custom_modules/{mod}.py', 'rb').read()) await message.edit( - text=f"All modules backed up to: backups/ folder", + text='All modules backed up to: backups/ folder', parse_mode=enums.ParseMode.HTML, ) except Exception as e: await message.edit(format_exc(e), parse_mode=enums.ParseMode.HTML) -@Client.on_message(filters.command(["backupmod", "bm"], prefix) & filters.me) +@Client.on_message(filters.command(['backupmod', 'bm'], prefix) & filters.me) async def backupmod(client: Client, message: Message): """ Backup the module """ try: - if not os.path.exists("backups/"): - os.mkdir("backups/") - from utils.misc import modules_help + if not os.path.exists('backups/'): + os.mkdir('backups/') try: - mod = message.text.split(maxsplit=1)[1].split(".")[0] + mod = message.text.split(maxsplit=1)[1].split('.')[0] except: return await message.edit( - f"Usage: {prefix}backupmod [module]", + f'Usage: {prefix}backupmod [module]', parse_mode=enums.ParseMode.HTML, ) - await message.edit( - "Backing up module...", parse_mode=enums.ParseMode.HTML - ) + await message.edit('Backing up module...', parse_mode=enums.ParseMode.HTML) - if os.path.isfile(f"modules/custom_modules/{mod}.py"): - f = open(f"backups/{mod}.py", "wb") - f.write(open(f"modules/custom_modules/{mod}.py", "rb").read()) + if os.path.isfile(f'modules/custom_modules/{mod}.py'): + f = open(f'backups/{mod}.py', 'wb') + f.write(open(f'modules/custom_modules/{mod}.py', 'rb').read()) else: return await message.edit( - f"Module {mod} not found.", + f'Module {mod} not found.', parse_mode=enums.ParseMode.HTML, ) await message.reply_document( - document=f"backups/{mod}.py", - caption=f"Module {mod} backed up to: backups/ folder", + document=f'backups/{mod}.py', + caption=f'Module {mod} backed up to: backups/ folder', parse_mode=enums.ParseMode.HTML, ) except Exception as e: await message.edit(format_exc(e), parse_mode=enums.ParseMode.HTML) -@Client.on_message(filters.command(["restoremod", "resmod"], prefix) & filters.me) +@Client.on_message(filters.command(['restoremod', 'resmod'], prefix) & filters.me) async def restoremod(client: Client, message: Message): """ Restore the module """ try: - if not os.path.exists("backups/"): - os.mkdir("backups/") - from utils.misc import modules_help + if not os.path.exists('backups/'): + os.mkdir('backups/') try: - mod = message.text.split(maxsplit=1)[1].split(".")[0] + mod = message.text.split(maxsplit=1)[1].split('.')[0] except: return await message.edit( - f"Usage: {prefix}restoremod [module]", + f'Usage: {prefix}restoremod [module]', parse_mode=enums.ParseMode.HTML, ) - await message.edit( - "Restoring module...", parse_mode=enums.ParseMode.HTML - ) + await message.edit('Restoring module...', parse_mode=enums.ParseMode.HTML) - if os.path.isfile(f"backups/{mod}.py"): - f = open(f"modules/custom_modules/{mod}.py", "wb") - f.write(open(f"backups/{mod}.py", "rb").read()) + if os.path.isfile(f'backups/{mod}.py'): + f = open(f'modules/custom_modules/{mod}.py', 'wb') + f.write(open(f'backups/{mod}.py', 'rb').read()) else: return await message.edit( - f"Module {mod} not found.", + f'Module {mod} not found.', parse_mode=enums.ParseMode.HTML, ) await message.edit( - f"Module {mod} restored successfully!", + f'Module {mod} restored successfully!', parse_mode=enums.ParseMode.HTML, ) restart() @@ -213,27 +194,25 @@ async def restoremod(client: Client, message: Message): await message.edit(format_exc(e), parse_mode=enums.ParseMode.HTML) -@Client.on_message(filters.command(["restoremods", "resmods"], prefix) & filters.me) +@Client.on_message(filters.command(['restoremods', 'resmods'], prefix) & filters.me) async def restoremods(client: Client, message: Message): """ Restore the modules """ try: - if not os.path.exists("backups/"): - os.mkdir("backups/") + if not os.path.exists('backups/'): + os.mkdir('backups/') - await message.edit( - "Restoring modules...", parse_mode=enums.ParseMode.HTML - ) + await message.edit('Restoring modules...', parse_mode=enums.ParseMode.HTML) - for mod in os.listdir("backups/"): - if mod.endswith(".py"): - if os.path.isfile(f"modules/{mod}"): + for mod in os.listdir('backups/'): + if mod.endswith('.py'): + if os.path.isfile(f'modules/{mod}'): continue - f = open(f"modules/custom_modules/{mod}", "wb") - f.write(open(f"backups/{mod}", "rb").read()) + f = open(f'modules/custom_modules/{mod}', 'wb') + f.write(open(f'backups/{mod}', 'rb').read()) await message.edit( - text=f"All modules restored from: backups/ folder", + text='All modules restored from: backups/ folder', parse_mode=enums.ParseMode.HTML, ) restart() @@ -241,11 +220,11 @@ async def restoremods(client: Client, message: Message): await message.edit(format_exc(e), parse_mode=enums.ParseMode.HTML) -modules_help["backup"] = { - "backup": f"Backup database", - "restore [reply]": f"Restore database", - "backupmod [name]": f"Backup mod", - "backupmods": f"Backup all mods", - "resmod [name]": f"Restore mod", - "resmods": f"Restore all mods", +modules_help['backup'] = { + 'backup': 'Backup database', + 'restore [reply]': 'Restore database', + 'backupmod [name]': 'Backup mod', + 'backupmods': 'Backup all mods', + 'resmod [name]': 'Restore mod', + 'resmods': 'Restore all mods', } diff --git a/userbot/modules/misc/cama.py b/userbot/modules/misc/cama.py index ed51d42..a61f490 100644 --- a/userbot/modules/misc/cama.py +++ b/userbot/modules/misc/cama.py @@ -1,109 +1,95 @@ -from pyrogram import Client, filters import requests - +from pyrogram import Client, filters +from utils.misc import modules_help, prefix from utils.scripts import format_exc, import_library -from utils.misc import modules_help, prefix +pcp = import_library('pubchempy') -pcp = import_library("pubchempy") - -INATURALIST_API_URL = "https://api.inaturalist.org/v1/observations" +INATURALIST_API_URL = 'https://api.inaturalist.org/v1/observations' def get_marine_life_details(species_name): params = { - "taxon_name": species_name, - "quality_grade": "research", - "iconic_taxa": "Mollusca,Fish,Crustacea", - "per_page": 1, + 'taxon_name': species_name, + 'quality_grade': 'research', + 'iconic_taxa': 'Mollusca,Fish,Crustacea', + 'per_page': 1, } response = requests.get(INATURALIST_API_URL, params=params) if response.status_code == 200: data = response.json() - if data["total_results"] > 0: - observation = data["results"][0] - species = observation["taxon"]["name"] - common_name = observation["taxon"]["preferred_common_name"] - photo_url = ( - observation["photos"][0]["url"] - if observation["photos"] - else "No photo available" - ) - description = ( - observation["description"] - if "description" in observation - else "No description available." - ) + if data['total_results'] > 0: + observation = data['results'][0] + species = observation['taxon']['name'] + common_name = observation['taxon']['preferred_common_name'] + photo_url = observation['photos'][0]['url'] if observation['photos'] else 'No photo available' + description = observation['description'] if 'description' in observation else 'No description available.' return { - "species": species, - "common_name": common_name, - "photo_url": photo_url, - "description": description, + 'species': species, + 'common_name': common_name, + 'photo_url': photo_url, + 'description': description, } else: - return {"error": "No marine life found for this species."} + return {'error': 'No marine life found for this species.'} else: - return { - "error": f"Error {response.status_code}: Unable to connect to iNaturalist API." - } + return {'error': f'Error {response.status_code}: Unable to connect to iNaturalist API.'} -@Client.on_message(filters.command("camistry", prefix) & filters.me) +@Client.on_message(filters.command('camistry', prefix) & filters.me) async def fetch_chemical_data_with_visual(_, message): - query = " ".join(message.text.split()[1:]) # Combine query words properly + query = ' '.join(message.text.split()[1:]) # Combine query words properly try: # Fetch chemical data by name - results = pcp.get_compounds(query, "name", record_type="3d") + results = pcp.get_compounds(query, 'name', record_type='3d') if results: compound = results[0] # Send chemical information without SMILES structure info = ( - f"Chemical Data for {compound.iupac_name}\n\n" - f"Molecular Formula: {compound.molecular_formula}\n" - f"Molecular Weight: {compound.molecular_weight}\n" - f"CID: {compound.cid}\n" - f"Synonyms: {', '.join(compound.synonyms[:5])}\n" + f'Chemical Data for {compound.iupac_name}\n\n' + f'Molecular Formula: {compound.molecular_formula}\n' + f'Molecular Weight: {compound.molecular_weight}\n' + f'CID: {compound.cid}\n' + f'Synonyms: {", ".join(compound.synonyms[:5])}\n' ) await message.edit_text(info) else: await message.edit_text(f"No chemical data found for the query: '{query}'") except pcp.PubChemHTTPError as http_err: - await message.edit_text(f"HTTP error occurred: {format_exc(http_err)}") + await message.edit_text(f'HTTP error occurred: {format_exc(http_err)}') except Exception as e: - await message.edit_text(f"An error occurred: {format_exc(e)}") + await message.edit_text(f'An error occurred: {format_exc(e)}') -@Client.on_message(filters.command("marinelife", prefix) & filters.me) +@Client.on_message(filters.command('marinelife', prefix) & filters.me) async def marine_life_command(_, message): if len(message.command) < 2: - await message.edit_text( - f"Please specify a species name. Example: {prefix}marinelife dolphin" - ) + await message.edit_text(f'Please specify a species name. Example: {prefix}marinelife dolphin') return - species_name = " ".join(message.command[1:]) + species_name = ' '.join(message.command[1:]) marine_life = get_marine_life_details(species_name) - if "error" in marine_life: - await message.edit_text(marine_life["error"]) + if 'error' in marine_life: + await message.edit_text(marine_life['error']) else: reply_text = ( - f"Species: {marine_life['species']}\n" - f"Common Name: {marine_life['common_name']}\n" - f"Description: {marine_life['description']}\n" + f'Species: {marine_life["species"]}\n' + f'Common Name: {marine_life["common_name"]}\n' + f'Description: {marine_life["description"]}\n' f"Photo" ) await message.edit_text(reply_text) -modules_help["cama"] = { - "camistry [text]": " getting camicale info", - "marinelife [text]": " getting marinelife info", +modules_help['cama'] = { + 'camistry [text]': ' getting camicale info', + 'marinelife [text]': ' getting marinelife info', } diff --git a/userbot/modules/misc/mlog.py b/userbot/modules/misc/mlog.py index 31e5d0b..e6a4797 100644 --- a/userbot/modules/misc/mlog.py +++ b/userbot/modules/misc/mlog.py @@ -1,65 +1,60 @@ import asyncio import os +from collections import defaultdict + from pyrogram import Client, filters from pyrogram.errors import ( FileReferenceExpired, FileReferenceInvalid, - TopicDeleted, TopicClosed, + TopicDeleted, ) from pyrogram.types import Message -from collections import defaultdict - from utils.db import db from utils.misc import modules_help, prefix -mlog_enabled = filters.create(lambda _, __, ___: db.get("custom.mlog", "status", False)) +mlog_enabled = filters.create(lambda _, __, ___: db.get('custom.mlog', 'status', False)) # Media cache and processing tasks user_media_cache = defaultdict(list) media_processing_tasks = {} + # Helper to get group-specific data def get_group_data(group_id): - return db.get(f"custom.mlog", str(group_id), {}) + return db.get('custom.mlog', str(group_id), {}) + # Helper to update group-specific data def update_group_data(group_id, data): - db.set(f"custom.mlog", str(group_id), data) + db.set('custom.mlog', str(group_id), data) -@Client.on_message(filters.command(["mlog"], prefix) & filters.me) +@Client.on_message(filters.command(['mlog'], prefix) & filters.me) async def mlog(_, message: Message): - if len(message.command) < 2 or message.command[1].lower() not in ["on", "off"]: - return await message.edit(f"Usage: {prefix}mlog [on/off]") + if len(message.command) < 2 or message.command[1].lower() not in ['on', 'off']: + return await message.edit(f'Usage: {prefix}mlog [on/off]') - status = message.command[1].lower() == "on" - db.set("custom.mlog", "status", status) - await message.edit(f"Media logging is now {'enabled' if status else 'disabled'}") + status = message.command[1].lower() == 'on' + db.set('custom.mlog', 'status', status) + await message.edit(f'Media logging is now {"enabled" if status else "disabled"}') -@Client.on_message(filters.command(["msetchat"], prefix) & filters.me) +@Client.on_message(filters.command(['msetchat'], prefix) & filters.me) async def set_chat(_, message: Message): if len(message.command) < 2: - return await message.edit(f"Usage: {prefix}msetchat [chat_id]") + return await message.edit(f'Usage: {prefix}msetchat [chat_id]') try: chat_id = message.command[1] - chat_id = int("-100" + chat_id if not chat_id.startswith("-100") else chat_id) - db.set("custom.mlog", "chat", chat_id) - await message.edit(f"Chat ID set to {chat_id}") + chat_id = int('-100' + chat_id if not chat_id.startswith('-100') else chat_id) + db.set('custom.mlog', 'chat', chat_id) + await message.edit(f'Chat ID set to {chat_id}') except ValueError: - await message.edit("Invalid chat ID") + await message.edit('Invalid chat ID') -@Client.on_message( - mlog_enabled - & filters.incoming - & filters.private - & filters.media - & ~filters.me - & ~filters.bot -) +@Client.on_message(mlog_enabled & filters.incoming & filters.private & filters.media & ~filters.me & ~filters.bot) async def media_log(client: Client, message: Message): user_id = message.from_user.id user_media_cache[user_id].append(message) @@ -76,26 +71,26 @@ async def process_media(client: Client, user): if user_id == me.id: return - chat_id = db.get("custom.mlog", "chat") + chat_id = db.get('custom.mlog', 'chat') if not chat_id: return await client.send_message( - "me", - f"Media Logger is on, but no Chat ID is set. Use {prefix}msetchat to set it.", + 'me', + f'Media Logger is on, but no Chat ID is set. Use {prefix}msetchat to set it.', ) group_data = get_group_data(chat_id) - user_topics = group_data.get("user_topics", {}) + user_topics = group_data.get('user_topics', {}) topic_id = user_topics.get(str(user_id)) # Fetch user's topic ID if it exists if not topic_id: topic = await client.create_forum_topic(chat_id, user.first_name) topic_id = topic.id user_topics[str(user_id)] = topic_id # Store topic ID for this user - update_group_data(chat_id, {"user_topics": user_topics}) + update_group_data(chat_id, {'user_topics': user_topics}) m = await client.send_message( chat_id=chat_id, message_thread_id=topic_id, - text=f"Chat Name: {user.full_name}\nUser ID: {user_id}\nUsername: @{user.username or 'N/A'}\nPhone No: +{user.phone_number or 'N/A'}", + text=f'Chat Name: {user.full_name}\nUser ID: {user_id}\nUsername: @{user.username or "N/A"}\nPhone No: +{user.phone_number or "N/A"}', ) await m.pin() @@ -111,11 +106,11 @@ async def process_media(client: Client, user): topic = await client.create_forum_topic(chat_id, user.first_name) topic_id = topic.id user_topics[str(user_id)] = topic_id # Update the new topic ID - update_group_data(chat_id, {"user_topics": user_topics}) + update_group_data(chat_id, {'user_topics': user_topics}) await client.send_message( chat_id=chat_id, message_thread_id=topic_id, - text=f"Chat Name: {user.full_name}\nUser ID: {user_id}\nUsername: @{user.username or 'N/A'}\nPhone No: +{user.phone_number or 'N/A'}", + text=f'Chat Name: {user.full_name}\nUser ID: {user_id}\nUsername: @{user.username or "N/A"}\nPhone No: +{user.phone_number or "N/A"}', ) await handle_self_destruct_media(client, media_message, chat_id, topic_id) except TopicClosed: @@ -135,10 +130,10 @@ async def handle_self_destruct_media(client: Client, message: Message, chat_id: await client.send_video(chat_id, file_path, message_thread_id=topic_id) os.remove(file_path) # Clean up after sending except Exception as e: - print(f"Error handling self-destructing media: {e}") + print(f'Error handling self-destructing media: {e}') -modules_help["mlog"] = { - "mlog [on/off]": "Enable or disable media logging", - "msetchat [chat_id]": "Set the chat ID for media logging", +modules_help['mlog'] = { + 'mlog [on/off]': 'Enable or disable media logging', + 'msetchat [chat_id]': 'Set the chat ID for media logging', } diff --git a/userbot/modules/misc/prayer.py b/userbot/modules/misc/prayer.py index 83219ee..bf2d33c 100644 --- a/userbot/modules/misc/prayer.py +++ b/userbot/modules/misc/prayer.py @@ -1,46 +1,46 @@ -from pyrogram import Client, filters -from pyrogram.types import Message -import aiohttp from datetime import datetime +import aiohttp +from pyrogram import Client, filters +from pyrogram.types import Message from utils.misc import modules_help, prefix # Aladhan API credentials -ALADHAN_API_URL = "https://api.aladhan.com/v1/timingsByCity" +ALADHAN_API_URL = 'https://api.aladhan.com/v1/timingsByCity' DEFAULT_METHOD = 2 # Islamic Society of North America -DEFAULT_CITY = "Lahore" -DEFAULT_COUNTRY = "PK" +DEFAULT_CITY = 'Lahore' +DEFAULT_COUNTRY = 'PK' async def fetch_namaz_times(city_name: str, country_name: str) -> dict: - params = {"city": city_name, "country": country_name, "method": DEFAULT_METHOD} + params = {'city': city_name, 'country': country_name, 'method': DEFAULT_METHOD} async with aiohttp.ClientSession() as session: try: async with session.get(ALADHAN_API_URL, params=params) as response: response.raise_for_status() return await response.json() except Exception as e: - return {"error": str(e)} + return {'error': str(e)} def format_time_12hr(time_str: str) -> str: try: # Split time into hours and minutes - hours, minutes = map(int, time_str.split(":")) + hours, minutes = map(int, time_str.split(':')) # Convert to 12-hour format - period = "AM" if hours < 12 else "PM" + period = 'AM' if hours < 12 else 'PM' if hours == 0: hours = 12 elif hours > 12: hours -= 12 elif hours == 12: - period = "PM" - return f"{hours}:{minutes:02d} {period}" + period = 'PM' + return f'{hours}:{minutes:02d} {period}' except Exception as e: - return f"Error formatting time: {str(e)}" + return f'Error formatting time: {str(e)}' -@Client.on_message(filters.command("prayer", prefix) & filters.me) +@Client.on_message(filters.command('prayer', prefix) & filters.me) async def namaz_times(client: Client, message: Message): if message.reply_to_message: city_name = message.reply_to_message.text @@ -59,32 +59,32 @@ async def namaz_times(client: Client, message: Message): data = await fetch_namaz_times(city_name, country_name) - if "error" in data: - result = f"Error: {data['error']}" - elif "data" in data: - timings = data["data"]["timings"] - today = datetime.now().strftime("%Y-%m-%d") + if 'error' in data: + result = f'Error: {data["error"]}' + elif 'data' in data: + timings = data['data']['timings'] + today = datetime.now().strftime('%Y-%m-%d') formatted_timings = { - "Fajr": format_time_12hr(timings["Fajr"]), - "Dhuhr": format_time_12hr(timings["Dhuhr"]), - "Asr": format_time_12hr(timings["Asr"]), - "Maghrib": format_time_12hr(timings["Maghrib"]), - "Isha": format_time_12hr(timings["Isha"]), + 'Fajr': format_time_12hr(timings['Fajr']), + 'Dhuhr': format_time_12hr(timings['Dhuhr']), + 'Asr': format_time_12hr(timings['Asr']), + 'Maghrib': format_time_12hr(timings['Maghrib']), + 'Isha': format_time_12hr(timings['Isha']), } result = ( - f"Prayer Times for {city_name}, {country_name} on {today}:\n\n" - f"Fajr: {formatted_timings['Fajr']}\n" - f"Dhuhr: {formatted_timings['Dhuhr']}\n" - f"Asr: {formatted_timings['Asr']}\n" - f"Maghrib: {formatted_timings['Maghrib']}\n" - f"Isha: {formatted_timings['Isha']}\n" + f'Prayer Times for {city_name}, {country_name} on {today}:\n\n' + f'Fajr: {formatted_timings["Fajr"]}\n' + f'Dhuhr: {formatted_timings["Dhuhr"]}\n' + f'Asr: {formatted_timings["Asr"]}\n' + f'Maghrib: {formatted_timings["Maghrib"]}\n' + f'Isha: {formatted_timings["Isha"]}\n' ) else: - result = "Error: Unable to get prayer times for the specified location." + result = 'Error: Unable to get prayer times for the specified location.' await message.edit_text(result) -modules_help["namaz"] = { - "prayer [city_name] [country_name]": "Shows the prayer times. Default to Pakistan if no country is provided" +modules_help['namaz'] = { + 'prayer [city_name] [country_name]': 'Shows the prayer times. Default to Pakistan if no country is provided' } diff --git a/userbot/modules/misc/safone.py b/userbot/modules/misc/safone.py index f97f2b9..e54c0a2 100644 --- a/userbot/modules/misc/safone.py +++ b/userbot/modules/misc/safone.py @@ -14,41 +14,40 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import os -import requests -import aiofiles import base64 +import os +import aiofiles +import requests from pyrogram import Client, enums, filters -from pyrogram.types import Message, InputMediaPhoto from pyrogram.errors import MediaCaptionTooLong, MessageTooLong - -from utils.misc import prefix, modules_help +from pyrogram.types import InputMediaPhoto, Message +from utils.misc import modules_help, prefix from utils.scripts import format_exc -url = "https://api.safone.co" +url = 'https://api.safone.co' headers = { - "Accept-Language": "en-US,en;q=0.9", - "Connection": "keep-alive", - "DNT": "1", - "Referer": "https://api.safone.dev/docs", - "Sec-Fetch-Dest": "empty", - "Sec-Fetch-Mode": "cors", - "Sec-Fetch-Site": "same-origin", - "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36", - "accept": "application/json", - "sec-ch-ua": '"Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"', - "sec-ch-ua-mobile": "?0", - "sec-ch-ua-platform": '"Linux"', + 'Accept-Language': 'en-US,en;q=0.9', + 'Connection': 'keep-alive', + 'DNT': '1', + 'Referer': 'https://api.safone.dev/docs', + 'Sec-Fetch-Dest': 'empty', + 'Sec-Fetch-Mode': 'cors', + 'Sec-Fetch-Site': 'same-origin', + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36', + 'accept': 'application/json', + 'sec-ch-ua': '"Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"', + 'sec-ch-ua-mobile': '?0', + 'sec-ch-ua-platform': '"Linux"', } -async def make_carbon(code): - url = "https://carbonara.solopov.dev/api/cook" - async with aiohttp.ClientSession() as session: - async with session.post(url, json={"code": code}) as resp: - image_data = await resp.read() +async def make_carbon(code): + url = 'https://carbonara.solopov.dev/api/cook' + + async with aiohttp.ClientSession() as session, session.post(url, json={'code': code}) as resp: + image_data = await resp.read() carbon_image = Image.open(BytesIO(image_data)) @@ -56,148 +55,139 @@ async def make_carbon(code): bright_image = enhancer.enhance(1.0) output_image = BytesIO() - bright_image.save(output_image, format="PNG", quality=95) - output_image.name = "carbon.png" + bright_image.save(output_image, format='PNG', quality=95) + output_image.name = 'carbon.png' return output_image + async def telegraph(title, user_name, content): - formatted_content = "
".join(content.split("\n")) - formatted_content = "

" + formatted_content + "

" + formatted_content = '
'.join(content.split('\n')) + formatted_content = '

' + formatted_content + '

' - data = {"title": title, "content": formatted_content, "author_name": user_name} + data = {'title': title, 'content': formatted_content, 'author_name': user_name} - response = requests.post( - url=f"{url}/telegraph/text", headers=headers, json=data, timeout=5 - ) + response = requests.post(url=f'{url}/telegraph/text', headers=headers, json=data, timeout=5) result = response.json() - return result["url"] + return result['url'] async def voice_characters(): - response = requests.get(url=f"{url}/speech/characters", headers=headers, timeout=5) + response = requests.get(url=f'{url}/speech/characters', headers=headers, timeout=5) result = response.json() - return ", ".join(result["characters"]) + return ', '.join(result['characters']) async def make_rayso(code: str, title: str, theme: str): data = { - "code": code, - "title": title, - "theme": theme, - "padding": 64, - "language": "auto", - "darkMode": False, + 'code': code, + 'title': title, + 'theme': theme, + 'padding': 64, + 'language': 'auto', + 'darkMode': False, } - response = requests.post(f"{url}/rayso", data=data, headers=headers) + response = requests.post(f'{url}/rayso', data=data, headers=headers) if response.status_code != 200: return None result = response.json() try: - if result["error"] is not None: + if result['error'] is not None: return None except KeyError: pass - image_data = result["image"] - file_name = "rayso.png" - with open(file_name, "wb") as f: + image_data = result['image'] + file_name = 'rayso.png' + with open(file_name, 'wb') as f: f.write(base64.b64decode(image_data)) return file_name -@Client.on_message(filters.command("asq", prefix) & filters.me) +@Client.on_message(filters.command('asq', prefix) & filters.me) async def asq(_, message: Message): if len(message.command) > 1: query = message.text.split(maxsplit=1)[1] else: - await message.edit_text("Query not provided!") + await message.edit_text('Query not provided!') return - await message.edit_text("Processing...") - response = requests.get(url=f"{url}/asq?query={query}", headers=headers, timeout=5) + await message.edit_text('Processing...') + response = requests.get(url=f'{url}/asq?query={query}', headers=headers, timeout=5) if response.status_code != 200: - await message.edit_text("Something went wrong!") + await message.edit_text('Something went wrong!') return result = response.json() - ans = result["answer"] - await message.edit_text( - f"Q. {query}\n A. {ans}", parse_mode=enums.ParseMode.MARKDOWN - ) + ans = result['answer'] + await message.edit_text(f'Q. {query}\n A. {ans}', parse_mode=enums.ParseMode.MARKDOWN) -@Client.on_message(filters.command("sgemini", prefix) & filters.me) +@Client.on_message(filters.command('sgemini', prefix) & filters.me) async def sgemini(_, message: Message): if len(message.command) > 1: prompt = message.text.split(maxsplit=1)[1] else: - await message.edit_text("prompt not provided!") + await message.edit_text('prompt not provided!') return - await message.edit_text("Processing...") - response = requests.get(url=f"{url}/bard?query={prompt}", headers=headers) + await message.edit_text('Processing...') + response = requests.get(url=f'{url}/bard?query={prompt}', headers=headers) if response.status_code != 200: - await message.edit_text("Something went wrong!") + await message.edit_text('Something went wrong!') return result = response.json() - ans = result["message"] - await message.edit_text( - f"Prompt: {prompt}\n Ans: {ans}", parse_mode=enums.ParseMode.MARKDOWN - ) + ans = result['message'] + await message.edit_text(f'Prompt: {prompt}\n Ans: {ans}', parse_mode=enums.ParseMode.MARKDOWN) -@Client.on_message(filters.command("app", prefix) & filters.me) +@Client.on_message(filters.command('app', prefix) & filters.me) async def app(client: Client, message: Message): try: chat_id = message.chat.id - await message.edit_text("Processing...") + await message.edit_text('Processing...') if len(message.command) > 1: query = message.text.split(maxsplit=1)[1] else: - message.edit_text( - "What should i search? You didn't provided me with any value to search" - ) + message.edit_text("What should i search? You didn't provided me with any value to search") - response = requests.get( - url=f"{url}/apps?query={query}&limit=1", headers=headers, timeout=5 - ) + response = requests.get(url=f'{url}/apps?query={query}&limit=1', headers=headers, timeout=5) if response.status_code != 200: - await message.edit_text("Something went wrong") + await message.edit_text('Something went wrong') return result = response.json() try: - coverImage_url = result["results"][0]["icon"] + coverImage_url = result['results'][0]['icon'] coverImage = requests.get(url=coverImage_url).content - async with aiofiles.open("coverImage.jpg", mode="wb") as f: + async with aiofiles.open('coverImage.jpg', mode='wb') as f: await f.write(coverImage) except Exception: coverImage = None - description = result["results"][0]["description"] - developer = result["results"][0]["developer"] - IsFree = result["results"][0]["free"] - genre = result["results"][0]["genre"] - package_name = result["results"][0]["id"] - title = result["results"][0]["title"] - price = result["results"][0]["price"] - link = result["results"][0]["link"] - rating = result["results"][0]["rating"] + description = result['results'][0]['description'] + developer = result['results'][0]['developer'] + IsFree = result['results'][0]['free'] + genre = result['results'][0]['genre'] + package_name = result['results'][0]['id'] + title = result['results'][0]['title'] + price = result['results'][0]['price'] + link = result['results'][0]['link'] + rating = result['results'][0]['rating'] await message.delete() await client.send_media_group( chat_id, [ InputMediaPhoto( - "coverImage.jpg", - caption=f"Title: {title}\nRating: {rating}\nIsFree: {IsFree}\nPrice: {price}\nPackage Name: {package_name}\nGenres: {genre}\nDeveloper: {developer}\nDescription: {description}\nLink: {link}", + 'coverImage.jpg', + caption=f'Title: {title}\nRating: {rating}\nIsFree: {IsFree}\nPrice: {price}\nPackage Name: {package_name}\nGenres: {genre}\nDeveloper: {developer}\nDescription: {description}\nLink: {link}', ) ], ) @@ -209,77 +199,71 @@ async def app(client: Client, message: Message): chat_id, [ InputMediaPhoto( - "coverImage.jpg", - caption=f"Title: {title}\nRating: {rating}\nIsFree: {IsFree}\nPrice: {price}\nPackage Name: {package_name}\nGenres: {genre}\nDeveloper: {developer}\nDescription: {description}\nLink: {link}", + 'coverImage.jpg', + caption=f'Title: {title}\nRating: {rating}\nIsFree: {IsFree}\nPrice: {price}\nPackage Name: {package_name}\nGenres: {genre}\nDeveloper: {developer}\nDescription: {description}\nLink: {link}', ) ], ) except Exception as e: await message.edit_text(format_exc(e)) finally: - if os.path.exists("coverImage.jpg"): - os.remove("coverImage.jpg") + if os.path.exists('coverImage.jpg'): + os.remove('coverImage.jpg') -@Client.on_message(filters.command("tsearch", prefix) & filters.me) +@Client.on_message(filters.command('tsearch', prefix) & filters.me) async def tsearch(client: Client, message: Message): try: chat_id = message.chat.id limit = 10 - await message.edit_text("Processing...") + await message.edit_text('Processing...') if len(message.command) > 1: query = message.text.split(maxsplit=1)[1] else: - message.edit_text( - "What should i search? You didn't provided me with any value to search" - ) + message.edit_text("What should i search? You didn't provided me with any value to search") - response = requests.get( - url=f"{url}/torrent?query={query}&limit={limit}", headers=headers - ) + response = requests.get(url=f'{url}/torrent?query={query}&limit={limit}', headers=headers) if response.status_code != 200: - await message.edit_text("Something went wrong") + await message.edit_text('Something went wrong') return result = response.json() - coverImage_url = result["results"][0]["thumbnail"] - description = result["results"][0]["description"] - genre = result["results"][0]["genre"] - category = result["results"][0]["category"] - title = result["results"][0]["name"] - link = result["results"][0]["magnetLink"] - link_result = await telegraph( - title=title, user_name=message.from_user.first_name, content=link - ) - language = result["results"][0]["language"] - size = result["results"][0]["size"] + coverImage_url = result['results'][0]['thumbnail'] + description = result['results'][0]['description'] + genre = result['results'][0]['genre'] + category = result['results'][0]['category'] + title = result['results'][0]['name'] + link = result['results'][0]['magnetLink'] + link_result = await telegraph(title=title, user_name=message.from_user.first_name, content=link) + language = result['results'][0]['language'] + size = result['results'][0]['size'] results = [] - for i in range(min(limit, len(result["results"]))): - descriptions = result["results"][i]["description"] - genres = result["results"][i]["genre"] - categorys = result["results"][i]["category"] - titles = result["results"][i]["name"] - links = result["results"][i]["magnetLink"] - languages = result["results"][i]["language"] - sizes = result["results"][i]["size"] + for i in range(min(limit, len(result['results']))): + descriptions = result['results'][i]['description'] + genres = result['results'][i]['genre'] + categorys = result['results'][i]['category'] + titles = result['results'][i]['name'] + links = result['results'][i]['magnetLink'] + languages = result['results'][i]['language'] + sizes = result['results'][i]['size'] - r = f"Title: {titles}\nCategory: {categorys}\nLanguage: {languages}\nSize: {sizes}\nGenres: {genres}\nDescription: {descriptions}\nMagnet Link: {links}
" + r = f'Title: {titles}\nCategory: {categorys}\nLanguage: {languages}\nSize: {sizes}\nGenres: {genres}\nDescription: {descriptions}\nMagnet Link: {links}
' results.append(r) - all_results_content = "
".join(results) + all_results_content = '
'.join(results) link_results = await telegraph( - title="Search Results", + title='Search Results', user_name=message.from_user.first_name, content=all_results_content, ) if coverImage_url is not None: coverImage = requests.get(url=coverImage_url).content - async with aiofiles.open("coverImage.jpg", mode="wb") as f: + async with aiofiles.open('coverImage.jpg', mode='wb') as f: await f.write(coverImage) await message.delete() @@ -287,7 +271,7 @@ async def tsearch(client: Client, message: Message): chat_id, [ InputMediaPhoto( - "coverImage.jpg", + 'coverImage.jpg', caption=f"Title: {title}\nCategory: {category}\nLanguage: {language}\nSize: {size}\nGenres: {genre}\nDescription: {description}\nMagnet Link: Click Here\nMore Results: Click Here", ) ], @@ -305,7 +289,7 @@ async def tsearch(client: Client, message: Message): chat_id, [ InputMediaPhoto( - "coverImage.jpg", + 'coverImage.jpg', caption=f"Title: {title}\nCategory: {category}\nLanguage: {language}\nSize: {size}\nGenres: {genre}\nDescription: {description}\nMagnet Link: Click Here", ) ], @@ -321,20 +305,20 @@ async def tsearch(client: Client, message: Message): except Exception as e: await message.edit_text(format_exc(e)) finally: - if os.path.exists("coverImage.jpg"): - os.remove("coverImage.jpg") + if os.path.exists('coverImage.jpg'): + os.remove('coverImage.jpg') -@Client.on_message(filters.command("stts", prefix) & filters.me) +@Client.on_message(filters.command('stts', prefix) & filters.me) async def tts(client: Client, message: Message): characters = await voice_characters() - await message.edit_text("Please Wait...") + await message.edit_text('Please Wait...') try: if len(message.command) > 2: character, prompt = message.text.split(maxsplit=2)[1:] if character not in characters: await message.edit_text( - f"Usage: {prefix}tts [character]* [text/reply to text]*\n Available Characters:
{characters}
" + f'Usage: {prefix}tts [character]* [text/reply to text]*\n Available Characters:
{characters}
' ) return @@ -344,52 +328,50 @@ async def tts(client: Client, message: Message): prompt = message.reply_to_message.text else: await message.edit_text( - f"Usage: {prefix}tts [character]* [text/reply to text]*\n Available Characters:
{characters}
" + f'Usage: {prefix}tts [character]* [text/reply to text]*\n Available Characters:
{characters}
' ) return else: await message.edit_text( - f"Usage: {prefix}tts [character]* [text/reply to text]*\n Available Characters:
{characters}
" + f'Usage: {prefix}tts [character]* [text/reply to text]*\n Available Characters:
{characters}
' ) return - data = {"text": prompt, "character": character} - response = requests.post(url=f"{url}/speech", headers=headers, json=data) + data = {'text': prompt, 'character': character} + response = requests.post(url=f'{url}/speech', headers=headers, json=data) if response.status_code != 200: - await message.edit_text("Something went wrong") + await message.edit_text('Something went wrong') return result = response.json() - audio_data = result["audio"] + audio_data = result['audio'] audio_data = base64.b64decode(audio_data) - async with aiofiles.open(f"{prompt}.mp3", mode="wb") as f: + async with aiofiles.open(f'{prompt}.mp3', mode='wb') as f: await f.write(audio_data) await message.delete() await client.send_audio( chat_id=message.chat.id, - audio=f"{prompt}.mp3", - caption=f"Characters: {character}\nPrompt: {prompt}", + audio=f'{prompt}.mp3', + caption=f'Characters: {character}\nPrompt: {prompt}', ) - if os.path.exists(f"{prompt}.mp3"): - os.remove(f"{prompt}.mp3") + if os.path.exists(f'{prompt}.mp3'): + os.remove(f'{prompt}.mp3') except KeyError: try: - error = result["error"] + error = result['error'] await message.edit_text(error) except KeyError: await message.edit_text( - f"Usage: {prefix}tts [character]* [text/reply to text]*\n Available Characters:
{characters}
" + f'Usage: {prefix}tts [character]* [text/reply to text]*\n Available Characters:
{characters}
' ) except Exception as e: await message.edit_text(format_exc(e)) -@Client.on_message( - filters.command(["carbonnowsh", "carboon", "carbon", "cboon"], prefix) & filters.me -) +@Client.on_message(filters.command(['carbonnowsh', 'carboon', 'carbon', 'cboon'], prefix) & filters.me) async def carbon(client: Client, message: Message): if message.reply_to_message: text = message.reply_to_message.text @@ -398,9 +380,9 @@ async def carbon(client: Client, message: Message): message_id = None text = message.text.split(maxsplit=1)[1] else: - await message.edit_text("Query not provided!") + await message.edit_text('Query not provided!') return - await message.edit_text("Processing...") + await message.edit_text('Processing...') image_file = await make_carbon(text) @@ -409,7 +391,7 @@ async def carbon(client: Client, message: Message): await client.send_photo( chat_id=message.chat.id, photo=image_file, - caption=f"Text: {text}", + caption=f'Text: {text}', reply_to_message_id=message_id, ) except MediaCaptionTooLong: @@ -417,62 +399,62 @@ async def carbon(client: Client, message: Message): await client.send_photo( chat_id=message.chat.id, photo=image_file, - caption=f"Text: {cap}", + caption=f'Text: {cap}', reply_to_message_id=message_id, ) except Exception as e: await message.edit_text(format_exc(e)) - if os.path.exists("carbon.png"): - os.remove("carbon.png") + if os.path.exists('carbon.png'): + os.remove('carbon.png') -@Client.on_message(filters.command("ccgen", prefix) & filters.me) +@Client.on_message(filters.command('ccgen', prefix) & filters.me) async def ccgen(_, message: Message): if len(message.command) > 1: bins = message.text.split(maxsplit=1)[1] else: - await message.edit_text("Code not provided!") + await message.edit_text('Code not provided!') return - await message.edit_text("Processing...") - response = requests.get(url=f"{url}/ccgen?bins={bins}", headers=headers) + await message.edit_text('Processing...') + response = requests.get(url=f'{url}/ccgen?bins={bins}', headers=headers) if response.status_code != 200: - await message.edit_text("Something went wrong") + await message.edit_text('Something went wrong') return result = response.json() - cards = result["results"][0]["cards"] - cards_str = "\n".join([f'"{card}"' for card in cards]) - bins = result["results"][0]["bin"] + cards = result['results'][0]['cards'] + cards_str = '\n'.join([f'"{card}"' for card in cards]) + bins = result['results'][0]['bin'] await message.edit_text( - f"Bins: {bins}\nTotal: {len(cards)}\nCards: \n{cards_str}" + f'Bins: {bins}\nTotal: {len(cards)}\nCards: \n{cards_str}' ) -@Client.on_message(filters.command("rayso", prefix) & filters.me) +@Client.on_message(filters.command('rayso', prefix) & filters.me) async def rayso(client: Client, message: Message): - title = "Untitled" + title = 'Untitled' themes = [ - "vercel", - "supabase", - "tailwind", - "clerk", - "mintlify", - "prisma", - "bitmap", - "noir", - "ice", - "sand", - "forest", - "mono", - "breeze", - "candy", - "crimson", - "falcon", - "meadow", - "midnight", - "raindrop", - "sunset", + 'vercel', + 'supabase', + 'tailwind', + 'clerk', + 'mintlify', + 'prisma', + 'bitmap', + 'noir', + 'ice', + 'sand', + 'forest', + 'mono', + 'breeze', + 'candy', + 'crimson', + 'falcon', + 'meadow', + 'midnight', + 'raindrop', + 'sunset', ] if message.reply_to_message: text = message.reply_to_message.text @@ -481,29 +463,29 @@ async def rayso(client: Client, message: Message): title = message.text.split(maxsplit=2)[1] theme = message.text.split(maxsplit=2)[2].lower() if theme not in themes: - theme = "breeze" + theme = 'breeze' elif len(message.command) > 1: message_id = message.id title = message.text.split(maxsplit=3)[1] theme = message.text.split(maxsplit=3)[2] if theme not in themes: - theme = "breeze" + theme = 'breeze' text = message.text.split(maxsplit=3)[3] else: - await message.edit_text("Query not provided!") + await message.edit_text('Query not provided!') return - await message.edit_text("Processing...") + await message.edit_text('Processing...') image_file = await make_rayso(text, title, theme) if image_file is None: - await message.edit_text("Something went wrong") + await message.edit_text('Something went wrong') return try: await client.send_photo( chat_id=message.chat.id, photo=image_file, - caption=f"Text: {text}", + caption=f'Text: {text}', reply_to_message_id=message_id, ) await message.delete() @@ -512,7 +494,7 @@ async def rayso(client: Client, message: Message): await client.send_photo( chat_id=message.chat.id, photo=image_file, - caption=f"Text: {cap}", + caption=f'Text: {cap}', reply_to_message_id=message_id, ) await message.delete() @@ -522,13 +504,13 @@ async def rayso(client: Client, message: Message): os.remove(image_file) -modules_help["safone"] = { - "asq [query]*": "Asq", - "app [query]*": "Search for an app on Play Store", - "tsearch [query]*": "Search Torrent", - "tts [character]* [text/reply to text]*": "Convert Text to Speech", - "sgemini [prompt]*": "Gemini Model through safone api", - "carbon [code/file/reply]": "Create beautiful image with your code", - "ccgen [bins]*": "Generate credit cards", - "rayso [title]* [theme]* [text/reply to text]*": "Create beautiful image with your text", +modules_help['safone'] = { + 'asq [query]*': 'Asq', + 'app [query]*': 'Search for an app on Play Store', + 'tsearch [query]*': 'Search Torrent', + 'tts [character]* [text/reply to text]*': 'Convert Text to Speech', + 'sgemini [prompt]*': 'Gemini Model through safone api', + 'carbon [code/file/reply]': 'Create beautiful image with your code', + 'ccgen [bins]*': 'Generate credit cards', + 'rayso [title]* [theme]* [text/reply to text]*': 'Create beautiful image with your text', } diff --git a/userbot/modules/misc/sarethai.py b/userbot/modules/misc/sarethai.py index e7975e0..275a2ae 100644 --- a/userbot/modules/misc/sarethai.py +++ b/userbot/modules/misc/sarethai.py @@ -14,33 +14,30 @@ #  You should have received a copy of the GNU General Public License #  along with this program.  If not, see . -import os -import requests import asyncio +import os + +import requests +from modules.url import generate_screenshot from pyrogram import Client, enums, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix -from modules.url import generate_screenshot - -from pyrogram import filters - -from utils.scripts import with_reply, no_prefix +from utils.scripts import no_prefix np = no_prefix(prefix) # API URLs -BASE_URL = "https://deliriussapi-oficial.vercel.app" -URL = f"{BASE_URL}/ia" -GOOGLE_SEARCH_URL = f"{BASE_URL}/search/googlesearch?query=" -YOUTUBE_SEARCH_URL = f"{BASE_URL}/search/ytsearch?q=" -MOVIE_SEARCH_URL = f"{BASE_URL}/search/movie?query=" -APK_SEARCH_URL = f"https://bk9.fun/search/apkfab?q=" -APK_DOWNLOAD_URL = "https://bk9.fun/download/apkfab?url=" +BASE_URL = 'https://deliriussapi-oficial.vercel.app' +URL = f'{BASE_URL}/ia' +GOOGLE_SEARCH_URL = f'{BASE_URL}/search/googlesearch?query=' +YOUTUBE_SEARCH_URL = f'{BASE_URL}/search/ytsearch?q=' +MOVIE_SEARCH_URL = f'{BASE_URL}/search/movie?query=' +APK_SEARCH_URL = 'https://bk9.fun/search/apkfab?q=' +APK_DOWNLOAD_URL = 'https://bk9.fun/download/apkfab?url=' def clean_data(data): - parts = data.split("$@$") + parts = data.split('$@$') if len(parts) > 1: return parts[-1] @@ -55,19 +52,16 @@ search_results = {} # Helper Functions def format_google_results(results): results = results[:15] - return results, "\n\n".join( - [ - f"{i+1}. **[{item['title']}]({item['url']})**\n{item['description']}" - for i, item in enumerate(results) - ] + return results, '\n\n'.join( + [f'{i + 1}. **[{item["title"]}]({item["url"]})**\n{item["description"]}' for i, item in enumerate(results)] ) def format_youtube_results(results): results = results[:15] - return results, "\n\n".join( + return results, '\n\n'.join( [ - f"{i+1}. **[{item['title']}]({item['url']})**\nPublished by: [{item['author']['name']}]({item['author']['url']}) - {item['views']} views - {item['duration']}" + f'{i + 1}. **[{item["title"]}]({item["url"]})**\nPublished by: [{item["author"]["name"]}]({item["author"]["url"]}) - {item["views"]} views - {item["duration"]}' for i, item in enumerate(results) ] ) @@ -75,9 +69,9 @@ def format_youtube_results(results): def format_movie_results(results): results = results[:15] - return results, "\n\n".join( + return results, '\n\n'.join( [ - f"{i+1}. **{item['title']}** ({item['release_date']})\nRating: {item['vote_average']}/10\nVotes: {item['vote_count']}" + f'{i + 1}. **{item["title"]}** ({item["release_date"]})\nRating: {item["vote_average"]}/10\nVotes: {item["vote_count"]}' for i, item in enumerate(results) ] ) @@ -85,9 +79,7 @@ def format_movie_results(results): def format_apk_results(results): results = results[:15] - return results, "\n\n".join( - [f"{i+1}. [{item['title']}]({item['link']})" for i, item in enumerate(results)] - ) + return results, '\n\n'.join([f'{i + 1}. [{item["title"]}]({item["link"]})' for i, item in enumerate(results)]) async def send_screenshot(client, message, url): @@ -96,21 +88,18 @@ async def send_screenshot(client, message, url): await client.send_photo( message.chat.id, screenshot_data, - caption=f"Screenshot of {url}", + caption=f'Screenshot of {url}', reply_to_message_id=message.id, ) else: - await message.reply("Failed to take screenshot.") + await message.reply('Failed to take screenshot.') async def delete_search_data(client, chat_id, message_id): await asyncio.sleep(60) - for key in ["google", "youtube", "movie", "apk"]: - search_key = f"{chat_id}_{key}" - if ( - search_key in search_results - and search_results[search_key]["message_id"] == message_id - ): + for key in ['google', 'youtube', 'movie', 'apk']: + search_key = f'{chat_id}_{key}' + if search_key in search_results and search_results[search_key]['message_id'] == message_id: del search_results[search_key] try: await client.delete_messages(chat_id, message_id) @@ -120,59 +109,59 @@ async def delete_search_data(client, chat_id, message_id): def format_spotify_result(data): - result = "" + result = '' for item in data[:15]: # Limit to 15 results - result += f"🎵 **{item['title']}** by {item['artist']}\n" - result += f"Album: {item['album']}\n" - result += f"Duration: {item['duration']}\n" - result += f"Popularity: {item['popularity']}\n" - result += f"Publish Date: {item['publish']}\n" - result += f"[Listen on Spotify]({item['url']})\n\n" + result += f'🎵 **{item["title"]}** by {item["artist"]}\n' + result += f'Album: {item["album"]}\n' + result += f'Duration: {item["duration"]}\n' + result += f'Popularity: {item["popularity"]}\n' + result += f'Publish Date: {item["publish"]}\n' + result += f'[Listen on Spotify]({item["url"]})\n\n' return result def format_lyrics_result(data): - return f"🎵 **{data['fullTitle']}** by {data['artist']}\n\n{data['lyrics']}" + return f'🎵 **{data["fullTitle"]}** by {data["artist"]}\n\n{data["lyrics"]}' def format_soundcloud_result(data): - result = "" + result = '' for item in data[:15]: # Limit to 15 results - result += f"🎵 **{item['title']}**\n" - result += f"Genre: {item['genre']}\n" - result += f"Duration: {item['duration'] // 1000 // 60}:{item['duration'] // 1000 % 60}\n" - result += f"Likes: {item['likes']}\n" - result += f"Plays: {item['play']}\n" - result += f"[Listen on SoundCloud]({item['link']})\n\n" + result += f'🎵 **{item["title"]}**\n' + result += f'Genre: {item["genre"]}\n' + result += f'Duration: {item["duration"] // 1000 // 60}:{item["duration"] // 1000 % 60}\n' + result += f'Likes: {item["likes"]}\n' + result += f'Plays: {item["play"]}\n' + result += f'[Listen on SoundCloud]({item["link"]})\n\n' return result def format_deezer_result(data): - result = "" + result = '' for item in data[:15]: # Limit to 15 results - result += f"🎵 **{item['title']}** by {item['artist']}\n" - result += f"Duration: {item['duration']}\n" - result += f"Rank: {item['rank']}\n" - result += f"[Listen on Deezer]({item['url']})\n\n" + result += f'🎵 **{item["title"]}** by {item["artist"]}\n' + result += f'Duration: {item["duration"]}\n' + result += f'Rank: {item["rank"]}\n' + result += f'[Listen on Deezer]({item["url"]})\n\n' return result def format_apple_music_result(data): - result = "" + result = '' for item in data[:15]: # Limit to 15 results - title = item.get("title", "Unknown Title") - artists = item.get("artists", "Unknown Artist") - music_type = item.get("type", "Unknown Type") - url = item.get("url", "#") - result += f"🎵 **{title}** by {artists}\n" - result += f"Type: {music_type}\n" - result += f"[Listen on Apple Music]({url})\n\n" + title = item.get('title', 'Unknown Title') + artists = item.get('artists', 'Unknown Artist') + music_type = item.get('type', 'Unknown Type') + url = item.get('url', '#') + result += f'🎵 **{title}** by {artists}\n' + result += f'Type: {music_type}\n' + result += f'[Listen on Apple Music]({url})\n\n' return result async def search_music(api_url, format_function, message, query): - await message.edit("Searching...") - url = f"{api_url}{query}&limit=10" + await message.edit('Searching...') + url = f'{api_url}{query}&limit=10' response = requests.get(url) if response.status_code == 200: @@ -181,105 +170,101 @@ async def search_music(api_url, format_function, message, query): if isinstance(data, list): result = format_function(data) - elif isinstance(data, dict) and "data" in data: - result = format_function(data["data"]) + elif isinstance(data, dict) and 'data' in data: + result = format_function(data['data']) else: - result = "No data found or unexpected format." + result = 'No data found or unexpected format.' await message.edit(result, parse_mode=enums.ParseMode.MARKDOWN) except (ValueError, KeyError, TypeError) as e: - await message.edit(f"An error occurred while processing the data: {str(e)}") - elif response.json()["msg"]: - await message.edit(response.json()["msg"]) + await message.edit(f'An error occurred while processing the data: {str(e)}') + elif response.json()['msg']: + await message.edit(response.json()['msg']) else: - await message.edit("An error occurred, please try again later.") + await message.edit('An error occurred, please try again later.') -@Client.on_message(filters.command(["gsearch"], prefix) & filters.me) +@Client.on_message(filters.command(['gsearch'], prefix) & filters.me) async def google_search(client: Client, message: Message): if message.reply_to_message: query = message.reply_to_message.text.strip() elif len(message.command) > 1: query = message.text.split(maxsplit=1)[1] else: - return await message.edit_text(f"{prefix}gsearch ") + return await message.edit_text(f'{prefix}gsearch ') - await message.edit("Searching...") - url = f"{GOOGLE_SEARCH_URL}{query}" + await message.edit('Searching...') + url = f'{GOOGLE_SEARCH_URL}{query}' response = requests.get(url) if response.status_code == 200: data = response.json() - results, formatted_results = format_google_results(data["data"]) + results, formatted_results = format_google_results(data['data']) search_message = await message.edit( - f"**Google Search Results for:** `{query}`\n\n{formatted_results}", + f'**Google Search Results for:** `{query}`\n\n{formatted_results}', parse_mode=enums.ParseMode.MARKDOWN, disable_web_page_preview=True, ) - search_key = f"{message.chat.id}_google" + search_key = f'{message.chat.id}_google' global search_results search_results[search_key] = { - "results": results, - "message_id": search_message.id, + 'results': results, + 'message_id': search_message.id, } - google_url = f"https://www.google.com/search?q={query}" + google_url = f'https://www.google.com/search?q={query}' await send_screenshot(client, message, google_url) - asyncio.create_task( - delete_search_data(client, message.chat.id, search_message.id) - ) + asyncio.create_task(delete_search_data(client, message.chat.id, search_message.id)) else: - await message.edit("An error occurred, please try again later.") + await message.edit('An error occurred, please try again later.') -@Client.on_message(filters.command(["ytsearch"], prefix) & filters.me) +@Client.on_message(filters.command(['ytsearch'], prefix) & filters.me) async def youtube_search(client: Client, message: Message): if message.reply_to_message: query = message.reply_to_message.text.strip() elif len(message.command) > 1: query = message.text.split(maxsplit=1)[1] else: - return await message.edit_text(f"{prefix}ytsearch ") + return await message.edit_text(f'{prefix}ytsearch ') - await message.edit("Searching...") - url = f"{YOUTUBE_SEARCH_URL}{query}" + await message.edit('Searching...') + url = f'{YOUTUBE_SEARCH_URL}{query}' response = requests.get(url) if response.status_code == 200: data = response.json() - results, formatted_results = format_youtube_results(data["data"]) + results, formatted_results = format_youtube_results(data['data']) search_message = await message.edit( - f"**YouTube Search Results for:** `{query}`\n\n{formatted_results}", + f'**YouTube Search Results for:** `{query}`\n\n{formatted_results}', parse_mode=enums.ParseMode.MARKDOWN, disable_web_page_preview=True, ) - search_key = f"{message.chat.id}_youtube" + search_key = f'{message.chat.id}_youtube' global search_results search_results[search_key] = { - "results": results, - "message_id": search_message.id, + 'results': results, + 'message_id': search_message.id, } - youtube_url = f"https://www.youtube.com/results?search_query={query}" + youtube_url = f'https://www.youtube.com/results?search_query={query}' await send_screenshot(client, message, youtube_url) - asyncio.create_task( - delete_search_data(client, message.chat.id, search_message.id) - ) + asyncio.create_task(delete_search_data(client, message.chat.id, search_message.id)) else: - await message.edit("An error occurred, please try again later.") + await message.edit('An error occurred, please try again later.') -@Client.on_message(filters.command(["moviesearch"], prefix) & filters.me) +@Client.on_message(filters.command(['moviesearch'], prefix) & filters.me) async def movie_search(client, message: Message): if message.reply_to_message: query = message.reply_to_message.text.strip() elif len(message.command) > 1: query = message.text.split(maxsplit=1)[1] else: - return await message.edit_text(f"{prefix}moviesearch ") + return await message.edit_text(f'{prefix}moviesearch ') - await message.edit("Searching...") - url = f"{MOVIE_SEARCH_URL}{query}" + await message.edit('Searching...') + url = f'{MOVIE_SEARCH_URL}{query}' response = requests.get(url) if response.status_code == 200: data = response.json() - results, formatted_results = format_movie_results(data["data"]) + results, formatted_results = format_movie_results(data['data']) # Split the message into multiple parts if it's too long parts = [] @@ -289,179 +274,145 @@ async def movie_search(client, message: Message): for part in parts: search_message = await message.reply( - f"**Movie Search Results for:** `{query}`\n\n{part}", + f'**Movie Search Results for:** `{query}`\n\n{part}', parse_mode=enums.ParseMode.MARKDOWN, disable_web_page_preview=True, ) - search_key = f"{message.chat.id}_movie" + search_key = f'{message.chat.id}_movie' global search_results search_results[search_key] = { - "results": results, - "message_id": search_message.id, + 'results': results, + 'message_id': search_message.id, } - asyncio.create_task( - delete_search_data(client, message.chat.id, search_message.id) - ) + asyncio.create_task(delete_search_data(client, message.chat.id, search_message.id)) else: - await message.edit("An error occurred, please try again later.") + await message.edit('An error occurred, please try again later.') -@Client.on_message(filters.command(["apksearch"], prefix) & filters.me) +@Client.on_message(filters.command(['apksearch'], prefix) & filters.me) async def apk_search(client, message: Message): if message.reply_to_message: query = message.reply_to_message.text.strip() elif len(message.command) > 1: query = message.text.split(maxsplit=1)[1] else: - return await message.edit_text(f"{prefix}apksearch ") + return await message.edit_text(f'{prefix}apksearch ') - await message.edit("Searching...") - url = f"{APK_SEARCH_URL}{query}" + await message.edit('Searching...') + url = f'{APK_SEARCH_URL}{query}' response = requests.get(url) if response.status_code == 200: data = response.json() - results, formatted_results = format_apk_results(data["BK9"]) + results, formatted_results = format_apk_results(data['BK9']) search_message = await message.edit( - f"**APK Search Results for:** `{query}`\n\n{formatted_results}", + f'**APK Search Results for:** `{query}`\n\n{formatted_results}', parse_mode=enums.ParseMode.MARKDOWN, disable_web_page_preview=True, ) - search_key = f"{message.chat.id}_apk" + search_key = f'{message.chat.id}_apk' global search_results search_results[search_key] = { - "results": results, - "message_id": search_message.id, + 'results': results, + 'message_id': search_message.id, } - asyncio.create_task( - delete_search_data(client, message.chat.id, search_message.id) - ) + asyncio.create_task(delete_search_data(client, message.chat.id, search_message.id)) else: - await message.edit("An error occurred, please try again later.") + await message.edit('An error occurred, please try again later.') -@Client.on_message(filters.command(["wgpt", "gptweb"], prefix) & filters.me) +@Client.on_message(filters.command(['wgpt', 'gptweb'], prefix) & filters.me) async def gptweb(_, message: Message): if len(message.command) < 2: - await message.edit("Usage: `wgpt `") + await message.edit('Usage: `wgpt `') return - await message.edit("Thinking...") - query = " ".join(message.command[1:]) - url = f"{URL}/gptweb?text={query}" + await message.edit('Thinking...') + query = ' '.join(message.command[1:]) + url = f'{URL}/gptweb?text={query}' response = requests.get(url) if response.status_code == 200: data = response.json() await message.edit( - f"**Question:**\n{query}\n**Answer:**\n{data['data']}", + f'**Question:**\n{query}\n**Answer:**\n{data["data"]}', parse_mode=enums.ParseMode.MARKDOWN, ) else: - await message.edit("An error occurred, please try again later.") + await message.edit('An error occurred, please try again later.') -@Client.on_message(filters.command(["wgemini"], prefix) & filters.me) +@Client.on_message(filters.command(['wgemini'], prefix) & filters.me) async def gemini(_, message: Message): if len(message.command) < 2: - await message.edit("Usage: `wgemini `") + await message.edit('Usage: `wgemini `') return - await message.edit("Thinking...") - query = " ".join(message.command[1:]) - url = f"{URL}/gemini?query={query}" + await message.edit('Thinking...') + query = ' '.join(message.command[1:]) + url = f'{URL}/gemini?query={query}' response = requests.get(url) if response.status_code == 200: data = response.json() await message.edit( - f"**Question:**\n{query}\n**Answer:**\n{data['message']}", + f'**Question:**\n{query}\n**Answer:**\n{data["message"]}', parse_mode=enums.ParseMode.MARKDOWN, ) else: - await message.edit("An error occurred, please try again later.") + await message.edit('An error occurred, please try again later.') -@Client.on_message(filters.command(["sputify"], prefix) & filters.me) +@Client.on_message(filters.command(['sputify'], prefix) & filters.me) async def spotify_search(_, message: Message): - query = ( - message.text.split(maxsplit=1)[1] - if len(message.command) > 1 - else message.reply_to_message.text - ) + query = message.text.split(maxsplit=1)[1] if len(message.command) > 1 else message.reply_to_message.text if not query: - await message.edit("Usage: spotify ") + await message.edit('Usage: spotify ') return - await search_music( - f"{BASE_URL}/search/spotify?q=", format_spotify_result, message, query - ) + await search_music(f'{BASE_URL}/search/spotify?q=', format_spotify_result, message, query) -@Client.on_message(filters.command(["lyrics"], prefix) & filters.me) +@Client.on_message(filters.command(['lyrics'], prefix) & filters.me) async def lyrics_search(_, message: Message): - query = ( - message.text.split(maxsplit=1)[1] - if len(message.command) > 1 - else message.reply_to_message.text - ) + query = message.text.split(maxsplit=1)[1] if len(message.command) > 1 else message.reply_to_message.text if not query: - await message.edit("Usage: lyrics ") + await message.edit('Usage: lyrics ') return - await search_music( - f"{BASE_URL}/search/letra?query=", format_lyrics_result, message, query - ) + await search_music(f'{BASE_URL}/search/letra?query=', format_lyrics_result, message, query) -@Client.on_message(filters.command(["soundcloud"], prefix) & filters.me) +@Client.on_message(filters.command(['soundcloud'], prefix) & filters.me) async def soundcloud_search(_, message: Message): - query = ( - message.text.split(maxsplit=1)[1] - if len(message.command) > 1 - else message.reply_to_message.text - ) + query = message.text.split(maxsplit=1)[1] if len(message.command) > 1 else message.reply_to_message.text if not query: - await message.edit("Usage: soundcloud ") + await message.edit('Usage: soundcloud ') return - await search_music( - f"{BASE_URL}/search/soundcloud?q=", format_soundcloud_result, message, query - ) + await search_music(f'{BASE_URL}/search/soundcloud?q=', format_soundcloud_result, message, query) -@Client.on_message(filters.command(["deezer"], prefix) & filters.me) +@Client.on_message(filters.command(['deezer'], prefix) & filters.me) async def deezer_search(_, message: Message): - query = ( - message.text.split(maxsplit=1)[1] - if len(message.command) > 1 - else message.reply_to_message.text - ) + query = message.text.split(maxsplit=1)[1] if len(message.command) > 1 else message.reply_to_message.text if not query: - await message.edit("Usage: deezer ") + await message.edit('Usage: deezer ') return - await search_music( - f"{BASE_URL}/search/deezer?q=", format_deezer_result, message, query - ) + await search_music(f'{BASE_URL}/search/deezer?q=', format_deezer_result, message, query) -@Client.on_message(filters.command(["applemusic"], prefix) & filters.me) +@Client.on_message(filters.command(['applemusic'], prefix) & filters.me) async def applemusic_search(_, message: Message): - query = ( - message.text.split(maxsplit=1)[1] - if len(message.command) > 1 - else message.reply_to_message.text - ) + query = message.text.split(maxsplit=1)[1] if len(message.command) > 1 else message.reply_to_message.text if not query: - await message.edit("Usage: applemusic ") + await message.edit('Usage: applemusic ') return - await search_music( - f"{BASE_URL}/search/applemusic?text=", format_apple_music_result, message, query - ) + await search_music(f'{BASE_URL}/search/applemusic?text=', format_apple_music_result, message, query) @Client.on_message(filters.reply & filters.text & filters.me & np) async def handle_reply(client: Client, message: Message): chat_id = message.chat.id search_keys = [ - f"{chat_id}_google", - f"{chat_id}_youtube", - f"{chat_id}_movie", - f"{chat_id}_apk", + f'{chat_id}_google', + f'{chat_id}_youtube', + f'{chat_id}_movie', + f'{chat_id}_apk', ] for search_key in search_keys: @@ -472,76 +423,65 @@ async def handle_reply(client: Client, message: Message): return index = int(message.text.strip()) - 1 - results = search_results[search_key]["results"] - search_message_id = search_results[search_key]["message_id"] - if ( - message.reply_to_message.id == search_message_id - and 0 <= index < len(results) - ): - await message.edit("Please wait...") + results = search_results[search_key]['results'] + search_message_id = search_results[search_key]['message_id'] + if message.reply_to_message.id == search_message_id and 0 <= index < len(results): + await message.edit('Please wait...') - if search_key.endswith("_movie"): + if search_key.endswith('_movie'): # Send movie details with image movie = results[index] caption = ( - f"**{movie['title']}** ({movie['release_date']})\n" - f"Original Title: {movie['original_title']}\n" - f"Language: {movie['original_language']}\n" - f"Overview: {movie['overview']}\n" - f"Popularity: {movie['popularity']}\n" - f"Rating: {movie['vote_average']}/10\n" - f"Votes: {movie['vote_count']}" + f'**{movie["title"]}** ({movie["release_date"]})\n' + f'Original Title: {movie["original_title"]}\n' + f'Language: {movie["original_language"]}\n' + f'Overview: {movie["overview"]}\n' + f'Popularity: {movie["popularity"]}\n' + f'Rating: {movie["vote_average"]}/10\n' + f'Votes: {movie["vote_count"]}' ) - if "image" in movie: - response = requests.get(movie["image"]) + if 'image' in movie: + response = requests.get(movie['image']) if response.status_code == 200: - with open("movie_image.jpg", "wb") as f: + with open('movie_image.jpg', 'wb') as f: f.write(response.content) await message.reply_photo( - photo="movie_image.jpg", + photo='movie_image.jpg', caption=caption, parse_mode=enums.ParseMode.MARKDOWN, ) - os.remove("movie_image.jpg") + os.remove('movie_image.jpg') else: - await message.reply( - caption, parse_mode=enums.ParseMode.MARKDOWN - ) + await message.reply(caption, parse_mode=enums.ParseMode.MARKDOWN) else: - await message.reply( - caption, parse_mode=enums.ParseMode.MARKDOWN - ) - elif search_key.endswith("_apk"): - apk_url = f"{APK_DOWNLOAD_URL}{results[index]['link']}" + await message.reply(caption, parse_mode=enums.ParseMode.MARKDOWN) + elif search_key.endswith('_apk'): + apk_url = f'{APK_DOWNLOAD_URL}{results[index]["link"]}' fetch_apk_url = requests.get(apk_url) if fetch_apk_url.status_code != 200: - await message.edit("Failed to fetch APK data.") + await message.edit('Failed to fetch APK data.') else: data_apk = fetch_apk_url.json() - download_url = data_apk["BK9"]["link"] - size_apk = data_apk["BK9"]["size"] - apk_size = float(size_apk.split(" ")[0]) + download_url = data_apk['BK9']['link'] + size_apk = data_apk['BK9']['size'] + apk_size = float(size_apk.split(' ')[0]) - if "GB" in size_apk or apk_size > 100: - await message.edit( - "File size is too large to download." - ) + if 'GB' in size_apk or apk_size > 100: + await message.edit('File size is too large to download.') else: - apk_file_name = f"{data_apk['BK9']['title']}.apk" + apk_file_name = f'{data_apk["BK9"]["title"]}.apk' response = requests.get(download_url) if response.status_code != 200: - await message.edit( - "Failed to download the APK file." - ) + await message.edit('Failed to download the APK file.') else: - with open(apk_file_name, "wb") as f: + with open(apk_file_name, 'wb') as f: f.write(response.content) await message.reply_document(apk_file_name) os.remove(apk_file_name) else: - url = results[index]["url"] + url = results[index]['url'] await send_screenshot(client, message, url) await message.delete() return @@ -549,17 +489,17 @@ async def handle_reply(client: Client, message: Message): pass -modules_help["sarethai"] = { - "wgpt [query]*": "Ask anything to GPT-Web", - "gptweb [query]*": "Ask anything to GPT-Web", - "wgemini [query]*": "Ask anything to Gemini", - "sputify [query]*": "Search for songs on Spotify", - "lyrics [song name]*": "Get the lyrics of a song", - "soundcloud [query]*": "Search for songs on SoundCloud", - "deezer [query]*": "Search for songs on Deezer", - "applemusic [query]*": "Search for songs on Apple Music", - "gsearch [query]*": "Searches Google for the query.", - "ytsearch [query]*": "Searches YouTube for the query.", - "moviesearch [query]*": "Searches movies for the query and returns results.", - "apksearch [query]*": "Searches APKs for the query and returns results.", +modules_help['sarethai'] = { + 'wgpt [query]*': 'Ask anything to GPT-Web', + 'gptweb [query]*': 'Ask anything to GPT-Web', + 'wgemini [query]*': 'Ask anything to Gemini', + 'sputify [query]*': 'Search for songs on Spotify', + 'lyrics [song name]*': 'Get the lyrics of a song', + 'soundcloud [query]*': 'Search for songs on SoundCloud', + 'deezer [query]*': 'Search for songs on Deezer', + 'applemusic [query]*': 'Search for songs on Apple Music', + 'gsearch [query]*': 'Searches Google for the query.', + 'ytsearch [query]*': 'Searches YouTube for the query.', + 'moviesearch [query]*': 'Searches movies for the query and returns results.', + 'apksearch [query]*': 'Searches APKs for the query and returns results.', } diff --git a/userbot/modules/misc/search.py b/userbot/modules/misc/search.py index 7ffbbb3..02dd472 100644 --- a/userbot/modules/misc/search.py +++ b/userbot/modules/misc/search.py @@ -12,16 +12,15 @@ from utils.scripts import format_exc now = {} -@Client.on_message(filters.command(["search"], prefix) & filters.me) +@Client.on_message(filters.command(['search'], prefix) & filters.me) async def search_cmd(client: Client, message: Message): if now.get(message.chat.id): return await message.edit( - "You already have a search in progress!\n" - "Type: {}scancel to cancel it.".format(prefix), + f'You already have a search in progress!\nType: {prefix}scancel to cancel it.', parse_mode=enums.ParseMode.HTML, ) - await message.edit("Start searching...", parse_mode=enums.ParseMode.HTML) + await message.edit('Start searching...', parse_mode=enums.ParseMode.HTML) finished = False local = False try: @@ -30,9 +29,7 @@ async def search_cmd(client: Client, message: Message): timeout = float(message.command[3]) if len(message.command) > 3 else 2 except: return await message.edit( - "Usage: {}search [/cmd]* [search_word]* [timeout=2.0]".format( - prefix - ), + f'Usage: {prefix}search [/cmd]* [search_word]* [timeout=2.0]', parse_mode=enums.ParseMode.HTML, ) @@ -49,31 +46,25 @@ async def search_cmd(client: Client, message: Message): local = True if not local: await sleep(timeout) - await message.reply_text( - quote=False, text=cmd, reply_to_message_id=None - ) + await message.reply_text(quote=False, text=cmd, reply_to_message_id=None) else: break if now[message.chat.id]: - await message.reply_text( - "Search finished!", parse_mode=enums.ParseMode.HTML - ) + await message.reply_text('Search finished!', parse_mode=enums.ParseMode.HTML) except Exception as ex: await message.edit(format_exc(ex), parse_mode=enums.ParseMode.HTML) now[message.chat.id] = False -@Client.on_message(filters.command(["scancel"], prefix) & filters.me) +@Client.on_message(filters.command(['scancel'], prefix) & filters.me) async def scancel_cmd(_: Client, message: Message): if not now.get(message.chat.id): - return await message.edit( - "There is no search in progress!", parse_mode=enums.ParseMode.HTML - ) + return await message.edit('There is no search in progress!', parse_mode=enums.ParseMode.HTML) now[message.chat.id] = False - await message.edit("Search cancelled!", parse_mode=enums.ParseMode.HTML) + await message.edit('Search cancelled!', parse_mode=enums.ParseMode.HTML) -modules_help["search"] = { - "search [/cmd]* [search_word]* [timeout=2.0]": "Search for a specific word in bot (while)", - "scancel": "Cancel current search", +modules_help['search'] = { + 'search [/cmd]* [search_word]* [timeout=2.0]': 'Search for a specific word in bot (while)', + 'scancel': 'Cancel current search', } diff --git a/userbot/modules/misc/summary.py b/userbot/modules/misc/summary.py index 763a19c..3a6c13c 100644 --- a/userbot/modules/misc/summary.py +++ b/userbot/modules/misc/summary.py @@ -2,21 +2,19 @@ from pyrogram import Client, filters from pyrogram.types import Message - -from utils.scripts import format_exc, import_library from utils.misc import modules_help, prefix +from utils.scripts import format_exc, import_library -import_library("lxml_html_clean") -import_library("newspaper", "newspaper3k") -nltk = import_library("nltk") +import_library('lxml_html_clean') +import_library('newspaper', 'newspaper3k') +nltk = import_library('nltk') from newspaper import Article from newspaper.article import ArticleException - -nltk.download("all") +nltk.download('all') -@Client.on_message(filters.command("summary", prefix) & filters.me) +@Client.on_message(filters.command('summary', prefix) & filters.me) async def summarize_article(_, message: Message): """ Summarize an article from a given URL. @@ -32,7 +30,7 @@ async def summarize_article(_, message: Message): url = message.text.split(maxsplit=1)[1] if len(message.text.split()) > 1 else None if not url: - await message.edit_text("Please provide a valid URL after the command.") + await message.edit_text('Please provide a valid URL after the command.') return try: @@ -51,14 +49,10 @@ async def summarize_article(_, message: Message): """ await message.edit_text(response) except ArticleException: - return await message.edit_text( - "Unable to extract information from the provided URL." - ) + return await message.edit_text('Unable to extract information from the provided URL.') except Exception as e: - return await message.edit_text(f"An error occurred: {format_exc(e)}") + return await message.edit_text(f'An error occurred: {format_exc(e)}') -modules_help["summary"] = { - "summary [url]": "Reply with article links, getting summary of articles" -} +modules_help['summary'] = {'summary [url]': 'Reply with article links, getting summary of articles'} diff --git a/userbot/modules/misc/switch.py b/userbot/modules/misc/switch.py index 3f55768..a3bd72d 100644 --- a/userbot/modules/misc/switch.py +++ b/userbot/modules/misc/switch.py @@ -14,21 +14,16 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from pyrogram import Client, filters, enums +from pyrogram import Client, enums, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix -ru_keys = ( - """ёйцукенгшщзхъфывапролджэячсмитьбю.Ё"№;%:?ЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭ/ЯЧСМИТЬБЮ,""" -) -en_keys = ( - """`qwertyuiop[]asdfghjkl;'zxcvbnm,./~@#$%^&QWERTYUIOP{}ASDFGHJKL:"|ZXCVBNM<>?""" -) +ru_keys = """ёйцукенгшщзхъфывапролджэячсмитьбю.Ё"№;%:?ЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭ/ЯЧСМИТЬБЮ,""" +en_keys = """`qwertyuiop[]asdfghjkl;'zxcvbnm,./~@#$%^&QWERTYUIOP{}ASDFGHJKL:"|ZXCVBNM<>?""" table = str.maketrans(ru_keys + en_keys, en_keys + ru_keys) -@Client.on_message(filters.command(["switch", "sw"], prefix) & filters.me) +@Client.on_message(filters.command(['switch', 'sw'], prefix) & filters.me) async def switch(client: Client, message: Message): if len(message.command) == 1: if message.reply_to_message: @@ -38,9 +33,7 @@ async def switch(client: Client, message: Message): if history and history[1].from_user.is_self and history[1].text: text = history[1].text else: - await message.edit( - "Text to switch not found", parse_mode=enums.ParseMode.HTML - ) + await message.edit('Text to switch not found', parse_mode=enums.ParseMode.HTML) return else: text = message.text.split(maxsplit=1)[1] @@ -48,6 +41,6 @@ async def switch(client: Client, message: Message): await message.edit(str.translate(text, table), parse_mode=enums.ParseMode.HTML) -modules_help["switch"] = { - "sw [reply/text for switch]*": "Useful when you forgot to change the keyboard layout[RU]", +modules_help['switch'] = { + 'sw [reply/text for switch]*': 'Useful when you forgot to change the keyboard layout[RU]', } diff --git a/userbot/modules/misc/transcribeyt.py b/userbot/modules/misc/transcribeyt.py index 7cc0a97..f443e3d 100644 --- a/userbot/modules/misc/transcribeyt.py +++ b/userbot/modules/misc/transcribeyt.py @@ -1,70 +1,62 @@ -import requests -import time -from pyrogram import Client, filters, enums -from pyrogram.types import Message -from pyrogram.errors import MessageTooLong import os +import time + +import requests +from pyrogram import Client, enums, filters +from pyrogram.errors import MessageTooLong +from pyrogram.types import Message from utils.misc import modules_help, prefix - # Replace with your Gladia API key -gladia_key = "your key " -gladia_url = "https://api.gladia.io/v2/transcription/" +gladia_key = 'your key ' +gladia_url = 'https://api.gladia.io/v2/transcription/' # Function to make fetch requests to the Gladia API -def make_fetch_request(url, headers, method="GET", data=None): - if method == "POST": +def make_fetch_request(url, headers, method='GET', data=None): + if method == 'POST': response = requests.post(url, headers=headers, json=data) else: response = requests.get(url, headers=headers) return response.json() -@Client.on_message(filters.command("transcribeyt", prefix) & filters.me) +@Client.on_message(filters.command('transcribeyt', prefix) & filters.me) async def transcribe_audio(_, message: Message): """ Transcribe an audio URL using the Gladia API. Usage: .transcribe """ - audio_url = ( - message.text.split(maxsplit=1)[1] if len(message.text.split()) > 1 else None - ) + audio_url = message.text.split(maxsplit=1)[1] if len(message.text.split()) > 1 else None # Check if a valid URL was provided if not audio_url: - await message.reply("Please provide a valid audio URL.") + await message.reply('Please provide a valid audio URL.') return - headers = {"x-gladia-key": gladia_key, "Content-Type": "application/json"} + headers = {'x-gladia-key': gladia_key, 'Content-Type': 'application/json'} - request_data = {"audio_url": audio_url} + request_data = {'audio_url': audio_url} # Send initial request to Gladia API - status_message = await message.reply("- Sending initial request to Gladia API...") - initial_response = make_fetch_request(gladia_url, headers, "POST", request_data) + status_message = await message.reply('- Sending initial request to Gladia API...') + initial_response = make_fetch_request(gladia_url, headers, 'POST', request_data) # Check if the response contains the result_url - if "result_url" not in initial_response: - await status_message.edit(f"Error in transcription request: {initial_response}") + if 'result_url' not in initial_response: + await status_message.edit(f'Error in transcription request: {initial_response}') return - result_url = initial_response["result_url"] - await status_message.edit( - f"Initial request sent. Polling for transcription results..." - ) + result_url = initial_response['result_url'] + await status_message.edit('Initial request sent. Polling for transcription results...') # Polling for transcription result while True: poll_response = make_fetch_request(result_url, headers) - if poll_response.get("status") == "done": - transcription = ( - poll_response.get("result", {}) - .get("transcription", {}) - .get("full_transcript") - ) + if poll_response.get('status') == 'done': + transcription = poll_response.get('result', {}).get('transcription', {}).get('full_transcript') if transcription: # Format the transcription result with HTML result_html = f""" @@ -74,12 +66,10 @@ async def transcribe_audio(_, message: Message): """ try: # Attempt to send transcription as a message - await message.reply_text( - result_html, parse_mode=enums.ParseMode.HTML - ) + await message.reply_text(result_html, parse_mode=enums.ParseMode.HTML) except MessageTooLong: # Save the large response to a file - with open("transcription.txt", "w") as f: + with open('transcription.txt', 'w') as f: f.write(result_html) # Read general details to include in the caption @@ -87,24 +77,18 @@ async def transcribe_audio(_, message: Message): # Send the file with a caption await message.reply_document( - "transcription.txt", - caption=f"General Details:\n{general_details}", + 'transcription.txt', + caption=f'General Details:\n{general_details}', ) # Clean up by removing the file - os.remove("transcription.html") + os.remove('transcription.html') else: - await status_message.edit( - "Transcription completed, but no transcript was found." - ) + await status_message.edit('Transcription completed, but no transcript was found.') break else: - await status_message.edit( - f"Transcription status: {poll_response.get('status')}" - ) + await status_message.edit(f'Transcription status: {poll_response.get("status")}') time.sleep(30) # Wait for a few seconds before polling again -modules_help["transcribeyt"] = { - "transcribeyt [yt video url]": "Reply with a YT video link to get transcribed " -} +modules_help['transcribeyt'] = {'transcribeyt [yt video url]': 'Reply with a YT video link to get transcribed '} diff --git a/userbot/modules/notes.py b/userbot/modules/notes.py index b43dc3e..216a945 100644 --- a/userbot/modules/notes.py +++ b/userbot/modules/notes.py @@ -16,128 +16,118 @@ from pyrogram import Client, errors, filters from pyrogram.types import Message - from utils.db import db from utils.handlers import NoteSendHandler from utils.misc import modules_help, prefix -@Client.on_message(filters.command(["save"], prefix) & filters.me) +@Client.on_message(filters.command(['save'], prefix) & filters.me) async def save_note(client: Client, message: Message): - await message.edit("Loading...") + await message.edit('Loading...') try: - chat = await client.get_chat(db.get("core.notes", "chat_id", 0)) + chat = await client.get_chat(db.get('core.notes', 'chat_id', 0)) except (errors.RPCError, ValueError, KeyError): # group is not accessible or isn't created - chat = await client.create_supergroup( - "Userbot_Notes_Filters", "Don't touch this group, please" - ) - db.set("core.notes", "chat_id", chat.id) + chat = await client.create_supergroup('Userbot_Notes_Filters', "Don't touch this group, please") + db.set('core.notes', 'chat_id', chat.id) chat_id = chat.id if message.reply_to_message and len(message.text.split()) >= 2: note_name = message.text.split(maxsplit=1)[1] if message.reply_to_message.media_group_id: - checking_note = db.get("core.notes", f"note{note_name}", False) + checking_note = db.get('core.notes', f'note{note_name}', False) if not checking_note: get_media_group = [ - _.id - for _ in await client.get_media_group( - message.chat.id, message.reply_to_message.id - ) + _.id for _ in await client.get_media_group(message.chat.id, message.reply_to_message.id) ] try: - message_id = await client.forward_messages( - chat_id, message.chat.id, get_media_group - ) + message_id = await client.forward_messages(chat_id, message.chat.id, get_media_group) except errors.ChatForwardsRestricted: await message.edit( - "Forwarding messages is restricted by chat admins", + 'Forwarding messages is restricted by chat admins', ) return note = { - "MESSAGE_ID": str(message_id[1].id), - "MEDIA_GROUP": True, - "CHAT_ID": str(chat_id), + 'MESSAGE_ID': str(message_id[1].id), + 'MEDIA_GROUP': True, + 'CHAT_ID': str(chat_id), } - db.set("core.notes", f"note{note_name}", note) - await message.edit(f"Note {note_name} saved") + db.set('core.notes', f'note{note_name}', note) + await message.edit(f'Note {note_name} saved') else: - await message.edit("This note already exists") + await message.edit('This note already exists') else: - checking_note = db.get("core.notes", f"note{note_name}", False) + checking_note = db.get('core.notes', f'note{note_name}', False) if not checking_note: try: message_id = await message.reply_to_message.forward(chat_id) except errors.ChatForwardsRestricted: message_id = await message.copy(chat_id) note = { - "MEDIA_GROUP": False, - "MESSAGE_ID": str(message_id.id), - "CHAT_ID": str(chat_id), + 'MEDIA_GROUP': False, + 'MESSAGE_ID': str(message_id.id), + 'CHAT_ID': str(chat_id), } - db.set("core.notes", f"note{note_name}", note) - await message.edit(f"Note {note_name} saved") + db.set('core.notes', f'note{note_name}', note) + await message.edit(f'Note {note_name} saved') else: - await message.edit("This note already exists") + await message.edit('This note already exists') elif len(message.text.split()) >= 3: note_name = message.text.split(maxsplit=1)[1].split()[0] - checking_note = db.get("core.notes", f"note{note_name}", False) + checking_note = db.get('core.notes', f'note{note_name}', False) if not checking_note: - message_id = await client.send_message( - chat_id, message.text.split(note_name)[1].strip() - ) + message_id = await client.send_message(chat_id, message.text.split(note_name)[1].strip()) note = { - "MEDIA_GROUP": False, - "MESSAGE_ID": str(message_id.id), - "CHAT_ID": str(chat_id), + 'MEDIA_GROUP': False, + 'MESSAGE_ID': str(message_id.id), + 'CHAT_ID': str(chat_id), } - db.set("core.notes", f"note{note_name}", note) - await message.edit(f"Note {note_name} saved") + db.set('core.notes', f'note{note_name}', note) + await message.edit(f'Note {note_name} saved') else: - await message.edit("This note already exists") + await message.edit('This note already exists') else: await message.edit( - f"Example: {prefix}save note_name", + f'Example: {prefix}save note_name', ) -@Client.on_message(filters.command("note", prefix) & filters.me) +@Client.on_message(filters.command('note', prefix) & filters.me) async def note_send(client: Client, message: Message): handler = NoteSendHandler(client, message) await handler.handle_note_send() -@Client.on_message(filters.command(["notes"], prefix) & filters.me) +@Client.on_message(filters.command(['notes'], prefix) & filters.me) async def notes(_, message: Message): - await message.edit("Loading...") - text = "Available notes:\n\n" - collection = db.get_collection("core.notes") + await message.edit('Loading...') + text = 'Available notes:\n\n' + collection = db.get_collection('core.notes') for note in collection.keys(): - if note[:4] == "note": - text += f"{note[4:]}\n" + if note[:4] == 'note': + text += f'{note[4:]}\n' await message.edit(text) -@Client.on_message(filters.command(["clear"], prefix) & filters.me) +@Client.on_message(filters.command(['clear'], prefix) & filters.me) async def clear_note(_, message: Message): if len(message.text.split()) >= 2: note_name = message.text.split(maxsplit=1)[1] - find_note = db.get("core.notes", f"note{note_name}", False) + find_note = db.get('core.notes', f'note{note_name}', False) if find_note: - db.remove("core.notes", f"note{note_name}") - await message.edit(f"Note {note_name} deleted") + db.remove('core.notes', f'note{note_name}') + await message.edit(f'Note {note_name} deleted') else: - await message.edit("There is no such note") + await message.edit('There is no such note') else: - await message.edit(f"Example: {prefix}clear note_name") + await message.edit(f'Example: {prefix}clear note_name') -modules_help["notes"] = { - "save [name]*": "Save note", - "note [name]*": "Get saved note", - "notes": "Get note list", - "clear [name]*": "Delete note", +modules_help['notes'] = { + 'save [name]*': 'Save note', + 'note [name]*': 'Get saved note', + 'notes': 'Get note list', + 'clear [name]*': 'Delete note', } diff --git a/userbot/modules/open.py b/userbot/modules/open.py index dd6da30..9c25295 100644 --- a/userbot/modules/open.py +++ b/userbot/modules/open.py @@ -22,94 +22,85 @@ import aiofiles from pyrogram import Client, filters from pyrogram.errors import MessageTooLong from pyrogram.types import Message - from utils.misc import modules_help, prefix -from utils.scripts import edit_or_reply, format_exc, progress from utils.rentry import paste as rentry_paste +from utils.scripts import edit_or_reply, format_exc, progress async def read_file(file_path): - async with aiofiles.open(file_path, mode="r") as file: + async with aiofiles.open(file_path) as file: content = await file.read() return content def check_extension(file_path): extensions = { - ".txt": "
",
-        ".py": "
",
-        ".js": "
",
-        ".json": "
",
-        ".smali": "
",
-        ".sh": "
",
-        ".c": "
",
-        ".java": "
",
-        ".php": "
",
-        ".doc": "
",
-        ".docx": "
",
-        ".rtf": "
",
-        ".s": "
",
-        ".dart": "
",
-        ".cfg": "
",
-        ".swift": "
",
-        ".cs": "
",
-        ".vb": "
",
-        ".css": "
",
-        ".htm": "
",
-        ".html": "
",
-        ".rss": "
",
-        ".xhtml": "
",
-        ".cpp": "
",
+        '.txt': "
",
+        '.py': "
",
+        '.js': "
",
+        '.json': "
",
+        '.smali': "
",
+        '.sh': "
",
+        '.c': "
",
+        '.java': "
",
+        '.php': "
",
+        '.doc': "
",
+        '.docx': "
",
+        '.rtf': "
",
+        '.s': "
",
+        '.dart': "
",
+        '.cfg': "
",
+        '.swift': "
",
+        '.cs': "
",
+        '.vb': "
",
+        '.css': "
",
+        '.htm': "
",
+        '.html': "
",
+        '.rss': "
",
+        '.xhtml': "
",
+        '.cpp': "
",
     }
 
     ext = os.path.splitext(file_path)[1].lower()
 
-    return extensions.get(ext, "
")
+    return extensions.get(ext, '
')
 
 
-@Client.on_message(filters.command("open", prefix) & filters.me)
+@Client.on_message(filters.command('open', prefix) & filters.me)
 async def openfile(client: Client, message: Message):
     if not message.reply_to_message:
-        return await message.edit_text("Kindly Reply to a File")
+        return await message.edit_text('Kindly Reply to a File')
 
     try:
-        ms = await edit_or_reply(message, "Downloading...")
+        ms = await edit_or_reply(message, 'Downloading...')
         ct = time.time()
-        file_path = await message.reply_to_message.download(
-            progress=progress, progress_args=(ms, ct, "Downloading...")
-        )
-        await ms.edit_text("Trying to open file...")
+        file_path = await message.reply_to_message.download(progress=progress, progress_args=(ms, ct, 'Downloading...'))
+        await ms.edit_text('Trying to open file...')
         file_info = os.stat(file_path)
-        file_name = file_path.split("/")[-1:]
+        file_name = file_path.split('/')[-1:]
         file_size = file_info.st_size
-        last_modified = datetime.datetime.fromtimestamp(file_info.st_mtime).strftime(
-            "%Y-%m-%d %H:%M:%S"
-        )
+        last_modified = datetime.datetime.fromtimestamp(file_info.st_mtime).strftime('%Y-%m-%d %H:%M:%S')
         code_start = check_extension(file_path=file_path)
         content = await read_file(file_path=file_path)
         await ms.edit_text(
-            f"File Name: {file_name[0]}\nSize: {file_size} bytes\nLast Modified: {last_modified}\nContent: {code_start}{content}
", + f'File Name: {file_name[0]}\nSize: {file_size} bytes\nLast Modified: {last_modified}\nContent: {code_start}{content}
', ) except MessageTooLong: - await ms.edit_text( - "File Content is too long... Pasting to rentry..." - ) - content_new = f"```{code_start[11:-2]}\n{content}```" + await ms.edit_text('File Content is too long... Pasting to rentry...') + content_new = f'```{code_start[11:-2]}\n{content}```' try: - rentry_url, edit_code = await rentry_paste( - text=content_new, return_edit=True - ) + rentry_url, edit_code = await rentry_paste(text=content_new, return_edit=True) except RuntimeError: - await ms.edit_text("Error: Failed to paste to rentry") + await ms.edit_text('Error: Failed to paste to rentry') return await client.send_message( - "me", + 'me', f"Here's your edit code for Url: {rentry_url}\nEdit code: {edit_code}", disable_web_page_preview=True, ) await ms.edit_text( - f"File Name: {file_name[0]}\nSize: {file_size} bytes\nLast Modified: {last_modified}\nContent: {rentry_url}\nNote: Edit Code has been sent to your saved messages", + f'File Name: {file_name[0]}\nSize: {file_size} bytes\nLast Modified: {last_modified}\nContent: {rentry_url}\nNote: Edit Code has been sent to your saved messages', disable_web_page_preview=True, ) @@ -121,6 +112,4 @@ async def openfile(client: Client, message: Message): os.remove(file_path) -modules_help["open"] = { - "open": "Open content of any text supported filetype and show it's raw data" -} +modules_help['open'] = {'open': "Open content of any text supported filetype and show it's raw data"} diff --git a/userbot/modules/pdf2md.py b/userbot/modules/pdf2md.py index 8d1649f..d5cba9e 100644 --- a/userbot/modules/pdf2md.py +++ b/userbot/modules/pdf2md.py @@ -1,49 +1,48 @@ import os + from pyrogram import Client, filters from pyrogram.types import Message - +from utils.config import gemini_key from utils.misc import modules_help, prefix from utils.scripts import import_library -from utils.config import gemini_key +import_library('pyzerox', 'py-zerox') -import_library("pyzerox", "py-zerox") - +import litellm from pyzerox import zerox from pyzerox.errors import ModelAccessError, NotAVisionModel -import litellm kwargs = {} CUSTOM_SYSTEM_PROMPT = "For the below pdf page, convert it into as accurate markdown format as possible with it's structure intact i.e, tables, charts, layouts etc. Return only the markdown with no explanation text. Do not exclude any content from the page." -MODEL = "gemini/gemini-1.5-pro" +MODEL = 'gemini/gemini-1.5-pro' -@Client.on_message(filters.command("pdf2md", prefix) & filters.me) +@Client.on_message(filters.command('pdf2md', prefix) & filters.me) async def pdf2md(client: Client, message: Message): if not message.reply_to_message: - await message.edit("Reply to a pdf file") + await message.edit('Reply to a pdf file') return if not message.reply_to_message.document: - await message.edit("Reply to a pdf file") + await message.edit('Reply to a pdf file') return - if not message.reply_to_message.document.mime_type == "application/pdf": - await message.edit("Reply to a pdf file") + if not message.reply_to_message.document.mime_type == 'application/pdf': + await message.edit('Reply to a pdf file') return - if gemini_key == "": - await message.edit("Set GEMINI_KEY to use this command") + if gemini_key == '': + await message.edit('Set GEMINI_KEY to use this command') return file_name = message.reply_to_message.document.file_name - file_name = file_name.split(".")[0] - if os.path.exists(f"{file_name}.md"): - os.remove(f"{file_name}.md") - md = f"{file_name}.md" - os.environ["GEMINI_API_KEY"] = gemini_key - await message.edit("Downloading pdf...") + file_name = file_name.split('.')[0] + if os.path.exists(f'{file_name}.md'): + os.remove(f'{file_name}.md') + md = f'{file_name}.md' + os.environ['GEMINI_API_KEY'] = gemini_key + await message.edit('Downloading pdf...') pdf = await message.reply_to_message.download() - await message.edit("Converting pdf to markdown...") + await message.edit('Converting pdf to markdown...') try: result = await zerox( file_path=pdf, @@ -55,29 +54,29 @@ async def pdf2md(client: Client, message: Message): if result: pages = result.pages for page in pages: - with open(md, "a") as f: + with open(md, 'a') as f: f.write(page.content) - f.write("\n\n") + f.write('\n\n') else: - await message.edit("No result") + await message.edit('No result') return except ModelAccessError: - await message.edit("Model not accessible") + await message.edit('Model not accessible') return except NotAVisionModel: - await message.edit("Model is not a vision model") + await message.edit('Model is not a vision model') return except litellm.InternalServerError: - await message.edit("Internal Server Error") + await message.edit('Internal Server Error') return except Exception as e: - await message.edit(f"Error: {e}") + await message.edit(f'Error: {e}') return - await message.edit("Uploading markdown...") + await message.edit('Uploading markdown...') await client.send_document( message.chat.id, document=md, - file_name=f"{message.reply_to_message.document.file_name.split('.')[0]}.md", + file_name=f'{message.reply_to_message.document.file_name.split(".")[0]}.md', reply_to_message_id=message.reply_to_message.id, ) await message.delete() @@ -85,4 +84,4 @@ async def pdf2md(client: Client, message: Message): os.remove(md) -modules_help["pdf2md"] = {"pdf2md": "Convert a pdf to markdown"} +modules_help['pdf2md'] = {'pdf2md': 'Convert a pdf to markdown'} diff --git a/userbot/modules/perfectrussian.py b/userbot/modules/perfectrussian.py index 46e5d79..568663e 100644 --- a/userbot/modules/perfectrussian.py +++ b/userbot/modules/perfectrussian.py @@ -1,27 +1,26 @@ -from pyrogram import Client, filters, enums -from pyrogram.types import Message +import random +from pyrogram import Client, enums, filters +from pyrogram.types import Message from utils.misc import modules_help, prefix from utils.scripts import with_reply -import random - -@Client.on_message(filters.command("prus", prefix) & filters.me) +@Client.on_message(filters.command('prus', prefix) & filters.me) @with_reply async def prussian_cmd(_, message: Message): words = [ - "сука", - "нахуй", - "блять", - "блядь", - "пиздец", - "еблан", - "уебан", - "уебок", - "пизда", - "очко", - "хуй", + 'сука', + 'нахуй', + 'блять', + 'блядь', + 'пиздец', + 'еблан', + 'уебан', + 'уебок', + 'пизда', + 'очко', + 'хуй', ] splitted = message.reply_to_message.text.split() @@ -29,9 +28,9 @@ async def prussian_cmd(_, message: Message): for j in range(1, 2): splitted.insert(i, random.choice(words)) - await message.edit(" ".join(splitted), parse_mode=enums.ParseMode.HTML) + await message.edit(' '.join(splitted), parse_mode=enums.ParseMode.HTML) -modules_help["perfectrussian"] = { - "prus": "translate your message into perfect 🇷🇺Russian", +modules_help['perfectrussian'] = { + 'prus': 'translate your message into perfect 🇷🇺Russian', } diff --git a/userbot/modules/ping.py b/userbot/modules/ping.py index 9a2cb31..fecaeaf 100644 --- a/userbot/modules/ping.py +++ b/userbot/modules/ping.py @@ -17,16 +17,15 @@ from pyrogram import Client, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix -@Client.on_message(filters.command(["ping", "p"], prefix) & filters.me) +@Client.on_message(filters.command(['ping', 'p'], prefix) & filters.me) async def ping(client: Client, message: Message): latency = await client.ping() - await message.edit(f"Pong! {latency}ms") + await message.edit(f'Pong! {latency}ms') -modules_help["ping"] = { - "ping": "Check ping to Telegram servers", +modules_help['ping'] = { + 'ping': 'Check ping to Telegram servers', } diff --git a/userbot/modules/prefix.py b/userbot/modules/prefix.py index dcec0d5..a7c49a0 100644 --- a/userbot/modules/prefix.py +++ b/userbot/modules/prefix.py @@ -16,37 +16,32 @@ from pyrogram import Client, filters from pyrogram.types import Message - from utils.db import db from utils.misc import modules_help, prefix from utils.scripts import restart -@Client.on_message( - filters.command(["sp", "setprefix"], prefix) & filters.me -) +@Client.on_message(filters.command(['sp', 'setprefix'], prefix) & filters.me) async def setprefix(_, message: Message): if len(message.command) > 1: pref = message.command[1] - db.set("core.main", "prefix", pref) - await message.edit( - f"Prefix [ {pref} ] is set!\nRestarting..." - ) + db.set('core.main', 'prefix', pref) + await message.edit(f'Prefix [ {pref} ] is set!\nRestarting...') db.set( - "core.updater", - "restart_info", + 'core.updater', + 'restart_info', { - "type": "restart", - "chat_id": message.chat.id, - "message_id": message.id, + 'type': 'restart', + 'chat_id': message.chat.id, + 'message_id': message.id, }, ) restart() else: - await message.edit("The prefix must not be empty!") + await message.edit('The prefix must not be empty!') -modules_help["prefix"] = { - "sp [prefix]": "Set custom prefix", - "setprefix [prefix]": "Set custom prefix", +modules_help['prefix'] = { + 'sp [prefix]': 'Set custom prefix', + 'setprefix [prefix]': 'Set custom prefix', } diff --git a/userbot/modules/purge.py b/userbot/modules/purge.py index ba435d8..7cb6059 100644 --- a/userbot/modules/purge.py +++ b/userbot/modules/purge.py @@ -15,20 +15,20 @@ # along with this program. If not, see . import asyncio + from pyrogram import Client, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix from utils.scripts import with_reply -@Client.on_message(filters.command("del", prefix) & filters.me) +@Client.on_message(filters.command('del', prefix) & filters.me) async def del_msg(_, message: Message): await message.delete() await message.reply_to_message.delete() -@Client.on_message(filters.command("purge", prefix) & filters.me) +@Client.on_message(filters.command('purge', prefix) & filters.me) @with_reply async def purge(client: Client, message: Message): chunk = [] @@ -48,7 +48,7 @@ async def purge(client: Client, message: Message): await client.delete_messages(message.chat.id, chunk) -modules_help["purge"] = { - "purge [reply]": "Purge (delete all messages) chat from replied message to last", - "del [reply]": "Delete replied message", +modules_help['purge'] = { + 'purge [reply]': 'Purge (delete all messages) chat from replied message to last', + 'del [reply]': 'Delete replied message', } diff --git a/userbot/modules/python.py b/userbot/modules/python.py index ecaa181..a07d8a4 100644 --- a/userbot/modules/python.py +++ b/userbot/modules/python.py @@ -28,9 +28,7 @@ from utils.scripts import format_exc # noinspection PyUnusedLocal -@Client.on_message( - filters.command(["ex", "exec", "py", "exnoedit"], prefix) & filters.me -) +@Client.on_message(filters.command(['ex', 'exec', 'py', 'exnoedit'], prefix) & filters.me) async def user_exec(_: Client, message: Message): if len(message.command) == 1: await message.edit("Code to execute isn't provided") @@ -39,18 +37,13 @@ async def user_exec(_: Client, message: Message): code = message.text.split(maxsplit=1)[1] stdout = StringIO() - await message.edit("Executing...") + await message.edit('Executing...') try: with redirect_stdout(stdout): exec(code) # skipcq - text = ( - "Code:\n" - f"{code}\n\n" - "Result:\n" - f"{stdout.getvalue()}" - ) - if message.command[0] == "exnoedit": + text = f'Code:\n{code}\n\nResult:\n{stdout.getvalue()}' + if message.command[0] == 'exnoedit': await message.reply(text) else: await message.edit(text) @@ -59,7 +52,7 @@ async def user_exec(_: Client, message: Message): # noinspection PyUnusedLocal -@Client.on_message(filters.command(["ev", "eval"], prefix) & filters.me) +@Client.on_message(filters.command(['ev', 'eval'], prefix) & filters.me) async def user_eval(client: Client, message: Message): if len(message.command) == 1: await message.edit("Code to eval isn't provided") @@ -69,18 +62,13 @@ async def user_eval(client: Client, message: Message): try: result = eval(code) # skipcq - await message.edit( - "Expression:\n" - f"{code}\n\n" - "Result:\n" - f"{result}" - ) + await message.edit(f'Expression:\n{code}\n\nResult:\n{result}') except Exception as e: await message.edit(format_exc(e)) -modules_help["python"] = { - "ex [python code]": "Execute Python code", - "exnoedit [python code]": "Execute Python code and return result with reply", - "eval [python code]": "Eval Python code", +modules_help['python'] = { + 'ex [python code]': 'Execute Python code', + 'exnoedit [python code]': 'Execute Python code and return result with reply', + 'eval [python code]': 'Eval Python code', } diff --git a/userbot/modules/reactionspam.py b/userbot/modules/reactionspam.py index 3eeb1a5..0e38f6d 100644 --- a/userbot/modules/reactionspam.py +++ b/userbot/modules/reactionspam.py @@ -1,33 +1,33 @@ -import asyncio, random -from pyrogram import Client, filters, enums -from pyrogram.raw import functions +import random + +from pyrogram import Client, enums, filters from pyrogram.types import Message from utils.misc import modules_help, prefix from utils.scripts import format_exc emojis = [ - "👍", - "👎", - "❤️", - "🔥", - "🥰", - "👏", - "😁", - "🤔", - "🤯", - "😱", - "🤬", - "😢", - "🎉", - "🤩", - "🤮", - "💩", + '👍', + '👎', + '❤️', + '🔥', + '🥰', + '👏', + '😁', + '🤔', + '🤯', + '😱', + '🤬', + '😢', + '🎉', + '🤩', + '🤮', + '💩', ] -@Client.on_message(filters.command("reactspam", prefix) & filters.me) +@Client.on_message(filters.command('reactspam', prefix) & filters.me) async def reactspam(client: Client, message: Message): - await message.edit(f"One moment...", parse_mode=enums.ParseMode.HTML) + await message.edit('One moment...', parse_mode=enums.ParseMode.HTML) try: selected_emojis = random.sample(emojis, 3) print(selected_emojis) @@ -41,4 +41,4 @@ async def reactspam(client: Client, message: Message): return await message.edit_text(format_exc(e)) -modules_help["reactionspam"] = {"reactspam [amount]* [emoji]*": "spam reactions"} +modules_help['reactionspam'] = {'reactspam [amount]* [emoji]*': 'spam reactions'} diff --git a/userbot/modules/removebg.py b/userbot/modules/removebg.py index 535d56d..4e635e6 100644 --- a/userbot/modules/removebg.py +++ b/userbot/modules/removebg.py @@ -17,7 +17,6 @@ import requests from PIL import Image from pyrogram import Client, enums, filters from pyrogram.types import Message - from utils.config import rmbg_key from utils.misc import modules_help, prefix from utils.scripts import edit_or_reply, format_exc @@ -43,54 +42,51 @@ async def convert_to_image(message, client) -> None | str: if message.reply_to_message.photo: final_path = await message.reply_to_message.download() elif message.reply_to_message.sticker: - if message.reply_to_message.sticker.mime_type == "image/webp": - final_path = "webp_to_png_s_proton.png" + if message.reply_to_message.sticker.mime_type == 'image/webp': + final_path = 'webp_to_png_s_proton.png' path_s = await message.reply_to_message.download() im = Image.open(path_s) - im.save(final_path, "PNG") + im.save(final_path, 'PNG') else: path_s = await client.download_media(message.reply_to_message) - final_path = "lottie_proton.png" - cmd = ( - f"lottie_convert.py --frame 0 -if lottie -of png {path_s} {final_path}" - ) + final_path = 'lottie_proton.png' + cmd = f'lottie_convert.py --frame 0 -if lottie -of png {path_s} {final_path}' await exec(cmd) # skipcq elif message.reply_to_message.audio: thumb = message.reply_to_message.audio.thumbs[0].file_id final_path = await client.download_media(thumb) elif message.reply_to_message.video or message.reply_to_message.animation: - final_path = "fetched_thumb.png" + final_path = 'fetched_thumb.png' vid_path = await client.download_media(message.reply_to_message) - await exec( - f"ffmpeg -i {vid_path} -filter:v scale=500:500 -an {final_path}" - ) # skipcq + await exec(f'ffmpeg -i {vid_path} -filter:v scale=500:500 -an {final_path}') # skipcq elif message.reply_to_message.document: - if message.reply_to_message.document.mime_type == "image/jpeg": + if ( + message.reply_to_message.document.mime_type == 'image/jpeg' + or message.reply_to_message.document.mime_type == 'image/png' + ): final_path = await message.reply_to_message.download() - elif message.reply_to_message.document.mime_type == "image/png": - final_path = await message.reply_to_message.download() - elif message.reply_to_message.document.mime_type == "image/webp": - final_path = "webp_to_png_s_proton.png" + elif message.reply_to_message.document.mime_type == 'image/webp': + final_path = 'webp_to_png_s_proton.png' path_s = await message.reply_to_message.download() im = Image.open(path_s) - im.save(final_path, "PNG") + im.save(final_path, 'PNG') else: return None return final_path def remove_background(photo_data): - with open(photo_data, "rb") as image_file: + with open(photo_data, 'rb') as image_file: image_data = image_file.read() response = requests.post( - "https://api.remove.bg/v1.0/removebg", - files={"image_file": image_data}, - data={"size": "auto"}, - headers={"X-Api-Key": rmbg_key}, + 'https://api.remove.bg/v1.0/removebg', + files={'image_file': image_data}, + data={'size': 'auto'}, + headers={'X-Api-Key': rmbg_key}, ) if response.status_code == 200: return BytesIO(response.content) - print("Error:", response.status_code, response.text) + print('Error:', response.status_code, response.text) return None @@ -108,26 +104,26 @@ def _check_rmbg(func): return check_rmbg -@Client.on_message(filters.command("rmbg", prefix) & filters.me) +@Client.on_message(filters.command('rmbg', prefix) & filters.me) @_check_rmbg async def rmbg(client: Client, message: Message): - pablo = await edit_or_reply(message, "Processing...") + pablo = await edit_or_reply(message, 'Processing...') if not message.reply_to_message: - await pablo.edit("Reply To A Image Please!") + await pablo.edit('Reply To A Image Please!') return cool = await convert_to_image(message, client) if not cool: - await pablo.edit("Reply to a valid media first.") + await pablo.edit('Reply to a valid media first.') return start = datetime.now() - await pablo.edit("sending to ReMove.BG") + await pablo.edit('sending to ReMove.BG') input_file_name = cool files = { - "image_file": (input_file_name, open(input_file_name, "rb")), + 'image_file': (input_file_name, open(input_file_name, 'rb')), } r = requests.post( - "https://api.remove.bg/v1.0/removebg", - headers={"X-Api-Key": rmbg_key}, + 'https://api.remove.bg/v1.0/removebg', + headers={'X-Api-Key': rmbg_key}, files=files, allow_redirects=True, stream=True, @@ -135,30 +131,23 @@ async def rmbg(client: Client, message: Message): if os.path.exists(cool): os.remove(cool) output_file_name = r - contentType = output_file_name.headers.get("content-type") - if "image" in contentType: + contentType = output_file_name.headers.get('content-type') + if 'image' in contentType: with io.BytesIO(output_file_name.content) as remove_bg_image: - remove_bg_image.name = "BG_rem.png" - await client.send_document( - message.chat.id, remove_bg_image, reply_to_message_id=message.id - ) + remove_bg_image.name = 'BG_rem.png' + await client.send_document(message.chat.id, remove_bg_image, reply_to_message_id=message.id) end = datetime.now() ms = (end - start).seconds - await pablo.edit( - f"Removed image's Background in {ms} seconds." - ) - if os.path.exists("BG_rem.png"): - os.remove("BG_rem.png") + await pablo.edit(f"Removed image's Background in {ms} seconds.") + if os.path.exists('BG_rem.png'): + os.remove('BG_rem.png') else: - await pablo.edit( - "ReMove.BG API returned Errors." - + f"\n`{output_file_name.content.decode('UTF-8')}" - ) + await pablo.edit('ReMove.BG API returned Errors.' + f'\n`{output_file_name.content.decode("UTF-8")}') -@Client.on_message(filters.command("rebg", prefix) & filters.me) +@Client.on_message(filters.command('rebg', prefix) & filters.me) async def rembg(client: Client, message: Message): - await message.edit("Processing...") + await message.edit('Processing...') chat_id = message.chat.id try: try: @@ -167,28 +156,26 @@ async def rembg(client: Client, message: Message): try: photo_data = await message.reply_to_message.download() except ValueError: - await message.edit("File not found") + await message.edit('File not found') return background_removed_data = remove_background(photo_data) if background_removed_data: await message.delete() - await client.send_photo( - chat_id, photo=background_removed_data, caption="Background removed!" - ) + await client.send_photo(chat_id, photo=background_removed_data, caption='Background removed!') else: await message.edit_text( "`Is Your RMBG Api 'rmbg_key' Valid Or You Didn't Add It??`\n **Check logs for details**", parse_mode=enums.ParseMode.MARKDOWN, ) except Exception as e: - await message.reply_text(f"An error occurred: {format_exc(e)}") + await message.reply_text(f'An error occurred: {format_exc(e)}') finally: if os.path.exists(photo_data): os.remove(photo_data) -modules_help["removebg"] = { - "rebg [reply to image]*": "remove background from image without transparency", - "rmbg [reply to image]*": "remove background from image with transparency", +modules_help['removebg'] = { + 'rebg [reply to image]*': 'remove background from image without transparency', + 'rmbg [reply to image]*': 'remove background from image with transparency', } diff --git a/userbot/modules/say.py b/userbot/modules/say.py index 6ccd962..a38668d 100644 --- a/userbot/modules/say.py +++ b/userbot/modules/say.py @@ -20,18 +20,17 @@ from pyrogram import Client, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix -@Client.on_message(filters.command(["say", "s"], prefix) & filters.me) +@Client.on_message(filters.command(['say', 's'], prefix) & filters.me) async def say(_, message: Message): if len(message.command) == 1: return - command = " ".join(message.command[1:]) - await message.edit(f"{command}") + command = ' '.join(message.command[1:]) + await message.edit(f'{command}') -modules_help["say"] = { - "say [command]*": "Send message that won't be interpreted by userbot", +modules_help['say'] = { + 'say [command]*': "Send message that won't be interpreted by userbot", } diff --git a/userbot/modules/sendmod.py b/userbot/modules/sendmod.py index b989164..b56adb7 100644 --- a/userbot/modules/sendmod.py +++ b/userbot/modules/sendmod.py @@ -18,41 +18,38 @@ import os from pyrogram import Client, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix from utils.scripts import format_exc, format_module_help, format_small_module_help -@Client.on_message(filters.command(["sendmod", "sm"], prefix) & filters.me) +@Client.on_message(filters.command(['sendmod', 'sm'], prefix) & filters.me) async def sendmod(client: Client, message: Message): if len(message.command) == 1: - await message.edit("Module name to send is not provided") + await message.edit('Module name to send is not provided') return - await message.edit("Dispatching...") + await message.edit('Dispatching...') try: module_name = message.command[1].lower() if module_name in modules_help: text = format_module_help(module_name) if len(text) >= 1024: text = format_small_module_help(module_name) - if os.path.isfile(f"modules/{module_name}.py"): - await client.send_document( - message.chat.id, f"modules/{module_name}.py", caption=text - ) - elif os.path.isfile(f"modules/custom_modules/{module_name.lower()}.py"): + if os.path.isfile(f'modules/{module_name}.py'): + await client.send_document(message.chat.id, f'modules/{module_name}.py', caption=text) + elif os.path.isfile(f'modules/custom_modules/{module_name.lower()}.py'): await client.send_document( message.chat.id, - f"modules/custom_modules/{module_name}.py", + f'modules/custom_modules/{module_name}.py', caption=text, ) await message.delete() else: - await message.edit(f"Module {module_name} not found!") + await message.edit(f'Module {module_name} not found!') except Exception as e: await message.edit(format_exc(e)) -modules_help["sendmod"] = { - "sendmod [module_name]": "Send module to interlocutor", +modules_help['sendmod'] = { + 'sendmod [module_name]': 'Send module to interlocutor', } diff --git a/userbot/modules/sessionkiller.py b/userbot/modules/sessionkiller.py index 053d310..fecde80 100644 --- a/userbot/modules/sessionkiller.py +++ b/userbot/modules/sessionkiller.py @@ -20,137 +20,128 @@ import time from datetime import datetime from html import escape -from pyrogram import Client, filters -from pyrogram import ContinuePropagation +from pyrogram import Client, ContinuePropagation, filters from pyrogram.errors import RPCError from pyrogram.raw.functions.account import GetAuthorizations, ResetAuthorization from pyrogram.raw.types import UpdateServiceNotification from pyrogram.types import Message - from utils.db import db from utils.misc import modules_help, prefix -auth_hashes = db.get("core.sessionkiller", "auths_hashes", []) +auth_hashes = db.get('core.sessionkiller', 'auths_hashes', []) -@Client.on_message(filters.command(["sessions"], prefix) & filters.me) +@Client.on_message(filters.command(['sessions'], prefix) & filters.me) async def sessions_list(client: Client, message: Message): formatted_sessions = [] sessions = (await client.invoke(GetAuthorizations())).authorizations for num, session in enumerate(sessions, 1): formatted_sessions.append( - f"{num}. {escape(session.device_model)} on {escape(session.platform if session.platform != '' else 'unknown platform')}\n" - f"Hash: {session.hash}\n" - f"App name: {escape(session.app_name)} v.{escape(session.app_version if session.app_version != '' else 'unknown')}\n" - f"Created (last activity): {datetime.fromtimestamp(session.date_created).isoformat()} ({datetime.fromtimestamp(session.date_active).isoformat()})\n" - f"IP and location: : {session.ip} ({session.country})\n" - f"Official status: {'✅' if session.official_app else '❌️'}\n" - f"2FA accepted: {'❌️️' if session.password_pending else '✅'}\n" - f"Can accept calls / secret chats: {'❌️️' if session.call_requests_disabled else '✅'} / {'❌️️' if session.encrypted_requests_disabled else '✅'}" + f'{num}. {escape(session.device_model)} on {escape(session.platform if session.platform != "" else "unknown platform")}\n' + f'Hash: {session.hash}\n' + f'App name: {escape(session.app_name)} v.{escape(session.app_version if session.app_version != "" else "unknown")}\n' + f'Created (last activity): {datetime.fromtimestamp(session.date_created).isoformat()} ({datetime.fromtimestamp(session.date_active).isoformat()})\n' + f'IP and location: : {session.ip} ({session.country})\n' + f'Official status: {"✅" if session.official_app else "❌️"}\n' + f'2FA accepted: {"❌️️" if session.password_pending else "✅"}\n' + f'Can accept calls / secret chats: {"❌️️" if session.call_requests_disabled else "✅"} / {"❌️️" if session.encrypted_requests_disabled else "✅"}' ) - answer = "Active sessions at your account:\n\n" + answer = 'Active sessions at your account:\n\n' chunk = [] for s in formatted_sessions: chunk.append(s) if len(chunk) == 5: - answer += "\n\n".join(chunk) + answer += '\n\n'.join(chunk) await message.reply(answer) - answer = "" + answer = '' chunk.clear() if chunk: - await message.reply("\n\n".join(chunk)) + await message.reply('\n\n'.join(chunk)) await message.delete() -@Client.on_message(filters.command(["sessionkiller", "sk"], prefix) & filters.me) +@Client.on_message(filters.command(['sessionkiller', 'sk'], prefix) & filters.me) async def sessionkiller(client: Client, message: Message): if len(message.command) == 1: - if db.get("core.sessionkiller", "enabled", False): + if db.get('core.sessionkiller', 'enabled', False): await message.edit( - "Sessionkiller status: enabled\n" - f"You can disable it with {prefix}sessionkiller disable" + 'Sessionkiller status: enabled\n' + f'You can disable it with {prefix}sessionkiller disable' ) else: await message.edit( - "Sessionkiller status: disabled\n" - f"You can enable it with {prefix}sessionkiller enable" + 'Sessionkiller status: disabled\n' + f'You can enable it with {prefix}sessionkiller enable' ) - elif message.command[1] in ["enable", "on", "1", "yes", "true"]: - db.set("core.sessionkiller", "enabled", True) - await message.edit("Sessionkiller enabled!") + elif message.command[1] in ['enable', 'on', '1', 'yes', 'true']: + db.set('core.sessionkiller', 'enabled', True) + await message.edit('Sessionkiller enabled!') db.set( - "core.sessionkiller", - "auths_hashes", - [ - auth.hash - for auth in (await client.invoke(GetAuthorizations())).authorizations - ], + 'core.sessionkiller', + 'auths_hashes', + [auth.hash for auth in (await client.invoke(GetAuthorizations())).authorizations], ) - elif message.command[1] in ["disable", "off", "0", "no", "false"]: - db.set("core.sessionkiller", "enabled", False) - await message.edit("Sessionkiller disabled!") + elif message.command[1] in ['disable', 'off', '0', 'no', 'false']: + db.set('core.sessionkiller', 'enabled', False) + await message.edit('Sessionkiller disabled!') else: - await message.edit(f"Usage: {prefix}sessionkiller [enable|disable]") + await message.edit(f'Usage: {prefix}sessionkiller [enable|disable]') @Client.on_raw_update() async def check_new_login(client: Client, update: UpdateServiceNotification, _, __): - if not isinstance(update, UpdateServiceNotification) or not update.type.startswith( - "auth" - ): + if not isinstance(update, UpdateServiceNotification) or not update.type.startswith('auth'): raise ContinuePropagation - if not db.get("core.sessionkiller", "enabled", False): + if not db.get('core.sessionkiller', 'enabled', False): raise ContinuePropagation - authorizations = (await client.invoke(GetAuthorizations()))["authorizations"] + authorizations = (await client.invoke(GetAuthorizations()))['authorizations'] for auth in authorizations: if auth.current: continue - if auth["hash"] not in auth_hashes: + if auth['hash'] not in auth_hashes: # found new unexpected login try: await client.invoke(ResetAuthorization(hash=auth.hash)) except RPCError: info_text = ( - "Someone tried to log in to your account. You can see this report because you" + 'Someone tried to log in to your account. You can see this report because you' "turned on this feature. But I couldn't terminate attacker's session and " - "⚠ you must reset it manually. You should change your 2FA password " - "(if enabled), or set it.\n" + '⚠ you must reset it manually. You should change your 2FA password ' + '(if enabled), or set it.\n' ) else: info_text = ( - "Someone tried to log in to your account. Since you have enabled " + 'Someone tried to log in to your account. Since you have enabled ' "this feature, I deleted the attacker's session from your account. " - "You should change your 2FA password (if enabled), or set it.\n" + 'You should change your 2FA password (if enabled), or set it.\n' ) - logined_time = datetime.utcfromtimestamp(auth.date_created).strftime( - "%d-%m-%Y %H-%M-%S UTC" - ) + logined_time = datetime.utcfromtimestamp(auth.date_created).strftime('%d-%m-%Y %H-%M-%S UTC') full_report = ( - "!!! ACTION REQUIRED !!!\n" + '!!! ACTION REQUIRED !!!\n' + info_text - + "Below is the information about the attacker that I got.\n\n" - f"Unique authorization hash: {auth.hash} (not valid anymore)\n" - f"Device model: {escape(auth.device_model)}\n" - f"Platform: {escape(auth.platform)}\n" - f"API ID: {auth.api_id}\n" - f"App name: {escape(auth.app_name)}\n" - f"App version: {auth.app_version}\n" - f"Logined at: {logined_time}\n" - f"IP: {auth.ip}\n" - f"Country: {auth.country}\n" - f"Official app: {'yes' if auth.official_app else 'no'}\n\n" - f"It is you? Type {prefix}sk off and try logging " - f"in again." + + 'Below is the information about the attacker that I got.\n\n' + f'Unique authorization hash: {auth.hash} (not valid anymore)\n' + f'Device model: {escape(auth.device_model)}\n' + f'Platform: {escape(auth.platform)}\n' + f'API ID: {auth.api_id}\n' + f'App name: {escape(auth.app_name)}\n' + f'App version: {auth.app_version}\n' + f'Logined at: {logined_time}\n' + f'IP: {auth.ip}\n' + f'Country: {auth.country}\n' + f'Official app: {"yes" if auth.official_app else "no"}\n\n' + f'It is you? Type {prefix}sk off and try logging ' + f'in again.' ) # schedule sending report message so user will get notification schedule_date = int(time.time() + 15) - await client.send_message("me", full_report, schedule_date=schedule_date) + await client.send_message('me', full_report, schedule_date=schedule_date) return -modules_help["sessions"] = { - "sessionkiller [enable|disable]": "When enabled, every new session will be terminated.\n" - "Useful for additional protection for your account", - "sessions": "List all sessions on your account", +modules_help['sessions'] = { + 'sessionkiller [enable|disable]': 'When enabled, every new session will be terminated.\n' + 'Useful for additional protection for your account', + 'sessions': 'List all sessions on your account', } diff --git a/userbot/modules/sgb.py b/userbot/modules/sgb.py index ceada81..fb27e7e 100644 --- a/userbot/modules/sgb.py +++ b/userbot/modules/sgb.py @@ -18,35 +18,34 @@ from pyrogram import Client, filters from pyrogram.errors import YouBlockedUser from pyrogram.types import Message - from utils.conv import Conversation from utils.misc import modules_help, prefix from utils.scripts import format_exc -@Client.on_message(filters.command("sgb", prefix) & filters.me) +@Client.on_message(filters.command('sgb', prefix) & filters.me) async def sg(client: Client, message: Message): if message.reply_to_message and message.reply_to_message.from_user: user_id = message.reply_to_message.from_user.id else: - await message.edit(f"Usage: {prefix}sgb [id]") + await message.edit(f'Usage: {prefix}sgb [id]') return try: - await message.edit("Processing please wait") - bot_username = "@SangMata_beta_bot" + await message.edit('Processing please wait') + bot_username = '@SangMata_beta_bot' async with Conversation(client, bot_username, timeout=15) as conv: await conv.send_message(str(user_id)) response = await conv.get_response(timeout=10) - if "you have used up your quota" in response.text: + if 'you have used up your quota' in response.text: await message.edit(response.text.splitlines()[0]) return return await message.edit(response.text) except YouBlockedUser: - await message.edit("Please unblock @SangMata_beta_bot first.") + await message.edit('Please unblock @SangMata_beta_bot first.') except TimeoutError: - await message.edit("No response from bot within the timeout period.") + await message.edit('No response from bot within the timeout period.') except Exception as e: - await message.edit(f"Error: {format_exc(e)}") + await message.edit(f'Error: {format_exc(e)}') -modules_help["sangmata"] = {"sgb": "reply to any user"} +modules_help['sangmata'] = {'sgb': 'reply to any user'} diff --git a/userbot/modules/shell.py b/userbot/modules/shell.py index d7f5b9b..82602f7 100644 --- a/userbot/modules/shell.py +++ b/userbot/modules/shell.py @@ -14,21 +14,20 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from subprocess import Popen, PIPE, TimeoutExpired import os +from subprocess import PIPE, Popen, TimeoutExpired from time import perf_counter from pyrogram import Client, filters -from pyrogram.types import Message from pyrogram.errors import MessageTooLong - +from pyrogram.types import Message from utils.misc import modules_help, prefix -@Client.on_message(filters.command(["shell", "sh"], prefix) & filters.me) +@Client.on_message(filters.command(['shell', 'sh'], prefix) & filters.me) async def shell(_, message: Message): if len(message.command) < 2: - return await message.edit("Specify the command in message text") + return await message.edit('Specify the command in message text') cmd_text = message.text.split(maxsplit=1)[1] cmd_args = cmd_text.split() cmd_obj = Popen( @@ -38,22 +37,22 @@ async def shell(_, message: Message): text=True, ) - char = "#" if os.getuid() == 0 else "$" - text = f"{char} {cmd_text}\n\n" + char = '#' if os.getuid() == 0 else '$' + text = f'{char} {cmd_text}\n\n' - await message.edit(text + "Running...") + await message.edit(text + 'Running...') try: start_time = perf_counter() stdout, stderr = cmd_obj.communicate(timeout=60) except TimeoutExpired: - text += "Timeout expired (60 seconds)" + text += 'Timeout expired (60 seconds)' else: stop_time = perf_counter() if stdout: - text += f"Output:\n{stdout}\n\n" + text += f'Output:\n{stdout}\n\n' if stderr: - text += f"Error:\n{stderr}\n\n" - text += f"Completed in {round(stop_time - start_time, 5)} seconds with code {cmd_obj.returncode}" + text += f'Error:\n{stderr}\n\n' + text += f'Completed in {round(stop_time - start_time, 5)} seconds with code {cmd_obj.returncode}' try: await message.edit(text) except MessageTooLong: @@ -61,4 +60,4 @@ async def shell(_, message: Message): cmd_obj.kill() -modules_help["shell"] = {"sh [command]*": "Execute command in shell"} +modules_help['shell'] = {'sh [command]*': 'Execute command in shell'} diff --git a/userbot/modules/socialstalk.py b/userbot/modules/socialstalk.py index 1be08cb..62e6641 100644 --- a/userbot/modules/socialstalk.py +++ b/userbot/modules/socialstalk.py @@ -1,75 +1,73 @@ -from datetime import datetime +import io import json +from datetime import datetime + import requests from pyrogram import Client, enums, filters from pyrogram.types import Message -import io - from utils.misc import modules_help, prefix -TIKTOK_API_URL = "https://api.maher-zubair.tech/stalk/tiktok?q=" -INSTAGRAM_API_URL = "https://tools.betabotz.eu.org/tools/stalk-ig?q=" -GH_STALK = "https://api.github.com/users/" +TIKTOK_API_URL = 'https://api.maher-zubair.tech/stalk/tiktok?q=' +INSTAGRAM_API_URL = 'https://tools.betabotz.eu.org/tools/stalk-ig?q=' +GH_STALK = 'https://api.github.com/users/' -@Client.on_message(filters.command(["tiktokstalk"], prefix) & filters.me) +@Client.on_message(filters.command(['tiktokstalk'], prefix) & filters.me) async def tiktok_stalk(_, message: Message): - query = "" + query = '' if len(message.command) > 1: query = message.command[1] elif message.reply_to_message: query = message.reply_to_message.text.strip() if not query: - await message.edit( - "Usage: `tiktokstalk ` or reply to a message containing the username." - ) + await message.edit('Usage: `tiktokstalk ` or reply to a message containing the username.') return - await message.edit("Fetching TikTok profile...") - url = f"{TIKTOK_API_URL}{query}" + await message.edit('Fetching TikTok profile...') + url = f'{TIKTOK_API_URL}{query}' response = requests.get(url) if response.status_code == 200: - data = response.json().get("result", {}) + data = response.json().get('result', {}) if data: - profile_pic_url = data.get("profile", "") + profile_pic_url = data.get('profile', '') profile_pic = requests.get(profile_pic_url).content profile_pic_stream = io.BytesIO(profile_pic) - profile_pic_stream.name = "profile.jpg" + profile_pic_stream.name = 'profile.jpg' await message.reply_photo( photo=profile_pic_stream, caption=( - f"TikTok Profile:\n" - f"Name: {data.get('name', 'N/A')}\n" - f"Username: {data.get('username', 'N/A')}\n" - f"Followers: {data.get('followers', 'N/A')}\n" - f"Following: {data.get('following', 'N/A')}\n" - f"Likes: {data.get('likes', 'N/A')}\n" - f"Description: {data.get('desc', 'N/A')}\n" - f"Bio: {data.get('bio', 'N/A')}" + f'TikTok Profile:\n' + f'Name: {data.get("name", "N/A")}\n' + f'Username: {data.get("username", "N/A")}\n' + f'Followers: {data.get("followers", "N/A")}\n' + f'Following: {data.get("following", "N/A")}\n' + f'Likes: {data.get("likes", "N/A")}\n' + f'Description: {data.get("desc", "N/A")}\n' + f'Bio: {data.get("bio", "N/A")}' ), parse_mode=enums.ParseMode.MARKDOWN, ) else: - await message.edit("No data found for this TikTok user.") + await message.edit('No data found for this TikTok user.') await message.delete() else: - await message.edit("An error occurred, please try again later.") + await message.edit('An error occurred, please try again later.') -@Client.on_message(filters.command("ipinfo", prefix) & filters.me) +@Client.on_message(filters.command('ipinfo', prefix) & filters.me) async def ipinfo(_, message: Message): - searchip = message.text.split(" ", 1) + searchip = message.text.split(' ', 1) if len(searchip) == 1: - await message.edit_text(f"Usage:{prefix}ipinfo [ip]") + await message.edit_text(f'Usage:{prefix}ipinfo [ip]') return searchip = searchip[1] - m = await message.edit_text("Searching...") - await m.edit_text("🔎") + m = await message.edit_text('Searching...') + await m.edit_text('🔎') try: url = requests.get( - f"http://ip-api.com/json/{searchip}?fields=status,message,continent,continentCode,country,countryCode,region,regionName,city,district,zip,lat,lon,timezone,offset,currency,isp,org,as,asname,reverse,mobile,proxy,hosting,query" + f'http://ip-api.com/json/{searchip}?fields=status,message,continent,continentCode,country,countryCode,region,regionName,city,district,zip,lat,lon,timezone,offset,currency,isp,org,as,asname,reverse,mobile,proxy,hosting,query' ) response = json.loads(url.text) text = f""" @@ -98,10 +96,10 @@ async def ipinfo(_, message: Message): Hosting: {response['hosting']}""" await m.edit_text(text) except: - await m.edit_text("Unable To Find Info!") + await m.edit_text('Unable To Find Info!') -@Client.on_message(filters.command("instastalk", prefix) & filters.me) +@Client.on_message(filters.command('instastalk', prefix) & filters.me) async def instagram_stalk(_, message: Message): if len(message.command) > 1: query = message.text.split(maxsplit=1)[1] @@ -109,43 +107,43 @@ async def instagram_stalk(_, message: Message): query = message.reply_to_message.text else: await message.edit( - f"Usage: {prefix}instastalk or reply to a message containing the username." + f'Usage: {prefix}instastalk or reply to a message containing the username.' ) return - await message.edit("Fetching Instagram profile...") - url = f"{INSTAGRAM_API_URL}{query}" + await message.edit('Fetching Instagram profile...') + url = f'{INSTAGRAM_API_URL}{query}' response = requests.get(url) if response.status_code == 200: - data = response.json().get("result", {}).get("user_info", {}) + data = response.json().get('result', {}).get('user_info', {}) if data: - profile_pic_url = data.get("profile_pic_url", "") + profile_pic_url = data.get('profile_pic_url', '') profile_pic = requests.get(profile_pic_url).content profile_pic_stream = io.BytesIO(profile_pic) - profile_pic_stream.name = "profile.jpg" + profile_pic_stream.name = 'profile.jpg' await message.reply_photo( photo=profile_pic_stream, caption=( - f"Instagram Profile:\n" - f"Full Name: {data.get('full_name', 'N/A')}\n" - f"Username: {data.get('username', 'N/A')}\n" - f"Biography: {data.get('biography', 'N/A')}\n" - f"External URL: {data.get('external_url', 'N/A')}\n" - f"Posts: {data.get('posts', 'N/A')}\n" - f"Followers: {data.get('followers', 'N/A')}\n" - f"Following: {data.get('following', 'N/A')}" + f'Instagram Profile:\n' + f'Full Name: {data.get("full_name", "N/A")}\n' + f'Username: {data.get("username", "N/A")}\n' + f'Biography: {data.get("biography", "N/A")}\n' + f'External URL: {data.get("external_url", "N/A")}\n' + f'Posts: {data.get("posts", "N/A")}\n' + f'Followers: {data.get("followers", "N/A")}\n' + f'Following: {data.get("following", "N/A")}' ), parse_mode=enums.ParseMode.MARKDOWN, ) else: - await message.edit("No data found for this Instagram user.") + await message.edit('No data found for this Instagram user.') await message.delete() else: - await message.edit("An error occurred, please try again later.") + await message.edit('An error occurred, please try again later.') -@Client.on_message(filters.command("ghstalk", prefix) & filters.me) +@Client.on_message(filters.command('ghstalk', prefix) & filters.me) async def github_stalk(_, message: Message): if len(message.command) > 1: query = message.text.split(maxsplit=1)[1] @@ -153,48 +151,44 @@ async def github_stalk(_, message: Message): query = message.reply_to_message.text else: await message.edit( - f"Usage: {prefix}ghstalk or reply to a message containing the username." + f'Usage: {prefix}ghstalk or reply to a message containing the username.' ) return - await message.edit("Fetching GitHub profile...") - url = f"{GH_STALK}{query}" + await message.edit('Fetching GitHub profile...') + url = f'{GH_STALK}{query}' response = requests.get(url) if response.status_code == 200: data = response.json() - created_at = data.get("created_at", "N/A") - formatted_date = ( - datetime.strptime(created_at, "%Y-%m-%dT%H:%M:%S%z") - if created_at != "N/A" - else None - ) + created_at = data.get('created_at', 'N/A') + formatted_date = datetime.strptime(created_at, '%Y-%m-%dT%H:%M:%S%z') if created_at != 'N/A' else None if data: await message.reply_photo( - photo=data.get("avatar_url", "").replace("?v=4", ""), - caption=f"GitHub Profile:\n" - f"Name: {data.get('name', 'N/A')}\n" - f"Username: {data.get('login', 'N/A')}\n" - f"Bio: {data.get('bio', 'N/A')}\n" + photo=data.get('avatar_url', '').replace('?v=4', ''), + caption=f'GitHub Profile:\n' + f'Name: {data.get("name", "N/A")}\n' + f'Username: {data.get("login", "N/A")}\n' + f'Bio: {data.get("bio", "N/A")}\n' f"Public Repositories: {data.get('public_repos', 'N/A')}\n" f"Public Gists: {data.get('public_gists', 'N/A')}\n" - f"Company: {data.get('company', 'N/A')}\n" - f"Location: {data.get('location', 'N/A')}\n" - f"Email: {data.get('email', 'N/A')}\n" - f"Website: {data.get('blog', 'N/A')}\n" - f"Created At: {formatted_date.strftime('%Y-%m-%d %I:%M:%S %p') if formatted_date else 'N/A'}\n" - f"Hireable: {data.get('hireable', 'N/A')}\n" - f"Followers: {data.get('followers', 'N/A')}\n" - f"Following: {data.get('following', 'N/A')}", + f'Company: {data.get("company", "N/A")}\n' + f'Location: {data.get("location", "N/A")}\n' + f'Email: {data.get("email", "N/A")}\n' + f'Website: {data.get("blog", "N/A")}\n' + f'Created At: {formatted_date.strftime("%Y-%m-%d %I:%M:%S %p") if formatted_date else "N/A"}\n' + f'Hireable: {data.get("hireable", "N/A")}\n' + f'Followers: {data.get("followers", "N/A")}\n' + f'Following: {data.get("following", "N/A")}', ) else: - await message.edit("No data found for this GitHub user.") + await message.edit('No data found for this GitHub user.') else: - await message.edit("An error occurred, please try again later.") + await message.edit('An error occurred, please try again later.') -modules_help["socialstalk"] = { - "tiktokstalk [username]*": "Get TikTok profile information", - "ipinfo [IP address]*": "Get information about an IP address", - "instastalk [username]*": "Get Instagram profile information", - "ghstalk [username]*": "Get GitHub profile information", +modules_help['socialstalk'] = { + 'tiktokstalk [username]*': 'Get TikTok profile information', + 'ipinfo [IP address]*': 'Get information about an IP address', + 'instastalk [username]*': 'Get Instagram profile information', + 'ghstalk [username]*': 'Get GitHub profile information', } diff --git a/userbot/modules/spam.py b/userbot/modules/spam.py index deb8431..69582a9 100644 --- a/userbot/modules/spam.py +++ b/userbot/modules/spam.py @@ -18,18 +18,17 @@ import asyncio from pyrogram import Client, filters from pyrogram.types import Message - from utils.misc import modules_help, prefix -commands = ["spam", "statspam", "slowspam", "fastspam"] +commands = ['spam', 'statspam', 'slowspam', 'fastspam'] @Client.on_message(filters.command(commands, prefix) & filters.me) async def spam(client: Client, message: Message): amount = int(message.command[1]) - text = " ".join(message.command[2:]) + text = ' '.join(message.command[2:]) - cooldown = {"spam": 0.15, "statspam": 0.1, "slowspam": 0.9, "fastspam": 0} + cooldown = {'spam': 0.15, 'statspam': 0.1, 'slowspam': 0.9, 'fastspam': 0} await message.delete() @@ -39,16 +38,16 @@ async def spam(client: Client, message: Message): else: sent = await client.send_message(message.chat.id, text) - if message.command[0] == "statspam": + if message.command[0] == 'statspam': await asyncio.sleep(0.1) await sent.delete() await asyncio.sleep(cooldown[message.command[0]]) -modules_help["spam"] = { - "spam [amount] [text]": "Start spam", - "statspam [amount] [text]": "Send and delete", - "fastspam [amount] [text]": "Start fast spam", - "slowspam [amount] [text]": "Start slow spam", +modules_help['spam'] = { + 'spam [amount] [text]': 'Start spam', + 'statspam [amount] [text]': 'Send and delete', + 'fastspam [amount] [text]': 'Start fast spam', + 'slowspam [amount] [text]': 'Start slow spam', } diff --git a/userbot/modules/spin.py b/userbot/modules/spin.py index d7e8e1b..e3c942b 100644 --- a/userbot/modules/spin.py +++ b/userbot/modules/spin.py @@ -13,19 +13,17 @@ from pyrogram.types import Message from utils.misc import modules_help, prefix from utils.scripts import format_exc, import_library, resize_image -Image = import_library("PIL", "pillow").Image -np = import_library("numpy") -imageio = import_library("imageio") +Image = import_library('PIL', 'pillow').Image +np = import_library('numpy') +imageio = import_library('imageio') -def create_gif(filename: str, offset: int, fps: int = 2, typ: str = "spin"): - img = Image.open(f"downloads/{filename}") - if typ.lower() != "spin": - img = img.resize( - (random.randint(200, 1280), random.randint(200, 1280)), Image.ANTIALIAS - ) +def create_gif(filename: str, offset: int, fps: int = 2, typ: str = 'spin'): + img = Image.open(f'downloads/{filename}') + if typ.lower() != 'spin': + img = img.resize((random.randint(200, 1280), random.randint(200, 1280)), Image.ANTIALIAS) imageio.mimsave( - "downloads/video.gif", + 'downloads/video.gif', [img.rotate(-(i % 360)) for i in range(1, 361, offset)], fps=fps, ) @@ -40,9 +38,7 @@ async def quote_cmd(client: Client, message: types.Message): messages = [] - async for msg in client.get_chat_history( - message.chat.id, offset_id=message.reply_to_message.id, reverse=True - ): + async for msg in client.get_chat_history(message.chat.id, offset_id=message.reply_to_message.id, reverse=True): if msg.empty: continue if msg.message_id >= message.id: @@ -57,102 +53,86 @@ async def quote_cmd(client: Client, message: types.Message): if send_for_me: await message.delete() - message = await client.send_message( - "me", "Generating...", parse_mode=enums.ParseMode.HTML - ) + message = await client.send_message('me', 'Generating...', parse_mode=enums.ParseMode.HTML) else: - await message.edit("Generating...", parse_mode=enums.ParseMode.HTML) + await message.edit('Generating...', parse_mode=enums.ParseMode.HTML) - url = "https://quotes.fl1yd.su/generate" + url = 'https://quotes.fl1yd.su/generate' params = { - "messages": [ - await render_message(client, msg) for msg in messages if not msg.empty - ], - "quote_color": "#162330", - "text_color": "#fff", + 'messages': [await render_message(client, msg) for msg in messages if not msg.empty], + 'quote_color': '#162330', + 'text_color': '#fff', } response = await aiohttp.ClientSession().post(url, json=params) if response.status != 200: return await message.edit( - f"Quotes API error!\n" f"{response.text}", + f'Quotes API error!\n{response.text}', parse_mode=enums.ParseMode.HTML, ) - resized = resize_image( - BytesIO(await response.read()), img_type="PNG" if is_png else "WEBP" - ) + resized = resize_image(BytesIO(await response.read()), img_type='PNG' if is_png else 'WEBP') return resized, is_png -@Client.on_message(filters.command(["spin", "dspin"], prefix) & filters.me) +@Client.on_message(filters.command(['spin', 'dspin'], prefix) & filters.me) async def spin_handler(client: Client, message: Message): if not message.reply_to_message: await message.edit( - "Reply to a message to spin it!", + 'Reply to a message to spin it!', parse_mode=enums.ParseMode.HTML, ) - await message.edit( - "Downloading sticker...", parse_mode=enums.ParseMode.HTML - ) - return await message.edit( - "Invalid file type!", parse_mode=enums.ParseMode.HTML - ) + await message.edit('Downloading sticker...', parse_mode=enums.ParseMode.HTML) + return await message.edit('Invalid file type!', parse_mode=enums.ParseMode.HTML) try: coro = True if message.reply_to_message.document: filename = message.reply_to_message.document.file_name if ( - not filename.endswith(".webp") - and not filename.endswith(".png") - and not filename.endswith(".jpg") - and not filename.endswith(".jpeg") + not filename.endswith('.webp') + and not filename.endswith('.png') + and not filename.endswith('.jpg') + and not filename.endswith('.jpeg') ): - return await message.edit( - "Invalid file type!", parse_mode=enums.ParseMode.HTML - ) + return await message.edit('Invalid file type!', parse_mode=enums.ParseMode.HTML) elif message.reply_to_message.sticker: if message.reply_to_message.sticker.is_video: - return await message.edit( - "Video stickers not allowed", parse_mode=enums.ParseMode.HTML - ) - filename = "sticker.webp" + return await message.edit('Video stickers not allowed', parse_mode=enums.ParseMode.HTML) + filename = 'sticker.webp' elif message.reply_to_message.text: result = await quote_cmd(client, message) if result[1]: - filename = "sticker.png" + filename = 'sticker.png' else: - filename = "sticker.webp" - open(f"downloads/" + filename, "wb").write(result[0].getbuffer()) + filename = 'sticker.webp' + open('downloads/' + filename, 'wb').write(result[0].getbuffer()) coro = False else: - filename = "photo.jpg" + filename = 'photo.jpg' if coro: - await message.reply_to_message.download(f"downloads/{filename}") + await message.reply_to_message.download(f'downloads/{filename}') except Exception as ex: return await message.edit( - f"Message can not be loaded:\n{format_exc(ex)}", + f'Message can not be loaded:\n{format_exc(ex)}', parse_mode=enums.ParseMode.HTML, ) - await message.edit("Spinning...", parse_mode=enums.ParseMode.HTML) + await message.edit('Spinning...', parse_mode=enums.ParseMode.HTML) offset = int(message.command[1]) if len(message.command) > 1 else 10 fps = int(message.command[2]) if len(message.command) > 2 else 30 try: loop = asyncio.get_event_loop() - await loop.run_in_executor( - None, lambda: create_gif(filename, offset, fps, message.command[0]) - ) + await loop.run_in_executor(None, lambda: create_gif(filename, offset, fps, message.command[0])) await message.delete() return await client.send_animation( chat_id=message.chat.id, - animation="downloads/video.gif", + animation='downloads/video.gif', reply_to_message_id=message.reply_to_message.id, ) except Exception as e: await message.reply(format_exc(e), parse_mode=enums.ParseMode.HTML) -modules_help["spin"] = { - "spin [offset] [fps]": "Spin message (Reply required)", - "dspin [offset] [fps]": "SHAKAL spin message (Reply required)", +modules_help['spin'] = { + 'spin [offset] [fps]': 'Spin message (Reply required)', + 'dspin [offset] [fps]': 'SHAKAL spin message (Reply required)', } diff --git a/userbot/modules/squotes.py b/userbot/modules/squotes.py index 34605d6..cf0c88c 100644 --- a/userbot/modules/squotes.py +++ b/userbot/modules/squotes.py @@ -18,16 +18,15 @@ import base64 from io import BytesIO import requests -from pyrogram import Client, filters, errors, types +from pyrogram import Client, errors, filters, types from pyrogram.types import Message - from utils.misc import modules_help, prefix -from utils.scripts import with_reply, format_exc, resize_image +from utils.scripts import format_exc, resize_image, with_reply -QUOTES_API = "https://quotes-o042.onrender.com/generate" +QUOTES_API = 'https://quotes-o042.onrender.com/generate' -@Client.on_message(filters.command(["q", "quote"], prefix) & filters.me) +@Client.on_message(filters.command(['q', 'quote'], prefix) & filters.me) @with_reply async def quote_cmd(client: Client, message: Message): if len(message.command) > 1 and message.command[1].isdigit(): @@ -39,9 +38,9 @@ async def quote_cmd(client: Client, message: Message): else: count = 1 - is_png = "!png" in message.command or "!file" in message.command - send_for_me = "!me" in message.command or "!ls" in message.command - no_reply = "!noreply" in message.command or "!nr" in message.command + is_png = '!png' in message.command or '!file' in message.command + send_for_me = '!me' in message.command or '!ls' in message.command + no_reply = '!noreply' in message.command or '!nr' in message.command messages = [] @@ -66,32 +65,26 @@ async def quote_cmd(client: Client, message: Message): if send_for_me: await message.delete() - message = await client.send_message("me", "Generating...") + message = await client.send_message('me', 'Generating...') else: - await message.edit("Generating...") + await message.edit('Generating...') params = { - "messages": [ - await render_message(client, msg) for msg in messages if not msg.empty - ], - "quote_color": "#162330", - "text_color": "#fff", + 'messages': [await render_message(client, msg) for msg in messages if not msg.empty], + 'quote_color': '#162330', + 'text_color': '#fff', } response = requests.post(QUOTES_API, json=params) if not response.ok: - return await message.edit( - f"Quotes API error!\n{response.text}" - ) + return await message.edit(f'Quotes API error!\n{response.text}') - resized = resize_image( - BytesIO(response.content), img_type="PNG" if is_png else "WEBP" - ) - await message.edit("Sending...") + resized = resize_image(BytesIO(response.content), img_type='PNG' if is_png else 'WEBP') + await message.edit('Sending...') try: func = client.send_document if is_png else client.send_sticker - chat_id = "me" if send_for_me else message.chat.id + chat_id = 'me' if send_for_me else message.chat.id await func(chat_id, resized) except errors.RPCError as e: # no rights to send stickers, etc await message.edit(format_exc(e)) @@ -99,23 +92,21 @@ async def quote_cmd(client: Client, message: Message): await message.delete() -@Client.on_message(filters.command(["fq", "fakequote"], prefix) & filters.me) +@Client.on_message(filters.command(['fq', 'fakequote'], prefix) & filters.me) @with_reply async def fake_quote_cmd(client: Client, message: types.Message): - is_png = "!png" in message.command or "!file" in message.command - send_for_me = "!me" in message.command or "!ls" in message.command - no_reply = "!noreply" in message.command or "!nr" in message.command + is_png = '!png' in message.command or '!file' in message.command + send_for_me = '!me' in message.command or '!ls' in message.command + no_reply = '!noreply' in message.command or '!nr' in message.command - fake_quote_text = " ".join( + fake_quote_text = ' '.join( [ - arg - for arg in message.command[1:] - if arg not in ["!png", "!file", "!me", "!ls", "!noreply", "!nr"] + arg for arg in message.command[1:] if arg not in ['!png', '!file', '!me', '!ls', '!noreply', '!nr'] ] # remove some special arg words ) if not fake_quote_text: - return await message.edit("Fake quote text is empty") + return await message.edit('Fake quote text is empty') q_message = await client.get_messages(message.chat.id, message.reply_to_message.id) q_message.text = fake_quote_text @@ -125,30 +116,26 @@ async def fake_quote_cmd(client: Client, message: types.Message): if send_for_me: await message.delete() - message = await client.send_message("me", "Generating...") + message = await client.send_message('me', 'Generating...') else: - await message.edit("Generating...") + await message.edit('Generating...') params = { - "messages": [await render_message(client, q_message)], - "quote_color": "#162330", - "text_color": "#fff", + 'messages': [await render_message(client, q_message)], + 'quote_color': '#162330', + 'text_color': '#fff', } response = requests.post(QUOTES_API, json=params) if not response.ok: - return await message.edit( - f"Quotes API error!\n{response.text}" - ) + return await message.edit(f'Quotes API error!\n{response.text}') - resized = resize_image( - BytesIO(response.content), img_type="PNG" if is_png else "WEBP" - ) - await message.edit("Sending...") + resized = resize_image(BytesIO(response.content), img_type='PNG' if is_png else 'WEBP') + await message.edit('Sending...') try: func = client.send_document if is_png else client.send_sticker - chat_id = "me" if send_for_me else message.chat.id + chat_id = 'me' if send_for_me else message.chat.id await func(chat_id, resized) except errors.RPCError as e: # no rights to send stickers, etc await message.edit(format_exc(e)) @@ -171,11 +158,11 @@ async def render_message(app: Client, message: types.Message) -> dict: # text if message.photo: - text = message.caption if message.caption else "" + text = message.caption if message.caption else '' elif message.poll: text = get_poll_text(message.poll) elif message.sticker: - text = "" + text = '' else: text = get_reply_text(message) @@ -185,7 +172,7 @@ async def render_message(app: Client, message: types.Message) -> dict: elif message.sticker: media = await get_file(message.sticker.file_id) else: - media = "" + media = '' # entities entities = [] @@ -193,9 +180,9 @@ async def render_message(app: Client, message: types.Message) -> dict: for entity in message.entities: entities.append( { - "offset": entity.offset, - "length": entity.length, - "type": str(entity.type).split(".")[-1].lower(), + 'offset': entity.offset, + 'length': entity.length, + 'type': str(entity.type).split('.')[-1].lower(), } ) @@ -206,7 +193,7 @@ async def render_message(app: Client, message: types.Message) -> dict: elif isinstance(msg.forward_origin, types.MessageOriginHiddenUser): msg.from_user.id = 0 msg.from_user.first_name = msg.forward_origin.sender_user_name - msg.from_user.last_name = "" + msg.from_user.last_name = '' elif isinstance(msg.forward_origin, types.MessageOriginChat): msg.sender_chat = msg.forward_origin.sender_chat msg.from_user.id = 0 @@ -220,63 +207,55 @@ async def render_message(app: Client, message: types.Message) -> dict: if message.from_user and message.from_user.id != 0: from_user = message.from_user - author["id"] = from_user.id - author["name"] = get_full_name(from_user) + author['id'] = from_user.id + author['name'] = get_full_name(from_user) if message.author_signature: - author["rank"] = message.author_signature - elif message.chat.type != "supergroup" or message.forward_date: - author["rank"] = "" + author['rank'] = message.author_signature + elif message.chat.type != 'supergroup' or message.forward_date: + author['rank'] = '' else: try: member = await message.chat.get_member(from_user.id) except errors.UserNotParticipant: - author["rank"] = "" + author['rank'] = '' else: - author["rank"] = getattr(member, "title", "") or ( - "owner" - if member.status == "creator" - else "admin" - if member.status == "administrator" - else "" + author['rank'] = getattr(member, 'title', '') or ( + 'owner' if member.status == 'creator' else 'admin' if member.status == 'administrator' else '' ) if from_user.photo: - author["avatar"] = await get_file(from_user.photo.big_file_id) + author['avatar'] = await get_file(from_user.photo.big_file_id) elif not from_user.photo and from_user.username: # may be user blocked us, we will try to get avatar via t.me - t_me_page = requests.get(f"https://t.me/{from_user.username}").text + t_me_page = requests.get(f'https://t.me/{from_user.username}').text sub = ' 0 - and link[0] - and link[0] != "https://telegram.org/img/t_logo.png" - ): + if len(link) > 0 and link[0] and link[0] != 'https://telegram.org/img/t_logo.png': # found valid link avatar = requests.get(link[0]).content - author["avatar"] = base64.b64encode(avatar).decode() + author['avatar'] = base64.b64encode(avatar).decode() else: - author["avatar"] = "" + author['avatar'] = '' else: - author["avatar"] = "" + author['avatar'] = '' else: - author["avatar"] = "" + author['avatar'] = '' elif message.from_user and message.from_user.id == 0: - author["id"] = 0 - author["name"] = message.from_user.first_name - author["rank"] = "" + author['id'] = 0 + author['name'] = message.from_user.first_name + author['rank'] = '' else: - author["id"] = message.sender_chat.id - author["name"] = message.sender_chat.title - author["rank"] = "channel" if message.sender_chat.type == "channel" else "" + author['id'] = message.sender_chat.id + author['name'] = message.sender_chat.title + author['rank'] = 'channel' if message.sender_chat.type == 'channel' else '' if message.sender_chat.photo: - author["avatar"] = await get_file(message.sender_chat.photo.big_file_id) + author['avatar'] = await get_file(message.sender_chat.photo.big_file_id) else: - author["avatar"] = "" - author["via_bot"] = message.via_bot.username if message.via_bot else "" + author['avatar'] = '' + author['via_bot'] = message.via_bot.username if message.via_bot else '' # reply reply = {} @@ -285,129 +264,122 @@ async def render_message(app: Client, message: types.Message) -> dict: move_forwards(reply_msg) if reply_msg.from_user: - reply["id"] = reply_msg.from_user.id - reply["name"] = get_full_name(reply_msg.from_user) + reply['id'] = reply_msg.from_user.id + reply['name'] = get_full_name(reply_msg.from_user) else: - reply["id"] = reply_msg.sender_chat.id - reply["name"] = reply_msg.sender_chat.title + reply['id'] = reply_msg.sender_chat.id + reply['name'] = reply_msg.sender_chat.title - reply["text"] = get_reply_text(reply_msg) + reply['text'] = get_reply_text(reply_msg) return { - "text": text, - "media": media, - "entities": entities, - "author": author, - "reply": reply, + 'text': text, + 'media': media, + 'entities': entities, + 'author': author, + 'reply': reply, } def get_audio_text(audio: types.Audio) -> str: if audio.title and audio.performer: - return f" ({audio.title} — {audio.performer})" + return f' ({audio.title} — {audio.performer})' if audio.title: - return f" ({audio.title})" + return f' ({audio.title})' if audio.performer: - return f" ({audio.performer})" - return "" + return f' ({audio.performer})' + return '' def get_reply_text(reply: types.Message) -> str: return ( - "📷 Photo" + ("\n" + reply.caption if reply.caption else "") + '📷 Photo' + ('\n' + reply.caption if reply.caption else '') if reply.photo else ( get_reply_poll_text(reply.poll) if reply.poll else ( - "📍 Location" + '📍 Location' if reply.location or reply.venue else ( - "👤 Contact" + '👤 Contact' if reply.contact else ( - "🖼 GIF" + '🖼 GIF' if reply.animation else ( - "🎧 Music" + get_audio_text(reply.audio) + '🎧 Music' + get_audio_text(reply.audio) if reply.audio else ( - "📹 Video" + '📹 Video' if reply.video else ( - "📹 Videomessage" + '📹 Videomessage' if reply.video_note else ( - "🎵 Voice" + '🎵 Voice' if reply.voice else ( - ( - reply.sticker.emoji + " " - if reply.sticker.emoji - else "" - ) - + "Sticker" + (reply.sticker.emoji + ' ' if reply.sticker.emoji else '') + 'Sticker' if reply.sticker else ( - "💾 File " + reply.document.file_name + '💾 File ' + reply.document.file_name if reply.document else ( - "🎮 Game" + '🎮 Game' if reply.game else ( - "🎮 set new record" + '🎮 set new record' if reply.game_high_score else ( - f"{reply.dice.emoji} - {reply.dice.value}" + f'{reply.dice.emoji} - {reply.dice.value}' if reply.dice else ( ( - "👤 joined the group" - if reply.new_chat_members[ - 0 - ].id + '👤 joined the group' + if reply.new_chat_members[0].id == reply.from_user.id - else f"👤 invited {get_full_name(reply.new_chat_members[0])} to the group" + else f'👤 invited {get_full_name(reply.new_chat_members[0])} to the group' ) if reply.new_chat_members else ( ( - "👤 left the group" + '👤 left the group' if reply.left_chat_member.id == reply.from_user.id - else f"👤 removed {get_full_name(reply.left_chat_member)}" + else f'👤 removed {get_full_name(reply.left_chat_member)}' ) if reply.left_chat_member else ( - f"✏ changed group name to {reply.new_chat_title}" + f'✏ changed group name to {reply.new_chat_title}' if reply.new_chat_title else ( - "🖼 changed group photo" + '🖼 changed group photo' if reply.new_chat_photo else ( - "🖼 removed group photo" + '🖼 removed group photo' if reply.delete_chat_photo else ( - "📍 pinned message" + '📍 pinned message' if reply.pinned_message else ( - "🎤 started a new video chat" + '🎤 started a new video chat' if reply.video_chat_started else ( - "🎤 ended the video chat" + '🎤 ended the video chat' if reply.video_chat_ended else ( - "🎤 invited participants to the video chat" + '🎤 invited participants to the video chat' if reply.video_chat_members_invited else ( - "👥 created the group" + '👥 created the group' if reply.group_chat_created or reply.supergroup_chat_created else ( - "👥 created the channel" + '👥 created the channel' if reply.channel_chat_created else reply.text - or "unsupported message" + or 'unsupported message' ) ) ) @@ -436,27 +408,27 @@ def get_reply_text(reply: types.Message) -> str: def get_poll_text(poll: types.Poll) -> str: - text = get_reply_poll_text(poll) + "\n" + text = get_reply_poll_text(poll) + '\n' - text += poll.question + "\n" + text += poll.question + '\n' for option in poll.options: - text += f"- {option.text}" + text += f'- {option.text}' if option.voter_count > 0: - text += f" ({option.voter_count} voted)" - text += "\n" + text += f' ({option.voter_count} voted)' + text += '\n' - text += f"Total: {poll.total_voter_count} voted" + text += f'Total: {poll.total_voter_count} voted' return text def get_reply_poll_text(poll: types.Poll) -> str: if poll.is_anonymous: - text = "📊 Anonymous poll" if poll.type == "regular" else "📊 Anonymous quiz" + text = '📊 Anonymous poll' if poll.type == 'regular' else '📊 Anonymous quiz' else: - text = "📊 Poll" if poll.type == "regular" else "📊 Quiz" + text = '📊 Poll' if poll.type == 'regular' else '📊 Quiz' if poll.is_closed: - text += " (closed)" + text += ' (closed)' return text @@ -464,13 +436,13 @@ def get_reply_poll_text(poll: types.Poll) -> str: def get_full_name(user: types.User) -> str: name = user.first_name if user.last_name: - name += " " + user.last_name + name += ' ' + user.last_name return name -modules_help["squotes"] = { - "q [reply]* [count 1-15] [!png] [!me] [!noreply]": "Generate a quote\n" - "Available options: !png — send as PNG, !me — send quote to" - "saved messages, !noreply — generate quote without reply", - "fq [reply]* [!png] [!me] [!noreply] [text]*": "Generate a fake quote", +modules_help['squotes'] = { + 'q [reply]* [count 1-15] [!png] [!me] [!noreply]': 'Generate a quote\n' + 'Available options: !png — send as PNG, !me — send quote to' + 'saved messages, !noreply — generate quote without reply', + 'fq [reply]* [!png] [!me] [!noreply] [text]*': 'Generate a fake quote', } diff --git a/userbot/modules/stickers.py b/userbot/modules/stickers.py index 499d42c..b1430eb 100644 --- a/userbot/modules/stickers.py +++ b/userbot/modules/stickers.py @@ -17,27 +17,25 @@ import os from io import BytesIO -from pyrogram import Client, filters, types, enums - +from pyrogram import Client, enums, filters, types from utils.misc import modules_help, prefix from utils.scripts import ( - with_reply, + format_exc, interact_with, interact_with_to_delete, - format_exc, resize_image, + with_reply, ) -@Client.on_message(filters.command("kang", prefix) & filters.me) +@Client.on_message(filters.command('kang', prefix) & filters.me) @with_reply async def kang(client: Client, message: types.Message): - await message.edit("Please wait...") + await message.edit('Please wait...') if len(message.command) < 2: await message.edit( - "No arguments provided\n" - f"Usage: {prefix}kang [pack]* [emoji]", + f'No arguments provided\nUsage: {prefix}kang [pack]* [emoji]', ) return @@ -45,29 +43,17 @@ async def kang(client: Client, message: types.Message): if len(message.command) >= 3: emoji = message.command[2] else: - emoji = "✨" + emoji = '✨' - await client.unblock_user("@stickers") - await interact_with( - await client.send_message( - "@stickers", "/cancel", parse_mode=enums.ParseMode.MARKDOWN - ) - ) - await interact_with( - await client.send_message( - "@stickers", "/addsticker", parse_mode=enums.ParseMode.MARKDOWN - ) - ) + await client.unblock_user('@stickers') + await interact_with(await client.send_message('@stickers', '/cancel', parse_mode=enums.ParseMode.MARKDOWN)) + await interact_with(await client.send_message('@stickers', '/addsticker', parse_mode=enums.ParseMode.MARKDOWN)) - result = await interact_with( - await client.send_message( - "@stickers", pack, parse_mode=enums.ParseMode.MARKDOWN - ) - ) - if ".TGS" in result.text: + result = await interact_with(await client.send_message('@stickers', pack, parse_mode=enums.ParseMode.MARKDOWN)) + if '.TGS' in result.text: await message.edit("Animated packs aren't supported") return - if "StickerExample.psd" not in result.text: + if 'StickerExample.psd' not in result.text: await message.edit( "Stickerpack doesn't exitst. Create it using @Stickers bot (via /newpack command)", ) @@ -85,79 +71,63 @@ async def kang(client: Client, message: types.Message): if os.path.exists(path): os.remove(path) - await interact_with( - await client.send_document( - "@stickers", resized, parse_mode=enums.ParseMode.MARKDOWN - ) - ) - response = await interact_with( - await client.send_message( - "@stickers", emoji, parse_mode=enums.ParseMode.MARKDOWN - ) - ) - if "/done" in response.text: + await interact_with(await client.send_document('@stickers', resized, parse_mode=enums.ParseMode.MARKDOWN)) + response = await interact_with(await client.send_message('@stickers', emoji, parse_mode=enums.ParseMode.MARKDOWN)) + if '/done' in response.text: # ok - await interact_with( - await client.send_message( - "@stickers", "/done", parse_mode=enums.ParseMode.MARKDOWN - ) - ) - await client.delete_messages("@stickers", interact_with_to_delete) + await interact_with(await client.send_message('@stickers', '/done', parse_mode=enums.ParseMode.MARKDOWN)) + await client.delete_messages('@stickers', interact_with_to_delete) await message.edit( - f"Sticker added to pack", + f'Sticker added to pack', ) else: - await message.edit("Something went wrong. Check history with @stickers") + await message.edit('Something went wrong. Check history with @stickers') interact_with_to_delete.clear() -@Client.on_message(filters.command(["stp", "s2p", "stick2png"], prefix) & filters.me) +@Client.on_message(filters.command(['stp', 's2p', 'stick2png'], prefix) & filters.me) @with_reply async def stick2png(client: Client, message: types.Message): try: - await message.edit("Downloading...") + await message.edit('Downloading...') path = await message.reply_to_message.download() - with open(path, "rb") as f: + with open(path, 'rb') as f: content = f.read() if os.path.exists(path): os.remove(path) file_io = BytesIO(content) - file_io.name = "sticker.png" + file_io.name = 'sticker.png' - await client.send_document( - message.chat.id, file_io, parse_mode=enums.ParseMode.MARKDOWN - ) + await client.send_document(message.chat.id, file_io, parse_mode=enums.ParseMode.MARKDOWN) except Exception as e: await message.edit(format_exc(e)) else: await message.delete() -@Client.on_message(filters.command(["resize"], prefix) & filters.me) +@Client.on_message(filters.command(['resize'], prefix) & filters.me) @with_reply async def resize_cmd(client: Client, message: types.Message): try: - await message.edit("Downloading...") + await message.edit('Downloading...') path = await message.reply_to_message.download() resized = resize_image(path) - resized.name = "image.png" + resized.name = 'image.png' if os.path.exists(path): os.remove(path) - await client.send_document( - message.chat.id, resized, parse_mode=enums.ParseMode.MARKDOWN - ) + await client.send_document(message.chat.id, resized, parse_mode=enums.ParseMode.MARKDOWN) except Exception as e: await message.edit(format_exc(e)) else: await message.delete() -modules_help["stickers"] = { - "kang [reply]* [pack]* [emoji]": "Add sticker to defined pack", - "stp [reply]*": "Convert replied sticker to PNG", - "resize [reply]*": "Resize replied image to 512xN format", +modules_help['stickers'] = { + 'kang [reply]* [pack]* [emoji]': 'Add sticker to defined pack', + 'stp [reply]*': 'Convert replied sticker to PNG', + 'resize [reply]*': 'Resize replied image to 512xN format', } diff --git a/userbot/modules/support.py b/userbot/modules/support.py index 9c5c5d6..03ae8c0 100644 --- a/userbot/modules/support.py +++ b/userbot/modules/support.py @@ -14,17 +14,17 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import datetime +import random + from pyrogram import Client, filters from pyrogram.types import Message -import random -import datetime - -from utils.misc import modules_help, prefix, userbot_version, python_version, gitrepo +from utils.misc import gitrepo, modules_help, prefix, python_version, userbot_version -@Client.on_message(filters.command(["support", "repo"], prefix) & filters.me) +@Client.on_message(filters.command(['support', 'repo'], prefix) & filters.me) async def support(_, message: Message): - devs = ["@Qbtaumai", "@H4T3H46K3R"] + devs = ['@Qbtaumai', '@H4T3H46K3R'] random.shuffle(devs) commands_count = 0.0 @@ -33,27 +33,27 @@ async def support(_, message: Message): commands_count += 1 await message.edit( - f"Moon-Userbot\n\n" - "GitHub: Moon-Userbot\n" - "Custom modules repository: " - "custom_modules\n" - "License: GNU GPL v3\n\n" - "Channel: @moonuserbot\n" - "Custom modules: @moonub_modules\n" - "Chat [EN]: @moonub_chat\n" - f"Main developers: {', '.join(devs)}\n\n" - f"Python version: {python_version}\n" - f"Modules count: {len(modules_help) / 1}\n" - f"Commands count: {commands_count}", + f'Moon-Userbot\n\n' + 'GitHub: Moon-Userbot\n' + 'Custom modules repository: ' + 'custom_modules\n' + 'License: GNU GPL v3\n\n' + 'Channel: @moonuserbot\n' + 'Custom modules: @moonub_modules\n' + 'Chat [EN]: @moonub_chat\n' + f'Main developers: {", ".join(devs)}\n\n' + f'Python version: {python_version}\n' + f'Modules count: {len(modules_help) / 1}\n' + f'Commands count: {commands_count}', disable_web_page_preview=True, ) -@Client.on_message(filters.command(["version", "ver"], prefix) & filters.me) +@Client.on_message(filters.command(['version', 'ver'], prefix) & filters.me) async def version(client: Client, message: Message): - changelog = "" - ub_version = ".".join(userbot_version.split(".")[:2]) - async for m in client.search_messages("moonuserbot", query=f"{userbot_version}."): + changelog = '' + ub_version = '.'.join(userbot_version.split('.')[:2]) + async for m in client.search_messages('moonuserbot', query=f'{userbot_version}.'): if ub_version in m.text: changelog = m.message_id @@ -63,26 +63,32 @@ async def version(client: Client, message: Message): remote_url = list(gitrepo.remote().urls)[0] commit_time = ( datetime.datetime.fromtimestamp(gitrepo.head.commit.committed_date) - .astimezone(datetime.timezone.utc) - .strftime("%Y-%m-%d %H:%M:%S %Z") + .astimezone(datetime.UTC) + .strftime('%Y-%m-%d %H:%M:%S %Z') ) git_info = ( - f"\nBranch: {gitrepo.active_branch}\n" - if gitrepo.active_branch != "master" else "\n" - ) + f"Commit: " f"{gitrepo.head.commit.hexsha[:7]} by {gitrepo.head.commit.author.name}\n" f"Commit time: {commit_time}" + ( + f'\nBranch: {gitrepo.active_branch}\n' + if gitrepo.active_branch != 'master' + else '\n' + ) + + f'Commit: ' + f'{gitrepo.head.commit.hexsha[:7]} by {gitrepo.head.commit.author.name}\n' + f'Commit time: {commit_time}' + ) else: - git_info = "" + git_info = '' await message.reply( - f"Moon Userbot version: {userbot_version}\n" - f"Changelog in channel.\n" - f"Changelog written by " - f"Abhi\n\n" - f"{git_info}", + f'Moon Userbot version: {userbot_version}\n' + f'Changelog in channel.\n' + f'Changelog written by ' + f'Abhi\n\n' + f'{git_info}', ) -modules_help["support"] = { - "support": "Information about userbot", - "version": "Check userbot version", +modules_help['support'] = { + 'support': 'Information about userbot', + 'version': 'Check userbot version', } diff --git a/userbot/modules/thumbnail.py b/userbot/modules/thumbnail.py index 4bf6e3c..99764b4 100644 --- a/userbot/modules/thumbnail.py +++ b/userbot/modules/thumbnail.py @@ -15,29 +15,28 @@ # along with this program. If not, see . import os -from PIL import Image +from PIL import Image from pyrogram import Client, filters from pyrogram.types import Message - -from utils.misc import prefix, modules_help +from utils.misc import modules_help, prefix -@Client.on_message(filters.command("setthumb", prefix) & filters.me) +@Client.on_message(filters.command('setthumb', prefix) & filters.me) async def setthumb(_, message: Message): - THUMB_PATH = "downloads/thumb" + THUMB_PATH = 'downloads/thumb' if message.reply_to_message: if not os.path.exists(THUMB_PATH): os.makedirs(THUMB_PATH) new_thumb = await message.reply_to_message.download() with Image.open(new_thumb) as img: - if img.format in ["PNG", "JPG", "JPEG"]: - new_path = os.path.join(THUMB_PATH, "thumb.jpg") + if img.format in ['PNG', 'JPG', 'JPEG']: + new_path = os.path.join(THUMB_PATH, 'thumb.jpg') os.rename(new_thumb, new_path) - await message.edit_text("Thumbnail set successfully!") + await message.edit_text('Thumbnail set successfully!') else: - await message.edit_text("Kindly reply to a PHOTO Entity!") + await message.edit_text('Kindly reply to a PHOTO Entity!') return -modules_help["thumb"] = {"setthumb [reply_to_photo]*": "set your own custom thumbnail"} +modules_help['thumb'] = {'setthumb [reply_to_photo]*': 'set your own custom thumbnail'} diff --git a/userbot/modules/type.py b/userbot/modules/type.py index 5941371..5f41773 100644 --- a/userbot/modules/type.py +++ b/userbot/modules/type.py @@ -15,20 +15,17 @@ # along with this program. If not, see . import asyncio -import time from pyrogram import Client, filters -from pyrogram.errors import FloodWait from pyrogram.types import Message - from utils.misc import modules_help, prefix -@Client.on_message(filters.command(["type", "typewriter"], prefix) & filters.me) +@Client.on_message(filters.command(['type', 'typewriter'], prefix) & filters.me) async def type_cmd(_, message: Message): text = message.text.split(maxsplit=1)[1] - typed = "" - typing_symbol = "▒" + typed = '' + typing_symbol = '▒' for char in text: await message.edit(typed + typing_symbol) @@ -38,6 +35,6 @@ async def type_cmd(_, message: Message): await asyncio.sleep(0.1) -modules_help["type"] = { - "type | typewriter [text]*": "Typing emulation. Don't use a lot of characters, you can receive a lot of floodwaits!" +modules_help['type'] = { + 'type | typewriter [text]*': "Typing emulation. Don't use a lot of characters, you can receive a lot of floodwaits!" } diff --git a/userbot/modules/updater.py b/userbot/modules/updater.py index e2b5018..0e1c99d 100644 --- a/userbot/modules/updater.py +++ b/userbot/modules/updater.py @@ -15,15 +15,14 @@ # along with this program. If not, see . import os -import sys import shutil import subprocess +import sys from pyrogram import Client, filters from pyrogram.types import Message - -from utils.misc import modules_help, prefix, requirements_list from utils.db import db +from utils.misc import modules_help, prefix, requirements_list from utils.scripts import format_exc, restart @@ -31,87 +30,82 @@ def check_command(command): return shutil.which(command) is not None -@Client.on_message(filters.command("restart", prefix) & filters.me) +@Client.on_message(filters.command('restart', prefix) & filters.me) async def restart_cmd(_, message: Message): db.set( - "core.updater", - "restart_info", + 'core.updater', + 'restart_info', { - "type": "restart", - "chat_id": message.chat.id, - "message_id": message.id, + 'type': 'restart', + 'chat_id': message.chat.id, + 'message_id': message.id, }, ) - if "LAVHOST" in os.environ: - await message.edit("Your lavHost is restarting...") - os.system("lavhost restart") + if 'LAVHOST' in os.environ: + await message.edit('Your lavHost is restarting...') + os.system('lavhost restart') return - await message.edit("Restarting...") - if os.path.exists("moonlogs.txt"): - os.remove("moonlogs.txt") + await message.edit('Restarting...') + if os.path.exists('moonlogs.txt'): + os.remove('moonlogs.txt') restart() -@Client.on_message(filters.command("update", prefix) & filters.me) +@Client.on_message(filters.command('update', prefix) & filters.me) async def update(_, message: Message): db.set( - "core.updater", - "restart_info", + 'core.updater', + 'restart_info', { - "type": "update", - "chat_id": message.chat.id, - "message_id": message.id, + 'type': 'update', + 'chat_id': message.chat.id, + 'message_id': message.id, }, ) - if "LAVHOST" in os.environ: - await message.edit("Your lavHost is updating...") - os.system("lavhost update") + if 'LAVHOST' in os.environ: + await message.edit('Your lavHost is updating...') + os.system('lavhost update') return - await message.edit("Updating...") + await message.edit('Updating...') try: - if not check_command("termux-setup-storage"): - subprocess.run( - [sys.executable, "-m", "pip", "install", "-U", "pip"], check=True - ) - subprocess.run(["git", "pull"], check=True) + if not check_command('termux-setup-storage'): + subprocess.run([sys.executable, '-m', 'pip', 'install', '-U', 'pip'], check=True) + subprocess.run(['git', 'pull'], check=True) - if ( - os.path.exists("requirements.txt") - and os.path.getsize("requirements.txt") > 0 - ): + if os.path.exists('requirements.txt') and os.path.getsize('requirements.txt') > 0: subprocess.run( [ sys.executable, - "-m", - "pip", - "install", - "-U", - "-r", - "requirements.txt", + '-m', + 'pip', + 'install', + '-U', + '-r', + 'requirements.txt', ], check=True, ) if requirements_list: subprocess.run( - [sys.executable, "-m", "pip", "install", "-U", *requirements_list], + [sys.executable, '-m', 'pip', 'install', '-U', *requirements_list], check=True, ) except Exception as e: await message.edit(format_exc(e)) - db.remove("core.updater", "restart_info") + db.remove('core.updater', 'restart_info') else: - await message.edit("Updating: done! Restarting...") - if os.path.exists("moonlogs.txt"): - os.remove("moonlogs.txt") + await message.edit('Updating: done! Restarting...') + if os.path.exists('moonlogs.txt'): + os.remove('moonlogs.txt') restart() -modules_help["updater"] = { - "update": "Update the userbot. If new core modules are avaliable, they will be installed", - "restart": "Restart userbot", +modules_help['updater'] = { + 'update': 'Update the userbot. If new core modules are avaliable, they will be installed', + 'restart': 'Restart userbot', } diff --git a/userbot/modules/upl.py b/userbot/modules/upl.py index a5e3dfd..2fb5d72 100644 --- a/userbot/modules/upl.py +++ b/userbot/modules/upl.py @@ -17,71 +17,65 @@ import io import os import time + from pyrogram import Client, filters from pyrogram.types import Message from utils.misc import modules_help, prefix from utils.scripts import format_exc, progress -@Client.on_message(filters.command("upl", prefix) & filters.me) +@Client.on_message(filters.command('upl', prefix) & filters.me) async def upl(client: Client, message: Message): if len(message.command) > 1: link = message.text.split(maxsplit=1)[1] elif message.reply_to_message: link = message.reply_to_message.text else: - await message.edit( - f"Usage: {prefix}upl [filepath to upload]" - ) + await message.edit(f'Usage: {prefix}upl [filepath to upload]') return if not os.path.isfile(link): - await message.edit( - f"Error: {link} is not a valid file path." - ) + await message.edit(f'Error: {link} is not a valid file path.') return try: - await message.edit("Uploading Now...") + await message.edit('Uploading Now...') await client.send_document( message.chat.id, link, progress=progress, - progress_args=(message, time.time(), "Uploading Now...", link), + progress_args=(message, time.time(), 'Uploading Now...', link), ) await message.delete() except Exception as e: await message.edit(format_exc(e)) -@Client.on_message(filters.command("dlf", prefix) & filters.me) +@Client.on_message(filters.command('dlf', prefix) & filters.me) async def dlf(client: Client, message: Message): if message.reply_to_message: await client.download_media( message.reply_to_message, progress=progress, - progress_args=(message, time.time(), "Uploading Now..."), + progress_args=(message, time.time(), 'Uploading Now...'), ) - await message.edit("Downloaded Successfully!") + await message.edit('Downloaded Successfully!') else: - await message.edit(f"Usage: {prefix}dlf [reply to a file]") + await message.edit(f'Usage: {prefix}dlf [reply to a file]') -@Client.on_message(filters.command("moonlogs", prefix) & filters.me) +@Client.on_message(filters.command('moonlogs', prefix) & filters.me) async def mupl(client: Client, message: Message): - link = "moonlogs.txt" + link = 'moonlogs.txt' if os.path.exists(link): try: - await message.edit("Uploading Now...") - with open(link, "rb") as f: + await message.edit('Uploading Now...') + with open(link, 'rb') as f: data = f.read() bio = io.BytesIO(data) - bio.name = "moonlogs.txt" + bio.name = 'moonlogs.txt' await client.send_document( - message.chat.id, - bio, - progress=progress, - progress_args=(message, time.time(), "Uploading Now...") + message.chat.id, bio, progress=progress, progress_args=(message, time.time(), 'Uploading Now...') ) await message.delete() except Exception as e: @@ -90,31 +84,27 @@ async def mupl(client: Client, message: Message): await message.edit("Error: LOGS file doesn't exist.") -@Client.on_message(filters.command("uplr", prefix) & filters.me) +@Client.on_message(filters.command('uplr', prefix) & filters.me) async def uplr(client: Client, message: Message): if len(message.command) > 1: link = message.text.split(maxsplit=1)[1] elif message.reply_to_message: link = message.reply_to_message.text else: - await message.edit( - f"Usage: {prefix}upl [filepath to upload]" - ) + await message.edit(f'Usage: {prefix}upl [filepath to upload]') return if not os.path.isfile(link): - await message.edit( - f"Error: {link} is not a valid file path." - ) + await message.edit(f'Error: {link} is not a valid file path.') return try: - await message.edit("Uploading Now...") + await message.edit('Uploading Now...') await client.send_document( message.chat.id, link, progress=progress, - progress_args=(message, time.time(), "Uploading Now...", link), + progress_args=(message, time.time(), 'Uploading Now...', link), ) await message.delete() except Exception as e: @@ -124,9 +114,9 @@ async def uplr(client: Client, message: Message): os.remove(link) -modules_help["uplud"] = { - "upl [filepath]/[reply to path]*": "Upload a file from your local machine to Telegram", - "dlf": "Download a file from Telegram to your local machine", - "uplr [filepath]/[reply to path]*": "Upload a file from your local machine to Telegram, delete the file after uploading", - "moonlogs": "Upload the moonlogs.txt file to Telegram", +modules_help['uplud'] = { + 'upl [filepath]/[reply to path]*': 'Upload a file from your local machine to Telegram', + 'dlf': 'Download a file from Telegram to your local machine', + 'uplr [filepath]/[reply to path]*': 'Upload a file from your local machine to Telegram, delete the file after uploading', + 'moonlogs': 'Upload the moonlogs.txt file to Telegram', } diff --git a/userbot/modules/url.py b/userbot/modules/url.py index 94c3fad..65ee09e 100644 --- a/userbot/modules/url.py +++ b/userbot/modules/url.py @@ -17,7 +17,6 @@ import asyncio import math import mimetypes - import os import time from datetime import datetime @@ -29,14 +28,13 @@ import urllib3 from pyrogram import Client, enums, filters from pyrogram.types import Message from pySmartDL import SmartDL - from utils.config import apiflash_key from utils.misc import modules_help, prefix from utils.scripts import format_exc, humanbytes, progress def generate_screenshot(url): - api_url = f"https://api.apiflash.com/v1/urltoimage?access_key={apiflash_key}&url={url}&format=png" + api_url = f'https://api.apiflash.com/v1/urltoimage?access_key={apiflash_key}&url={url}&format=png' response = requests.get(api_url) if response.status_code == 200: return BytesIO(response.content) @@ -46,23 +44,23 @@ def generate_screenshot(url): http = urllib3.PoolManager() -@Client.on_message(filters.command("short", prefix) & filters.me) +@Client.on_message(filters.command('short', prefix) & filters.me) async def short(_, message: Message): if len(message.command) > 1: link = message.text.split(maxsplit=1)[1] elif message.reply_to_message: link = message.reply_to_message.text else: - await message.edit(f"Usage: {prefix}short [url to short]") + await message.edit(f'Usage: {prefix}short [url to short]') return - r = http.request("GET", "https://clck.ru/--?url=" + link) + r = http.request('GET', 'https://clck.ru/--?url=' + link) await message.edit( - r.data.decode().replace("https://", "Shortened Url:"), + r.data.decode().replace('https://', 'Shortened Url:'), disable_web_page_preview=True, ) -@Client.on_message(filters.command("urldl", prefix) & filters.me) +@Client.on_message(filters.command('urldl', prefix) & filters.me) async def urldl(client: Client, message: Message): if len(message.command) > 1: message_id = None @@ -71,65 +69,63 @@ async def urldl(client: Client, message: Message): message_id = message.reply_to_message.id link = message.reply_to_message.text else: - await message.edit( - f"Usage: {prefix}urldl [url to download]" - ) + await message.edit(f'Usage: {prefix}urldl [url to download]') return - await message.edit("Trying to download...") + await message.edit('Trying to download...') c_time = time.time() resp = requests.head(link, allow_redirects=True, timeout=5) if resp.status_code != 200: - return await message.edit("Failed to fetch request header information") + return await message.edit('Failed to fetch request header information') - content_type = resp.headers.get("Content-Type").split(";")[0] + content_type = resp.headers.get('Content-Type').split(';')[0] extension = mimetypes.guess_extension(content_type) # Check if the file is an executable binary is_executable = content_type in [ - "application/octet-stream", - "application/x-msdownload", + 'application/octet-stream', + 'application/x-msdownload', ] # Get the file extension from the URL url_extension = os.path.splitext(link)[1].lower() try: - os.makedirs("downloads") + os.makedirs('downloads') if is_executable: - file_name = "downloads/" + link.split("/")[-1] + file_name = 'downloads/' + link.split('/')[-1] if not file_name.endswith(url_extension): file_name += url_extension elif extension: - file_name = "downloads/" + link.split("/")[-1] + file_name = 'downloads/' + link.split('/')[-1] if not file_name.endswith(extension): file_name += extension else: - file_name = "downloads/" + link.split("/")[-1] + file_name = 'downloads/' + link.split('/')[-1] except FileNotFoundError: if is_executable: - file_name = "downloads/" + link.split("/")[-1] + file_name = 'downloads/' + link.split('/')[-1] if not file_name.endswith(url_extension): file_name += url_extension elif extension: - file_name = "downloads/" + link.split("/")[-1] + file_name = 'downloads/' + link.split('/')[-1] if not file_name.endswith(extension): file_name += extension else: - file_name = "downloads/" + link.split("/")[-1] + file_name = 'downloads/' + link.split('/')[-1] except FileExistsError: if is_executable: - file_name = "downloads/" + link.split("/")[-1] + file_name = 'downloads/' + link.split('/')[-1] if not file_name.endswith(url_extension): file_name += url_extension elif extension: - file_name = "downloads/" + link.split("/")[-1] + file_name = 'downloads/' + link.split('/')[-1] if not file_name.endswith(extension): file_name += extension else: - file_name = "downloads/" + link.split("/")[-1] + file_name = 'downloads/' + link.split('/')[-1] downloader = SmartDL(link, file_name, progress_bar=False, timeout=10) start_t = datetime.now() @@ -140,24 +136,24 @@ async def urldl(client: Client, message: Message): while not downloader.isFinished(): total_length = downloader.filesize or None downloaded = downloader.get_dl_size(human=True) - u_m = "" + u_m = '' now = time.time() diff = now - c_time percentage = downloader.get_progress() * 100 speed = downloader.get_speed(human=True) progress_str = ( - "".join(["▰" for _ in range(math.floor(percentage / 5))]) - + "".join(["▱" for _ in range(20 - math.floor(percentage / 5))]) - + f"\nProgress: {round(percentage, 2)}%" + ''.join(['▰' for _ in range(math.floor(percentage / 5))]) + + ''.join(['▱' for _ in range(20 - math.floor(percentage / 5))]) + + f'\nProgress: {round(percentage, 2)}%' ) eta = downloader.get_eta(human=True) try: - m = "Trying to download...\n" - m += f"File Name: {unquote(link.split('/')[-1])}\n" - m += f"Speed: {speed}\n" - m += f"{progress_str}\n" - m += f"{downloaded} of {humanbytes(total_length)}\n" - m += f"ETA: {eta}" + m = 'Trying to download...\n' + m += f'File Name: {unquote(link.split("/")[-1])}\n' + m += f'Speed: {speed}\n' + m += f'{progress_str}\n' + m += f'{downloaded} of {humanbytes(total_length)}\n' + m += f'ETA: {eta}' if round(diff % 10.00) == 0 and m != u_m: await message.edit_text(disable_web_page_preview=True, text=m) u_m = m @@ -167,25 +163,23 @@ async def urldl(client: Client, message: Message): if os.path.exists(file_name): end_t = datetime.now() sec = (end_t - start_t).seconds - await message.edit_text( - f"Downloaded to {file_name} in {sec} seconds" - ) - ms_ = await message.edit("Starting Upload...") + await message.edit_text(f'Downloaded to {file_name} in {sec} seconds') + ms_ = await message.edit('Starting Upload...') await client.send_document( message.chat.id, file_name, progress=progress, - progress_args=(ms_, c_time, "`Uploading...`"), - caption=f"File Name: {unquote(link.split('/')[-1])}\n", + progress_args=(ms_, c_time, '`Uploading...`'), + caption=f'File Name: {unquote(link.split("/")[-1])}\n', reply_to_message_id=message_id, ) await message.delete() os.remove(file_name) else: - await message.edit("Failed to download") + await message.edit('Failed to download') -@Client.on_message(filters.command("upload", prefix) & filters.me) +@Client.on_message(filters.command('upload', prefix) & filters.me) async def upload_cmd(_, message: Message): max_size = 512 * 1024 * 1024 max_size_mb = 100 @@ -193,20 +187,18 @@ async def upload_cmd(_, message: Message): min_file_age = 31 max_file_age = 180 - ms_ = await message.edit("`Downloading...`", parse_mode=enums.ParseMode.MARKDOWN) + ms_ = await message.edit('`Downloading...`', parse_mode=enums.ParseMode.MARKDOWN) c_time = time.time() try: - file_name = await message.download( - progress=progress, progress_args=(ms_, c_time, "`Downloading...`") - ) + file_name = await message.download(progress=progress, progress_args=(ms_, c_time, '`Downloading...`')) except ValueError: try: file_name = await message.reply_to_message.download( - progress=progress, progress_args=(ms_, c_time, "`Downloading...`") + progress=progress, progress_args=(ms_, c_time, '`Downloading...`') ) except ValueError: - await message.edit("File to upload not found") + await message.edit('File to upload not found') return if os.path.getsize(file_name) > max_size: @@ -215,71 +207,60 @@ async def upload_cmd(_, message: Message): os.remove(file_name) return - await message.edit("Uploading...") - with open(file_name, "rb") as f: + await message.edit('Uploading...') + with open(file_name, 'rb') as f: response = requests.post( - "https://x0.at", - files={"file": f}, + 'https://x0.at', + files={'file': f}, ) if response.ok: file_size_mb = os.path.getsize(file_name) / 1024 / 1024 - file_age = int( - min_file_age - + (max_file_age - min_file_age) * ((1 - (file_size_mb / max_size_mb)) ** 2) - ) - url = response.text.replace("https://", "") + file_age = int(min_file_age + (max_file_age - min_file_age) * ((1 - (file_size_mb / max_size_mb)) ** 2)) + url = response.text.replace('https://', '') await message.edit( - f"Your URL: {url}\nYour file will remain live for {file_age} days", + f'Your URL: {url}\nYour file will remain live for {file_age} days', disable_web_page_preview=True, ) else: - await message.edit( - f"API returned an error!\n{response.text}\n Not allowed" - ) + await message.edit(f'API returned an error!\n{response.text}\n Not allowed') print(response.text) if os.path.exists(file_name): os.remove(file_name) -@Client.on_message(filters.command(["ws", "webshot"], prefix) & filters.me) +@Client.on_message(filters.command(['ws', 'webshot'], prefix) & filters.me) async def webshot(client: Client, message: Message): if len(message.command) > 1: url = message.text.split(maxsplit=1)[1] - if not url.startswith("https://"): - url = "https://" + message.text.split(maxsplit=1)[1] + if not url.startswith('https://'): + url = 'https://' + message.text.split(maxsplit=1)[1] elif message.reply_to_message: url = message.reply_to_message.text - if not url.startswith("https://"): - url = "https://" + url + if not url.startswith('https://'): + url = 'https://' + url else: - await message.edit_text( - f"Usage: {prefix}webshot/{prefix}ws [url/reply to url]" - ) + await message.edit_text(f'Usage: {prefix}webshot/{prefix}ws [url/reply to url]') return chat_id = message.chat.id - await message.edit("Generating screenshot...") + await message.edit('Generating screenshot...') try: screenshot_data = generate_screenshot(url) if screenshot_data: await message.delete() - await client.send_photo( - chat_id, screenshot_data, caption=f"Screenshot of {url}" - ) + await client.send_photo(chat_id, screenshot_data, caption=f'Screenshot of {url}') else: - await message.edit_text( - "Failed to generate screenshot...\nMake sure url is correct" - ) + await message.edit_text('Failed to generate screenshot...\nMake sure url is correct') except Exception as e: - await message.edit_text(f"An error occurred: {format_exc(e)}") + await message.edit_text(f'An error occurred: {format_exc(e)}') -modules_help["url"] = { - "short [url]*": "short url", - "urldl [url]*": "download url content", - "upload [file|reply]*": "upload file to internet", - "webshot [link]*": "Screenshot of web page", - "ws [reply to link]*": "Screenshot of web page", +modules_help['url'] = { + 'short [url]*': 'short url', + 'urldl [url]*': 'download url content', + 'upload [file|reply]*': 'upload file to internet', + 'webshot [link]*': 'Screenshot of web page', + 'ws [reply to link]*': 'Screenshot of web page', } diff --git a/userbot/modules/user_info.py b/userbot/modules/user_info.py index ea022a6..a79bb3b 100644 --- a/userbot/modules/user_info.py +++ b/userbot/modules/user_info.py @@ -17,19 +17,18 @@ from pyrogram import Client, filters from pyrogram.raw import functions from pyrogram.types import Message - from utils.misc import modules_help, prefix from utils.scripts import format_exc, interact_with, interact_with_to_delete -@Client.on_message(filters.command("inf", prefix) & filters.me) +@Client.on_message(filters.command('inf', prefix) & filters.me) async def get_user_inf(client: Client, message: Message): if len(message.command) >= 2: peer = await client.resolve_peer(message.command[1]) elif message.reply_to_message and message.reply_to_message.from_user: peer = await client.resolve_peer(message.reply_to_message.from_user.id) else: - peer = await client.resolve_peer("me") + peer = await client.resolve_peer('me') response = await client.invoke(functions.users.GetFullUser(id=peer)) @@ -37,10 +36,10 @@ async def get_user_inf(client: Client, message: Message): full_user = response.full_user if user.username is None: - username = "None" + username = 'None' else: - username = f"@{user.username}" - about = "None" if full_user.about is None else full_user.about + username = f'@{user.username}' + about = 'None' if full_user.about is None else full_user.about user_info = f"""|=Username: {username} |-Id: {user.id} @@ -53,9 +52,9 @@ async def get_user_inf(client: Client, message: Message): await message.edit(user_info) -@Client.on_message(filters.command("inffull", prefix) & filters.me) +@Client.on_message(filters.command('inffull', prefix) & filters.me) async def get_full_user_inf(client: Client, message: Message): - await message.edit("Receiving the information...") + await message.edit('Receiving the information...') try: if len(message.command) >= 2: @@ -63,30 +62,28 @@ async def get_full_user_inf(client: Client, message: Message): elif message.reply_to_message and message.reply_to_message.from_user: peer = await client.resolve_peer(message.reply_to_message.from_user.id) else: - peer = await client.resolve_peer("me") + peer = await client.resolve_peer('me') response = await client.invoke(functions.users.GetFullUser(id=peer)) user = response.users[0] full_user = response.full_user - await client.unblock_user("@creationdatebot") + await client.unblock_user('@creationdatebot') try: - response = await interact_with( - await client.send_message("creationdatebot", f"/id {user.id}") - ) + response = await interact_with(await client.send_message('creationdatebot', f'/id {user.id}')) except RuntimeError: - creation_date = "None" + creation_date = 'None' else: creation_date = response.text # await client.delete_messages("@creationdatebot", interact_with_to_delete) interact_with_to_delete.clear() if user.username is None: - username = "None" + username = 'None' else: - username = f"@{user.username}" - about = "None" if full_user.about is None else full_user.about + username = f'@{user.username}' + about = 'None' if full_user.about is None else full_user.about user_info = f"""|=Username: {username} |-Id: {user.id} |-Account creation date: {creation_date} @@ -109,7 +106,7 @@ async def get_full_user_inf(client: Client, message: Message): await message.edit(format_exc(e)) -modules_help["user_info"] = { - "inf [reply|id|username]": "Get brief information about user", - "inffull [reply|id|username": "Get full information about user", +modules_help['user_info'] = { + 'inf [reply|id|username]': 'Get brief information about user', + 'inffull [reply|id|username': 'Get full information about user', } diff --git a/userbot/modules/vt.py b/userbot/modules/vt.py index 1ca4ce8..efc70be 100644 --- a/userbot/modules/vt.py +++ b/userbot/modules/vt.py @@ -12,48 +12,47 @@ import time import requests from pyrogram import Client, enums, filters from pyrogram.types import Message - from utils.config import vt_key as vak from utils.misc import modules_help, prefix from utils.scripts import edit_or_reply, format_exc, progress -@Client.on_message(filters.command("vt", prefix) & filters.me) +@Client.on_message(filters.command('vt', prefix) & filters.me) async def scan_my_file(_, message: Message): - ms_ = await edit_or_reply(message, "`Please Wait! Scanning This File`") + ms_ = await edit_or_reply(message, '`Please Wait! Scanning This File`') if not message.reply_to_message: return await ms_.edit( - "`Please Reply To File To Scan For Viruses`", + '`Please Reply To File To Scan For Viruses`', parse_mode=enums.ParseMode.MARKDOWN, ) if not message.reply_to_message.document: return await ms_.edit( - "`Please Reply To File To Scan For Viruses`", + '`Please Reply To File To Scan For Viruses`', parse_mode=enums.ParseMode.MARKDOWN, ) if vak is None: return await ms_.edit( - "`You Need To Set VIRUSTOTAL_API_KEY For Functing Of This Plugin.`", + '`You Need To Set VIRUSTOTAL_API_KEY For Functing Of This Plugin.`', parse_mode=enums.ParseMode.MARKDOWN, ) if int(message.reply_to_message.document.file_size) > 32000000: return await ms_.edit( - f"**File Too Large, Use `{prefix}vtl` instead**", + f'**File Too Large, Use `{prefix}vtl` instead**', parse_mode=enums.ParseMode.MARKDOWN, ) c_time = time.time() downloaded_file_name = await message.reply_to_message.download( progress=progress, - progress_args=(ms_, c_time, "`Downloading This File!`"), + progress_args=(ms_, c_time, '`Downloading This File!`'), ) - url = "https://www.virustotal.com/vtapi/v2/file/scan" - params = {"apikey": vak} - files = {"file": (downloaded_file_name, open(downloaded_file_name, "rb"))} + url = 'https://www.virustotal.com/vtapi/v2/file/scan' + params = {'apikey': vak} + files = {'file': (downloaded_file_name, open(downloaded_file_name, 'rb'))} response = requests.post(url, files=files, params=params, timeout=10) try: r_json = response.json() - md5 = r_json["md5"] + md5 = r_json['md5'] except Exception as e: return await ms_.edit(format_exc(e)) await ms_.edit( @@ -63,64 +62,64 @@ async def scan_my_file(_, message: Message): os.remove(downloaded_file_name) -@Client.on_message(filters.command("vtl", prefix) & filters.me) +@Client.on_message(filters.command('vtl', prefix) & filters.me) async def scan_my_large_file(_, message: Message): - ms_ = await edit_or_reply(message, "`Please Wait! Scanning This File`") + ms_ = await edit_or_reply(message, '`Please Wait! Scanning This File`') if not message.reply_to_message: return await ms_.edit( - "`Please Reply To File To Scan For Viruses`", + '`Please Reply To File To Scan For Viruses`', parse_mode=enums.ParseMode.MARKDOWN, ) if not message.reply_to_message.document: return await ms_.edit( - "`Please Reply To File To Scan For Viruses`", + '`Please Reply To File To Scan For Viruses`', parse_mode=enums.ParseMode.MARKDOWN, ) if vak is None: return await ms_.edit( - "`You Need To Set VIRUSTOTAL_API_KEY For Functing Of This Plugin.`", + '`You Need To Set VIRUSTOTAL_API_KEY For Functing Of This Plugin.`', parse_mode=enums.ParseMode.MARKDOWN, ) if int(message.reply_to_message.document.file_size) > 650000000: return await ms_.edit( - "**File Too Large, exceeded Max capacity of 650MB**", + '**File Too Large, exceeded Max capacity of 650MB**', parse_mode=enums.ParseMode.MARKDOWN, ) c_time = time.time() downloaded_file_name = await message.reply_to_message.download( progress=progress, - progress_args=(ms_, c_time, "`Downloading This File!`"), + progress_args=(ms_, c_time, '`Downloading This File!`'), ) - url1 = "https://www.virustotal.com/api/v3/files/upload_url" + url1 = 'https://www.virustotal.com/api/v3/files/upload_url' - headers = {"accept": "application/json", "x-apikey": vak} + headers = {'accept': 'application/json', 'x-apikey': vak} rponse = requests.get(url1, headers=headers, timeout=10) try: r_json = rponse.json() - upl_data = r_json["data"] + upl_data = r_json['data'] except Exception as e: return await ms_.edit(format_exc(e)) url = upl_data - files = {"file": (downloaded_file_name, open(downloaded_file_name, "rb"))} - headers = {"accept": "application/json", "x-apikey": vak} + files = {'file': (downloaded_file_name, open(downloaded_file_name, 'rb'))} + headers = {'accept': 'application/json', 'x-apikey': vak} response = requests.post(url, files=files, headers=headers, timeout=10) r_json = response.json() - analysis_url = r_json["data"]["links"]["self"] + analysis_url = r_json['data']['links']['self'] url = analysis_url - headers = {"accept": "application/json", "x-apikey": vak} + headers = {'accept': 'application/json', 'x-apikey': vak} response_result = requests.get(url, headers=headers, timeout=10) try: r_json = response_result.json() - md5 = r_json["meta"]["file_info"]["md5"] + md5 = r_json['meta']['file_info']['md5'] except Exception as e: return await ms_.edit(format_exc(e)) await ms_.edit( @@ -130,7 +129,7 @@ async def scan_my_large_file(_, message: Message): os.remove(downloaded_file_name) -modules_help["virustotal"] = { - "vt [reply to file]*": "Scan for viruses on Virus Total (for lower file size <32MB)", - "vtl [reply to file]*": "Scan for viruses on Virus Total (for lower file size >=32MB)", +modules_help['virustotal'] = { + 'vt [reply to file]*': 'Scan for viruses on Virus Total (for lower file size <32MB)', + 'vtl [reply to file]*': 'Scan for viruses on Virus Total (for lower file size >=32MB)', } diff --git a/userbot/string_gen.py b/userbot/string_gen.py index 39e9dd0..5dcf665 100644 --- a/userbot/string_gen.py +++ b/userbot/string_gen.py @@ -1,10 +1,10 @@ from pyrogram import Client, enums -api_id = input("Enter Your API ID: \n") -api_hash = input("Enter Your API HASH : \n") +api_id = input('Enter Your API ID: \n') +api_hash = input('Enter Your API HASH : \n') -with Client("my_account", api_id=api_id, api_hash=api_hash, hide_password=True) as bot_: +with Client('my_account', api_id=api_id, api_hash=api_hash, hide_password=True) as bot_: first_name = (bot_.get_me()).first_name - string_session_ = f"String Session For {first_name} \n{bot_.export_session_string()}" - bot_.send_message("me", string_session_, parse_mode=enums.ParseMode.HTML, disable_web_page_preview=True) - print(f"String Has Been Sent To Your Saved Message : {first_name}") + string_session_ = f'String Session For {first_name} \n{bot_.export_session_string()}' + bot_.send_message('me', string_session_, parse_mode=enums.ParseMode.HTML, disable_web_page_preview=True) + print(f'String Has Been Sent To Your Saved Message : {first_name}') diff --git a/userbot/utils/config.py b/userbot/utils/config.py index a8879d5..bc0a8b2 100644 --- a/userbot/utils/config.py +++ b/userbot/utils/config.py @@ -1,32 +1,31 @@ import os + import environs env = environs.Env() try: - env.read_env("./.env") + env.read_env('./.env') except FileNotFoundError: - print("No .env file found, using os.environ.") + print('No .env file found, using os.environ.') -api_id = int(os.getenv("API_ID", env.int("API_ID"))) -api_hash = os.getenv("API_HASH", env.str("API_HASH")) +api_id = int(os.getenv('API_ID', env.int('API_ID'))) +api_hash = os.getenv('API_HASH', env.str('API_HASH')) -STRINGSESSION = os.getenv("STRINGSESSION", env.str("STRINGSESSION")) +STRINGSESSION = os.getenv('STRINGSESSION', env.str('STRINGSESSION')) -second_session = os.getenv("SECOND_SESSION", env.str("SECOND_SESSION", "")) +second_session = os.getenv('SECOND_SESSION', env.str('SECOND_SESSION', '')) -db_type = os.getenv("DATABASE_TYPE", env.str("DATABASE_TYPE")) -db_url = os.getenv("DATABASE_URL", env.str("DATABASE_URL", "")) -db_name = os.getenv("DATABASE_NAME", env.str("DATABASE_NAME")) +db_type = os.getenv('DATABASE_TYPE', env.str('DATABASE_TYPE')) +db_url = os.getenv('DATABASE_URL', env.str('DATABASE_URL', '')) +db_name = os.getenv('DATABASE_NAME', env.str('DATABASE_NAME')) -apiflash_key = os.getenv("APIFLASH_KEY", env.str("APIFLASH_KEY")) -rmbg_key = os.getenv("RMBG_KEY", env.str("RMBG_KEY", "")) -vt_key = os.getenv("VT_KEY", env.str("VT_KEY", "")) -gemini_key = os.getenv("GEMINI_KEY", env.str("GEMINI_KEY", "")) -cohere_key = os.getenv("COHERE_KEY", env.str("COHERE_KEY", "")) +apiflash_key = os.getenv('APIFLASH_KEY', env.str('APIFLASH_KEY')) +rmbg_key = os.getenv('RMBG_KEY', env.str('RMBG_KEY', '')) +vt_key = os.getenv('VT_KEY', env.str('VT_KEY', '')) +gemini_key = os.getenv('GEMINI_KEY', env.str('GEMINI_KEY', '')) +cohere_key = os.getenv('COHERE_KEY', env.str('COHERE_KEY', '')) -pm_limit = int(os.getenv("PM_LIMIT", env.int("PM_LIMIT", 4))) +pm_limit = int(os.getenv('PM_LIMIT', env.int('PM_LIMIT', 4))) -test_server = bool(os.getenv("TEST_SERVER", env.bool("TEST_SERVER", False))) -modules_repo_branch = os.getenv( - "MODULES_REPO_BRANCH", env.str("MODULES_REPO_BRANCH", "master") -) +test_server = bool(os.getenv('TEST_SERVER', env.bool('TEST_SERVER', False))) +modules_repo_branch = os.getenv('MODULES_REPO_BRANCH', env.str('MODULES_REPO_BRANCH', 'master')) diff --git a/userbot/utils/conv.py b/userbot/utils/conv.py index 5b238fb..b56e909 100644 --- a/userbot/utils/conv.py +++ b/userbot/utils/conv.py @@ -14,14 +14,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import asyncio from collections import OrderedDict from pyrogram import Client, filters, types -from pyrogram.handlers import MessageHandler from pyrogram.enums.parse_mode import ParseMode - -import asyncio -from typing import Union, List, Dict, Optional +from pyrogram.handlers import MessageHandler class _TrueFilter(filters.Filter): @@ -30,12 +28,12 @@ class _TrueFilter(filters.Filter): class Conversation: - _locks: Dict[int, asyncio.Lock] = {} + _locks: dict[int, asyncio.Lock] = {} def __init__( self, client: Client, - chat: Union[str, int], + chat: str | int, timeout: float = 5, delete_at_end=True, exclusive=True, @@ -49,10 +47,10 @@ class Conversation: self._chat_id = 0 self._message_ids = [] self._handler_object = None - self._chat_unique_lock: Optional[asyncio.Lock] = None - self._waiters: Dict[asyncio.Event, filters.Filter] = {} - self._responses: Dict[asyncio.Event, types.Message] = {} - self._pending_updates: List[types.Message] = [] + self._chat_unique_lock: asyncio.Lock | None = None + self._waiters: dict[asyncio.Event, filters.Filter] = {} + self._responses: dict[asyncio.Event, types.Message] = {} + self._pending_updates: list[types.Message] = [] async def __aenter__(self): self._chat_id = (await self.client.get_chat(self.chat)).id @@ -65,9 +63,7 @@ class Conversation: if self.exclusive: await self._chat_unique_lock.acquire() - self._handler_object = MessageHandler( - self._handler, filters.chat(self._chat_id) - ) + self._handler_object = MessageHandler(self._handler, filters.chat(self._chat_id)) if -999 not in self.client.dispatcher.groups: new_groups = OrderedDict(self.client.dispatcher.groups) @@ -101,7 +97,7 @@ class Conversation: async def get_response( self, - message_filter: Optional[filters.Filter] = None, + message_filter: filters.Filter | None = None, timeout: float = None, ) -> types.Message: if timeout is None: @@ -119,15 +115,13 @@ class Conversation: self._message_ids.append(message.id) return message - async def _wait_message( - self, message_filter: Optional[filters.Filter], timeout: float - ) -> types.Message: + async def _wait_message(self, message_filter: filters.Filter | None, timeout: float) -> types.Message: event = asyncio.Event() self._waiters[event] = message_filter try: await asyncio.wait_for(event.wait(), timeout=timeout) - except asyncio.TimeoutError as e: + except TimeoutError as e: raise TimeoutError from e finally: self._waiters.pop(event) @@ -137,8 +131,8 @@ class Conversation: async def send_message( self, text: str, - parse_mode: Optional[str] = ParseMode.HTML, - entities: List[types.MessageEntity] = None, + parse_mode: str | None = ParseMode.HTML, + entities: list[types.MessageEntity] = None, disable_web_page_preview: bool = None, disable_notification: bool = None, reply_to_message_id: int = None, diff --git a/userbot/utils/db.py b/userbot/utils/db.py index 2cac220..90a2dc2 100644 --- a/userbot/utils/db.py +++ b/userbot/utils/db.py @@ -14,16 +14,18 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import re import json -import threading +import re import sqlite3 -from dns import resolver +import threading + import pymongo +from dns import resolver + from utils import config resolver.default_resolver = resolver.Resolver(configure=False) -resolver.default_resolver.nameservers = ["1.1.1.1"] +resolver.default_resolver.nameservers = ['1.1.1.1'] class Database: @@ -55,26 +57,24 @@ class MongoDatabase(Database): def set(self, module: str, variable: str, value): if not isinstance(module, str) or not isinstance(variable, str): - raise ValueError("Module and variable must be strings") - self._database[module].replace_one( - {"var": variable}, {"var": variable, "val": value}, upsert=True - ) + raise ValueError('Module and variable must be strings') + self._database[module].replace_one({'var': variable}, {'var': variable, 'val': value}, upsert=True) def get(self, module: str, variable: str, default=None): if not isinstance(module, str) or not isinstance(variable, str): - raise ValueError("Module and variable must be strings") - doc = self._database[module].find_one({"var": variable}) - return default if doc is None else doc["val"] + raise ValueError('Module and variable must be strings') + doc = self._database[module].find_one({'var': variable}) + return default if doc is None else doc['val'] def get_collection(self, module: str): if not isinstance(module, str): - raise ValueError("Module must be a string") - return {item["var"]: item["val"] for item in self._database[module].find()} + raise ValueError('Module must be a string') + return {item['var']: item['val'] for item in self._database[module].find()} def remove(self, module: str, variable: str): if not isinstance(module, str) or not isinstance(variable, str): - raise ValueError("Module and variable must be strings") - self._database[module].delete_one({"var": variable}) + raise ValueError('Module and variable must be strings') + self._database[module].delete_one({'var': variable}) def close(self): self._client.close() @@ -82,27 +82,27 @@ class MongoDatabase(Database): def add_chat_history(self, user_id, message): chat_history = self.get_chat_history(user_id, default=[]) chat_history.append(message) - self.set(f"core.cohere.user_{user_id}", "chat_history", chat_history) + self.set(f'core.cohere.user_{user_id}', 'chat_history', chat_history) def get_chat_history(self, user_id, default=None): if default is None: default = [] - return self.get(f"core.cohere.user_{user_id}", "chat_history", default=[]) + return self.get(f'core.cohere.user_{user_id}', 'chat_history', default=[]) def addaiuser(self, user_id): - chatai_users = self.get("core.chatbot", "chatai_users", default=[]) + chatai_users = self.get('core.chatbot', 'chatai_users', default=[]) if user_id not in chatai_users: chatai_users.append(user_id) - self.set("core.chatbot", "chatai_users", chatai_users) + self.set('core.chatbot', 'chatai_users', chatai_users) def remaiuser(self, user_id): - chatai_users = self.get("core.chatbot", "chatai_users", default=[]) + chatai_users = self.get('core.chatbot', 'chatai_users', default=[]) if user_id in chatai_users: chatai_users.remove(user_id) - self.set("core.chatbot", "chatai_users", chatai_users) + self.set('core.chatbot', 'chatai_users', chatai_users) def getaiusers(self): - return self.get("core.chatbot", "chatai_users", default=[]) + return self.get('core.chatbot', 'chatai_users', default=[]) class SqliteDatabase(Database): @@ -114,25 +114,25 @@ class SqliteDatabase(Database): @staticmethod def _parse_row(row: sqlite3.Row): - if row["type"] == "bool": - return row["val"] == "1" - if row["type"] == "int": - return int(row["val"]) - if row["type"] == "str": - return row["val"] - return json.loads(row["val"]) + if row['type'] == 'bool': + return row['val'] == '1' + if row['type'] == 'int': + return int(row['val']) + if row['type'] == 'str': + return row['val'] + return json.loads(row['val']) def _execute(self, module: str, *args, **kwargs) -> sqlite3.Cursor: - pattern = r"^(core|custom)" + pattern = r'^(core|custom)' if not re.match(pattern, module): - raise ValueError(f"Invalid module name format: {module}") + raise ValueError(f'Invalid module name format: {module}') self._lock.acquire() try: cursor = self._conn.cursor() return cursor.execute(*args, **kwargs) except sqlite3.OperationalError as e: - if str(e).startswith("no such table"): + if str(e).startswith('no such table'): sql = f""" CREATE TABLE IF NOT EXISTS '{module}' ( var TEXT UNIQUE NOT NULL, @@ -165,17 +165,17 @@ class SqliteDatabase(Database): """ if isinstance(value, bool): - val = "1" if value else "0" - typ = "bool" + val = '1' if value else '0' + typ = 'bool' elif isinstance(value, str): val = value - typ = "str" + typ = 'str' elif isinstance(value, int): val = str(value) - typ = "int" + typ = 'int' else: val = json.dumps(value) - typ = "json" + typ = 'json' self._execute(module, sql, (variable, val, typ, val, typ, variable)) self._conn.commit() @@ -188,16 +188,16 @@ class SqliteDatabase(Database): self._conn.commit() def get_collection(self, module: str) -> dict: - pattern = r"^(core|custom)" + pattern = r'^(core|custom)' if not re.match(pattern, module): - raise ValueError(f"Invalid module name format: {module}") + raise ValueError(f'Invalid module name format: {module}') sql = f"SELECT * FROM '{module}'" cur = self._execute(module, sql) collection = {} for row in cur: - collection[row["var"]] = self._parse_row(row) + collection[row['var']] = self._parse_row(row) return collection @@ -208,30 +208,30 @@ class SqliteDatabase(Database): def add_chat_history(self, user_id, message): chat_history = self.get_chat_history(user_id, default=[]) chat_history.append(message) - self.set(f"core.cohere.user_{user_id}", "chat_history", chat_history) + self.set(f'core.cohere.user_{user_id}', 'chat_history', chat_history) def get_chat_history(self, user_id, default=None): if default is None: default = [] - return self.get(f"core.cohere.user_{user_id}", "chat_history", default=[]) + return self.get(f'core.cohere.user_{user_id}', 'chat_history', default=[]) def addaiuser(self, user_id): - chatai_users = self.get("core.chatbot", "chatai_users", default=[]) + chatai_users = self.get('core.chatbot', 'chatai_users', default=[]) if user_id not in chatai_users: chatai_users.append(user_id) - self.set("core.chatbot", "chatai_users", chatai_users) + self.set('core.chatbot', 'chatai_users', chatai_users) def remaiuser(self, user_id): - chatai_users = self.get("core.chatbot", "chatai_users", default=[]) + chatai_users = self.get('core.chatbot', 'chatai_users', default=[]) if user_id in chatai_users: chatai_users.remove(user_id) - self.set("core.chatbot", "chatai_users", chatai_users) + self.set('core.chatbot', 'chatai_users', chatai_users) def getaiusers(self): - return self.get("core.chatbot", "chatai_users", default=[]) + return self.get('core.chatbot', 'chatai_users', default=[]) -if config.db_type in ["mongo", "mongodb"]: +if config.db_type in ['mongo', 'mongodb']: db = MongoDatabase(config.db_url, config.db_name) else: db = SqliteDatabase(config.db_name) diff --git a/userbot/utils/handlers.py b/userbot/utils/handlers.py index c4dba5e..9a11822 100644 --- a/userbot/utils/handlers.py +++ b/userbot/utils/handlers.py @@ -16,7 +16,6 @@ import re from datetime import datetime, timedelta -from typing import Dict, Union from pyrogram import Client from pyrogram.enums import ChatType @@ -50,27 +49,21 @@ from utils.misc import prefix from utils.scripts import format_exc, text -async def check_username_or_id(data: Union[str, int]) -> str: +async def check_username_or_id(data: str | int) -> str: data = str(data) - if ( - not data.isdigit() - and data[0] == "-" - and not data[1:].isdigit() - or not data.isdigit() - and data[0] != "-" - ): - return "channel" + if not data.isdigit() and data[0] == '-' and not data[1:].isdigit() or not data.isdigit() and data[0] != '-': + return 'channel' peer_id = int(data) if peer_id < 0: - if MIN_CHAT_ID <= peer_id: - return "chat" + if peer_id >= MIN_CHAT_ID: + return 'chat' if MIN_CHANNEL_ID <= peer_id < MAX_CHANNEL_ID: - return "channel" + return 'channel' elif 0 < peer_id <= MAX_USER_ID: - return "user" + return 'user' - raise ValueError(f"Peer id invalid: {peer_id}") + raise ValueError(f'Peer id invalid: {peer_id}') async def get_user_and_name(message): @@ -101,7 +94,7 @@ class BanHandler: elif not self.message.reply_to_message: await self.handle_non_reply_ban() else: - await self.message.edit("Unsupported") + await self.message.edit('Unsupported') async def handle_reply_ban(self): if self.message.chat.type not in [ChatType.PRIVATE, ChatType.CHANNEL]: @@ -109,26 +102,19 @@ class BanHandler: await self.ban_user(user_for_ban) async def handle_non_reply_ban(self): - if ( - self.message.chat.type not in ["private", "channel"] - and len(self.cause.split()) > 1 - ): + if self.message.chat.type not in ['private', 'channel'] and len(self.cause.split()) > 1: user_to_ban = await self.get_user_to_ban() if user_to_ban: - self.name = ( - user_to_ban.first_name - if getattr(user_to_ban, "first_name", None) - else user_to_ban.title - ) + self.name = user_to_ban.first_name if getattr(user_to_ban, 'first_name', None) else user_to_ban.title await self.ban_user(user_to_ban.id) async def get_user_to_ban(self): - user_type = await check_username_or_id(self.cause.split(" ")[1]) - if user_type == "channel": - return await self.client.get_chat(self.cause.split(" ")[1]) - if user_type == "user": - return await self.client.get_users(self.cause.split(" ")[1]) - await self.message.edit("Invalid user type") + user_type = await check_username_or_id(self.cause.split(' ')[1]) + if user_type == 'channel': + return await self.client.get_chat(self.cause.split(' ')[1]) + if user_type == 'user': + return await self.client.get_users(self.cause.split(' ')[1]) + await self.message.edit('Invalid user type') return None async def ban_user(self, user_id): @@ -139,14 +125,14 @@ class BanHandler: await self.handle_additional_actions() await self.edit_message() except UserAdminInvalid: - await self.message.edit("No rights") + await self.message.edit('No rights') except ChatAdminRequired: - await self.message.edit("No rights") + await self.message.edit('No rights') except Exception as e: await self.message.edit(format_exc(e)) async def handle_additional_actions(self): - if "report_spam" in self.cause.lower().split(): + if 'report_spam' in self.cause.lower().split(): await self.client.invoke( functions.channels.ReportSpam( channel=self.channel, @@ -154,22 +140,16 @@ class BanHandler: id=[self.message.reply_to_message.id], ) ) - if "delete_history" in self.cause.lower().split(): + if 'delete_history' in self.cause.lower().split(): await self.client.invoke( - functions.channels.DeleteParticipantHistory( - channel=self.channel, participant=self.user_id - ) + functions.channels.DeleteParticipantHistory(channel=self.channel, participant=self.user_id) ) async def edit_message(self): - text_c = "".join( - f" {_}" - for _ in self.cause.split() - if _.lower() not in ["delete_history", "report_spam"] - ) + text_c = ''.join(f' {_}' for _ in self.cause.split() if _.lower() not in ['delete_history', 'report_spam']) await self.message.edit( - f"{self.name} banned!" - + f"\n{'Cause: ' + text_c.split(maxsplit=1)[1] + '' if len(text_c.split()) > 1 else ''}" + f'{self.name} banned!' + + f'\n{"Cause: " + text_c.split(maxsplit=1)[1] + "" if len(text_c.split()) > 1 else ""}' ) @@ -188,7 +168,7 @@ class UnbanHandler: elif not self.message.reply_to_message: await self.handle_non_reply_unban() else: - await self.message.edit("Unsupported") + await self.message.edit('Unsupported') async def handle_reply_unban(self): if self.message.chat.type not in [ChatType.PRIVATE, ChatType.CHANNEL]: @@ -196,26 +176,21 @@ class UnbanHandler: await self.unban_user(user_for_unban) async def handle_non_reply_unban(self): - if ( - self.message.chat.type not in ["private", "channel"] - and len(self.cause.split()) > 1 - ): + if self.message.chat.type not in ['private', 'channel'] and len(self.cause.split()) > 1: user_to_unban = await self.get_user_to_unban() if user_to_unban: self.name = ( - user_to_unban.first_name - if getattr(user_to_unban, "first_name", None) - else user_to_unban.title + user_to_unban.first_name if getattr(user_to_unban, 'first_name', None) else user_to_unban.title ) await self.unban_user(user_to_unban.id) async def get_user_to_unban(self): - user_type = await check_username_or_id(self.cause.split(" ")[1]) - if user_type == "channel": - return await self.client.get_chat(self.cause.split(" ")[1]) - if user_type == "user": - return await self.client.get_users(self.cause.split(" ")[1]) - await self.message.edit("Invalid user type") + user_type = await check_username_or_id(self.cause.split(' ')[1]) + if user_type == 'channel': + return await self.client.get_chat(self.cause.split(' ')[1]) + if user_type == 'user': + return await self.client.get_users(self.cause.split(' ')[1]) + await self.message.edit('Invalid user type') return None async def unban_user(self, user_id): @@ -225,21 +200,17 @@ class UnbanHandler: self.user_id = await self.client.resolve_peer(user_id) await self.edit_message() except UserAdminInvalid: - await self.message.edit("No rights") + await self.message.edit('No rights') except ChatAdminRequired: - await self.message.edit("No rights") + await self.message.edit('No rights') except Exception as e: await self.message.edit(format_exc(e)) async def edit_message(self): - text_c = "".join( - f" {_}" - for _ in self.cause.split() - if _.lower() not in ["delete_history", "report_spam"] - ) + text_c = ''.join(f' {_}' for _ in self.cause.split() if _.lower() not in ['delete_history', 'report_spam']) await self.message.edit( - f"{self.name} unbanned!" - + f"\n{'Cause: ' + text_c.split(maxsplit=1)[1] + '' if len(text_c.split()) > 1 else ''}" + f'{self.name} unbanned!' + + f'\n{"Cause: " + text_c.split(maxsplit=1)[1] + "" if len(text_c.split()) > 1 else ""}' ) @@ -258,7 +229,7 @@ class KickHandler: elif not self.message.reply_to_message: await self.handle_non_reply_kick() else: - await self.message.edit("Unsupported") + await self.message.edit('Unsupported') async def handle_reply_kick(self): if self.message.chat.type not in [ChatType.PRIVATE, ChatType.CHANNEL]: @@ -266,7 +237,7 @@ class KickHandler: self.name = self.message.reply_to_message.from_user.first_name await self.kick_user(self.message.reply_to_message.from_user.id) else: - await self.message.edit("Reply on user msg") + await self.message.edit('Reply on user msg') async def handle_non_reply_kick(self): if self.message.chat.type not in [ChatType.PRIVATE, ChatType.CHANNEL]: @@ -274,21 +245,19 @@ class KickHandler: user_to_kick = await self.get_user_to_kick() if user_to_kick: self.name = ( - user_to_kick.first_name - if getattr(user_to_kick, "first_name", None) - else user_to_kick.title + user_to_kick.first_name if getattr(user_to_kick, 'first_name', None) else user_to_kick.title ) await self.kick_user(user_to_kick.id) else: - await self.message.edit("user_id or username") + await self.message.edit('user_id or username') async def get_user_to_kick(self): - user_type = await check_username_or_id(self.cause.split(" ")[1]) - if user_type == "channel": - return await self.client.get_chat(self.cause.split(" ")[1]) - if user_type == "user": - return await self.client.get_users(self.cause.split(" ")[1]) - await self.message.edit("Invalid user type") + user_type = await check_username_or_id(self.cause.split(' ')[1]) + if user_type == 'channel': + return await self.client.get_chat(self.cause.split(' ')[1]) + if user_type == 'user': + return await self.client.get_users(self.cause.split(' ')[1]) + await self.message.edit('Invalid user type') return None async def kick_user(self, user_id): @@ -304,14 +273,14 @@ class KickHandler: await self.client.unban_chat_member(self.message.chat.id, user_id) await self.edit_message() except UserAdminInvalid: - await self.message.edit("No rights") + await self.message.edit('No rights') except ChatAdminRequired: - await self.message.edit("No rights") + await self.message.edit('No rights') except Exception as e: await self.message.edit(format_exc(e)) async def handle_additional_actions(self): - if "report_spam" in self.cause.lower().split(): + if 'report_spam' in self.cause.lower().split(): await self.client.invoke( functions.channels.ReportSpam( channel=self.channel, @@ -319,22 +288,16 @@ class KickHandler: id=[self.message.reply_to_message.id], ) ) - if "delete_history" in self.cause.lower().split(): + if 'delete_history' in self.cause.lower().split(): await self.client.invoke( - functions.channels.DeleteParticipantHistory( - channel=self.channel, participant=self.user_id - ) + functions.channels.DeleteParticipantHistory(channel=self.channel, participant=self.user_id) ) async def edit_message(self): - text_c = "".join( - f" {_}" - for _ in self.cause.split() - if _.lower() not in ["delete_history", "report_spam"] - ) + text_c = ''.join(f' {_}' for _ in self.cause.split() if _.lower() not in ['delete_history', 'report_spam']) await self.message.edit( - f"{self.name} kicked!" - + f"\n{'Cause: ' + text_c.split(maxsplit=1)[1] + '' if len(text_c.split()) > 1 else ''}" + f'{self.name} kicked!' + + f'\n{"Cause: " + text_c.split(maxsplit=1)[1] + "" if len(text_c.split()) > 1 else ""}' ) @@ -346,7 +309,7 @@ class KickDeletedAccountsHandler: self.kicked_count = 0 async def kick_deleted_accounts(self): - await self.message.edit("Kicking deleted accounts...") + await self.message.edit('Kicking deleted accounts...') try: async for member in self.client.get_chat_members(self.chat_id): if member.user.is_deleted: @@ -355,16 +318,14 @@ class KickDeletedAccountsHandler: except Exception as e: return await self.message.edit(format_exc(e)) await self.message.edit( - f"Successfully kicked {self.kicked_count} deleted account(s)", + f'Successfully kicked {self.kicked_count} deleted account(s)', ) async def kick_member(self, user_id): try: - await self.client.ban_chat_member( - self.chat_id, user_id, datetime.now() + timedelta(seconds=31) - ) + await self.client.ban_chat_member(self.chat_id, user_id, datetime.now() + timedelta(seconds=31)) except Exception as e: - await self.message.edit(f"Failed to kick user {user_id}: {format_exc(e)}") + await self.message.edit(f'Failed to kick user {user_id}: {format_exc(e)}') class TimeMuteHandler: @@ -373,7 +334,7 @@ class TimeMuteHandler: self.message = message self.cause = text(message) self.chat_id = message.chat.id - self.tmuted_users = db.get("core.ats", f"c{self.chat_id}", []) + self.tmuted_users = db.get('core.ats', f'c{self.chat_id}', []) async def handle_tmute(self): if self.message.reply_to_message: @@ -381,19 +342,19 @@ class TimeMuteHandler: elif not self.message.reply_to_message: await self.handle_non_reply_tmute() else: - await self.message.edit("Unsupported") + await self.message.edit('Unsupported') async def handle_reply_tmute(self): if self.message.chat.type not in [ChatType.PRIVATE, ChatType.CHANNEL]: user_for_tmute, name = await get_user_and_name(self.message) if user_for_tmute in self.tmuted_users: - await self.message.edit(f"{name} already in tmute") + await self.message.edit(f'{name} already in tmute') else: self.tmuted_users.append(user_for_tmute) - db.set("core.ats", f"c{self.chat_id}", self.tmuted_users) + db.set('core.ats', f'c{self.chat_id}', self.tmuted_users) await self.message.edit( - f"{name} in tmute" - + f"\n{'Cause: ' + self.cause.split(maxsplit=1)[1] + '' if len(self.cause.split()) > 1 else ''}", + f'{name} in tmute' + + f'\n{"Cause: " + self.cause.split(maxsplit=1)[1] + "" if len(self.cause.split()) > 1 else ""}', ) async def handle_non_reply_tmute(self): @@ -402,31 +363,29 @@ class TimeMuteHandler: user_to_tmute = await self.get_user_to_tmute() if user_to_tmute: name = ( - user_to_tmute.first_name - if getattr(user_to_tmute, "first_name", None) - else user_to_tmute.title + user_to_tmute.first_name if getattr(user_to_tmute, 'first_name', None) else user_to_tmute.title ) if user_to_tmute.id not in self.tmuted_users: self.tmuted_users.append(user_to_tmute.id) - db.set("core.ats", f"c{self.chat_id}", self.tmuted_users) + db.set('core.ats', f'c{self.chat_id}', self.tmuted_users) await self.message.edit( - f"{name} in tmute" - + f"\n{'Cause: ' + self.cause.split(maxsplit=2)[2] + '' if len(self.cause.split()) > 2 else ''}", + f'{name} in tmute' + + f'\n{"Cause: " + self.cause.split(maxsplit=2)[2] + "" if len(self.cause.split()) > 2 else ""}', ) else: await self.message.edit( - f"{name} already in tmute", + f'{name} already in tmute', ) else: - await self.message.edit("user_id or username") + await self.message.edit('user_id or username') async def get_user_to_tmute(self): - user_type = await check_username_or_id(self.cause.split(" ")[1]) - if user_type == "channel": - return await self.client.get_chat(self.cause.split(" ")[1]) - if user_type == "user": - return await self.client.get_users(self.cause.split(" ")[1]) - await self.message.edit("Invalid user type") + user_type = await check_username_or_id(self.cause.split(' ')[1]) + if user_type == 'channel': + return await self.client.get_chat(self.cause.split(' ')[1]) + if user_type == 'user': + return await self.client.get_users(self.cause.split(' ')[1]) + await self.message.edit('Invalid user type') return None @@ -436,7 +395,7 @@ class TimeUnmuteHandler: self.message = message self.cause = text(message) self.chat_id = message.chat.id - self.tmuted_users = db.get("core.ats", f"c{self.chat_id}", []) + self.tmuted_users = db.get('core.ats', f'c{self.chat_id}', []) async def handle_tunmute(self): if self.message.reply_to_message: @@ -444,19 +403,19 @@ class TimeUnmuteHandler: elif not self.message.reply_to_message: await self.handle_non_reply_tunmute() else: - await self.message.edit("Unsupported") + await self.message.edit('Unsupported') async def handle_reply_tunmute(self): if self.message.chat.type not in [ChatType.PRIVATE, ChatType.CHANNEL]: user_for_tunmute, name = await get_user_and_name(self.message) if user_for_tunmute not in self.tmuted_users: - await self.message.edit(f"{name} not in tmute") + await self.message.edit(f'{name} not in tmute') else: self.tmuted_users.remove(user_for_tunmute) - db.set("core.ats", f"c{self.chat_id}", self.tmuted_users) + db.set('core.ats', f'c{self.chat_id}', self.tmuted_users) await self.message.edit( - f"{name} tunmuted" - + f"\n{'Cause: ' + self.cause.split(maxsplit=1)[1] + '' if len(self.cause.split()) > 1 else ''}", + f'{name} tunmuted' + + f'\n{"Cause: " + self.cause.split(maxsplit=1)[1] + "" if len(self.cause.split()) > 1 else ""}', ) async def handle_non_reply_tunmute(self): @@ -466,30 +425,30 @@ class TimeUnmuteHandler: if user_to_tunmute: name = ( user_to_tunmute.first_name - if getattr(user_to_tunmute, "first_name", None) + if getattr(user_to_tunmute, 'first_name', None) else user_to_tunmute.title ) if user_to_tunmute.id not in self.tmuted_users: await self.message.edit( - f"{name} not in tmute", + f'{name} not in tmute', ) else: self.tmuted_users.remove(user_to_tunmute.id) - db.set("core.ats", f"c{self.chat_id}", self.tmuted_users) + db.set('core.ats', f'c{self.chat_id}', self.tmuted_users) await self.message.edit( - f"{name} tunmuted" - + f"\n{'Cause: ' + self.cause.split(maxsplit=2)[2] + '' if len(self.cause.split()) > 2 else ''}", + f'{name} tunmuted' + + f'\n{"Cause: " + self.cause.split(maxsplit=2)[2] + "" if len(self.cause.split()) > 2 else ""}', ) else: - await self.message.edit("user_id or username") + await self.message.edit('user_id or username') async def get_user_to_tunmute(self): - user_type = await check_username_or_id(self.cause.split(" ")[1]) - if user_type == "channel": - return await self.client.get_chat(self.cause.split(" ")[1]) - if user_type == "user": - return await self.client.get_users(self.cause.split(" ")[1]) - await self.message.edit("Invalid user type") + user_type = await check_username_or_id(self.cause.split(' ')[1]) + if user_type == 'channel': + return await self.client.get_chat(self.cause.split(' ')[1]) + if user_type == 'user': + return await self.client.get_users(self.cause.split(' ')[1]) + await self.message.edit('Invalid user type') return None @@ -498,32 +457,32 @@ class TimeMuteUsersHandler: self.client = client self.message = message self.chat_id = message.chat.id - self.tmuted_users = db.get("core.ats", f"c{self.chat_id}", []) + self.tmuted_users = db.get('core.ats', f'c{self.chat_id}', []) async def list_tmuted_users(self): if self.message.chat.type not in [ChatType.PRIVATE, ChatType.CHANNEL]: - text = f"All users {self.message.chat.title} who are now in tmute\n\n" + text = f'All users {self.message.chat.title} who are now in tmute\n\n' count = 0 for user in self.tmuted_users: try: name = await self.get_user_name(user) if name: count += 1 - text += f"{count}. {name}\n" + text += f'{count}. {name}\n' except PeerIdInvalid: pass if count == 0: - await self.message.edit("No users in tmute") + await self.message.edit('No users in tmute') else: - text += f"\nTotal users in tmute {count}" + text += f'\nTotal users in tmute {count}' await self.message.edit(text) else: - await self.message.edit("Unsupported") + await self.message.edit('Unsupported') async def get_user_name(self, user_id): try: _name_ = await self.client.get_chat(user_id) - if await check_username_or_id(_name_.id) == "channel": + if await check_username_or_id(_name_.id) == 'channel': channel = await self.client.invoke( functions.channels.GetChannels( id=[ @@ -535,7 +494,7 @@ class TimeMuteUsersHandler: ) ) return channel.chats[0].title - if await check_username_or_id(_name_.id) == "user": + if await check_username_or_id(_name_.id) == 'user': user = await self.client.get_users(_name_.id) return user.first_name except PeerIdInvalid: @@ -556,7 +515,7 @@ class UnmuteHandler: elif not self.message.reply_to_message: await self.handle_non_reply_unmute() else: - await self.message.edit("Unsupported") + await self.message.edit('Unsupported') async def handle_reply_unmute(self): if self.message.chat.type not in [ChatType.PRIVATE, ChatType.CHANNEL]: @@ -565,17 +524,17 @@ class UnmuteHandler: try: await self.unmute_user(user_for_unmute.id) await self.message.edit( - f"{user_for_unmute.first_name} unmuted" - + f"\n{'Cause: ' + self.cause.split(' ', maxsplit=1)[1] + '' if len(self.cause.split()) > 1 else ''}" + f'{user_for_unmute.first_name} unmuted' + + f'\n{"Cause: " + self.cause.split(" ", maxsplit=1)[1] + "" if len(self.cause.split()) > 1 else ""}' ) except UserAdminInvalid: - await self.message.edit("No rights") + await self.message.edit('No rights') except ChatAdminRequired: - await self.message.edit("No rights") + await self.message.edit('No rights') except Exception as e: await self.message.edit(format_exc(e)) else: - await self.message.edit("Reply on user msg") + await self.message.edit('Reply on user msg') async def handle_non_reply_unmute(self): if self.message.chat.type not in [ChatType.PRIVATE, ChatType.CHANNEL]: @@ -585,27 +544,27 @@ class UnmuteHandler: try: await self.unmute_user(user_to_unmute.id) await self.message.edit( - f"{user_to_unmute.first_name} unmuted!" - + f"\n{'Cause: ' + self.cause.split(' ', maxsplit=2)[2] + '' if len(self.cause.split()) > 2 else ''}" + f'{user_to_unmute.first_name} unmuted!' + + f'\n{"Cause: " + self.cause.split(" ", maxsplit=2)[2] + "" if len(self.cause.split()) > 2 else ""}' ) except UserAdminInvalid: - await self.message.edit("No rights") + await self.message.edit('No rights') except ChatAdminRequired: - await self.message.edit("No rights") + await self.message.edit('No rights') except Exception as e: await self.message.edit(format_exc(e)) else: - await self.message.edit("User is not found") + await self.message.edit('User is not found') else: - await self.message.edit("user_id or username") + await self.message.edit('user_id or username') async def get_user_to_unmute(self): - user_type = await check_username_or_id(self.cause.split(" ")[1]) - if user_type == "channel": - return await self.client.get_chat(self.cause.split(" ")[1]) - if user_type == "user": - return await self.client.get_users(self.cause.split(" ")[1]) - await self.message.edit("Invalid user type") + user_type = await check_username_or_id(self.cause.split(' ')[1]) + if user_type == 'channel': + return await self.client.get_chat(self.cause.split(' ')[1]) + if user_type == 'user': + return await self.client.get_users(self.cause.split(' ')[1]) + await self.message.edit('Invalid user type') return None async def unmute_user(self, user_id): @@ -633,7 +592,7 @@ class MuteHandler: elif not self.message.reply_to_message: await self.handle_non_reply_mute() else: - await self.message.edit("Unsupported") + await self.message.edit('Unsupported') async def handle_reply_mute(self): if self.message.chat.type not in [ChatType.PRIVATE, ChatType.CHANNEL]: @@ -642,17 +601,15 @@ class MuteHandler: mute_seconds = self.calculate_mute_seconds() try: await self.mute_user(user_for_mute.id, mute_seconds) - await self.message.edit( - self.construct_mute_message(user_for_mute, mute_seconds) - ) + await self.message.edit(self.construct_mute_message(user_for_mute, mute_seconds)) except UserAdminInvalid: - await self.message.edit("No rights") + await self.message.edit('No rights') except ChatAdminRequired: - await self.message.edit("No rights") + await self.message.edit('No rights') except Exception as e: await self.message.edit(format_exc(e)) else: - await self.message.edit("Reply on user msg") + await self.message.edit('Reply on user msg') async def handle_non_reply_mute(self): if self.message.chat.type not in [ChatType.PRIVATE, ChatType.CHANNEL]: @@ -662,42 +619,40 @@ class MuteHandler: mute_seconds = self.calculate_mute_seconds() try: await self.mute_user(user_to_mute.id, mute_seconds) - await self.message.edit( - self.construct_mute_message(user_to_mute, mute_seconds) - ) + await self.message.edit(self.construct_mute_message(user_to_mute, mute_seconds)) except UserAdminInvalid: - await self.message.edit("No rights") + await self.message.edit('No rights') except ChatAdminRequired: - await self.message.edit("No rights") + await self.message.edit('No rights') except Exception as e: await self.message.edit(format_exc(e)) else: - await self.message.edit("User is not found") + await self.message.edit('User is not found') else: - await self.message.edit("user_id or username") + await self.message.edit('user_id or username') async def get_user_to_mute(self): - user_type = await check_username_or_id(self.cause.split(" ")[1]) - if user_type == "channel": - return await self.client.get_chat(self.cause.split(" ")[1]) - if user_type == "user": - return await self.client.get_users(self.cause.split(" ")[1]) - await self.message.edit("Invalid user type") + user_type = await check_username_or_id(self.cause.split(' ')[1]) + if user_type == 'channel': + return await self.client.get_chat(self.cause.split(' ')[1]) + if user_type == 'user': + return await self.client.get_users(self.cause.split(' ')[1]) + await self.message.edit('Invalid user type') return None def calculate_mute_seconds(self): mute_seconds: int = 0 - for character in "mhdw": - match = re.search(rf"(\d+|(\d+\.\d+)){character}", self.message.text) + for character in 'mhdw': + match = re.search(rf'(\d+|(\d+\.\d+)){character}', self.message.text) if match: value = float(match.string[match.start() : match.end() - 1]) - if character == "m": + if character == 'm': mute_seconds += int(value * 60) - if character == "h": + if character == 'h': mute_seconds += int(value * 3600) - if character == "d": + if character == 'd': mute_seconds += int(value * 86400) - if character == "w": + if character == 'w': mute_seconds += int(value * 604800) return mute_seconds @@ -720,19 +675,19 @@ class MuteHandler: await self.message.edit(format_exc(e)) def construct_mute_message(self, user, mute_seconds): - mute_time: Dict[str, int] = { - "days": mute_seconds // 86400, - "hours": mute_seconds % 86400 // 3600, - "minutes": mute_seconds % 86400 % 3600 // 60, + mute_time: dict[str, int] = { + 'days': mute_seconds // 86400, + 'hours': mute_seconds % 86400 // 3600, + 'minutes': mute_seconds % 86400 % 3600 // 60, } message_text = ( - f"{user.first_name} was muted for" - f" {((str(mute_time['days']) + ' day') if mute_time['days'] > 0 else '') + ('s' if mute_time['days'] > 1 else '')}" - f" {((str(mute_time['hours']) + ' hour') if mute_time['hours'] > 0 else '') + ('s' if mute_time['hours'] > 1 else '')}" - f" {((str(mute_time['minutes']) + ' minute') if mute_time['minutes'] > 0 else '') + ('s' if mute_time['minutes'] > 1 else '')}" - + f"\n{'Cause: ' + self.cause.split(' ', maxsplit=2)[2] + '' if len(self.cause.split()) > 2 else ''}" + f'{user.first_name} was muted for' + f' {((str(mute_time["days"]) + " day") if mute_time["days"] > 0 else "") + ("s" if mute_time["days"] > 1 else "")}' + f' {((str(mute_time["hours"]) + " hour") if mute_time["hours"] > 0 else "") + ("s" if mute_time["hours"] > 1 else "")}' + f' {((str(mute_time["minutes"]) + " minute") if mute_time["minutes"] > 0 else "") + ("s" if mute_time["minutes"] > 1 else "")}' + + f'\n{"Cause: " + self.cause.split(" ", maxsplit=2)[2] + "" if len(self.cause.split()) > 2 else ""}' ) - message_text = " ".join(message_text.split()) + message_text = ' '.join(message_text.split()) return message_text @@ -743,17 +698,17 @@ class DemoteHandler: self.cause = text(message) self.chat_id = message.chat.id self.common_privileges_demote = { - "is_anonymous": False, - "can_manage_chat": False, - "can_change_info": False, - "can_post_messages": False, - "can_edit_messages": False, - "can_delete_messages": False, - "can_manage_video_chats": False, - "can_restrict_members": False, - "can_invite_users": False, - "can_pin_messages": False, - "can_promote_members": False, + 'is_anonymous': False, + 'can_manage_chat': False, + 'can_change_info': False, + 'can_post_messages': False, + 'can_edit_messages': False, + 'can_delete_messages': False, + 'can_manage_video_chats': False, + 'can_restrict_members': False, + 'can_invite_users': False, + 'can_pin_messages': False, + 'can_promote_members': False, } async def handle_demote(self): @@ -762,7 +717,7 @@ class DemoteHandler: elif not self.message.reply_to_message: await self.handle_non_reply_demote() else: - await self.message.edit("Unsupported") + await self.message.edit('Unsupported') async def handle_reply_demote(self): if self.message.chat.type not in [ChatType.PRIVATE, ChatType.CHANNEL]: @@ -770,17 +725,15 @@ class DemoteHandler: if user_for_demote: try: await self.demote_user(user_for_demote.id) - await self.message.edit( - self.construct_demote_message(user_for_demote) - ) + await self.message.edit(self.construct_demote_message(user_for_demote)) except UserAdminInvalid: - await self.message.edit("No rights") + await self.message.edit('No rights') except ChatAdminRequired: - await self.message.edit("No rights") + await self.message.edit('No rights') except Exception as e: await self.message.edit(format_exc(e)) else: - await self.message.edit("Reply on user msg") + await self.message.edit('Reply on user msg') async def handle_non_reply_demote(self): if self.message.chat.type not in [ChatType.PRIVATE, ChatType.CHANNEL]: @@ -789,27 +742,25 @@ class DemoteHandler: if user_to_demote: try: await self.demote_user(user_to_demote.id) - await self.message.edit( - self.construct_demote_message(user_to_demote) - ) + await self.message.edit(self.construct_demote_message(user_to_demote)) except UserAdminInvalid: - await self.message.edit("No rights") + await self.message.edit('No rights') except ChatAdminRequired: - await self.message.edit("No rights") + await self.message.edit('No rights') except Exception as e: await self.message.edit(format_exc(e)) else: - await self.message.edit("User is not found") + await self.message.edit('User is not found') else: - await self.message.edit("user_id or username not provided!") + await self.message.edit('user_id or username not provided!') async def get_user_to_demote(self): - user_type = await check_username_or_id(self.cause.split(" ")[1]) - if user_type == "channel": - return await self.client.get_chat(self.cause.split(" ")[1]) - if user_type == "user": - return await self.client.get_users(self.cause.split(" ")[1]) - await self.message.edit("Invalid user type") + user_type = await check_username_or_id(self.cause.split(' ')[1]) + if user_type == 'channel': + return await self.client.get_chat(self.cause.split(' ')[1]) + if user_type == 'user': + return await self.client.get_users(self.cause.split(' ')[1]) + await self.message.edit('Invalid user type') return None async def demote_user(self, user_id): @@ -828,8 +779,8 @@ class DemoteHandler: def construct_demote_message(self, user): return ( - f"{user.first_name} demoted!" - + f"\n{'Cause: ' + self.cause.split(' ', maxsplit=2)[2] + '' if len(self.cause.split()) > 2 else ''}" + f'{user.first_name} demoted!' + + f'\n{"Cause: " + self.cause.split(" ", maxsplit=2)[2] + "" if len(self.cause.split()) > 2 else ""}' ) @@ -840,10 +791,10 @@ class PromoteHandler: self.cause = text(message) self.chat_id = message.chat.id self.common_privileges_promote = { - "can_delete_messages": True, - "can_restrict_members": True, - "can_invite_users": True, - "can_pin_messages": True, + 'can_delete_messages': True, + 'can_restrict_members': True, + 'can_invite_users': True, + 'can_pin_messages': True, } async def handle_promote(self): @@ -852,68 +803,56 @@ class PromoteHandler: elif not self.message.reply_to_message: await self.handle_non_reply_promote() else: - await self.message.edit("Unsupported") + await self.message.edit('Unsupported') async def handle_reply_promote(self): if self.message.chat.type not in [ChatType.PRIVATE, ChatType.CHANNEL]: user_for_promote = self.message.reply_to_message.from_user - promote_title = ( - self.message.text.split(maxsplit=1)[1] - if len(self.message.text.split()) > 1 - else None - ) + promote_title = self.message.text.split(maxsplit=1)[1] if len(self.message.text.split()) > 1 else None if promote_title and len(promote_title) > 16: promote_title = promote_title[:16] if user_for_promote: try: await self.promote_user(user_for_promote.id, promote_title) - await self.message.edit( - self.construct_promote_message(user_for_promote) - ) + await self.message.edit(self.construct_promote_message(user_for_promote)) except UserAdminInvalid: - await self.message.edit("No rights") + await self.message.edit('No rights') except ChatAdminRequired: - await self.message.edit("No rights") + await self.message.edit('No rights') except Exception as e: await self.message.edit(format_exc(e)) else: - await self.message.edit("Reply on user msg") + await self.message.edit('Reply on user msg') async def handle_non_reply_promote(self): if self.message.chat.type not in [ChatType.PRIVATE, ChatType.CHANNEL]: if len(self.cause.split()) > 1: user_to_promote = await self.get_user_to_promote() - promote_title = ( - " ".join(self.cause.split(" ")[2:]) - if len(self.cause.split(" ")) > 2 - else None - ) + promote_title = ' '.join(self.cause.split(' ')[2:]) if len(self.cause.split(' ')) > 2 else None if promote_title and len(promote_title) > 16: promote_title = promote_title[:16] if user_to_promote: try: await self.promote_user(user_to_promote.id, promote_title) - await self.message.edit( - self.construct_promote_message(user_to_promote) - ) + await self.message.edit(self.construct_promote_message(user_to_promote)) except UserAdminInvalid: - await self.message.edit("No rights") + await self.message.edit('No rights') except ChatAdminRequired: - await self.message.edit("No rights") + await self.message.edit('No rights') except Exception as e: await self.message.edit(format_exc(e)) else: - await self.message.edit("User is not found") + await self.message.edit('User is not found') else: - await self.message.edit("user_id or username not provided!") + await self.message.edit('user_id or username not provided!') async def get_user_to_promote(self): - user_type = await check_username_or_id(self.cause.split(" ")[1]) - if user_type == "channel": - return await self.client.get_chat(self.cause.split(" ")[1]) - if user_type == "user": - return await self.client.get_users(self.cause.split(" ")[1]) - await self.message.edit("Invalid user type") + user_type = await check_username_or_id(self.cause.split(' ')[1]) + if user_type == 'channel': + return await self.client.get_chat(self.cause.split(' ')[1]) + if user_type == 'user': + return await self.client.get_users(self.cause.split(' ')[1]) + await self.message.edit('Invalid user type') return None async def promote_user(self, user_id, title): @@ -924,7 +863,7 @@ class PromoteHandler: privileges=ChatPrivileges(**self.common_privileges_promote), title=title, ) - if len(self.cause.split()) > 1 and self.message.chat.type == "group": + if len(self.cause.split()) > 1 and self.message.chat.type == 'group': await self.client.set_administrator_title( self.chat_id, user_id, @@ -939,8 +878,8 @@ class PromoteHandler: def construct_promote_message(self, user): return ( - f"{user.first_name} promoted!" - + f"\n{'Title: ' + self.cause.split(' ', maxsplit=1)[1] + '' if len(self.cause.split()) > 1 else ''}" + f'{user.first_name} promoted!' + + f'\n{"Title: " + self.cause.split(" ", maxsplit=1)[1] + "" if len(self.cause.split()) > 1 else ""}' ) @@ -953,42 +892,40 @@ class AntiChannelsHandler: async def handle_anti_channels(self): if self.message.chat.type not in [ChatType.GROUP, ChatType.SUPERGROUP]: - await self.message.edit("Not supported in non-group chats") + await self.message.edit('Not supported in non-group chats') return command = self.message.command if len(command) == 1: await self.toggle_anti_channels_status() - elif command[1] in ["enable", "on", "1", "yes", "true"]: + elif command[1] in ['enable', 'on', '1', 'yes', 'true']: await self.enable_anti_channels() - elif command[1] in ["disable", "off", "0", "no", "false"]: + elif command[1] in ['disable', 'off', '0', 'no', 'false']: await self.disable_anti_channels() else: - await self.message.edit( - f"Usage: {self.prefix}antich [enable|disable]" - ) + await self.message.edit(f'Usage: {self.prefix}antich [enable|disable]') async def toggle_anti_channels_status(self): - current_status = db.get("core.ats", f"antich{self.chat_id}", False) + current_status = db.get('core.ats', f'antich{self.chat_id}', False) new_status = not current_status - db.set("core.ats", f"antich{self.chat_id}", new_status) + db.set('core.ats', f'antich{self.chat_id}', new_status) if new_status: - await self.message.edit("Blocking channels in this chat enabled.") + await self.message.edit('Blocking channels in this chat enabled.') else: - await self.message.edit("Blocking channels in this chat disabled.") + await self.message.edit('Blocking channels in this chat disabled.') async def enable_anti_channels(self): - db.set("core.ats", f"antich{self.chat_id}", True) + db.set('core.ats', f'antich{self.chat_id}', True) group = await self.client.get_chat(self.chat_id) if group.linked_chat: - db.set("core.ats", f"linked{self.chat_id}", group.linked_chat.id) + db.set('core.ats', f'linked{self.chat_id}', group.linked_chat.id) else: - db.set("core.ats", f"linked{self.chat_id}", 0) - await self.message.edit("Blocking channels in this chat enabled.") + db.set('core.ats', f'linked{self.chat_id}', 0) + await self.message.edit('Blocking channels in this chat enabled.') async def disable_anti_channels(self): - db.set("core.ats", f"antich{self.chat_id}", False) - await self.message.edit("Blocking channels in this chat disabled.") + db.set('core.ats', f'antich{self.chat_id}', False) + await self.message.edit('Blocking channels in this chat disabled.') class DeleteHistoryHandler: @@ -1006,7 +943,7 @@ class DeleteHistoryHandler: elif not self.message.reply_to_message: await self.handle_non_reply_delete_history() else: - await self.message.edit("Unsupported") + await self.message.edit('Unsupported') async def handle_reply_delete_history(self): if self.message.reply_to_message.from_user: @@ -1014,13 +951,13 @@ class DeleteHistoryHandler: user_for_delete, name = await get_user_and_name(self.message) await self.delete_user_history(user_for_delete, name) except UserAdminInvalid: - await self.message.edit("No rights") + await self.message.edit('No rights') except ChatAdminRequired: - await self.message.edit("No rights") + await self.message.edit('No rights') except Exception as e: await self.message.edit(format_exc(e)) else: - await self.message.edit("Reply on user msg") + await self.message.edit('Reply on user msg') async def handle_non_reply_delete_history(self): if len(self.cause.split()) > 1: @@ -1029,47 +966,43 @@ class DeleteHistoryHandler: if user_to_delete: name = ( user_to_delete.first_name - if getattr(user_to_delete, "first_name", None) + if getattr(user_to_delete, 'first_name', None) else user_to_delete.title ) await self.delete_user_history(user_to_delete.id, name) else: - await self.message.edit("User is not found") + await self.message.edit('User is not found') except PeerIdInvalid: - await self.message.edit("User is not found") + await self.message.edit('User is not found') except UsernameInvalid: - await self.message.edit("User is not found") + await self.message.edit('User is not found') except IndexError: - await self.message.edit("User is not found") + await self.message.edit('User is not found') else: - await self.message.edit("user_id or username") + await self.message.edit('user_id or username') async def get_user_to_delete(self): - user_type = await check_username_or_id(self.cause.split(" ")[1]) - if user_type == "channel": - return await self.client.get_chat(self.cause.split(" ")[1]) - if user_type == "user": - return await self.client.get_users(self.cause.split(" ")[1]) - await self.message.edit("Invalid user type") + user_type = await check_username_or_id(self.cause.split(' ')[1]) + if user_type == 'channel': + return await self.client.get_chat(self.cause.split(' ')[1]) + if user_type == 'user': + return await self.client.get_users(self.cause.split(' ')[1]) + await self.message.edit('Invalid user type') return None async def delete_user_history(self, user_id, name): try: channel = await self.client.resolve_peer(self.chat_id) user_id = await self.client.resolve_peer(user_id) - await self.client.invoke( - functions.channels.DeleteParticipantHistory( - channel=channel, participant=user_id - ) - ) + await self.client.invoke(functions.channels.DeleteParticipantHistory(channel=channel, participant=user_id)) await self.message.edit( - f"History from {name} was deleted!" - + f"\n{'Cause: ' + self.cause.split(' ', maxsplit=1)[1] + '' if len(self.cause.split()) > 1 else ''}" + f'History from {name} was deleted!' + + f'\n{"Cause: " + self.cause.split(" ", maxsplit=1)[1] + "" if len(self.cause.split()) > 1 else ""}' ) except UserAdminInvalid: - await self.message.edit("No rights") + await self.message.edit('No rights') except ChatAdminRequired: - await self.message.edit("No rights") + await self.message.edit('No rights') except Exception as e: await self.message.edit(format_exc(e)) @@ -1084,45 +1017,41 @@ class AntiRaidHandler: async def handle_antiraid(self): command = self.message.command if len(command) > 1: - if command[1] == "on": + if command[1] == 'on': await self.enable_antiraid() - elif command[1] == "off": + elif command[1] == 'off': await self.disable_antiraid() else: await self.toggle_antiraid() async def enable_antiraid(self): - db.set("core.ats", f"antiraid{self.chat_id}", True) + db.set('core.ats', f'antiraid{self.chat_id}', True) group = await self.client.get_chat(self.chat_id) if group.linked_chat: - db.set("core.ats", f"linked{self.chat_id}", group.linked_chat.id) + db.set('core.ats', f'linked{self.chat_id}', group.linked_chat.id) else: - db.set("core.ats", f"linked{self.chat_id}", 0) - await self.message.edit( - "Anti-raid mode enabled!\n" - f"Disable with: {self.prefix}antiraid off" - ) + db.set('core.ats', f'linked{self.chat_id}', 0) + await self.message.edit(f'Anti-raid mode enabled!\nDisable with: {self.prefix}antiraid off') async def disable_antiraid(self): - db.set("core.ats", f"antiraid{self.chat_id}", False) - await self.message.edit("Anti-raid mode disabled") + db.set('core.ats', f'antiraid{self.chat_id}', False) + await self.message.edit('Anti-raid mode disabled') async def toggle_antiraid(self): - current_status = db.get("core.ats", f"antiraid{self.chat_id}", False) + current_status = db.get('core.ats', f'antiraid{self.chat_id}', False) new_status = not current_status - db.set("core.ats", f"antiraid{self.chat_id}", new_status) + db.set('core.ats', f'antiraid{self.chat_id}', new_status) if new_status: group = await self.client.get_chat(self.chat_id) if group.linked_chat: - db.set("core.ats", f"linked{self.chat_id}", group.linked_chat.id) + db.set('core.ats', f'linked{self.chat_id}', group.linked_chat.id) else: - db.set("core.ats", f"linked{self.chat_id}", 0) + db.set('core.ats', f'linked{self.chat_id}', 0) await self.message.edit( - "Anti-raid mode enabled!\n" - f"Disable with: {self.prefix}antiraid off" + f'Anti-raid mode enabled!\nDisable with: {self.prefix}antiraid off' ) else: - await self.message.edit("Anti-raid mode disabled") + await self.message.edit('Anti-raid mode disabled') class NoteSendHandler: @@ -1134,28 +1063,28 @@ class NoteSendHandler: async def handle_note_send(self): if len(self.message.text.split()) >= 2: - await self.message.edit("Loading...") + await self.message.edit('Loading...') note_name = self.message.text.split(maxsplit=1)[1] - find_note = db.get("core.notes", f"note{note_name}", False) + find_note = db.get('core.notes', f'note{note_name}', False) if find_note: try: await self.send_note(find_note) except RPCError: await self.message.edit( - "Sorry, but this note is unavailable.\n\n" - f"You can delete this note with " - f"{self.prefix}clear {note_name}" + 'Sorry, but this note is unavailable.\n\n' + f'You can delete this note with ' + f'{self.prefix}clear {note_name}' ) else: - await self.message.edit("There is no such note") + await self.message.edit('There is no such note') else: await self.message.edit( - f"Example: {self.prefix}note note_name", + f'Example: {self.prefix}note note_name', ) async def send_note(self, find_note): - if find_note.get("MEDIA_GROUP"): + if find_note.get('MEDIA_GROUP'): await self.message.delete() await self.send_media_group(find_note) else: @@ -1163,9 +1092,7 @@ class NoteSendHandler: await self.copy_message(find_note) async def send_media_group(self, find_note): - messages_grouped = await self.client.get_media_group( - int(find_note["CHAT_ID"]), int(find_note["MESSAGE_ID"]) - ) + messages_grouped = await self.client.get_media_group(int(find_note['CHAT_ID']), int(find_note['MESSAGE_ID'])) media_grouped_list = self.prepare_media_group(messages_grouped) if self.message.reply_to_message: await self.client.send_media_group( @@ -1180,15 +1107,15 @@ class NoteSendHandler: if self.message.reply_to_message: await self.client.copy_message( self.message.chat.id, - int(find_note["CHAT_ID"]), - int(find_note["MESSAGE_ID"]), + int(find_note['CHAT_ID']), + int(find_note['MESSAGE_ID']), reply_to_message_id=self.message.reply_to_message.id, ) else: await self.client.copy_message( self.message.chat.id, - int(find_note["CHAT_ID"]), - int(find_note["MESSAGE_ID"]), + int(find_note['CHAT_ID']), + int(find_note['MESSAGE_ID']), ) def prepare_media_group(self, messages_grouped): @@ -1221,9 +1148,7 @@ class NoteSendHandler: ) return InputMediaVideo(message.video.file_id, message.caption.markdown) if message.video.thumbs: - return InputMediaVideo( - message.video.file_id, message.video.thumbs[0].file_id - ) + return InputMediaVideo(message.video.file_id, message.video.thumbs[0].file_id) return InputMediaVideo(message.video.file_id) @staticmethod @@ -1241,11 +1166,7 @@ class NoteSendHandler: message.document.thumbs[0].file_id, message.caption.markdown, ) - return InputMediaDocument( - message.document.file_id, message.caption.markdown - ) + return InputMediaDocument(message.document.file_id, message.caption.markdown) if message.document.thumbs: - return InputMediaDocument( - message.document.file_id, message.document.thumbs[0].file_id - ) + return InputMediaDocument(message.document.file_id, message.document.thumbs[0].file_id) return InputMediaDocument(message.document.file_id) diff --git a/userbot/utils/misc.py b/userbot/utils/misc.py index 4b86d03..9d346cb 100644 --- a/userbot/utils/misc.py +++ b/userbot/utils/misc.py @@ -1,31 +1,33 @@ from sys import version_info -from .db import db + import git +from .db import db + __all__ = [ - "modules_help", - "requirements_list", - "python_version", - "prefix", - "gitrepo", - "userbot_version", + 'modules_help', + 'requirements_list', + 'python_version', + 'prefix', + 'gitrepo', + 'userbot_version', ] modules_help = {} requirements_list = [] -python_version = f"{version_info[0]}.{version_info[1]}.{version_info[2]}" +python_version = f'{version_info[0]}.{version_info[1]}.{version_info[2]}' -prefix = db.get("core.main", "prefix", ".") +prefix = db.get('core.main', 'prefix', '.') try: - gitrepo = git.Repo(".") + gitrepo = git.Repo('.') except (git.exc.InvalidGitRepositoryError, git.exc.NoSuchPathError): gitrepo = None if gitrepo is not None and len(gitrepo.tags) > 0: - commits_since_tag = list(gitrepo.iter_commits(f"{gitrepo.tags[-1].name}..HEAD")) - userbot_version = f"2.5.{len(commits_since_tag)}" + commits_since_tag = list(gitrepo.iter_commits(f'{gitrepo.tags[-1].name}..HEAD')) + userbot_version = f'2.5.{len(commits_since_tag)}' else: - userbot_version = "2.5.0" + userbot_version = '2.5.0' diff --git a/userbot/utils/module.py b/userbot/utils/module.py index 2b4cba6..515c064 100644 --- a/userbot/utils/module.py +++ b/userbot/utils/module.py @@ -4,12 +4,12 @@ from typing import Optional from pyrogram import Client -from utils.scripts import load_module from utils.misc import modules_help +from utils.scripts import load_module class ModuleManager: - _instance: Optional["ModuleManager"] = None + _instance: Optional['ModuleManager'] = None def __init__(self): self.success_modules = 0 @@ -17,27 +17,25 @@ class ModuleManager: self.help_navigator = None @classmethod - def get_instance(cls) -> "ModuleManager": + def get_instance(cls) -> 'ModuleManager': if cls._instance is None: cls._instance = ModuleManager() return cls._instance async def load_modules(self, app: Client): """Load all modules and initialize help navigator""" - for path in Path("modules").rglob("*.py"): + for path in Path('modules').rglob('*.py'): try: - await load_module( - path.stem, app, core="custom_modules" not in path.parent.parts - ) + await load_module(path.stem, app, core='custom_modules' not in path.parent.parts) except Exception: logging.warning("Can't import module %s", path.stem, exc_info=True) self.failed_modules += 1 else: self.success_modules += 1 - logging.info("Imported %d modules", self.success_modules) + logging.info('Imported %d modules', self.success_modules) if self.failed_modules: - logging.warning("Failed to import %d modules", self.failed_modules) + logging.warning('Failed to import %d modules', self.failed_modules) self.help_navigator = HelpNavigator() return self.help_navigator @@ -48,7 +46,7 @@ class HelpNavigator: self.current_page = 1 self.module_list = list(modules_help.keys()) self.total_pages = (len(modules_help) + 9) // 10 - logging.info("Initialized HelpNavigator with %d modules", len(self.module_list)) + logging.info('Initialized HelpNavigator with %d modules', len(self.module_list)) async def send_page(self, message): from utils.misc import prefix @@ -56,13 +54,13 @@ class HelpNavigator: start_index = (self.current_page - 1) * 10 end_index = start_index + 10 page_modules = self.module_list[start_index:end_index] - text = "Help\n" - text += f"For more help on how to use a command, type {prefix}help [module]\n\n" - text += f"Help Page No: {self.current_page}/{self.total_pages}\n\n" + text = 'Help\n' + text += f'For more help on how to use a command, type {prefix}help [module]\n\n' + text += f'Help Page No: {self.current_page}/{self.total_pages}\n\n' for module_name in page_modules: commands = modules_help[module_name] - text += f"• {module_name.title()}: {', '.join([f'{prefix + cmd_name.split()[0]}' for cmd_name in commands.keys()])}\n" - text += f"\nThe number of modules in the userbot: {len(modules_help)}" + text += f'• {module_name.title()}: {", ".join([f"{prefix + cmd_name.split()[0]}" for cmd_name in commands.keys()])}\n' + text += f'\nThe number of modules in the userbot: {len(modules_help)}' await message.edit(text, disable_web_page_preview=True) def next_page(self) -> bool: diff --git a/userbot/utils/rentry.py b/userbot/utils/rentry.py index dd6d7ad..cda0fc3 100644 --- a/userbot/utils/rentry.py +++ b/userbot/utils/rentry.py @@ -5,18 +5,17 @@ import asyncio import http.cookiejar import urllib.parse import urllib.request - -from uuid import uuid4 from datetime import datetime, timedelta from http.cookies import SimpleCookie from json import loads as json_loads +from uuid import uuid4 from utils.db import db -BASE_PROTOCOL = "https://" -BASE_URL = "rentry.co" +BASE_PROTOCOL = 'https://' +BASE_URL = 'rentry.co' -_headers = {"Referer": f"{BASE_PROTOCOL}{BASE_URL}"} +_headers = {'Referer': f'{BASE_PROTOCOL}{BASE_URL}'} class UrllibClient: @@ -24,9 +23,7 @@ class UrllibClient: def __init__(self): self.cookie_jar = http.cookiejar.CookieJar() - self.opener = urllib.request.build_opener( - urllib.request.HTTPCookieProcessor(self.cookie_jar) - ) + self.opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(self.cookie_jar)) urllib.request.install_opener(self.opener) def get(self, url, headers=None): @@ -45,58 +42,50 @@ class UrllibClient: def _request(self, request): response = self.opener.open(request) response.status_code = response.getcode() - response.data = response.read().decode("utf-8") + response.data = response.read().decode('utf-8') return response def raw(url: str): client = UrllibClient() - return json_loads(client.get(f"{BASE_PROTOCOL}{BASE_URL}/api/raw/{url}").data) + return json_loads(client.get(f'{BASE_PROTOCOL}{BASE_URL}/api/raw/{url}').data) -def new(text: str, edit_code: str = "", url: str = ""): +def new(text: str, edit_code: str = '', url: str = ''): client, cookie = UrllibClient(), SimpleCookie() - cookie.load(vars(client.get(f"{BASE_PROTOCOL}{BASE_URL}"))["headers"]["Set-Cookie"]) - csrftoken = cookie["csrftoken"].value + cookie.load(vars(client.get(f'{BASE_PROTOCOL}{BASE_URL}'))['headers']['Set-Cookie']) + csrftoken = cookie['csrftoken'].value payload = { - "csrfmiddlewaretoken": csrftoken, - "url": url, - "edit_code": edit_code, - "text": text, + 'csrfmiddlewaretoken': csrftoken, + 'url': url, + 'edit_code': edit_code, + 'text': text, } - return json_loads( - client.post( - f"{BASE_PROTOCOL}{BASE_URL}" + "/api/new", payload, headers=_headers - ).data - ) + return json_loads(client.post(f'{BASE_PROTOCOL}{BASE_URL}' + '/api/new', payload, headers=_headers).data) def edit(url_short: str, edit_code: str, text: str): client, cookie = UrllibClient(), SimpleCookie() - cookie.load(vars(client.get(f"{BASE_PROTOCOL}{BASE_URL}"))["headers"]["Set-Cookie"]) - csrftoken = cookie["csrftoken"].value + cookie.load(vars(client.get(f'{BASE_PROTOCOL}{BASE_URL}'))['headers']['Set-Cookie']) + csrftoken = cookie['csrftoken'].value - payload = {"csrfmiddlewaretoken": csrftoken, "edit_code": edit_code, "text": text} + payload = {'csrfmiddlewaretoken': csrftoken, 'edit_code': edit_code, 'text': text} - return json_loads( - client.post( - f"{BASE_PROTOCOL}{BASE_URL}/api/edit/{url_short}", payload, headers=_headers - ).data - ) + return json_loads(client.post(f'{BASE_PROTOCOL}{BASE_URL}/api/edit/{url_short}', payload, headers=_headers).data) def delete(url_short: str, edit_code: str): client, cookie = UrllibClient(), SimpleCookie() - cookie.load(vars(client.get(f"{BASE_PROTOCOL}{BASE_URL}"))["headers"]["Set-Cookie"]) - csrftoken = cookie["csrftoken"].value - payload = {"csrfmiddlewaretoken": csrftoken, "edit_code": edit_code} + cookie.load(vars(client.get(f'{BASE_PROTOCOL}{BASE_URL}'))['headers']['Set-Cookie']) + csrftoken = cookie['csrftoken'].value + payload = {'csrfmiddlewaretoken': csrftoken, 'edit_code': edit_code} return json_loads( client.post( - f"{BASE_PROTOCOL}{BASE_URL}/api/delete/{url_short}", + f'{BASE_PROTOCOL}{BASE_URL}/api/delete/{url_short}', payload, headers=_headers, ).data @@ -128,35 +117,35 @@ async def paste( if edit_bin: if not (url and edit_code): - raise ValueError("Please provide both, url and edit code") + raise ValueError('Please provide both, url and edit code') response = edit(url_short=url, edit_code=edit_code, text=text) else: response = new(text=text) - if response.get("status") != "200": + if response.get('status') != '200': raise RuntimeError( - f"paste task terminated with status: {response.get('status')}\n" - f"Message: {response.get('content', 'No message provided')}" + f'paste task terminated with status: {response.get("status")}\n' + f'Message: {response.get("content", "No message provided")}' ) - url = response["url"] - edit_code = response["edit_code"] + url = response['url'] + edit_code = response['edit_code'] if not permanent: - short_url = response["url_short"] + short_url = response['url_short'] time_now = datetime.now() - ftime = time_now.strftime("%d %I:%M:%S %p %Y") + ftime = time_now.strftime('%d %I:%M:%S %p %Y') - print(f"URL: {url} - Edit Code: {edit_code} - Time: {ftime}") + print(f'URL: {url} - Edit Code: {edit_code} - Time: {ftime}') - rallUrls = db.get("core.rentry", "urls", default={"allUrls": {}}) + rallUrls = db.get('core.rentry', 'urls', default={'allUrls': {}}) entry_id = str(uuid4()) - rallUrls["allUrls"][entry_id] = { - "url": short_url, - "edit_code": edit_code, - "time": ftime, + rallUrls['allUrls'][entry_id] = { + 'url': short_url, + 'edit_code': edit_code, + 'time': ftime, } - db.set("core.rentry", "urls", rallUrls) + db.set('core.rentry', 'urls', rallUrls) if return_edit: return (url, edit_code) @@ -167,34 +156,32 @@ async def rentry_cleanup_job(): """Periodically checks and deletes rentry pastes older than 24 hours""" while True: try: - rallUrls = db.get("core.rentry", "urls", default={"allUrls": {}}) + rallUrls = db.get('core.rentry', 'urls', default={'allUrls': {}}) now = datetime.now() deleted_count = 0 error_count = 0 - for entry_id, entry in list(rallUrls["allUrls"].items()): - url = entry["url"] - entry_time = datetime.strptime(entry["time"], "%d %I:%M:%S %p %Y") + for entry_id, entry in list(rallUrls['allUrls'].items()): + url = entry['url'] + entry_time = datetime.strptime(entry['time'], '%d %I:%M:%S %p %Y') if now - entry_time > timedelta(days=1): try: - delete(url, entry["edit_code"]) - del rallUrls["allUrls"][entry_id] + delete(url, entry['edit_code']) + del rallUrls['allUrls'][entry_id] deleted_count += 1 - print(f"[#] Deleted expired rentry paste: {url}") + print(f'[#] Deleted expired rentry paste: {url}') except Exception as e: error_count += 1 - print(f"[!] Failed to delete rentry paste {url}: {str(e)}") + print(f'[!] Failed to delete rentry paste {url}: {str(e)}') if deleted_count or error_count: - print( - f"[*] Cleanup summary: {deleted_count} deleted, {error_count} failed" - ) + print(f'[*] Cleanup summary: {deleted_count} deleted, {error_count} failed') if deleted_count: - db.set("core.rentry", "urls", rallUrls) + db.set('core.rentry', 'urls', rallUrls) except Exception as e: - print(f"[!] Error in rentry cleanup job: {str(e)}") + print(f'[!] Error in rentry cleanup job: {str(e)}') await asyncio.sleep(12 * 60 * 60) diff --git a/userbot/utils/scripts.py b/userbot/utils/scripts.py index cb9604e..88fea6e 100644 --- a/userbot/utils/scripts.py +++ b/userbot/utils/scripts.py @@ -25,22 +25,20 @@ import sys import tempfile import time import traceback -from PIL import Image from io import BytesIO from types import ModuleType -from typing import Dict, Tuple import psutil +from PIL import Image from pyrogram import Client, errors, filters from pyrogram.errors import FloodWait, MessageNotModified, UserNotParticipant from pyrogram.types import Message -from pyrogram.enums import ChatMembersFilter from utils.db import db from .misc import modules_help, prefix, requirements_list -META_COMMENTS = re.compile(r"^ *# *meta +(\S+) *: *(.*?)\s*$", re.MULTILINE) +META_COMMENTS = re.compile(r'^ *# *meta +(\S+) *: *(.*?)\s*$', re.MULTILINE) interact_with_to_delete = [] @@ -51,11 +49,11 @@ def time_formatter(milliseconds: int) -> str: hours, minutes = divmod(minutes, 60) days, hours = divmod(hours, 24) tmp = ( - ((str(days) + " day(s), ") if days else "") - + ((str(hours) + " hour(s), ") if hours else "") - + ((str(minutes) + " minute(s), ") if minutes else "") - + ((str(seconds) + " second(s), ") if seconds else "") - + ((str(milliseconds) + " millisecond(s), ") if milliseconds else "") + ((str(days) + ' day(s), ') if days else '') + + ((str(hours) + ' hour(s), ') if hours else '') + + ((str(minutes) + ' minute(s), ') if minutes else '') + + ((str(seconds) + ' second(s), ') if seconds else '') + + ((str(milliseconds) + ' millisecond(s), ') if milliseconds else '') ) return tmp[:-2] @@ -63,32 +61,30 @@ def time_formatter(milliseconds: int) -> str: def humanbytes(size): """Convert Bytes To Bytes So That Human Can Read It""" if not size: - return "" + return '' power = 2**10 raised_to_pow = 0 - dict_power_n = {0: "", 1: "Ki", 2: "Mi", 3: "Gi", 4: "Ti"} + dict_power_n = {0: '', 1: 'Ki', 2: 'Mi', 3: 'Gi', 4: 'Ti'} while size > power: size /= power raised_to_pow += 1 - return str(round(size, 2)) + " " + dict_power_n[raised_to_pow] + "B" + return str(round(size, 2)) + ' ' + dict_power_n[raised_to_pow] + 'B' async def edit_or_send_as_file( tex: str, message: Message, client: Client, - caption: str = "Result!", - file_name: str = "result", + caption: str = 'Result!', + file_name: str = 'result', ): """Send As File If Len Of Text Exceeds Tg Limit Else Edit Message""" if not tex: - await message.edit("Wait, What?") + await message.edit('Wait, What?') return if len(tex) > 1024: - await message.edit("OutPut is Too Large, Sending As File!") - with tempfile.NamedTemporaryFile( - "w", delete=False, suffix=".txt", prefix=f"{file_name}_" - ) as fn: + await message.edit('OutPut is Too Large, Sending As File!') + with tempfile.NamedTemporaryFile('w', delete=False, suffix='.txt', prefix=f'{file_name}_') as fn: fn.write(tex) temp_path = fn.name try: @@ -106,7 +102,7 @@ def get_text(message: Message) -> None | str: text_to_return = message.text if message.text is None: return None - if " " in text_to_return: + if ' ' in text_to_return: try: return message.text.split(None, 1)[1] except IndexError: @@ -127,32 +123,28 @@ async def progress(current, total, message, start, type_of_ps, file_name=None): return time_to_completion = round((total - current) / speed) * 1000 estimated_total_time = elapsed_time + time_to_completion - progress_str = f"{''.join(['▰' for i in range(math.floor(percentage / 10))])}" - progress_str += ( - f"{''.join(['▱' for i in range(10 - math.floor(percentage / 10))])}" - ) - progress_str += f"{round(percentage, 2)}%\n" - tmp = f"{progress_str}{humanbytes(current)} of {humanbytes(total)}\n" - tmp += f"ETA: {time_formatter(estimated_total_time)}" + progress_str = f'{"".join(["▰" for i in range(math.floor(percentage / 10))])}' + progress_str += f'{"".join(["▱" for i in range(10 - math.floor(percentage / 10))])}' + progress_str += f'{round(percentage, 2)}%\n' + tmp = f'{progress_str}{humanbytes(current)} of {humanbytes(total)}\n' + tmp += f'ETA: {time_formatter(estimated_total_time)}' if file_name: try: - await message.edit( - f"{type_of_ps}\nFile Name: {file_name}\n{tmp}" - ) + await message.edit(f'{type_of_ps}\nFile Name: {file_name}\n{tmp}') except FloodWait as e: await asyncio.sleep(e.x) except MessageNotModified: pass else: try: - await message.edit(f"{type_of_ps}\n{tmp}") + await message.edit(f'{type_of_ps}\n{tmp}') except FloodWait as e: await asyncio.sleep(e.x) except MessageNotModified: pass -async def run_cmd(prefix: str) -> Tuple[str, str, int, int]: +async def run_cmd(prefix: str) -> tuple[str, str, int, int]: """Run Commands""" args = shlex.split(prefix) process = await asyncio.create_subprocess_exec( @@ -160,45 +152,45 @@ async def run_cmd(prefix: str) -> Tuple[str, str, int, int]: ) stdout, stderr = await process.communicate() return ( - stdout.decode("utf-8", "replace").strip(), - stderr.decode("utf-8", "replace").strip(), + stdout.decode('utf-8', 'replace').strip(), + stderr.decode('utf-8', 'replace').strip(), process.returncode, process.pid, ) def mediainfo(media): - xx = str((str(media)).split("(", maxsplit=1)[0]) - m = "" - if xx == "MessageMediaDocument": + xx = str((str(media)).split('(', maxsplit=1)[0]) + m = '' + if xx == 'MessageMediaDocument': mim = media.document.mime_type - if mim == "application/x-tgsticker": - m = "sticker animated" - elif "image" in mim: - if mim == "image/webp": - m = "sticker" - elif mim == "image/gif": - m = "gif as doc" + if mim == 'application/x-tgsticker': + m = 'sticker animated' + elif 'image' in mim: + if mim == 'image/webp': + m = 'sticker' + elif mim == 'image/gif': + m = 'gif as doc' else: - m = "pic as doc" - elif "video" in mim: - if "DocumentAttributeAnimated" in str(media): - m = "gif" - elif "DocumentAttributeVideo" in str(media): + m = 'pic as doc' + elif 'video' in mim: + if 'DocumentAttributeAnimated' in str(media): + m = 'gif' + elif 'DocumentAttributeVideo' in str(media): i = str(media.document.attributes[0]) - if "supports_streaming=True" in i: - m = "video" - m = "video as doc" + if 'supports_streaming=True' in i: + m = 'video' + m = 'video as doc' else: - m = "video" - elif "audio" in mim: - m = "audio" + m = 'video' + elif 'audio' in mim: + m = 'audio' else: - m = "document" - elif xx == "MessageMediaPhoto": - m = "pic" - elif xx == "MessageMediaWebPage": - m = "web" + m = 'document' + elif xx == 'MessageMediaPhoto': + m = 'pic' + elif xx == 'MessageMediaWebPage': + m = 'web' return m @@ -217,31 +209,31 @@ def text(message: Message) -> str: def restart() -> None: - music_bot_pid = db.get("custom.musicbot", "music_bot_pid", None) + music_bot_pid = db.get('custom.musicbot', 'music_bot_pid', None) if music_bot_pid is not None: try: music_bot_process = psutil.Process(music_bot_pid) music_bot_process.terminate() except psutil.NoSuchProcess: - print("Music bot is not running.") - os.execvp(sys.executable, [sys.executable, "main.py"]) # skipcq + print('Music bot is not running.') + os.execvp(sys.executable, [sys.executable, 'main.py']) # skipcq -def format_exc(e: Exception, suffix="") -> str: +def format_exc(e: Exception, suffix='') -> str: traceback.print_exc() err = traceback.format_exc() if isinstance(e, errors.RPCError): return ( - f"Telegram API error!\n" - f"[{e.CODE} {e.ID or e.NAME}] — {e.MESSAGE.format(value=e.value)}\n\n{suffix}" + f'Telegram API error!\n' + f'[{e.CODE} {e.ID or e.NAME}] — {e.MESSAGE.format(value=e.value)}\n\n{suffix}' ) - return f"Error!\n" f"{err}" + return f'Error!\n{err}' def with_reply(func): async def wrapped(client: Client, message: Message): if not message.reply_to_message: - await message.edit("Reply to message is required") + await message.edit('Reply to message is required') else: return await func(client, message) @@ -251,16 +243,12 @@ def with_reply(func): def is_admin(func): async def wrapped(client: Client, message: Message): try: - chat_member = await client.get_chat_member( - message.chat.id, message.from_user.id - ) - if chat_member.status in ("administrator", "creator"): + chat_member = await client.get_chat_member(message.chat.id, message.from_user.id) + if chat_member.status in ('administrator', 'creator'): return await func(client, message) - await message.edit("You need to be an admin to perform this action.") + await message.edit('You need to be an admin to perform this action.') except UserNotParticipant: - await message.edit( - "You need to be a participant in the chat to perform this action." - ) + await message.edit('You need to be a participant in the chat to perform this action.') return wrapped @@ -278,9 +266,7 @@ async def interact_with(message: Message) -> Message: await asyncio.sleep(1) # noinspection PyProtectedMember - response = [ - msg async for msg in message._client.get_chat_history(message.chat.id, limit=1) - ] + response = [msg async for msg in message._client.get_chat_history(message.chat.id, limit=1)] seconds_waiting = 0 while response[0].from_user.is_self: @@ -290,10 +276,7 @@ async def interact_with(message: Message) -> Message: await asyncio.sleep(1) # noinspection PyProtectedMember - response = [ - msg - async for msg in message._client.get_chat_history(message.chat.id, limit=1) - ] + response = [msg async for msg in message._client.get_chat_history(message.chat.id, limit=1)] interact_with_to_delete.append(message.id) interact_with_to_delete.append(response[0].id) @@ -304,14 +287,12 @@ async def interact_with(message: Message) -> Message: def format_module_help(module_name: str, full=True): commands = modules_help[module_name] - help_text = ( - f"Help for |{module_name}|\n\nUsage:\n" if full else "Usage:\n" - ) + help_text = f'Help for |{module_name}|\n\nUsage:\n' if full else 'Usage:\n' for command, desc in commands.items(): cmd = command.split(maxsplit=1) - args = " " + cmd[1] + "" if len(cmd) > 1 else "" - help_text += f"{prefix}{cmd[0]}{args} — {desc}\n" + args = ' ' + cmd[1] + '' if len(cmd) > 1 else '' + help_text += f'{prefix}{cmd[0]}{args} — {desc}\n' return help_text @@ -319,16 +300,12 @@ def format_module_help(module_name: str, full=True): def format_small_module_help(module_name: str, full=True): commands = modules_help[module_name] - help_text = ( - f"Help for |{module_name}|\n\nCommands list:\n" - if full - else "Commands list:\n" - ) + help_text = f'Help for |{module_name}|\n\nCommands list:\n' if full else 'Commands list:\n' for command, _desc in commands.items(): cmd = command.split(maxsplit=1) - args = " " + cmd[1] + "" if len(cmd) > 1 else "" - help_text += f"{prefix}{cmd[0]}{args}\n" - help_text += f"\nGet full usage: {prefix}help {module_name}" + args = ' ' + cmd[1] + '' if len(cmd) > 1 else '' + help_text += f'{prefix}{cmd[0]}{args}\n' + help_text += f'\nGet full usage: {prefix}help {module_name}' return help_text @@ -348,12 +325,12 @@ def import_library(library_name: str, package_name: str = None): return importlib.import_module(library_name) except ImportError as exc: completed = subprocess.run( - [sys.executable, "-m", "pip", "install", "--upgrade", package_name], + [sys.executable, '-m', 'pip', 'install', '--upgrade', package_name], check=True, ) if completed.returncode != 0: raise AssertionError( - f"Failed to install library {package_name} (pip exited with code {completed.returncode})" + f'Failed to install library {package_name} (pip exited with code {completed.returncode})' ) from exc return importlib.import_module(library_name) @@ -363,21 +340,17 @@ def uninstall_library(package_name: str): Uninstalls a library :param package_name: package name in PyPi (pip uninstall example) """ - completed = subprocess.run( - [sys.executable, "-m", "pip", "uninstall", "-y", package_name], check=True - ) + completed = subprocess.run([sys.executable, '-m', 'pip', 'uninstall', '-y', package_name], check=True) if completed.returncode != 0: raise AssertionError( - f"Failed to uninstall library {package_name} (pip exited with code {completed.returncode})" + f'Failed to uninstall library {package_name} (pip exited with code {completed.returncode})' ) -def resize_image( - input_img, output=None, img_type="PNG", size: int = 512, size2: int = None -): +def resize_image(input_img, output=None, img_type='PNG', size: int = 512, size2: int = None): if output is None: output = BytesIO() - output.name = f"sticker.{img_type.lower()}" + output.name = f'sticker.{img_type.lower()}' with Image.open(input_img) as img: # We used to use thumbnail(size) here, but it returns with a *max* dimension of 512,512 @@ -435,13 +408,13 @@ async def load_module( if module_name in modules_help and not core: await unload_module(module_name, client) - path = f"modules.{'custom_modules.' if not core else ''}{module_name}" + path = f'modules.{"custom_modules." if not core else ""}{module_name}' - with open(f"{path.replace('.', '/')}.py", encoding="utf-8") as f: + with open(f'{path.replace(".", "/")}.py', encoding='utf-8') as f: code = f.read() meta = parse_meta_comments(code) - packages = meta.get("requires", "").split() + packages = meta.get('requires', '').split() requirements_list.extend(packages) try: @@ -455,39 +428,36 @@ async def load_module( raise if message: - await message.edit(f"Installing requirements: {' '.join(packages)}") + await message.edit(f'Installing requirements: {" ".join(packages)}') proc = await asyncio.create_subprocess_exec( sys.executable, - "-m", - "pip", - "install", - "-U", + '-m', + 'pip', + 'install', + '-U', *packages, ) try: await asyncio.wait_for(proc.wait(), timeout=120) - except asyncio.TimeoutError: + except TimeoutError: if message: - await message.edit( - "Timeout while installed requirements." - + "Try to install them manually" - ) - raise TimeoutError("timeout while installing requirements") from e + await message.edit('Timeout while installed requirements.' + 'Try to install them manually') + raise TimeoutError('timeout while installing requirements') from e if proc.returncode != 0: if message: await message.edit( - f"Failed to install requirements (pip exited with code {proc.returncode}). " - f"Check logs for futher info", + f'Failed to install requirements (pip exited with code {proc.returncode}). ' + f'Check logs for futher info', ) - raise RuntimeError("failed to install requirements") from e + raise RuntimeError('failed to install requirements') from e module = importlib.import_module(path) for _name, obj in vars(module).items(): - if isinstance(getattr(obj, "handlers", []), list): - for handler, group in getattr(obj, "handlers", []): + if isinstance(getattr(obj, 'handlers', []), list): + for handler, group in getattr(obj, 'handlers', []): client.add_handler(handler, group) module.__meta__ = meta @@ -496,14 +466,14 @@ async def load_module( async def unload_module(module_name: str, client: Client) -> bool: - path = "modules.custom_modules." + module_name + path = 'modules.custom_modules.' + module_name if path not in sys.modules: return False module = importlib.import_module(path) for _name, obj in vars(module).items(): - for handler, group in getattr(obj, "handlers", []): + for handler, group in getattr(obj, 'handlers', []): client.remove_handler(handler, group) del modules_help[module_name] @@ -521,7 +491,7 @@ def no_prefix(handler): return filters.create(func) -def parse_meta_comments(code: str) -> Dict[str, str]: +def parse_meta_comments(code: str) -> dict[str, str]: try: groups = META_COMMENTS.search(code).groups() except AttributeError: