├── .gitignore ├── .gitlab-ci.yml ├── LICENSE ├── Procfile ├── README.md ├── app.json ├── heroku_config.py ├── requirements-startup.txt ├── requirements.txt ├── telesetup.py ├── userbot ├── __init__.py ├── __main__.py ├── _core.py ├── googol_images.py ├── plugins │ ├── Earth.py │ ├── Kill.py │ ├── Lucky.py │ ├── README.md │ ├── _helper.py │ ├── _inlinebot.py │ ├── admin.py │ ├── afk.py │ ├── alive.py │ ├── android.py │ ├── antivirus2.py │ ├── autopic.py │ ├── bash.py │ ├── being_logical.py │ ├── blacklist.py │ ├── bye.py │ ├── call.py │ ├── carbon.py │ ├── chod.py │ ├── command_list.py │ ├── currency.py │ ├── dagd.py │ ├── decide.py │ ├── deepfryer.py │ ├── design.py │ ├── dictionary.py │ ├── ding.py │ ├── dumpster.py │ ├── eval.py │ ├── exec.py │ ├── ff_mpeg.py │ ├── figlet.py │ ├── filters.py │ ├── fleaveme.py │ ├── fpost (1).py │ ├── frybot.py │ ├── fuck.py │ ├── gDrive.py │ ├── gaand_me_loge.py │ ├── gangasta.py │ ├── gbun.py │ ├── get_admin.py │ ├── get_bot.py │ ├── get_id.py │ ├── getmusic.py │ ├── gitcommit.py │ ├── github.py │ ├── gmute.py │ ├── google.py │ ├── got_memes.py │ ├── got_thoughts.py │ ├── gps.py │ ├── hack.py │ ├── heroku.py │ ├── howtogoogle.py │ ├── iffuci.py │ ├── images.py │ ├── instant_install_ext_module.py │ ├── jainder.py │ ├── json.py │ ├── labstack.py │ ├── list_user_names_reserved_by_me.py │ ├── locks.py │ ├── lydia.py │ ├── meme.py │ ├── memes.py │ ├── memify.py │ ├── mention │ ├── mf.py │ ├── moon.py │ ├── mtn.py │ ├── music.py │ ├── mute.py │ ├── muth.py │ ├── nakal.py │ ├── none.txt │ ├── ocr.py │ ├── ok.py │ ├── os.py │ ├── padmin.py │ ├── pastebin.py │ ├── pin_message.py │ ├── ping.py │ ├── plane.py │ ├── pmpermit.py │ ├── pmpermit_menu.py │ ├── power_tools.py │ ├── pro_nub.py │ ├── purge.py │ ├── purnhub_download.py │ ├── quickheal.py │ ├── randomsticker.py │ ├── remove.bg.py │ ├── rename.py │ ├── repeat.py │ ├── reverseimg.py │ ├── sca.py │ ├── schd.py │ ├── screencapture.py │ ├── screenlong.py │ ├── sed.py │ ├── shout.py │ ├── snake.py │ ├── snip.py │ ├── solarsystem.py │ ├── spam.py │ ├── spamV2.py │ ├── speedtest.py │ ├── spotify_deezer_downloader.py │ ├── sql_helper │ │ ├── __init__.py │ │ ├── blacklist_sql.py │ │ ├── filter_sql.py │ │ ├── gmute_sql.py │ │ ├── locks_sql.py │ │ ├── mute_sql.py │ │ ├── pmpermit_sql.py │ │ ├── snips_sql.py │ │ └── welcome_sql.py │ ├── stickers.py │ ├── telegraph.py │ ├── think.py │ ├── thinklol.py │ ├── time.py │ ├── translate.py │ ├── tts.py │ ├── updater.py │ ├── urbandictionary.py │ ├── warnbun.py │ ├── webupload.py │ ├── welcome.py │ ├── whois.py │ ├── wtf.py │ ├── ytdl.py │ ├── zip_unzip.py │ └── zombies.py ├── uniborgConfig.py └── utils.py └── var.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | CheckUserBotWorking: 2 | script: 3 | - echo "Nothing" 4 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | userbot: python -m userbot 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FORK AT YOUR OWN RISK 2 | # Documentation/Guide, visit [How2Techy](https://how2techy.com/x-tra-userbot-plugin-guide-part1/) 3 | # Installing 4 | Join https://t.me/XtraTgBot for updates and tuts 5 | ### The Easy Way 6 | 7 | [![Deploy To Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) 8 | 9 | 10 | ### UniBorg Configuration 11 | 12 | The UniBorg Config is situated in `userbot/uniborgConfig.py`. 13 | 14 | **Heroku Configuration** 15 | Simply just leave the Config as it is. 16 | 17 | **Local Configuration** 18 | Check [Line 111](https://github.com/Total-Noob-69/X-tra-Telegram/blob/master/userbot/uniborgConfig.py#L111) and start adding your vars there. 19 | Fortunately there are no Mandatory vars for the UniBorg Support Config. 20 | 21 | ## Mandatory Vars 22 | 23 | - Only two of the environment variables are mandatory. 24 | - This is because of `telethon.errors.rpc_error_list.ApiIdPublishedFloodError` 25 | - `APP_ID`: You can get this value from https://my.telegram.org 26 | - `API_HASH`: You can get this value from https://my.telegram.org 27 | - The userbot will not work without setting the mandatory vars. 28 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "X-tra Telegram", 3 | "description": "Userbot created by a SNAPDRAGON and custom fork by ANUBIS\n\n join https://t.me/XtraTgChat for any problems or support", 4 | "logo": "https://telegra.ph/file/1be6c59f53fef57b5745b.jpg", 5 | "keywords": [ 6 | "telegram", 7 | "userbot", 8 | "plugin", 9 | "modular", 10 | "productivity" 11 | ], 12 | "repository": "https://github.com/Prince-Mendiratta/X-tra-Telegram/", 13 | "website": "#TODO", 14 | "success_url": "#TODO", 15 | "env": { 16 | "ENV": { 17 | "description": "Setting this to ANYTHING will enable heroku.", 18 | "value": "ANYTHING" 19 | }, 20 | "TEMP_DOWNLOAD_DIRECTORY": { 21 | "description": "Where downloaded files will go.", 22 | "value": "./userbot/DOWNLOADS/", 23 | "required": false 24 | }, 25 | "APP_ID": { 26 | "description": "Get this value from my.telegram.org! Please do not steal", 27 | "value": "" 28 | }, 29 | "API_HASH": { 30 | "description": "Get this value from my.telegram.org! Please do not steal", 31 | "value": "" 32 | }, 33 | "STRING_SESSION": { 34 | "description": "Get this value by running python3 telesetup.py locally", 35 | "value": "" 36 | }, 37 | "MAX_FLOOD_IN_P_M_s": { 38 | "description": "Maximum number of messages a person can send in pm before getting blocked. Value must be an integer. 3 by default.", 39 | "value": "3", 40 | "required": false 41 | }, 42 | "OCR_SPACE_API_KEY": { 43 | "description": "Required for OCR functionality. Get from https://ocr.space/ocrapi", 44 | "value": "", 45 | "required": false 46 | }, 47 | "REM_BG_API_KEY": { 48 | "description": "Required for Removing image background functionality. Get from https://www.remove.bg/", 49 | "value": "", 50 | "required": false 51 | }, 52 | "GITHUB_ACCESS_TOKEN": { 53 | "description": "Your Github Access Token for gitcommit plugin.Google 'Github access token' to find.", 54 | "value": "", 55 | "required": false 56 | }, 57 | "GIT_REPO_NAME": { 58 | "description": "Your repo name Example: Total-Noob-69/X-Tra-Telegram, but GITHUB_ACCESS_TOKEN must be setup first.", 59 | "value": "", 60 | "required": false 61 | }, 62 | "LYDIA_API_KEY": { 63 | "description": "Needed for Lydia AI. Follow https://telegra.ph/Lydia-09-05 to get your API.", 64 | "value": "", 65 | "required": false 66 | }, 67 | "TG_BOT_TOKEN_BF_HER": { 68 | "description": "Needed for inline buttons maker. Make a bot at http://telegram.dog/BotFather and get the token of your bot.Worth it. Get it.", 69 | "value": "", 70 | "required": false 71 | }, 72 | "CHROME_BIN": { 73 | "description": "For Carbon.py. Leave as it is. ", 74 | "value": "/app/.apt/usr/bin/google-chrome", 75 | "required": false 76 | }, 77 | "CHROME_DRIVER": { 78 | "description": "For Carbon.py. Leave as it is. ", 79 | "value": "/app/.chromedriver/bin/chromedriver", 80 | "required": false 81 | }, 82 | "TG_BOT_USER_NAME_BF_HER": { 83 | "description": "Needed for inline buttons maker. Make a bot at http://telegram.dog/BotFather and get the username of your bot", 84 | "value": "", 85 | "required": false 86 | }, 87 | "DOWNLOAD_PFP_URL_CLOCK": { 88 | "description": "Needed for autopic module. A url that is a preview link of your Profile Pic", 89 | "value": "", 90 | "required": false 91 | }, 92 | "TZ": { 93 | "description": "Required for Correct Time on autopic/get time. Know your timezone from http://www.timezoneconverter.com/cgi-bin/findzone.tzc", 94 | "value": "Asia/Kolkata", 95 | "required": false 96 | } 97 | }, 98 | "addons": [{ 99 | "plan": "heroku-postgresql", 100 | "options": { 101 | "version": "9.6" 102 | } 103 | }], 104 | "buildpacks": [{ 105 | "url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest" 106 | },{ 107 | "url":"https://github.com/amivin/aria2-heroku.git" 108 | },{ 109 | "url":"https://github.com/heroku/heroku-buildpack-google-chrome" 110 | },{ 111 | "url":"https://github.com/heroku/heroku-buildpack-chromedriver" 112 | },{ 113 | "url": "https://github.com/opendoor-labs/heroku-buildpack-p7zip" 114 | },{ 115 | "url": "heroku/python" 116 | }] 117 | } 118 | -------------------------------------------------------------------------------- /heroku_config.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | class Var(object): 4 | APP_ID = int(os.environ.get("APP_ID", 6)) 5 | # 6 is a placeholder 6 | API_HASH = os.environ.get("API_HASH", "eb06d4abfb49dc3eeb1aeb98ae0f581e") 7 | STRING_SESSION = os.environ.get("STRING_SESSION", None) 8 | DB_URI = os.environ.get("DATABASE_URL", None) 9 | TEMP_DOWNLOAD_DIRECTORY = os.environ.get("TEMP_DOWNLOAD_DIRECTORY", None) 10 | LOGGER = True 11 | GITHUB_ACCESS_TOKEN = os.environ.get("GITHUB_ACCESS_TOKEN", None) 12 | GIT_REPO_NAME = os.environ.get("GIT_REPO_NAME", None) 13 | # Here for later purposes 14 | SUDO_USERS = set(int(x) for x in os.environ.get("SUDO_USERS", "967883138").split()) 15 | LYDIA_API_KEY = os.environ.get("LYDIA_API_KEY", None) 16 | LESS_SPAMMY = os.environ.get("LESS_SPAMMY", None) 17 | HEROKU_API_KEY = os.environ.get("HEROKU_API_KEY", None) 18 | HEROKU_APP_NAME = os.environ.get("HEROKU_APP_NAME", None) 19 | TG_BOT_TOKEN_BF_HER = os.environ.get("TG_BOT_TOKEN_BF_HER", None) 20 | # Send .get_id in any channel to fill this value. 21 | PLUGIN_CHANNEL = int(os.environ.get("PLUGIN_CHANNEL", -100)) 22 | TG_BOT_USER_NAME_BF_HER = os.environ.get("TG_BOT_USER_NAME_BF_HER", None) 23 | NO_SONGS = bool(os.environ.get("NO_SONGS", False)) 24 | DOWNLOAD_PFP_URL_CLOCK = os.environ.get("DOWNLOAD_PFP_URL_CLOCK", None) 25 | G_DRIVE_CLIENT_ID = os.environ.get("G_DRIVE_CLIENT_ID", None) 26 | G_DRIVE_CLIENT_SECRET = os.environ.get("G_DRIVE_CLIENT_SECRET", None) 27 | GDRIVE_FOLDER_ID = os.environ.get("GDRIVE_FOLDER_ID", "root") 28 | AUTH_TOKEN_DATA = os.environ.get("AUTH_TOKEN_DATA", None) 29 | MAX_FLOOD_IN_P_M_s = int(os.environ.get("MAX_FLOOD_IN_P_M_s", 3)) 30 | if AUTH_TOKEN_DATA != None: 31 | if not os.path.isdir(TEMP_DOWNLOAD_DIRECTORY): 32 | os.makedirs(TEMP_DOWNLOAD_DIRECTORY) 33 | t_file = open(TEMP_DOWNLOAD_DIRECTORY+"auth_token.txt","w") 34 | t_file.write(AUTH_TOKEN_DATA) 35 | t_file.close() 36 | PRIVATE_GROUP_ID = os.environ.get("PRIVATE_GROUP_ID", None) 37 | if PRIVATE_GROUP_ID != None: 38 | try: 39 | PRIVATE_GROUP_ID = int(PRIVATE_GROUP_ID) 40 | except ValueError: 41 | raise ValueError("Invalid Private Group ID. Make sure your ID is starts with -100 and make sure that it is only numbers.") 42 | 43 | class Development(Var): 44 | LOGGER = True 45 | # Here for later purposes 46 | -------------------------------------------------------------------------------- /requirements-startup.txt: -------------------------------------------------------------------------------- 1 | Pillow>=5.3.0 2 | PyGithub 3 | aiofiles 4 | aiohttp 5 | aria2p 6 | async_generator 7 | beautifulsoup4 8 | bs4 9 | bwb==3.0.0 10 | cfscrape 11 | coffeehouse 12 | cowpy 13 | cryptg 14 | dnspython 15 | emoji 16 | geopy 17 | gTTS-token>=1.1.3 18 | gTTS>=2.0.1 19 | gitpython 20 | google-api-python-client==1.8.0 21 | google-auth-oauthlib 22 | google_images_download>=2.7.1 23 | googletrans>=2.4.0 24 | gsearch 25 | hachoir 26 | heroku3 27 | httplib2>=0.19.0 28 | humanize 29 | lxml 30 | oauth2client 31 | psycopg2 32 | psycopg2-binary 33 | pySmartDL 34 | pybase64>=0.4.0 35 | pyfiglet 36 | pylast 37 | pymongo 38 | python-barcode 39 | python-dotenv 40 | python-magic 41 | pytube 42 | pytz 43 | qrcode 44 | regex 45 | requests>=2.18.4 46 | search-engine-parser>=0.4.2 47 | selenium 48 | speedtest-cli>=2.0.2 49 | sqlalchemy>=1.2 50 | telegraph 51 | asyncurban 52 | urbandict 53 | wikipedia>=1.4.0 54 | youtube-dl 55 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | telethon>=1.10.3 2 | -r requirements-startup.txt 3 | -------------------------------------------------------------------------------- /telesetup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # (c) https://t.me/TelethonChat/37677 3 | # This Source Code Form is subject to the terms of the GNU 4 | # General Public License, v.3.0. If a copy of the GPL was not distributed with this 5 | # file, You can obtain one at https://www.gnu.org/licenses/gpl-3.0.en.html. 6 | 7 | from telethon.sync import TelegramClient 8 | from telethon.sessions import StringSession 9 | 10 | print("""Please go-to my.telegram.org 11 | Login using your Telegram account 12 | Click on API Development Tools 13 | Create a new application, by entering the required details""") 14 | APP_ID = int(input("Enter APP ID here: ")) 15 | API_HASH = input("Enter API HASH here: ") 16 | 17 | with TelegramClient(StringSession(), APP_ID, API_HASH) as client: 18 | print(client.session.save()) 19 | -------------------------------------------------------------------------------- /userbot/__main__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 - 2020 DarkPrinc3 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from userbot import bot 16 | from sys import argv 17 | import sys 18 | from telethon.errors.rpcerrorlist import PhoneNumberInvalidError 19 | import os 20 | from telethon import TelegramClient 21 | from var import Var 22 | from userbot.utils import load_module 23 | from userbot import LOAD_PLUG, BOTLOG_CHATID, LOGS 24 | from pathlib import Path 25 | import asyncio 26 | import telethon.utils 27 | import heroku3 28 | 29 | 30 | async def add_bot(): 31 | ((await bot.start()) if os.environ.get("PHONE") is None else (await bot.start(phone=os.environ.get("PHONE")))) 32 | bot.me = await bot.get_me() 33 | bot.uid = telethon.utils.get_peer_id(bot.me) 34 | 35 | 36 | 37 | if len(argv) not in (1, 3, 4): 38 | bot.disconnect() 39 | else: 40 | bot.tgbot = None 41 | if Var.TG_BOT_USER_NAME_BF_HER is not None: 42 | print("Initiating Inline Bot") 43 | # ForTheGreatrerGood of beautification 44 | bot.tgbot = TelegramClient( 45 | "TG_BOT_TOKEN", 46 | api_id=Var.APP_ID, 47 | api_hash=Var.API_HASH 48 | ).start(bot_token=Var.TG_BOT_TOKEN_BF_HER) 49 | print("Initialisation finished with no errors") 50 | print("Starting Userbot") 51 | bot.loop.run_until_complete(add_bot()) 52 | if Var.HEROKU_APP_NAME and Var.HEROKU_API_KEY is not None: 53 | Heroku = heroku3.from_key(Var.HEROKU_API_KEY) 54 | app = Heroku.app(Var.HEROKU_APP_NAME) 55 | heroku_var = app.config() 56 | variable = "SUDO_USERS" 57 | if variable in heroku_var: 58 | del heroku_var[variable] 59 | else: 60 | print("All Good!") 61 | print("Startup Completed") 62 | else: 63 | ((bot.start()) if os.environ.get("PHONE") is None else (bot.start(phone=os.environ.get("PHONE")))) 64 | 65 | 66 | import glob 67 | path = 'userbot/plugins/*.py' 68 | files = glob.glob(path) 69 | for name in files: 70 | with open(name) as f: 71 | path1 = Path(f.name) 72 | shortname = path1.stem 73 | load_module(shortname.replace(".py", "")) 74 | 75 | import userbot._core 76 | 77 | print("Yay your userbot is officially working. Ja gaand mara") 78 | 79 | if len(argv) not in (1, 3, 4): 80 | bot.disconnect() 81 | else: 82 | bot.run_until_disconnected() 83 | -------------------------------------------------------------------------------- /userbot/_core.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 - 2020 DarkPrinc3 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from userbot import bot 16 | from telethon import events 17 | from userbot.utils import command, remove_plugin, load_module 18 | from var import Var 19 | import importlib 20 | from pathlib import Path 21 | from userbot import LOAD_PLUG 22 | import sys 23 | import asyncio 24 | import traceback 25 | import os 26 | import userbot.utils 27 | from datetime import datetime 28 | 29 | DELETE_TIMEOUT = 5 30 | 31 | @command(pattern="^.install", outgoing=True) 32 | async def install(event): 33 | if event.fwd_from: 34 | return 35 | if event.reply_to_msg_id: 36 | try: 37 | downloaded_file_name = await event.client.download_media( # pylint:disable=E0602 38 | await event.get_reply_message(), 39 | "userbot/plugins/" # pylint:disable=E0602 40 | ) 41 | if "(" not in downloaded_file_name: 42 | path1 = Path(downloaded_file_name) 43 | shortname = path1.stem 44 | load_module(shortname.replace(".py", "")) 45 | await event.edit("Installed Plugin `{}`".format(os.path.basename(downloaded_file_name))) 46 | else: 47 | os.remove(downloaded_file_name) 48 | await event.edit("Errors! This plugin is already installed/pre-installed.") 49 | except Exception as e: # pylint:disable=C0103,W0703 50 | await event.edit(str(e)) 51 | os.remove(downloaded_file_name) 52 | await asyncio.sleep(DELETE_TIMEOUT) 53 | await event.delete() 54 | 55 | @command(pattern="^.send (?P\w+)$", outgoing=True) 56 | async def send(event): 57 | if event.fwd_from: 58 | return 59 | message_id = event.message.id 60 | input_str = event.pattern_match["shortname"] 61 | the_plugin_file = "./userbot/plugins/{}.py".format(input_str) 62 | start = datetime.now() 63 | await event.client.send_file( # pylint:disable=E0602 64 | event.chat_id, 65 | the_plugin_file, 66 | force_document=True, 67 | allow_cache=False, 68 | reply_to=message_id 69 | ) 70 | end = datetime.now() 71 | time_taken_in_ms = (end - start).seconds 72 | await event.edit("Uploaded {} in {} seconds".format(input_str, time_taken_in_ms)) 73 | await asyncio.sleep(DELETE_TIMEOUT) 74 | await event.delete() 75 | 76 | @command(pattern="^.unload (?P\w+)$", outgoing=True) 77 | async def unload(event): 78 | if event.fwd_from: 79 | return 80 | shortname = event.pattern_match["shortname"] 81 | try: 82 | remove_plugin(shortname) 83 | await event.edit(f"Unloaded {shortname} successfully") 84 | except Exception as e: 85 | await event.edit("Successfully unload {shortname}\n{}".format(shortname, str(e))) 86 | 87 | @command(pattern="^.load (?P\w+)$", outgoing=True) 88 | async def load(event): 89 | if event.fwd_from: 90 | return 91 | shortname = event.pattern_match["shortname"] 92 | try: 93 | try: 94 | remove_plugin(shortname) 95 | except: 96 | pass 97 | load_module(shortname) 98 | await event.edit(f"Successfully loaded {shortname}") 99 | except Exception as e: 100 | await event.edit(f"Could not load {shortname} because of the following error.\n{str(e)}") 101 | -------------------------------------------------------------------------------- /userbot/plugins/Earth.py: -------------------------------------------------------------------------------- 1 | # (c) @UniBorg 2 | # Original written by @UniBorg edit by @I_m_Rock 3 | 4 | from telethon import events 5 | import asyncio 6 | from collections import deque 7 | 8 | 9 | @borg.on(events.NewMessage(pattern=r"\.earth", outgoing=True)) 10 | async def _(event): 11 | if event.fwd_from: 12 | return 13 | deq = deque(list("🌏🌍🌎🌎🌍🌏🌍🌎")) 14 | for _ in range(48): 15 | await asyncio.sleep(0.1) 16 | await event.edit("".join(deq)) 17 | deq.rotate(1) 18 | 19 | -------------------------------------------------------------------------------- /userbot/plugins/Lucky.py: -------------------------------------------------------------------------------- 1 | # plugin by lejend @r4r4n4 2 | """Emoji 3 | 4 | Available Commands: 5 | 6 | .lucky""" 7 | 8 | from telethon import events 9 | 10 | import asyncio 11 | 12 | 13 | 14 | 15 | 16 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 17 | 18 | async def _(event): 19 | 20 | if event.fwd_from: 21 | 22 | return 23 | 24 | animation_interval = 0.5 25 | 26 | animation_ttl = range(0, 17) 27 | 28 | input_str = event.pattern_match.group(1) 29 | 30 | if input_str == "lucky": 31 | 32 | await event.edit(input_str) 33 | 34 | animation_chars = [ 35 | 36 | "⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜", 37 | "⬛⬜⬜⬜⬜\n👇⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜", 38 | "⬛⬛⬜⬜⬜\n⬜👇⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜", 39 | "⬛⬛⬛⬜⬜\n⬜⬜👇⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜", 40 | "⬛⬛⬛⬛⬜\n⬜⬜⬜👇⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜", 41 | "⬛⬛⬛⬛⬜\n⬜⬜⬜⬛⬜\n⬜⬜⬜👇⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜", 42 | "⬛⬛⬛⬛⬜\n⬜⬜⬜⬛⬜\n⬜⬜⬜⬛⬜\n⬜⬜⬜👇⬜\n⬜⬜⬜[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜", 43 | "⬛⬛⬛⬛⬜\n⬜⬜⬜⬛⬜\n⬜⬜⬜👇⬜\n⬜⬜⬜[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜\n⬜⬜⬜⬜⬜", 44 | "⬛⬛⬛⬛⬜\n⬜⬜⬜👇⬜\n⬜⬜⬜[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜", 45 | "⬛⬛⬛⬜⬜\n⬜⬜👇⬜⬜\n⬜⬜[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜", 46 | "⬛⬛⬜⬜⬜\n⬜👇⬜⬜⬜\n⬜[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜", 47 | "⬛⬜⬜⬜⬜\n👇⬜⬜⬜⬜\n[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜", 48 | "⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜", 49 | "⬜⬜⬜⬜\n⬜⬜⬜⬜\n⬜⬜⬜⬜\n⬜⬜⬜⬜", 50 | "⬜⬜⬜\n⬜⬜⬜\n⬜⬜⬜", 51 | "⬜⬜\n⬜⬜", 52 | "[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)" 53 | 54 | ] 55 | 56 | for i in animation_ttl: 57 | 58 | await asyncio.sleep(animation_interval) 59 | 60 | await event.edit(animation_chars[i % 17]) 61 | -------------------------------------------------------------------------------- /userbot/plugins/README.md: -------------------------------------------------------------------------------- 1 | ## Mandatory Imports 2 | ```python3 3 | None 4 | ``` 5 | There is None Mandatory Imports. Because Var, bot and command are already automatically imported. 6 | 7 | ## Explanation 8 | The Mandatory Imports are now automatically imported. 9 | 10 | ### Formation 11 | Now I will show a short script to show the formation of the desired script. 12 | ```python3 13 | @command(pattern="^.alive", outgoing=True) 14 | async def hello_world(event): 15 | if event.fwd_from: 16 | return 17 | await event.edit("**HELLO WORLD**\n\nThe following is controlling me too!\n" + Var.SUDO_USERS) 18 | ``` 19 | -------------------------------------------------------------------------------- /userbot/plugins/_helper.py: -------------------------------------------------------------------------------- 1 | from userbot import CMD_LIST 2 | 3 | @command(pattern="^.help ?(.*)") 4 | async def cmd_list(event): 5 | if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "@", "!"): 6 | tgbotusername = Var.TG_BOT_USER_NAME_BF_HER 7 | input_str = event.pattern_match.group(1) 8 | if tgbotusername is None or input_str == "text": 9 | string = "" 10 | for i in CMD_LIST: 11 | string += "ℹ️ " + i + "\n" 12 | for iter_list in CMD_LIST[i]: 13 | string += " `" + str(iter_list) + "`" 14 | string += "\n" 15 | string += "\n" 16 | if len(string) > 4095: 17 | await borg.send_message(event.chat_id, "Do .help cmd") 18 | await asyncio.sleep(5) 19 | else: 20 | await event.edit(string) 21 | elif input_str: 22 | if input_str in CMD_LIST: 23 | string = "Commands found in {}:\n".format(input_str) 24 | for i in CMD_LIST[input_str]: 25 | string += " " + i 26 | string += "\n" 27 | await event.edit(string) 28 | else: 29 | await event.edit(input_str + " is not a valid plugin!") 30 | else: 31 | help_string = """Userbot Helper.. Provided by @A_Dark_Princ3 \n[Check out this dope af website](https://www.moddingunited.xyz/) \n 32 | `Userbot Helper to reveal all the commands`\n__Do .help plugin_name for commands, in case popup doesn't appear.__""" 33 | results = await bot.inline_query( # pylint:disable=E0602 34 | tgbotusername, 35 | help_string 36 | ) 37 | await results[0].click( 38 | event.chat_id, 39 | reply_to=event.reply_to_msg_id, 40 | hide_via=True 41 | ) 42 | await event.delete() 43 | -------------------------------------------------------------------------------- /userbot/plugins/alive.py: -------------------------------------------------------------------------------- 1 | """Check if userbot alive. If you change these, you become the gayest gay such that even the gay world will disown you.""" 2 | import asyncio 3 | from telethon import events 4 | from telethon.tl.types import ChannelParticipantsAdmins 5 | from platform import uname 6 | from userbot import ALIVE_NAME 7 | from userbot.utils import admin_cmd 8 | 9 | DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "**No Name set yet.** [Check Guide.](https://how2techy.com/xtra-guide1/)" 10 | 11 | @command(outgoing=True, pattern="^.alive$") 12 | async def amireallyalive(alive): 13 | """ For .alive command, check if the bot is running. """ 14 | await alive.edit("`Currently Alive, my peru master!` **ψ(`∇´)ψ**\n\n" 15 | "`Telethon version: 6.9.0\nPython: 3.7.3\n`" 16 | # Don't change this else you a TikTok loser, Son of Jinping. Add your own. 17 | "`Bot created by:` [SnapDragon](tg://user?id=719877937), @anubisxx\n" 18 | f"`My peru owner`: {DEFAULTUSER}\n\n" 19 | "https://github.com/Dark-Princ3/X-tra-Telegram") 20 | -------------------------------------------------------------------------------- /userbot/plugins/antivirus2.py: -------------------------------------------------------------------------------- 1 | # Lots of lub to @r4v4n4 for gibing the base <3 2 | import datetime 3 | from telethon import events 4 | from telethon.errors.rpcerrorlist import YouBlockedUserError 5 | from telethon.tl.functions.account import UpdateNotifySettingsRequest 6 | from userbot.utils import admin_cmd,register 7 | 8 | @borg.on(admin_cmd("scan ?(.*)")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | if not event.reply_to_msg_id: 13 | await event.edit("```Reply to any user message.```") 14 | return 15 | reply_message = await event.get_reply_message() 16 | if not reply_message.media: 17 | await event.edit("```reply to a media message```") 18 | return 19 | chat = "@DrWebBot" 20 | sender = reply_message.sender 21 | if reply_message.sender.bot: 22 | await event.edit("```Reply to actual users message.```") 23 | return 24 | await event.edit(" `Sliding my tip, of fingers over it`") 25 | async with borg.conversation(chat) as conv: 26 | try: 27 | response = conv.wait_event(events.NewMessage(incoming=True,from_users=161163358)) 28 | await borg.forward_messages(chat, reply_message) 29 | response = await response 30 | except YouBlockedUserError: 31 | await event.reply("```Please unblock @sangmatainfo_bot and try again```") 32 | return 33 | if response.text.startswith("Forward"): 34 | await event.edit("```can you kindly disable your forward privacy settings for good?```") 35 | else: 36 | if response.text.startswith("Select"): 37 | await event.edit("`Please go to` @DrWebBot `and select your language.`") 38 | else: 39 | await event.edit(f"**Antivirus scan was completed. I got dem final results.**\n {response.message.message}") 40 | -------------------------------------------------------------------------------- /userbot/plugins/autopic.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 - 2020 DarkPrinc3 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import os 16 | from datetime import datetime 17 | from PIL import Image, ImageDraw, ImageFont 18 | from pySmartDL import SmartDL 19 | from telethon.tl import functions 20 | import asyncio 21 | import shutil 22 | 23 | FONT_FILE_TO_USE = "/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf" 24 | 25 | @command(pattern="^.autopic", outgoing=True) 26 | async def autopic(event): 27 | downloaded_file_name = "userbot/original_pic.png" 28 | downloader = SmartDL(Var.DOWNLOAD_PFP_URL_CLOCK, downloaded_file_name, progress_bar=False) 29 | downloader.start(blocking=False) 30 | photo = "userbot/photo_pfp.png" 31 | while not downloader.isFinished(): 32 | place_holder = None 33 | counter = -30 34 | while True: 35 | shutil.copy(downloaded_file_name, photo) 36 | im = Image.open(photo) 37 | file_test = im.rotate(counter, expand=False).save(photo, "PNG") 38 | current_time = datetime.now().strftime("⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡ \n Time: %H:%M \n Date: %d.%m.%y \n⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡") 39 | img = Image.open(photo) 40 | drawn_text = ImageDraw.Draw(img) 41 | fnt = ImageFont.truetype(FONT_FILE_TO_USE, 30) 42 | drawn_text.text((95, 250), current_time, font=fnt, fill=(255, 255, 255)) 43 | img.save(photo) 44 | file = await bot.upload_file(photo) # pylint:disable=E0602 45 | try: 46 | await bot(functions.photos.UploadProfilePhotoRequest( # pylint:disable=E0602 47 | file 48 | )) 49 | os.remove(photo) 50 | counter -= 30 51 | await asyncio.sleep(60) 52 | except: 53 | return 54 | -------------------------------------------------------------------------------- /userbot/plugins/bash.py: -------------------------------------------------------------------------------- 1 | from telethon import events 2 | import subprocess 3 | from telethon.errors import MessageEmptyError, MessageTooLongError, MessageNotModifiedError 4 | import io 5 | import asyncio 6 | import time 7 | 8 | 9 | @command(pattern="^.bash ?(.*)") 10 | async def _(event): 11 | if event.fwd_from: 12 | return 13 | DELAY_BETWEEN_EDITS = 0.3 14 | PROCESS_RUN_TIME = 100 15 | cmd = event.pattern_match.group(1) 16 | reply_to_id = event.message.id 17 | if event.reply_to_msg_id: 18 | reply_to_id = event.reply_to_msg_id 19 | start_time = time.time() + PROCESS_RUN_TIME 20 | process = await asyncio.create_subprocess_shell( 21 | cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE 22 | ) 23 | stdout, stderr = await process.communicate() 24 | e = stderr.decode() 25 | if not e: 26 | e = "No Error" 27 | o = stdout.decode() 28 | if not o: 29 | o = "**Tip**: \n`If you want to see the results of your code, I suggest printing them to stdout.`" 30 | else: 31 | _o = o.split("\n") 32 | o = "`\n".join(_o) 33 | OUTPUT = f"**QUERY:**\n__Command:__\n`{cmd}` \n__PID:__\n`{process.pid}`\n\n**stderr:** \n`{e}`\n**Output:**\n{o}" 34 | if len(OUTPUT) > 4095: 35 | with io.BytesIO(str.encode(OUTPUT)) as out_file: 36 | out_file.name = "exec.text" 37 | await bot.send_file( 38 | event.chat_id, 39 | out_file, 40 | force_document=True, 41 | allow_cache=False, 42 | caption=cmd, 43 | reply_to=reply_to_id 44 | ) 45 | await event.delete() 46 | await event.edit(OUTPUT) 47 | -------------------------------------------------------------------------------- /userbot/plugins/blacklist.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | """Filters 5 | Available Commands: 6 | .addblacklist 7 | .listblacklist 8 | .rmblacklist""" 9 | import asyncio 10 | import re 11 | import userbot.plugins.sql_helper.blacklist_sql as sql 12 | from telethon import events, utils 13 | from telethon.tl import types, functions 14 | from userbot.utils import admin_cmd 15 | 16 | 17 | @borg.on(events.NewMessage(incoming=True)) 18 | async def on_new_message(event): 19 | # TODO: exempt admins from locks 20 | name = event.raw_text 21 | snips = sql.get_chat_blacklist(event.chat_id) 22 | for snip in snips: 23 | pattern = r"( |^|[^\w])" + re.escape(snip) + r"( |$|[^\w])" 24 | if re.search(pattern, name, flags=re.IGNORECASE): 25 | try: 26 | await event.delete() 27 | except Exception as e: 28 | await event.reply("I do not have DELETE permission in this chat") 29 | sql.rm_from_blacklist(event.chat_id, snip.lower()) 30 | break 31 | 32 | 33 | @borg.on(admin_cmd("addblacklist ((.|\n)*)")) 34 | async def on_add_black_list(event): 35 | text = event.pattern_match.group(1) 36 | to_blacklist = list(set(trigger.strip() for trigger in text.split("\n") if trigger.strip())) 37 | for trigger in to_blacklist: 38 | sql.add_to_blacklist(event.chat_id, trigger.lower()) 39 | await event.edit("Added {} triggers to the blacklist in the current chat".format(len(to_blacklist))) 40 | 41 | 42 | @borg.on(admin_cmd("listblacklist")) 43 | async def on_view_blacklist(event): 44 | all_blacklisted = sql.get_chat_blacklist(event.chat_id) 45 | OUT_STR = "Blacklists in the Current Chat:\n" 46 | if len(all_blacklisted) > 0: 47 | for trigger in all_blacklisted: 48 | OUT_STR += f"👉 {trigger} \n" 49 | else: 50 | OUT_STR = "No BlackLists. Start Saving using `.addblacklist`" 51 | if len(OUT_STR) > Config.MAX_MESSAGE_SIZE_LIMIT: 52 | with io.BytesIO(str.encode(OUT_STR)) as out_file: 53 | out_file.name = "blacklist.text" 54 | await borg.send_file( 55 | event.chat_id, 56 | out_file, 57 | force_document=True, 58 | allow_cache=False, 59 | caption="BlackLists in the Current Chat", 60 | reply_to=event 61 | ) 62 | await event.delete() 63 | else: 64 | await event.edit(OUT_STR) 65 | 66 | 67 | @borg.on(admin_cmd("rmblacklist ((.|\n)*)")) 68 | async def on_delete_blacklist(event): 69 | text = event.pattern_match.group(1) 70 | to_unblacklist = list(set(trigger.strip() for trigger in text.split("\n") if trigger.strip())) 71 | successful = 0 72 | for trigger in to_unblacklist: 73 | if sql.rm_from_blacklist(event.chat_id, trigger.lower()): 74 | successful += 1 75 | await event.edit(f"Removed {successful} / {len(to_unblacklist)} from the blacklist") 76 | -------------------------------------------------------------------------------- /userbot/plugins/bye.py: -------------------------------------------------------------------------------- 1 | # For @UniBorg 2 | # Courtesy @yasirsiddiqui 3 | 4 | """ 5 | .bye 6 | """ 7 | from telethon.tl.functions.channels import LeaveChannelRequest 8 | from userbot.utils import admin_cmd 9 | import time 10 | 11 | @borg.on(admin_cmd("bye", outgoing=True)) 12 | async def leave(e): 13 | if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"): 14 | await e.edit("`I am leaving this chat.....!`") 15 | time.sleep(3) 16 | if '-' in str(e.chat_id): 17 | await borg(LeaveChannelRequest(e.chat_id)) 18 | else: 19 | await e.edit('`Sir This is Not A Chat`') 20 | -------------------------------------------------------------------------------- /userbot/plugins/call.py: -------------------------------------------------------------------------------- 1 | """Emoji 2 | 3 | Available Commands: 4 | 5 | .emoji shrug 6 | 7 | .emoji apple 8 | 9 | .emoji :/ 10 | 11 | .emoji -_-""" 12 | 13 | from telethon import events 14 | 15 | import asyncio 16 | 17 | 18 | 19 | 20 | 21 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 22 | 23 | async def _(event): 24 | 25 | if event.fwd_from: 26 | 27 | return 28 | 29 | animation_interval = 3 30 | 31 | animation_ttl = range(0, 18) 32 | 33 | input_str = event.pattern_match.group(1) 34 | 35 | if input_str == "call": 36 | 37 | await event.edit(input_str) 38 | 39 | animation_chars = [ 40 | 41 | "`Connecting To Telegram Headquarters...`", 42 | "`Call Connected.`", 43 | "`Telegram: Hello This is Telegram HQ. Who is this?`", 44 | "`Me: Yo this is` @Dark_Princ3 ,`Please Connect me to my lil bro,Pavel Durov`", 45 | "`User Authorised.`", 46 | "`Calling Pavel Durov` `At +916969696969`", 47 | "`Private Call Connected...`", 48 | "`Me: Hello Sir, Please Ban This Telegram Account.`", 49 | "`Pavel: May I Know Who Is This?`", 50 | "`Me: Yo Brah, I Am` @Dark_Princ3 ", 51 | "`Pavel: OMG!!! Long time no see, Wassup Brother...\nI'll Make Sure That Guy Account Will Get Blocked Within 24Hrs.`", 52 | "`Me: Thanks, See You Later Brah.`", 53 | "`Pavel: Please Don't Thank Brah, Telegram Is Our's. Just Gimme A Call When You Become Free.`", 54 | "`Me: Is There Any Issue/Emergency???`", 55 | "`Pavel: Yes Sur, There Is A Bug In Telegram v69.6.9.\nI Am Not Able To Fix It. If Possible, Please Help Fix The Bug.`", 56 | "`Me: Send Me The App On My Telegram Account, I Will Fix The Bug & Send You.`", 57 | "`Pavel: Sure Sur \nTC Bye Bye :)`", 58 | "`Private Call Disconnected.`" 59 | ] 60 | 61 | for i in animation_ttl: 62 | 63 | await asyncio.sleep(animation_interval) 64 | 65 | await event.edit(animation_chars[i % 18]) 66 | -------------------------------------------------------------------------------- /userbot/plugins/chod.py: -------------------------------------------------------------------------------- 1 | from telethon import events 2 | import asyncio 3 | 4 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 5 | async def _(event): 6 | if event.fwd_from: 7 | return 8 | animation_interval = 0.1 9 | animation_ttl = range(0, 11) 10 | input_str = event.pattern_match.group(1) 11 | if input_str == "sqh": 12 | await event.edit(input_str) 13 | animation_chars = [ 14 | 15 | "`Downloading File..`", 16 | "`File Downloaded....`", 17 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 0%\n▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", 18 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 4%\n█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", 19 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 8%\n██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", 20 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 20%\n█████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", 21 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 36%\n█████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", 22 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 52%\n█████████████▒▒▒▒▒▒▒▒▒▒▒▒ `", 23 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 84%\n█████████████████████▒▒▒▒ `", 24 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 100%\n█████████████████████████ `", 25 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nTask: 01 of 01 Files Scanned...\n\nReault: No Virus Found...`" 26 | ] 27 | 28 | for i in animation_ttl: 29 | 30 | await asyncio.sleep(animation_interval) 31 | 32 | await event.edit(animation_chars[i % 11]) 33 | 34 | 35 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 36 | 37 | async def _(event): 38 | 39 | if event.fwd_from: 40 | 41 | return 42 | 43 | animation_interval = 5 44 | 45 | animation_ttl = range(0, 11) 46 | 47 | input_str = event.pattern_match.group(1) 48 | 49 | if input_str == "vquickheal": 50 | 51 | await event.edit(input_str) 52 | 53 | animation_chars = [ 54 | 55 | "`Downloading File..`", 56 | "`File Downloaded....`", 57 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 0%\n▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", 58 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 4%\n█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", 59 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 8%\n██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", 60 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 20%\n█████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", 61 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 36%\n█████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", 62 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 52%\n█████████████▒▒▒▒▒▒▒▒▒▒▒▒ `", 63 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 84%\n█████████████████████▒▒▒▒ `", 64 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nFile Scanned... 100%\n█████████████████████████ `", 65 | "`Quick Heal Total Security Checkup\n\n\nSubscription: Pru User\nValid Until: 31/12/2099\n\nTask: 01 of 01 Files Scanned...\n\nReault:⚠️Virus Found⚠️\nMore Info: Torzan, Spyware, Adware`" 66 | ] 67 | 68 | for i in animation_ttl: 69 | 70 | await asyncio.sleep(animation_interval) 71 | 72 | await event.edit(animation_chars[i % 11]) 73 | -------------------------------------------------------------------------------- /userbot/plugins/command_list.py: -------------------------------------------------------------------------------- 1 | from telethon import events 2 | import subprocess 3 | import asyncio 4 | import time 5 | 6 | 7 | @command(pattern="^.cmds", outgoing=True) 8 | async def install(event): 9 | if event.fwd_from: 10 | return 11 | cmd = "ls userbot/plugins" 12 | process = await asyncio.create_subprocess_shell( 13 | cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE 14 | ) 15 | stdout, stderr = await process.communicate() 16 | o = stdout.decode() 17 | _o = o.split("\n") 18 | o = "\n".join(_o) 19 | OUTPUT = f"**List of Plugins:**\n{o}\n\n**TIP:** __If you want to know the commands for a plugin, do:-__ \n `.help ` **without the < > brackets.**\n__All plugins might not work directly. Visit__ @XtraTgChat __for assistance.__" 20 | await event.edit(OUTPUT) 21 | -------------------------------------------------------------------------------- /userbot/plugins/currency.py: -------------------------------------------------------------------------------- 1 | """command: .currency usd inr""" 2 | from telethon import events 3 | import asyncio 4 | from datetime import datetime 5 | import requests 6 | from uniborg.util import admin_cmd 7 | 8 | 9 | @borg.on(admin_cmd(pattern="currency (.*)")) 10 | async def _(event): 11 | if event.fwd_from: 12 | return 13 | start = datetime.now() 14 | input_str = event.pattern_match.group(1) 15 | input_sgra = input_str.split(" ") 16 | if len(input_sgra) == 3: 17 | try: 18 | number = float(input_sgra[0]) 19 | currency_from = input_sgra[1].upper() 20 | currency_to = input_sgra[2].upper() 21 | request_url = "https://api.exchangeratesapi.io/latest?base={}".format(currency_from) 22 | current_response = requests.get(request_url).json() 23 | if currency_to in current_response["rates"]: 24 | current_rate = float(current_response["rates"][currency_to]) 25 | rebmun = round(number * current_rate, 2) 26 | await event.edit("**According to current rates,**\n {} **{}** = {} **{}**\n \n●▬▬▬▬▬ஜ۩❀۩ஜ▬▬▬▬▬●\n\n**Current Conversion Rates:**\n 1 **{}** = {} **{}**".format(number, currency_from, rebmun, currency_to, currency_from, current_rate, currency_to)) 27 | else: 28 | await event.edit("Welp, Hate to tell yout this but this Currency isn't supported **yet**.\n__Try__ `.currencies` __for a list of supported currencies.__") 29 | except e: 30 | await event.edit(str(e)) 31 | else: 32 | await event.edit("**Syntax:**\n.currency amount from to\n**Example:**\n`.currency 10 usd inr`") 33 | end = datetime.now() 34 | ms = (end - start).seconds 35 | 36 | 37 | @borg.on(admin_cmd(pattern="currencies (.*)")) 38 | async def list(ups): 39 | if ups.fwd_from: 40 | return 41 | request_url = "https://api.exchangeratesapi.io/latest?base=USD" 42 | current_response = requests.get(request_url).json() 43 | dil_wale_puch_de_na_chaaa = current_response["rates"] 44 | for key, value in dil_wale_puch_de_na_chaaa.items(): 45 | await borg.send_message(ups.chat_id, "**List of currencies:**\n {}\n*Tip:** Use `.gs` currency_code for more details on the currency.".format(key)) 46 | -------------------------------------------------------------------------------- /userbot/plugins/dagd.py: -------------------------------------------------------------------------------- 1 | """DA.GD helpers in @UniBorg 2 | Available Commands: 3 | .isup URL 4 | .dns google.com 5 | .url 6 | .unshort """ 7 | from telethon import events 8 | import os 9 | import requests 10 | import json 11 | from userbot.utils import admin_cmd 12 | 13 | 14 | @borg.on(admin_cmd("dns (.*)")) 15 | async def _(event): 16 | if event.fwd_from: 17 | return 18 | input_str = event.pattern_match.group(1) 19 | sample_url = "https://da.gd/dns/{}".format(input_str) 20 | response_api = requests.get(sample_url).text 21 | if response_api: 22 | await event.edit("DNS records of {} are \n{}".format(input_str, response_api)) 23 | else: 24 | await event.edit("i can't seem to find {} on the internet".format(input_str)) 25 | 26 | 27 | @borg.on(admin_cmd("url (.*)")) 28 | async def _(event): 29 | if event.fwd_from: 30 | return 31 | input_str = event.pattern_match.group(1) 32 | sample_url = "https://da.gd/s?url={}".format(input_str) 33 | response_api = requests.get(sample_url).text 34 | if response_api: 35 | await event.edit("Generated {} for {}.".format(response_api, input_str)) 36 | else: 37 | await event.edit("something is wrong. please try again later.") 38 | 39 | 40 | @borg.on(admin_cmd("unshort (.*)")) 41 | async def _(event): 42 | if event.fwd_from: 43 | return 44 | input_str = event.pattern_match.group(1) 45 | if not input_str.startswith("http"): 46 | input_str = "http://" + input_str 47 | r = requests.get(input_str, allow_redirects=False) 48 | if str(r.status_code).startswith('3'): 49 | await event.edit("Input URL: {}\nReDirected URL: {}".format(input_str, r.headers["Location"])) 50 | else: 51 | await event.edit("Input URL {} returned status_code {}".format(input_str, r.status_code)) 52 | -------------------------------------------------------------------------------- /userbot/plugins/decide.py: -------------------------------------------------------------------------------- 1 | """Quickly make a decision 2 | Syntax: .decide""" 3 | from telethon import events 4 | import requests 5 | from userbot.utils import admin_cmd 6 | 7 | 8 | @borg.on(admin_cmd("decide")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | message_id = event.message.id 13 | if event.reply_to_msg_id: 14 | message_id = event.reply_to_msg_id 15 | r = requests.get("https://yesno.wtf/api").json() 16 | await borg.send_message( 17 | event.chat_id, 18 | r["answer"], 19 | reply_to=message_id, 20 | file=r["image"] 21 | ) 22 | await event.delete() 23 | -------------------------------------------------------------------------------- /userbot/plugins/design.py: -------------------------------------------------------------------------------- 1 | """.admin Plugin for @UniBorg""" 2 | import asyncio 3 | from telethon import events 4 | from telethon.tl.types import ChannelParticipantsAdmins 5 | from userbot.utils import admin_cmd 6 | 7 | 8 | @borg.on(admin_cmd("join")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | mentions = "`━━━━━┓ \n┓┓┓┓┓┃\n┓┓┓┓┓┃ ヽ○ノ ⇦ Me When You Joined \n┓┓┓┓┓┃. /  \n┓┓┓┓┓┃ ノ) \n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃`" 13 | chat = await event.get_input_chat() 14 | async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins): 15 | mentions += f"" 16 | reply_message = None 17 | if event.reply_to_msg_id: 18 | reply_message = await event.get_reply_message() 19 | await reply_message.reply(mentions) 20 | else: 21 | await event.reply(mentions) 22 | await event.delete() 23 | 24 | @borg.on(admin_cmd("pay")) 25 | async def _(event): 26 | if event.fwd_from: 27 | return 28 | mentions = "`█▀▀▀▀▀█░▀▀░░░█░░░░█▀▀▀▀▀█\n█░███░█░█▄░█▀▀░▄▄░█░███░█\n█░▀▀▀░█░▀█▀▀▄▀█▀▀░█░▀▀▀░█\n▀▀▀▀▀▀▀░▀▄▀▄▀▄█▄▀░▀▀▀▀▀▀▀\n█▀█▀▄▄▀░█▄░░░▀▀░▄█░▄▀█▀░▀\n░█▄▀░▄▀▀░░░▄▄▄█░▀▄▄▄▀▄▄▀▄\n░░▀█░▀▀▀▀▀▄█░▄░████ ██▀█▄\n▄▀█░░▄▀█▀█▀░█▄▀░▀█▄██▀░█▄\n░░▀▀▀░▀░█▄▀▀▄▄░▄█▀▀▀█░█▀▀\n█▀▀▀▀▀█░░██▀█░░▄█░▀░█▄░██\n█░███░█░▄▀█▀██▄▄▀▀█▀█▄░▄▄\n█░▀▀▀░█░█░░▀▀▀░█░▀▀▀▀▄█▀░\n▀▀▀▀▀▀▀░▀▀░░▀░▀░░░▀▀░▀▀▀▀`" 29 | chat = await event.get_input_chat() 30 | async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins): 31 | mentions += f"" 32 | reply_message = None 33 | if event.reply_to_msg_id: 34 | reply_message = await event.get_reply_message() 35 | await reply_message.reply(mentions) 36 | else: 37 | await event.reply(mentions) 38 | await event.delete() 39 | -------------------------------------------------------------------------------- /userbot/plugins/dictionary.py: -------------------------------------------------------------------------------- 1 | """Dictionary Plugin for @UniBorg 2 | Syntax: .meaning """ 3 | 4 | import requests 5 | from telethon import events 6 | from uniborg.util import admin_cmd 7 | 8 | 9 | @borg.on(admin_cmd("meaning (.*)")) 10 | async def _(event): 11 | if event.fwd_from: 12 | return 13 | input_str = event.pattern_match.group(1) 14 | input_url = "https://bots.shrimadhavuk.me/dictionary/?s={}".format(input_str) 15 | headers = {"USER-AGENT": "UniBorg"} 16 | caption_str = f"Meaning of __{input_str}__\n" 17 | try: 18 | response = requests.get(input_url, headers=headers).json() 19 | pronounciation = response.get("p") 20 | meaning_dict = response.get("lwo") 21 | for current_meaning in meaning_dict: 22 | current_meaning_type = current_meaning.get("type") 23 | current_meaning_definition = current_meaning.get("definition") 24 | caption_str += f"**{current_meaning_type}**: {current_meaning_definition}\n\n" 25 | except Exception as e: 26 | caption_str = str(e) 27 | reply_msg_id = event.message.id 28 | if event.reply_to_msg_id: 29 | reply_msg_id = event.reply_to_msg_id 30 | try: 31 | await borg.send_file( 32 | event.chat_id, 33 | pronounciation, 34 | caption=f"Pronounciation of __{input_str}__", 35 | force_document=False, 36 | reply_to=reply_msg_id, 37 | allow_cache=True, 38 | voice_note=True, 39 | silent=True, 40 | supports_streaming=True 41 | ) 42 | except: 43 | pass 44 | await event.edit(caption_str) 45 | -------------------------------------------------------------------------------- /userbot/plugins/ding.py: -------------------------------------------------------------------------------- 1 | """Emoji 2 | 3 | Available Commands: 4 | 5 | .ding""" 6 | 7 | from telethon import events 8 | 9 | import asyncio 10 | 11 | 12 | 13 | 14 | 15 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 16 | 17 | async def _(event): 18 | 19 | if event.fwd_from: 20 | 21 | return 22 | 23 | animation_interval = 0.3 24 | 25 | animation_ttl = range(0, 10) 26 | 27 | input_str = event.pattern_match.group(1) 28 | 29 | if input_str == "ding": 30 | 31 | await event.edit(input_str) 32 | 33 | animation_chars = [ 34 | 35 | "🔴⬛⬛⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜", 36 | "⬜⬜⬛⬜⬜\n⬜⬛⬜⬜⬜\n🔴⬜⬜⬜⬜", 37 | "⬜⬜⬛⬜⬜\n⬜⬜⬛⬜⬜\n⬜⬜🔴⬜⬜", 38 | "⬜⬜⬛⬜⬜\n⬜⬜⬜⬛⬜\n⬜⬜⬜⬜🔴", 39 | "⬜⬜⬛⬛🔴\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜", 40 | "⬜⬜⬛⬜⬜\n⬜⬜⬜⬛⬜\n⬜⬜⬜⬜🔴", 41 | "⬜⬜⬛⬜⬜\n⬜⬜⬛⬜⬜\n⬜⬜🔴⬜⬜", 42 | "⬜⬜⬛⬜⬜\n⬜⬛⬜⬜⬜\n🔴⬜⬜⬜⬜", 43 | "🔴⬛⬛⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜", 44 | "⬜⬜⬜⬜⬜\n⬜ [BECOME A VIDHAYAK](https://github.com/Dark-Princ3/X-tra-Telegram/) ⬜\n⬜⬜⬜⬜⬜" 45 | 46 | ] 47 | 48 | for i in animation_ttl: 49 | 50 | await asyncio.sleep(animation_interval) 51 | 52 | await event.edit(animation_chars[i % 10]) 53 | -------------------------------------------------------------------------------- /userbot/plugins/dumpster.py: -------------------------------------------------------------------------------- 1 | from telethon import events 2 | import asyncio 3 | from userbot.utils import admin_cmd 4 | from telethon.errors.rpcerrorlist import MessageIdInvalidError 5 | 6 | 7 | @borg.on(admin_cmd(pattern="dump ?(.*)")) 8 | async def _(message): 9 | try: 10 | obj = message.pattern_match.group(1) 11 | if len(obj) != 3: 12 | raise IndexError 13 | inp = ' '.join(obj) 14 | except IndexError: 15 | inp = "🥞 🎂 🍫" 16 | u, t, g, o, s, n = inp.split(), '🗑', '<(^_^ <)', '(> ^_^)>', '⠀ ', '\n' 17 | h = [(u[0], u[1], u[2]), (u[0], u[1], ''), (u[0], '', '')] 18 | for something in reversed([y for y in ([''.join(x) for x in ( 19 | f + (s, g, s + s * f.count(''), t), f + (g, s * 2 + s * f.count(''), t), 20 | f[:i] + (o, f[i], s * 2 + s * f.count(''), t), f[:i] + (s + s * f.count(''), o, f[i], s, t), 21 | f[:i] + (s * 2 + s * f.count(''), o, f[i], t), f[:i] + (s * 3 + s * f.count(''), o, t), 22 | f[:i] + (s * 3 + s * f.count(''), g, t))] for i, f in enumerate(reversed(h)))]): 23 | for something_else in something: 24 | await asyncio.sleep(0.3) 25 | try: 26 | await message.edit(something_else) 27 | except MessageIdInvalidError: 28 | return 29 | -------------------------------------------------------------------------------- /userbot/plugins/eval.py: -------------------------------------------------------------------------------- 1 | """Evaluate Python Code inside Telegram 2 | Syntax: .eval PythonCode""" 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | from telethon import events, errors, functions, types 8 | import inspect 9 | import traceback 10 | import asyncio 11 | import sys 12 | import io 13 | from uniborg.util import admin_cmd 14 | 15 | 16 | @borg.on(admin_cmd("eval", allow_sudo=True)) 17 | @borg.on(admin_cmd("eval")) 18 | async def _(event): 19 | if event.fwd_from: 20 | return 21 | await event.edit("Processing ...") 22 | cmd = event.text.split(" ", maxsplit=1)[1] 23 | reply_to_id = event.message.id 24 | if event.reply_to_msg_id: 25 | reply_to_id = event.reply_to_msg_id 26 | 27 | old_stderr = sys.stderr 28 | old_stdout = sys.stdout 29 | redirected_output = sys.stdout = io.StringIO() 30 | redirected_error = sys.stderr = io.StringIO() 31 | stdout, stderr, exc = None, None, None 32 | 33 | try: 34 | await aexec(cmd, event) 35 | except Exception: 36 | exc = traceback.format_exc() 37 | 38 | stdout = redirected_output.getvalue() 39 | stderr = redirected_error.getvalue() 40 | sys.stdout = old_stdout 41 | sys.stderr = old_stderr 42 | 43 | evaluation = "" 44 | if exc: 45 | evaluation = exc 46 | elif stderr: 47 | evaluation = stderr 48 | elif stdout: 49 | evaluation = stdout 50 | else: 51 | evaluation = "Success" 52 | 53 | final_output = "**EVAL**: `{}` \n\n **OUTPUT**: \n`{}` \n".format(cmd, evaluation) 54 | 55 | if len(final_output) > Config.MAX_MESSAGE_SIZE_LIMIT: 56 | with io.BytesIO(str.encode(final_output)) as out_file: 57 | out_file.name = "eval.text" 58 | await borg.send_file( 59 | event.chat_id, 60 | out_file, 61 | force_document=True, 62 | allow_cache=False, 63 | caption=cmd, 64 | reply_to=reply_to_id 65 | ) 66 | await event.delete() 67 | else: 68 | await event.edit(final_output) 69 | 70 | 71 | async def aexec(code, event): 72 | exec( 73 | f'async def __aexec(event): ' + 74 | ''.join(f'\n {l}' for l in code.split('\n')) 75 | ) 76 | return await locals()['__aexec'](event) 77 | -------------------------------------------------------------------------------- /userbot/plugins/exec.py: -------------------------------------------------------------------------------- 1 | from telethon import events, errors, functions, types 2 | import inspect 3 | import traceback 4 | import asyncio 5 | import sys 6 | import io 7 | 8 | 9 | @command(pattern="^.exec") 10 | async def _(event): 11 | if event.fwd_from: 12 | return 13 | await event.edit("Processing ...") 14 | cmd = event.text.split(" ", maxsplit=1)[1] 15 | reply_to_id = event.message.id 16 | if event.reply_to_msg_id: 17 | reply_to_id = event.reply_to_msg_id 18 | 19 | old_stderr = sys.stderr 20 | old_stdout = sys.stdout 21 | redirected_output = sys.stdout = io.StringIO() 22 | redirected_error = sys.stderr = io.StringIO() 23 | stdout, stderr, exc = None, None, None 24 | 25 | try: 26 | await aexec(cmd, event) 27 | except Exception: 28 | exc = traceback.format_exc() 29 | 30 | stdout = redirected_output.getvalue() 31 | stderr = redirected_error.getvalue() 32 | sys.stdout = old_stdout 33 | sys.stderr = old_stderr 34 | 35 | evaluation = "" 36 | if exc: 37 | evaluation = exc 38 | elif stderr: 39 | evaluation = stderr 40 | elif stdout: 41 | evaluation = stdout 42 | else: 43 | evaluation = "Success" 44 | 45 | final_output = "**EXEC**: `{}` \n\n **OUTPUT**: \n`{}` \n".format(cmd, evaluation) 46 | 47 | if len(final_output) > 4096: 48 | with io.BytesIO(str.encode(final_output)) as out_file: 49 | out_file.name = "eval.text" 50 | await bot.send_file( 51 | event.chat_id, 52 | out_file, 53 | force_document=True, 54 | allow_cache=False, 55 | caption=f"**PROCCESSED**: `{cmd}`", 56 | reply_to=reply_to_id 57 | ) 58 | await event.delete() 59 | else: 60 | await event.edit(final_output) 61 | 62 | 63 | async def aexec(code, event): 64 | exec( 65 | f'async def __aexec(event): ' + 66 | ''.join(f'\n {l}' for l in code.split('\n')) 67 | ) 68 | return await locals()['__aexec'](event) 69 | -------------------------------------------------------------------------------- /userbot/plugins/figlet.py: -------------------------------------------------------------------------------- 1 | import pyfiglet 2 | 3 | @command(pattern="^.figlet ?(.*)", outgoing=True) 4 | async def figlet(event): 5 | if event.fwd_from: 6 | return 7 | CMD_FIG = {"slant": "slant", "3D": "3-d", "5line": "5lineoblique", "alpha": "alphabet", "banner": "banner3-D", "doh": "doh", "iso": "isometric1", "letter": "letters", "allig": "alligator", "dotm": "dotmatrix", "bubble": "bubble", "bulb": "bulbhead", "digi": "digital"} 8 | input_str = event.pattern_match.group(1) 9 | if "|" in input_str: 10 | text, cmd = input_str.split("|", maxsplit=1) 11 | elif input_str is not None: 12 | cmd = None 13 | text = input_str 14 | else: 15 | await event.edit("Please add some text to figlet") 16 | return 17 | if cmd is not None: 18 | try: 19 | font = CMD_FIG[cmd] 20 | except KeyError: 21 | await event.edit("Invalid selected font.") 22 | return 23 | result = pyfiglet.figlet_format(text, font=font) 24 | else: 25 | result = pyfiglet.figlet_format(text) 26 | await event.respond("‌‌‎`{}`".format(result)) 27 | await event.delete() 28 | -------------------------------------------------------------------------------- /userbot/plugins/fleaveme.py: -------------------------------------------------------------------------------- 1 | #Credit: @r4v4n4 2 | """Emoji 3 | 4 | Available Commands: 5 | 6 | .fleave""" 7 | 8 | from telethon import events 9 | 10 | import asyncio 11 | 12 | 13 | 14 | 15 | 16 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 17 | 18 | async def _(event): 19 | 20 | if event.fwd_from: 21 | 22 | return 23 | 24 | animation_interval = 1 25 | 26 | animation_ttl = range(0, 17) 27 | 28 | input_str = event.pattern_match.group(1) 29 | 30 | if input_str == "fleave": 31 | 32 | await event.edit(input_str) 33 | 34 | animation_chars = [ 35 | 36 | "⬛⬛⬛\n⬛⬛⬛\n⬛⬛⬛", 37 | "⬛⬛⬛\n⬛🔄⬛\n⬛⬛⬛", 38 | "⬛⬆️⬛\n⬛🔄⬛\n⬛⬛⬛", 39 | "⬛⬆️↗️\n⬛🔄⬛\n⬛⬛⬛", 40 | "⬛⬆️↗️\n⬛🔄➡️\n⬛⬛⬛", 41 | "⬛⬆️↗️\n⬛🔄➡️\n⬛⬛↘️", 42 | "⬛⬆️↗️\n⬛🔄➡️\n⬛⬇️↘️", 43 | "⬛⬆️↗️\n⬛🔄➡️\n↙️⬇️↘️", 44 | "⬛⬆️↗️\n⬅️🔄➡️\n↙️⬇️↘️", 45 | "↖️⬆️↗️\n⬅️🔄➡️\n↙️⬇️↘️", 46 | "**Chat Message Exported To** `./Inpu/`", 47 | "**Chat Message Exported To** `./Inpu/homework/`", 48 | "**Chat Message Exported To** `./Inpu/homework/groupchat.txt`", 49 | "__Legend is leaving this chat.....! Gaand Marao Bc..__", 50 | "__Legend is leaving this chat.....! Gaand Marao Bc..__" 51 | 52 | ] 53 | 54 | for i in animation_ttl: 55 | 56 | await asyncio.sleep(animation_interval) 57 | 58 | await event.edit(animation_chars[i % 17]) 59 | -------------------------------------------------------------------------------- /userbot/plugins/fpost (1).py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | """ Command: .fpost word 5 | 6 | credit: @r4v4n4""" 7 | 8 | import string 9 | 10 | from telethon import events 11 | from telethon.tl import types 12 | 13 | msg_cache = {} 14 | 15 | 16 | @borg.on(events.NewMessage(pattern=r"\.fpost\s+(.*)", outgoing=True)) 17 | async def _(event): 18 | await event.delete() 19 | text = event.pattern_match.group(1) 20 | destination = await event.get_input_chat() 21 | 22 | for c in text.lower(): 23 | if c not in string.ascii_lowercase: 24 | continue 25 | if c not in msg_cache: 26 | async for msg in borg.iter_messages(None, search=c): 27 | if msg.raw_text.lower() == c and msg.media is None: 28 | msg_cache[c] = msg 29 | break 30 | await borg.forward_messages(destination, msg_cache[c]) 31 | -------------------------------------------------------------------------------- /userbot/plugins/frybot.py: -------------------------------------------------------------------------------- 1 | #credits: @r4v4n4 2 | import datetime 3 | from telethon import events 4 | from telethon.errors.rpcerrorlist import YouBlockedUserError 5 | from telethon.tl.functions.account import UpdateNotifySettingsRequest 6 | from userbot.utils import admin_cmd 7 | 8 | @borg.on(admin_cmd("frybot ?(.*)")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | if not event.reply_to_msg_id: 13 | await event.edit("```Reply to any user message.```") 14 | return 15 | reply_message = await event.get_reply_message() 16 | if not reply_message.media: 17 | await event.edit("```reply to text message```") 18 | return 19 | chat = "@image_deepfrybot" 20 | sender = reply_message.sender 21 | if reply_message.sender.bot: 22 | await event.edit("```Reply to actual users message.```") 23 | return 24 | await event.edit("```Processing```") 25 | async with borg.conversation(chat) as conv: 26 | try: 27 | response = conv.wait_event(events.NewMessage(incoming=True,from_users=432858024)) 28 | await borg.forward_messages(chat, reply_message) 29 | response = await response 30 | except YouBlockedUserError: 31 | await event.reply("```Please unblock @sangmatainfo_bot and try again```") 32 | return 33 | if response.text.startswith("Forward"): 34 | await event.edit("```can you kindly disable your forward privacy settings for good?```") 35 | else: 36 | await borg.send_file(event.chat_id, response.message.media) 37 | -------------------------------------------------------------------------------- /userbot/plugins/fuck.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | Available Commands: 4 | 5 | .sux 6 | 7 | .fuk 8 | 9 | .kiss""" 10 | 11 | from telethon import events 12 | 13 | import asyncio 14 | 15 | 16 | 17 | 18 | 19 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 20 | 21 | async def _(event): 22 | 23 | if event.fwd_from: 24 | 25 | return 26 | 27 | animation_interval = 0.1 28 | 29 | animation_ttl = range(0, 101) 30 | 31 | input_str = event.pattern_match.group(1) 32 | 33 | if input_str == "fuk": 34 | 35 | await event.edit(input_str) 36 | 37 | animation_chars = [ 38 | 39 | "👉 ✊️", 40 | 41 | "👉 ✊️", 42 | 43 | "👉 ✊️", 44 | 45 | "👉✊️💦" 46 | 47 | ] 48 | 49 | for i in animation_ttl: 50 | 51 | await asyncio.sleep(animation_interval) 52 | 53 | await event.edit(animation_chars[i % 4]) 54 | 55 | 56 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 57 | 58 | async def _(event): 59 | 60 | if event.fwd_from: 61 | 62 | return 63 | 64 | animation_interval = 0.2 65 | 66 | animation_ttl = range(0, 101) 67 | 68 | input_str = event.pattern_match.group(1) 69 | 70 | if input_str == "sux": 71 | 72 | await event.edit(input_str) 73 | 74 | animation_chars = [ 75 | 76 | "🤵 👰", 77 | 78 | "🤵 👰", 79 | 80 | "🤵 👰", 81 | 82 | "🤵👼👰" 83 | 84 | ] 85 | 86 | for i in animation_ttl: 87 | 88 | await asyncio.sleep(animation_interval) 89 | 90 | await event.edit(animation_chars[i % 4]) 91 | 92 | 93 | "" 94 | 95 | 96 | from telethon import events 97 | 98 | import asyncio 99 | 100 | 101 | 102 | 103 | 104 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 105 | 106 | async def _(event): 107 | 108 | if event.fwd_from: 109 | 110 | return 111 | 112 | animation_interval = 0.2 113 | 114 | animation_ttl = range(0, 101) 115 | 116 | input_str = event.pattern_match.group(1) 117 | 118 | if input_str == "kiss": 119 | 120 | await event.edit(input_str) 121 | 122 | animation_chars = [ 123 | 124 | "🤵 👰", 125 | 126 | "🤵 👰", 127 | 128 | "🤵 👰", 129 | 130 | "🤵💋👰" 131 | 132 | ] 133 | 134 | for i in animation_ttl: 135 | 136 | await asyncio.sleep(animation_interval) 137 | 138 | await event.edit(animation_chars[i % 4]) 139 | -------------------------------------------------------------------------------- /userbot/plugins/gaand_me_loge.py: -------------------------------------------------------------------------------- 1 | """Emoji 2 | Available Commands: 3 | .emoji shrug 4 | .emoji apple 5 | .emoji :/ 6 | .emoji -_-""" 7 | from telethon import events 8 | import asyncio 9 | 10 | 11 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 12 | async def _(event): 13 | if event.fwd_from: 14 | return 15 | animation_interval = 0.3 16 | animation_ttl = range(0, 16) 17 | input_str = event.pattern_match.group(1) 18 | if input_str == "gaand": 19 | await event.edit(input_str) 20 | animation_chars = [ 21 | "me", 22 | "loge", 23 | "kya?", 24 | "gaand" 25 | ] 26 | for i in animation_ttl: 27 | await asyncio.sleep(animation_interval) 28 | await event.edit(animation_chars[i % 4]) 29 | -------------------------------------------------------------------------------- /userbot/plugins/gangasta.py: -------------------------------------------------------------------------------- 1 | from telethon import events 2 | import random, re 3 | from userbot.utils import admin_cmd 4 | import asyncio 5 | 6 | 7 | 8 | @borg.on(admin_cmd("gangasta ?(.*)")) 9 | async def _(event): 10 | if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "@", "!"): 11 | await event.edit("EVERyBOdy") 12 | await asyncio.sleep(0.3) 13 | await event.edit("iZ") 14 | await asyncio.sleep(0.2) 15 | await event.edit("GangSTur") 16 | await asyncio.sleep(0.5) 17 | await event.edit("UNtIL ") 18 | await asyncio.sleep(0.2) 19 | await event.edit("I") 20 | await asyncio.sleep(0.3) 21 | await event.edit("ArRivE") 22 | await asyncio.sleep(0.3) 23 | await event.edit("🔥🔥🔥") 24 | await asyncio.sleep(0.3) 25 | await event.edit("EVERyBOdy iZ GangSTur UNtIL I ArRivE 🔥🔥🔥") 26 | -------------------------------------------------------------------------------- /userbot/plugins/gbun.py: -------------------------------------------------------------------------------- 1 | # This is a troll indeed ffs *facepalm* 2 | import asyncio 3 | from telethon import events 4 | from telethon.tl.functions.users import GetFullUserRequest 5 | from telethon.tl.types import ChannelParticipantsAdmins 6 | from userbot.utils import admin_cmd 7 | 8 | 9 | @borg.on(admin_cmd("gbun")) 10 | async def gbun(event): 11 | if event.fwd_from: 12 | return 13 | gbunVar = event.text 14 | gbunVar = gbunVar[6:] 15 | mentions = "`Warning!! User 𝙂𝘽𝘼𝙉𝙉𝙀𝘿 By Admin...\n`" 16 | no_reason = "__Reason: Potential Porn Addict. __" 17 | await event.edit("**Summoning out le Gungnir ❗️⚜️☠️**") 18 | asyncio.sleep(3.5) 19 | chat = await event.get_input_chat() 20 | async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins): 21 | mentions += f"" 22 | reply_message = None 23 | if event.reply_to_msg_id: 24 | reply_message = await event.get_reply_message() 25 | replied_user = await event.client(GetFullUserRequest(reply_message.from_id)) 26 | firstname = replied_user.user.first_name 27 | usname = replied_user.user.username 28 | idd = reply_message.from_id 29 | # make meself invulnerable cuz why not xD 30 | if idd == 742506768: 31 | await reply_message.reply("`Wait a second, This is my master!`\n**How dare you threaten to ban my master nigger!**\n\n__Your account has been hacked! Pay 69$ to my master__ [Anubis](tg://user?id=742506768) __to release your account__😏") 32 | else: 33 | jnl=("`Warning!! `" 34 | "[{}](tg://user?id={})" 35 | "` 𝙂𝘽𝘼𝙉𝙉𝙀𝘿 By Admin...\n\n`" 36 | "**First Name: ** __{}__\n" 37 | "**ID : ** `{}`\n" 38 | ).format(firstname, idd, firstname, idd) 39 | if usname == None: 40 | jnl += "**Victim Nigga's username: ** `Doesn't own a username!`\n" 41 | elif usname != "None": 42 | jnl += "**Victim's username** : @{}\n".format(usname) 43 | if len(gbunVar) > 0: 44 | gbunm = "`{}`".format(gbunVar) 45 | gbunr = "**Reason: **"+gbunm 46 | jnl += gbunr 47 | else: 48 | jnl += no_reason 49 | await reply_message.reply(jnl) 50 | else: 51 | mention = "`Warning!! User 𝙂𝘽𝘼𝙉𝙉𝙀𝘿 By Admin...\nReason: Potential Porn Addict. `" 52 | await event.reply(mention) 53 | await event.delete() 54 | -------------------------------------------------------------------------------- /userbot/plugins/get_admin.py: -------------------------------------------------------------------------------- 1 | """Get Administrators of any Chat* 2 | Syntax: .get_admin""" 3 | from telethon import events 4 | from telethon.tl.types import ChannelParticipantsAdmins, ChannelParticipantAdmin, ChannelParticipantCreator 5 | from userbot.utils import admin_cmd 6 | 7 | 8 | @borg.on(admin_cmd("get_ad?(m)in ?(.*)")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | mentions = "**Admins in this Channel**: \n" 13 | should_mention_admins = False 14 | reply_message = None 15 | pattern_match_str = event.pattern_match.group(1) 16 | if "m" in pattern_match_str: 17 | should_mention_admins = True 18 | if event.reply_to_msg_id: 19 | reply_message = await event.get_reply_message() 20 | input_str = event.pattern_match.group(2) 21 | to_write_chat = await event.get_input_chat() 22 | chat = None 23 | if not input_str: 24 | chat = to_write_chat 25 | else: 26 | mentions_heading = "Admins in {} channel: \n".format(input_str) 27 | mentions = mentions_heading 28 | try: 29 | chat = await borg.get_entity(input_str) 30 | except Exception as e: 31 | await event.edit(str(e)) 32 | return None 33 | try: 34 | async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins): 35 | if not x.deleted: 36 | if isinstance(x.participant, ChannelParticipantCreator): 37 | mentions += "\n 👑 [{}](tg://user?id={}) `{}`".format(x.first_name, x.id, x.id) 38 | mentions += "\n" 39 | async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins): 40 | if not x.deleted: 41 | if isinstance(x.participant, ChannelParticipantAdmin): 42 | mentions += "\n ⚜️ [{}](tg://user?id={}) `{}`".format(x.first_name, x.id, x.id) 43 | else: 44 | mentions += "\n `{}`".format(x.id) 45 | except Exception as e: 46 | mentions += " " + str(e) + "\n" 47 | if should_mention_admins: 48 | if reply_message: 49 | await reply_message.reply(mentions) 50 | else: 51 | await event.reply(mentions) 52 | await event.delete() 53 | else: 54 | await event.edit(mentions) 55 | -------------------------------------------------------------------------------- /userbot/plugins/get_bot.py: -------------------------------------------------------------------------------- 1 | """ Get the Bots in any chat* 2 | Syntax: .get_bot""" 3 | from telethon import events 4 | from telethon.tl.types import ChannelParticipantAdmin, ChannelParticipantsBots 5 | from userbot.utils import admin_cmd 6 | 7 | 8 | @borg.on(admin_cmd("get_bot ?(.*)")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | mentions = "**Bots in this Channel**: \n" 13 | input_str = event.pattern_match.group(1) 14 | to_write_chat = await event.get_input_chat() 15 | chat = None 16 | if not input_str: 17 | chat = to_write_chat 18 | else: 19 | mentions = "Bots in {} channel: \n".format(input_str) 20 | try: 21 | chat = await borg.get_entity(input_str) 22 | except Exception as e: 23 | await event.edit(str(e)) 24 | return None 25 | try: 26 | async for x in borg.iter_participants(chat, filter=ChannelParticipantsBots): 27 | if isinstance(x.participant, ChannelParticipantAdmin): 28 | mentions += "\n ⚜️ [{}](tg://user?id={}) `{}`".format(x.first_name, x.id, x.id) 29 | else: 30 | mentions += "\n [{}](tg://user?id={}) `{}`".format(x.first_name, x.id, x.id) 31 | except Exception as e: 32 | mentions += " " + str(e) + "\n" 33 | await event.edit(mentions) 34 | -------------------------------------------------------------------------------- /userbot/plugins/get_id.py: -------------------------------------------------------------------------------- 1 | """Get ID of any Telegram media, or any user 2 | Syntax: .get_id""" 3 | from telethon import events 4 | from telethon.utils import pack_bot_file_id 5 | from userbot.utils import admin_cmd 6 | 7 | 8 | @borg.on(admin_cmd("get_id")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | if event.reply_to_msg_id: 13 | chat = await event.get_input_chat() 14 | r_msg = await event.get_reply_message() 15 | if r_msg.media: 16 | bot_api_file_id = pack_bot_file_id(r_msg.media) 17 | await event.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)) 18 | else: 19 | await event.edit("Current Chat ID: `{}`\nFrom User ID: `{}`".format(str(event.chat_id), str(r_msg.from_id))) 20 | else: 21 | await event.edit("Current Chat ID: `{}`".format(str(event.chat_id))) 22 | -------------------------------------------------------------------------------- /userbot/plugins/getmusic.py: -------------------------------------------------------------------------------- 1 | 2 | from telethon import events 3 | import subprocess 4 | from telethon.errors import MessageEmptyError, MessageTooLongError, MessageNotModifiedError 5 | import io 6 | import asyncio 7 | import time 8 | from userbot.utils import admin_cmd 9 | import glob 10 | import os 11 | try: 12 | import instantmusic , subprocess 13 | except: 14 | os.system("pip install instantmusic") 15 | 16 | 17 | 18 | os.system("rm -rf *.mp3") 19 | 20 | 21 | def bruh(name): 22 | 23 | os.system("instantmusic -q -s "+name) 24 | 25 | 26 | @borg.on(admin_cmd(pattern="song ?(.*)")) 27 | async def _(event): 28 | if event.fwd_from: 29 | return 30 | DELAY_BETWEEN_EDITS = 0.3 31 | PROCESS_RUN_TIME = 100 32 | cmd = event.pattern_match.group(1) 33 | reply_to_id = event.message.id 34 | if event.reply_to_msg_id: 35 | reply_to_id = event.reply_to_msg_id 36 | await event.edit("ok finding the song") 37 | bruh(str(cmd)) 38 | l = glob.glob("*.mp3") 39 | loa = l[0] 40 | await event.edit("sending song") 41 | await borg.send_file( 42 | event.chat_id, 43 | loa, 44 | force_document=True, 45 | allow_cache=False, 46 | caption=cmd, 47 | reply_to=reply_to_id 48 | ) 49 | os.system("rm -rf *.mp3") 50 | subprocess.check_output("rm -rf *.mp3",shell=True) 51 | -------------------------------------------------------------------------------- /userbot/plugins/gitcommit.py: -------------------------------------------------------------------------------- 1 | """ 2 | GITHUB File Uploader Plugin for userbot. Heroku Automation should be Enabled. Else u r not that lazy // For lazy people 3 | Instructions:- Set GITHUB_ACCESS_TOKEN and GIT_REPO_NAME Variables in Heroku vars First 4 | usage:- .commit reply_to_any_plugin //can be any type of file too. but for plugin must be in .py 5 | """ 6 | 7 | 8 | from github import Github 9 | import aiohttp 10 | import asyncio 11 | import os 12 | import time 13 | from datetime import datetime 14 | from telethon import events 15 | from telethon.tl.types import DocumentAttributeVideo 16 | 17 | 18 | GIT_TEMP_DIR = "./userbot/temp/" 19 | @command(pattern="^.commit", outgoing=True) 20 | async def download(event): 21 | if event.fwd_from: 22 | return 23 | if Var.GITHUB_ACCESS_TOKEN is None: 24 | await event.edit("`Please ADD Proper Access Token from github.com`") 25 | return 26 | if Var.GIT_REPO_NAME is None: 27 | await event.edit("`Please ADD Proper Github Repo Name of your userbot`") 28 | return 29 | mone = await event.reply("Processing ...") 30 | if not os.path.isdir(GIT_TEMP_DIR): 31 | os.makedirs(GIT_TEMP_DIR) 32 | start = datetime.now() 33 | reply_message = await event.get_reply_message() 34 | try: 35 | c_time = time.time() 36 | print("Downloading to TEMP directory") 37 | downloaded_file_name = await bot.download_media( 38 | reply_message.media, 39 | GIT_TEMP_DIR 40 | ) 41 | except Exception as e: 42 | await mone.edit(str(e)) 43 | else: 44 | end = datetime.now() 45 | ms = (end - start).seconds 46 | await event.delete() 47 | await mone.edit("Downloaded to `{}` in {} seconds.".format(downloaded_file_name, ms)) 48 | await mone.edit("Committing to Github....") 49 | await git_commit(downloaded_file_name, mone) 50 | 51 | async def git_commit(file_name,mone): 52 | content_list = [] 53 | access_token = Var.GITHUB_ACCESS_TOKEN 54 | g = Github(access_token) 55 | file = open(file_name,"r",encoding='utf-8') 56 | commit_data = file.read() 57 | repo = g.get_repo(Var.GIT_REPO_NAME) 58 | print(repo.name) 59 | create_file = True 60 | contents = repo.get_contents("") 61 | for content_file in contents: 62 | content_list.append(str(content_file)) 63 | print(content_file) 64 | for i in content_list: 65 | create_file = True 66 | if i == 'ContentFile(path="'+file_name+'")': 67 | return await mone.edit("`File Already Exists`") 68 | create_file = False 69 | file_name = "userbot/plugins/" + file_name 70 | if create_file == True: 71 | file_name = file_name.replace("./userbot/temp/","") 72 | print(file_name) 73 | try: 74 | repo.create_file(file_name, "Uploaded New Plugin", commit_data, branch="master") 75 | print("Committed File") 76 | ccess = Var.GIT_REPO_NAME 77 | ccess = ccess.strip() 78 | await mone.edit(f"`Commited On Your Github Repo`\n\n[Your STDPLUGINS](https://github.com/{ccess}/tree/master/userbot/plugins/)") 79 | except: 80 | print("Cannot Create Plugin") 81 | await mone.edit("Cannot Upload Plugin") 82 | else: 83 | return await mone.edit("`Committed Suicide`") 84 | -------------------------------------------------------------------------------- /userbot/plugins/github.py: -------------------------------------------------------------------------------- 1 | """Get information about an user on GitHub 2 | Syntax: .github USERNAME""" 3 | from telethon import events 4 | import requests 5 | from userbot.utils import admin_cmd 6 | 7 | 8 | @borg.on(admin_cmd("github (.*)")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | input_str = event.pattern_match.group(1) 13 | url = "https://api.github.com/users/{}".format(input_str) 14 | r = requests.get(url) 15 | if r.status_code != 404: 16 | b = r.json() 17 | avatar_url = b["avatar_url"] 18 | html_url = b["html_url"] 19 | gh_type = b["type"] 20 | name = b["name"] 21 | company = b["company"] 22 | blog = b["blog"] 23 | location = b["location"] 24 | bio = b["bio"] 25 | created_at = b["created_at"] 26 | await borg.send_file( 27 | event.chat_id, 28 | caption="""Name: [{}]({}) 29 | Type: {} 30 | Company: {} 31 | Blog: {} 32 | Location: {} 33 | Bio: {} 34 | Profile Created: {}""".format(name, html_url, gh_type, company, blog, location, bio, created_at), 35 | file=avatar_url, 36 | force_document=False, 37 | allow_cache=False, 38 | reply_to=event 39 | ) 40 | await event.delete() 41 | else: 42 | await event.edit("`{}`: {}".format(input_str, r.text)) 43 | -------------------------------------------------------------------------------- /userbot/plugins/gmute.py: -------------------------------------------------------------------------------- 1 | from userbot.plugins.sql_helper.mute_sql import is_muted, mute, unmute 2 | import asyncio 3 | 4 | @command(outgoing=True, pattern=r"^.gmute ?(\d+)?") 5 | async def startgmute(event): 6 | private = False 7 | if event.fwd_from: 8 | return 9 | elif event.is_private: 10 | await event.edit("Unexpected issues or ugly errors may occur!") 11 | await asyncio.sleep(3) 12 | private = True 13 | reply = await event.get_reply_message() 14 | if event.pattern_match.group(1) is not None: 15 | userid = event.pattern_match.group(1) 16 | elif reply is not None: 17 | userid = reply.sender_id 18 | elif private is True: 19 | userid = event.chat_id 20 | else: 21 | return await event.edit("Please reply to a user or add their into the command to gmute them.") 22 | chat_id = event.chat_id 23 | chat = await event.get_chat() 24 | if is_muted(userid, "gmute"): 25 | return await event.edit("This user is already gmuted") 26 | try: 27 | mute(userid, "gmute") 28 | except Exception as e: 29 | await event.edit("Error occured!\nError is " + str(e)) 30 | else: 31 | await event.edit("Successfully gmuted that person") 32 | 33 | @command(outgoing=True, pattern=r"^.ungmute ?(\d+)?") 34 | async def endgmute(event): 35 | private = False 36 | if event.fwd_from: 37 | return 38 | elif event.is_private: 39 | await event.edit("Unexpected issues or ugly errors may occur!") 40 | await asyncio.sleep(3) 41 | private = True 42 | reply = await event.get_reply_message() 43 | if event.pattern_match.group(1) is not None: 44 | userid = event.pattern_match.group(1) 45 | elif reply is not None: 46 | userid = reply.sender_id 47 | elif private is True: 48 | userid = event.chat_id 49 | else: 50 | return await event.edit("Please reply to a user or add their into the command to ungmute them.") 51 | chat_id = event.chat_id 52 | if not is_muted(userid, "gmute"): 53 | return await event.edit("This user is not gmuted") 54 | try: 55 | unmute(userid, "gmute") 56 | except Exception as e: 57 | await event.edit("Error occured!\nError is " + str(e)) 58 | else: 59 | await event.edit("Successfully ungmuted that person") 60 | 61 | @command(outgoing=True, pattern=r"^.gmute ?(\d+)?", allow_sudo=True) 62 | async def startgmute(event): 63 | private = False 64 | if event.fwd_from: 65 | return 66 | elif event.is_private: 67 | await event.edit("Unexpected issues or ugly errors may occur!") 68 | await asyncio.sleep(3) 69 | private = True 70 | reply = await event.get_reply_message() 71 | if event.pattern_match.group(1) is not None: 72 | userid = event.pattern_match.group(1) 73 | elif reply is not None: 74 | userid = reply.sender_id 75 | elif private is True: 76 | userid = event.chat_id 77 | else: 78 | return await event.edit("Please reply to a user or add their into the command to gmute them.") 79 | chat_id = event.chat_id 80 | chat = await event.get_chat() 81 | if is_muted(userid, "gmute"): 82 | return await event.edit("This user is already gmuted") 83 | try: 84 | mute(userid, "gmute") 85 | except Exception as e: 86 | await event.edit("Error occured!\nError is " + str(e)) 87 | else: 88 | await event.edit("Successfully gmuted that person") 89 | 90 | @command(outgoing=True, pattern=r"^.ungmute ?(\d+)?", allow_sudo=True) 91 | async def endgmute(event): 92 | private = False 93 | if event.fwd_from: 94 | return 95 | elif event.is_private: 96 | await event.edit("Unexpected issues or ugly errors may occur!") 97 | await asyncio.sleep(3) 98 | private = True 99 | reply = await event.get_reply_message() 100 | if event.pattern_match.group(1) is not None: 101 | userid = event.pattern_match.group(1) 102 | elif reply is not None: 103 | userid = reply.sender_id 104 | elif private is True: 105 | userid = event.chat_id 106 | else: 107 | return await event.edit("Please reply to a user or add their into the command to ungmute them.") 108 | chat_id = event.chat_id 109 | if not is_muted(userid, "gmute"): 110 | return await event.edit("This user is not gmuted") 111 | try: 112 | unmute(userid, "gmute") 113 | except Exception as e: 114 | await event.edit("Error occured!\nError is " + str(e)) 115 | else: 116 | await event.edit("Successfully ungmuted that person") 117 | 118 | @command(incoming=True) 119 | async def watcher(event): 120 | if is_muted(event.sender_id, "gmute"): 121 | await event.delete() 122 | -------------------------------------------------------------------------------- /userbot/plugins/google.py: -------------------------------------------------------------------------------- 1 | import os 2 | import time 3 | import asyncio 4 | import shutil 5 | from bs4 import BeautifulSoup 6 | import re 7 | from re import findall 8 | from search_engine_parser import GoogleSearch 9 | from asyncio import sleep 10 | from userbot.utils import register 11 | from telethon.tl.types import DocumentAttributeAudio 12 | 13 | @register(outgoing=True, pattern=r"^\.gs (.*)") 14 | async def gsearch(q_event): 15 | """ For .google command, do a Google search. """ 16 | match = q_event.pattern_match.group(1) 17 | page = findall(r"page=\d+", match) 18 | try: 19 | page = page[0] 20 | page = page.replace("page=", "") 21 | match = match.replace("page=" + page[0], "") 22 | except IndexError: 23 | page = 1 24 | search_args = (str(match), int(page)) 25 | gsearch = GoogleSearch() 26 | gresults = await gsearch.async_search(*search_args) 27 | msg = "" 28 | for i in range(len(gresults["links"])): 29 | try: 30 | title = gresults["titles"][i] 31 | link = gresults["links"][i] 32 | desc = gresults["descriptions"][i] 33 | msg += f"[{title}]({link})\n`{desc}`\n\n" 34 | except IndexError: 35 | break 36 | await q_event.edit("**Search Query:**\n`" + match + "`\n\n**Results:**\n" + 37 | msg, 38 | link_preview=False) 39 | -------------------------------------------------------------------------------- /userbot/plugins/gps.py: -------------------------------------------------------------------------------- 1 | """ 2 | Syntax : .gps 3 | credits :@mrconfused 4 | """ 5 | 6 | #help from @sunda005 and @SpEcHIDe 7 | # don't edit credits 8 | 9 | from geopy.geocoders import Nominatim 10 | from userbot.utils import admin_cmd 11 | from telethon.tl import types 12 | 13 | 14 | 15 | @borg.on(admin_cmd(pattern="gps ?(.*)")) 16 | async def gps(event): 17 | if event.fwd_from: 18 | return 19 | reply_to_id = event.message 20 | if event.reply_to_msg_id: 21 | reply_to_id = await event.get_reply_message() 22 | input_str = event.pattern_match.group(1) 23 | 24 | if not input_str: 25 | return await event.edit("what should i find give me location.") 26 | 27 | await event.edit("finding") 28 | 29 | geolocator = Nominatim(user_agent="catuserbot") 30 | geoloc = geolocator.geocode(input_str) 31 | 32 | if geoloc: 33 | lon = geoloc.longitude 34 | lat = geoloc.latitude 35 | await reply_to_id.reply( 36 | input_str, 37 | file=types.InputMediaGeoPoint( 38 | types.InputGeoPoint( 39 | lat, lon 40 | ) 41 | ) 42 | ) 43 | await event.delete() 44 | else: 45 | await event.edit("i coudn't find it") 46 | 47 | 48 | -------------------------------------------------------------------------------- /userbot/plugins/hack.py: -------------------------------------------------------------------------------- 1 | """Emoji 2 | Available Commands: 3 | .emoji shrug 4 | .emoji apple 5 | .emoji :/ 6 | .emoji -_-""" 7 | 8 | from telethon import events 9 | 10 | import asyncio 11 | 12 | 13 | 14 | 15 | 16 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 17 | 18 | async def _(event): 19 | 20 | if event.fwd_from: 21 | 22 | return 23 | 24 | animation_interval = 2 25 | 26 | animation_ttl = range(0, 11) 27 | 28 | input_str = event.pattern_match.group(1) 29 | 30 | if input_str == "hack": 31 | 32 | await event.edit(input_str) 33 | 34 | animation_chars = [ 35 | 36 | "`Connecting To Hacked Private Server...`", 37 | "`Target Selected.`", 38 | "`Hacking... 0%\n▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", 39 | "`Hacking... 4%\n█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", 40 | "`Hacking... 8%\n██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", 41 | "`Hacking... 20%\n█████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", 42 | "`Hacking... 36%\n█████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ `", 43 | "`Hacking... 52%\n█████████████▒▒▒▒▒▒▒▒▒▒▒▒ `", 44 | "`Hacking... 84%\n█████████████████████▒▒▒▒ `", 45 | "`Hacking... 100%\n█████████HACKED███████████ `", 46 | "`Targeted Account Hacked...\n\nPay 69$ To` @A_Dark_Princ3 `Or send nudes of female Homo Sapiens To Remove This Hack`" 47 | ] 48 | 49 | for i in animation_ttl: 50 | 51 | await asyncio.sleep(animation_interval) 52 | 53 | await event.edit(animation_chars[i % 11]) 54 | -------------------------------------------------------------------------------- /userbot/plugins/howtogoogle.py: -------------------------------------------------------------------------------- 1 | #Modded from dagd.py 2 | """ 3 | Animate How To Google 4 | Command .ggl Search Query 5 | By @loxxi 6 | """ 7 | 8 | from telethon import events 9 | import os 10 | import requests 11 | import json 12 | from userbot.utils import admin_cmd 13 | 14 | 15 | @borg.on(admin_cmd("ggl (.*)")) 16 | async def _(event): 17 | if event.fwd_from: 18 | return 19 | input_str = event.pattern_match.group(1) 20 | sample_url = "https://da.gd/s?url=https://lmgtfy.com/?q={}%26iie=1".format(input_str.replace(" ","+")) 21 | response_api = requests.get(sample_url).text 22 | if response_api: 23 | await event.edit("[{}]({})\n`Thank me Later 🙃` ".format(input_str,response_api.rstrip())) 24 | else: 25 | await event.edit("something is wrong. please try again later.") 26 | -------------------------------------------------------------------------------- /userbot/plugins/iffuci.py: -------------------------------------------------------------------------------- 1 | """iffuci.tk pastebin site 2 | Code written by @loxxi {iffuci} 3 | Syntax: .iffuci""" 4 | from telethon import events 5 | import asyncio 6 | from datetime import datetime 7 | import os 8 | import requests 9 | from userbot.utils import admin_cmd 10 | 11 | 12 | def progress(current, total): 13 | logger.info("Downloaded {} of {}\nCompleted {}".format(current, total, (current / total) * 100)) 14 | 15 | 16 | @borg.on(admin_cmd(pattern="iffuci ?(.*)")) 17 | async def _(event): 18 | if event.fwd_from: 19 | return 20 | start = datetime.now() 21 | if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): 22 | os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) 23 | input_str = event.pattern_match.group(1) 24 | message = "SYNTAX: `.iffuci `" 25 | if input_str: 26 | message = input_str 27 | elif event.reply_to_msg_id: 28 | previous_message = await event.get_reply_message() 29 | if previous_message.media: 30 | downloaded_file_name = await borg.download_media( 31 | previous_message, 32 | Config.TMP_DOWNLOAD_DIRECTORY, 33 | progress_callback=progress 34 | ) 35 | m_list = None 36 | with open(downloaded_file_name, "rb") as fd: 37 | m_list = fd.readlines() 38 | message = "" 39 | for m in m_list: 40 | message += m.decode("UTF-8") + "\r\n" 41 | os.remove(downloaded_file_name) 42 | else: 43 | message = previous_message.message 44 | else: 45 | message = "SYNTAX: `.iffuci `" 46 | url = "https://www.iffuci.tk/documents" 47 | r = requests.post(url, data=message.encode("UTF-8")).json() 48 | url = f"https://iffuci.tk/{r['key']}" 49 | end = datetime.now() 50 | ms = (end - start).seconds 51 | if r["isUrl"]: 52 | nurl = f"https://iffuci.tk/v/{r['key']}" 53 | await event.edit("code is pasted to {} in {} seconds. GoTo Original URL: {}".format(url, ms, nurl)) 54 | else: 55 | await event.edit("code is pasted to {} in {} seconds".format(url, ms)) 56 | -------------------------------------------------------------------------------- /userbot/plugins/images.py: -------------------------------------------------------------------------------- 1 | # Adapted from OpenUserBot for Uniborg, X-tra-Telegram 2 | 3 | """Download & Upload Images on Telegram\n 4 | Syntax: `.img ` or `.img (replied message)` 5 | \n Upgraded and Google Image Error Fixed by @NeoMatrix90 aka @kirito6969 6 | """ 7 | 8 | from userbot.googol_images import googleimagesdownload 9 | import os 10 | import shutil 11 | from re import findall 12 | from userbot.utils import admin_cmd 13 | 14 | 15 | @borg.on(admin_cmd(pattern="img ?(.*)")) 16 | async def img_sampler(event): 17 | await event.edit("`Processing...`") 18 | reply = await event.get_reply_message() 19 | if event.pattern_match.group(1): 20 | query = event.pattern_match.group(1) 21 | elif reply: 22 | query = reply.message 23 | else: 24 | await event.edit("`um, mind mentioning what I actually need to search for ;_;`") 25 | return 26 | 27 | lim = findall(r"lim=\d+", query) 28 | # lim = event.pattern_match.group(1) 29 | try: 30 | lim = lim[0] 31 | lim = lim.replace("lim=", "") 32 | query = query.replace("lim=" + lim[0], "") 33 | except IndexError: 34 | lim = 5 35 | response = googleimagesdownload() 36 | 37 | # creating list of arguments 38 | arguments = { 39 | "keywords": query, 40 | "limit": lim, 41 | "format": "jpg", 42 | "no_directory": "no_directory" 43 | } 44 | 45 | # passing the arguments to the function 46 | paths = response.download(arguments) 47 | lst = paths[0][query] 48 | await event.client.send_file(await event.client.get_input_entity(event.chat_id), lst) 49 | shutil.rmtree(os.path.dirname(os.path.abspath(lst[0]))) 50 | await event.delete() 51 | -------------------------------------------------------------------------------- /userbot/plugins/instant_install_ext_module.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 - 2020 DarkPrinc3 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from userbot import bot 16 | from telethon import events 17 | from telethon import functions, types 18 | from telethon.tl.types import InputMessagesFilterDocument 19 | from userbot.utils import command, remove_plugin, load_module 20 | from var import Var 21 | from pathlib import Path 22 | from userbot import LOAD_PLUG 23 | import sys 24 | import asyncio 25 | import traceback 26 | import os 27 | import userbot.utils 28 | 29 | @command(pattern="^.extdl", outgoing=True) 30 | async def install(event): 31 | if event.fwd_from: 32 | return 33 | chat = Var.PLUGIN_CHANNEL 34 | documentss = await borg.get_messages(chat, None , filter=InputMessagesFilterDocument) 35 | total = int(documentss.total) 36 | total_doxx = range(0, total) 37 | await event.delete() 38 | for ixo in total_doxx: 39 | mxo = documentss[ixo].id 40 | downloaded_file_name = await event.client.download_media(await borg.get_messages(chat, ids=mxo), "userbot/plugins/") 41 | if "(" not in downloaded_file_name: 42 | path1 = Path(downloaded_file_name) 43 | shortname = path1.stem 44 | load_module(shortname.replace(".py", "")) 45 | await borg.send_message(event.chat_id, "Installed Plugin `{}` successfully.".format(os.path.basename(downloaded_file_name))) 46 | else: 47 | await borg.send_message(event.chat_id, "Plugin `{}` has been pre-installed and cannot be installed.".format(os.path.basename(downloaded_file_name))) 48 | -------------------------------------------------------------------------------- /userbot/plugins/jainder.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from telethon import events 5 | import random 6 | import asyncio 7 | 8 | @borg.on(events.NewMessage(pattern=r"\.jainder(.*)", outgoing=True)) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | input_str = event.pattern_match.group(1) 13 | if input_str in "ex": 14 | emoticons = [ 15 | "u is mard", 16 | "u is man", 17 | "u is aurat", 18 | "u is woman", 19 | "u is gey", 20 | "u is chakka", 21 | ] 22 | elif input_str in "thinking": 23 | emoticons = [ 24 | "(҂⌣̀_⌣́)", 25 | "(;¬_¬)", 26 | "(-。-;", 27 | "┌[ O ʖ̯ O ]┐", 28 | "〳 ͡° Ĺ̯ ͡° 〵", 29 | ] 30 | elif input_str in "waving": 31 | emoticons = [ 32 | "(ノ^∇^)", 33 | "(;-_-)/", 34 | "@(o・ェ・)@ノ", 35 | "ヾ(^-^)ノ", 36 | "ヾ(◍’౪◍)ノ゙♡", 37 | "(ό‿ὸ)ノ", 38 | "(ヾ(´・ω・`)", 39 | ] 40 | elif input_str in "wtf": 41 | emoticons = [ 42 | "༎ຶ‿༎ຶ", 43 | "(‿ˠ‿)", 44 | "╰U╯☜(◉ɷ◉ )", 45 | "(;´༎ຶ益༎ຶ)♡", 46 | "╭∩╮(︶ε︶*)chu", 47 | "( ^◡^)っ (‿|‿)", 48 | ] 49 | elif input_str in "love": 50 | emoticons = [ 51 | "乂❤‿❤乂", 52 | "(。♥‿♥。)", 53 | "( ͡~ ͜ʖ ͡°)", 54 | "໒( ♥ ◡ ♥ )७", 55 | "༼♥ل͜♥༽", 56 | ] 57 | elif input_str in "confused": 58 | emoticons = [ 59 | "(・_・ヾ", 60 | "「(゚ペ)", 61 | "﴾͡๏̯͡๏﴿", 62 | "( ̄■ ̄;)!?", 63 | "▐ ˵ ͠° (oo) °͠ ˵ ▐", 64 | "(-_-)ゞ゛", 65 | ] 66 | elif input_str in "dead": 67 | emoticons = [ 68 | "(✖╭╮✖)", 69 | "✖‿✖", 70 | "(+_+)", 71 | "(✖﹏✖)", 72 | "∑(✘Д✘๑)", 73 | ] 74 | elif input_str in "sad": 75 | emoticons = [ 76 | "(@´_`@)", 77 | "⊙︿⊙", 78 | "(▰˘︹˘▰)", 79 | "●︿●", 80 | "( ´_ノ` )", 81 | "彡(-_-;)彡", 82 | ] 83 | elif input_str in "dog": 84 | emoticons = [ 85 | "-ᄒᴥᄒ-", 86 | "◖⚆ᴥ⚆◗", 87 | ] 88 | else: 89 | emoticons = [ 90 | "( ͡° ͜ʖ ͡°)", 91 | "¯\_(ツ)_/¯", 92 | "( ͡°( ͡° ͜ʖ( ͡° ͜ʖ ͡°)ʖ ͡°) ͡°)", 93 | "ʕ•ᴥ•ʔ", 94 | "(▀ Ĺ̯▀ )", 95 | "(ง ͠° ͟ل͜ ͡°)ง", 96 | "༼ つ ◕_◕ ༽つ", 97 | "ಠ_ಠ", 98 | "(☞ ͡° ͜ʖ ͡°)☞", 99 | "¯\_༼ ି ~ ି ༽_/¯", 100 | "c༼ ͡° ͜ʖ ͡° ༽⊃", 101 | ] 102 | index = random.randint(0, len(emoticons)) 103 | output_str = emoticons[index] 104 | await event.edit(output_str) 105 | -------------------------------------------------------------------------------- /userbot/plugins/json.py: -------------------------------------------------------------------------------- 1 | """Get Detailed info about any message 2 | Syntax: .json""" 3 | from telethon import events 4 | import io 5 | from userbot.utils import admin_cmd 6 | 7 | 8 | @borg.on(admin_cmd("json")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | the_real_message = None 13 | reply_to_id = None 14 | if event.reply_to_msg_id: 15 | previous_message = await event.get_reply_message() 16 | the_real_message = previous_message.stringify() 17 | reply_to_id = event.reply_to_msg_id 18 | else: 19 | the_real_message = event.stringify() 20 | reply_to_id = event.message.id 21 | if len(the_real_message) > Config.MAX_MESSAGE_SIZE_LIMIT: 22 | with io.BytesIO(str.encode(the_real_message)) as out_file: 23 | out_file.name = "json.text" 24 | await borg.send_file( 25 | event.chat_id, 26 | out_file, 27 | force_document=True, 28 | allow_cache=False, 29 | reply_to=reply_to_id 30 | ) 31 | await event.delete() 32 | else: 33 | await event.edit("`{}`".format(the_real_message)) 34 | -------------------------------------------------------------------------------- /userbot/plugins/labstack.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 - 2020 DarkPrinc3 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from datetime import datetime 15 | import os 16 | import requests 17 | import subprocess 18 | import time 19 | import json 20 | import sys 21 | 22 | @command(pattern="^.labstack ?(.*)") 23 | async def labstack(event): 24 | if event.fwd_from: 25 | return 26 | await event.edit("Processing...") 27 | input_str = event.pattern_match.group(1) 28 | reply = await event.get_reply_message() 29 | if input_str: 30 | filebase = input_str 31 | elif reply: 32 | filebase = await event.client.download_media(reply.media, Var.TEMP_DOWNLOAD_DIRECTORY) 33 | else: 34 | await event.edit("Reply to a media file or provide a directory to upload the file to labstack") 35 | return 36 | filesize = os.path.getsize(filebase) 37 | filename = os.path.basename(filebase) 38 | headers2 = {'Up-User-ID': 'IZfFbjUcgoo3Ao3m'} 39 | files2 = {"ttl":604800,"files":[{"name": filename, "type": "", "size": filesize}]} 40 | r2 = requests.post("https://up.labstack.com/api/v1/links", json=files2, headers=headers2) 41 | r2json = json.loads(r2.text) 42 | 43 | url = "https://up.labstack.com/api/v1/links/{}/send".format(r2json['code']) 44 | max_days = 7 45 | command_to_exec = [ 46 | "curl", 47 | "-F", "files=@" + filebase, 48 | "-H","Transfer-Encoding: chunked", 49 | "-H","Up-User-ID: IZfFbjUcgoo3Ao3m", 50 | url 51 | ] 52 | try: 53 | logger.info(command_to_exec) 54 | t_response = subprocess.check_output(command_to_exec, stderr=subprocess.STDOUT) 55 | except subprocess.CalledProcessError as exc: 56 | logger.info("Status : FAIL", exc.returncode, exc.output) 57 | await event.edit(exc.output.decode("UTF-8")) 58 | return 59 | else: 60 | logger.info(t_response) 61 | t_response_arry = "https://up.labstack.com/api/v1/links/{}/receive".format(r2json['code']) 62 | await event.edit(t_response_arry + "\nMax Days:" + str(max_days), link_preview=False) 63 | 64 | -------------------------------------------------------------------------------- /userbot/plugins/list_user_names_reserved_by_me.py: -------------------------------------------------------------------------------- 1 | # For @UniBorg 2 | # (c) Shrimadhav U K 3 | 4 | from telethon import events, functions, types 5 | import asyncio 6 | 7 | 8 | @borg.on(events.NewMessage(pattern=r"\-listmyusernames", outgoing=True)) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | result = await borg(functions.channels.GetAdminedPublicChannelsRequest()) 13 | output_str = "" 14 | for channel_obj in result.chats: 15 | output_str += f"- {channel_obj.title} @{channel_obj.username} \n" 16 | await event.edit(output_str) 17 | -------------------------------------------------------------------------------- /userbot/plugins/lydia.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 - 2020 DarkPrinc3 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from coffeehouse.lydia import LydiaAI 16 | from coffeehouse.api import API 17 | import asyncio 18 | from telethon import events 19 | 20 | # Non-SQL Mode 21 | ACC_LYDIA = {} 22 | 23 | if Var.LYDIA_API_KEY: 24 | api_key = Var.LYDIA_API_KEY 25 | api_client = API(api_key) 26 | lydia = LydiaAI(api_client) 27 | 28 | @command(pattern="^.repcf", outgoing=True) 29 | async def repcf(event): 30 | if event.fwd_from: 31 | return 32 | await event.edit("Processing...") 33 | try: 34 | session = lydia.create_session() 35 | session_id = session.id 36 | reply = await event.get_reply_message() 37 | msg = reply.text 38 | text_rep = session.think_thought(msg) 39 | await event.edit("**sun bsdk**: {0}".format(text_rep)) 40 | except Exception as e: 41 | await event.edit(str(e)) 42 | 43 | @command(pattern="^.addcf", outgoing=True) 44 | async def addcf(event): 45 | if event.fwd_from: 46 | return 47 | await event.edit("Running on Non-SQL mode for now...") 48 | await asyncio.sleep(3) 49 | await event.edit("Processing...") 50 | reply_msg = await event.get_reply_message() 51 | if reply_msg: 52 | session = lydia.create_session() 53 | session_id = session.id 54 | if reply_msg.from_id is None: 55 | return await event.edit("Invalid user type.") 56 | ACC_LYDIA.update({(event.chat_id & reply_msg.from_id): session}) 57 | await event.edit("Lydia successfully (re)enabled for user: {} in chat: {}".format(str(reply_msg.from_id), str(event.chat_id))) 58 | else: 59 | await event.edit("Reply to a user to activate Lydia AI on them") 60 | 61 | @command(pattern="^.remcf", outgoing=True) 62 | async def remcf(event): 63 | if event.fwd_from: 64 | return 65 | await event.edit("Running on Non-SQL mode for now...") 66 | await asyncio.sleep(3) 67 | await event.edit("Processing...") 68 | reply_msg = await event.get_reply_message() 69 | try: 70 | del ACC_LYDIA[event.chat_id & reply_msg.from_id] 71 | await event.edit("Lydia successfully disabled for user: {} in chat: {}".format(str(reply_msg.from_id), str(event.chat_id))) 72 | except Exception: 73 | await event.edit("This person does not have Lydia activated on him/her.") 74 | 75 | 76 | @bot.on(events.NewMessage(incoming=True)) 77 | async def user(event): 78 | user_text = event.text 79 | try: 80 | session = ACC_LYDIA[event.chat_id & event.from_id] 81 | msg = event.text 82 | async with event.client.action(event.chat_id, "typing"): 83 | text_rep = session.think_thought(msg) 84 | wait_time = 0 85 | for i in range(len(text_rep)): 86 | wait_time = wait_time + 0.1 87 | await asyncio.sleep(wait_time) 88 | await event.reply(text_rep) 89 | except (KeyError, TypeError): 90 | return 91 | -------------------------------------------------------------------------------- /userbot/plugins/meme.py: -------------------------------------------------------------------------------- 1 | """ 2 | Memes Plugin for Userbot 3 | usage = .meme someCharacter //default delay will be 3 4 | By : - @Zero_cool7870 5 | 6 | """ 7 | from telethon import events 8 | import asyncio 9 | import os 10 | import sys 11 | 12 | 13 | @borg.on(events.NewMessage(pattern=r"\.meme", outgoing=True)) 14 | async def meme(event): 15 | if event.fwd_from: 16 | return 17 | memeVar = event.text 18 | sleepValue = 3 19 | memeVar = memeVar[6:] 20 | 21 | await event.edit("-------------"+memeVar) 22 | await event.edit("------------"+memeVar+"-") 23 | await event.edit("-----------"+memeVar+"--") 24 | await event.edit("----------"+memeVar+"---") 25 | await event.edit("---------"+memeVar+"----") 26 | await event.edit("--------"+memeVar+"-----") 27 | await event.edit("-------"+memeVar+"------") 28 | await event.edit("------"+memeVar+"-------") 29 | await event.edit("-----"+memeVar+"--------") 30 | await event.edit("----"+memeVar+"---------") 31 | await event.edit("---"+memeVar+"----------") 32 | await event.edit("--"+memeVar+"-----------") 33 | await event.edit("-"+memeVar+"------------") 34 | await event.edit(memeVar+"-------------") 35 | await event.edit(memeVar) 36 | await asyncio.sleep(sleepValue) 37 | 38 | """ 39 | Bonus : Flower Boquee Generater 40 | usage:- .flower 41 | 42 | """ 43 | @borg.on(events.NewMessage(pattern=r"\.flower", outgoing=True)) 44 | async def meme(event): 45 | if event.fwd_from: 46 | return 47 | flower =" 🌹" 48 | sleepValue = 5 49 | 50 | await event.edit(flower+" ") 51 | await event.edit(flower+flower+" ") 52 | await event.edit(flower+flower+flower+" ") 53 | await event.edit(flower+flower+flower+flower+" ") 54 | await event.edit(flower+flower+flower+flower+flower+" ") 55 | await event.edit(flower+flower+flower+flower+flower+flower+flower+" ") 56 | await event.edit(flower+flower+flower+flower+flower+flower+flower+flower+" ") 57 | await event.edit(flower+flower+flower+flower+flower+flower+flower+flower+flower+" ") 58 | await event.edit(flower+flower+flower+flower+flower+flower+flower+flower+flower+flower) 59 | await asyncio.sleep(sleepValue) 60 | 61 | -------------------------------------------------------------------------------- /userbot/plugins/mention: -------------------------------------------------------------------------------- 1 | # For Uniborg 2 | # (c) @INF1N17Y 3 | 4 | from telethon import events 5 | from uniborg.util import admin_cmd 6 | 7 | 8 | @borg.on(admin_cmd("mention (.*)")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | input_str = event.pattern_match.group(1) 13 | if event.reply_to_msg_id: 14 | previous_message = await event.get_reply_message() 15 | if previous_message.forward: 16 | replied_user = previous_message.forward.from_id 17 | else: 18 | replied_user = previous_message.from_id 19 | else: 20 | await event.edit("reply To Message") 21 | user_id = replied_user 22 | caption = """{}""".format(user_id, input_str) 23 | await event.edit(caption, parse_mode="HTML") 24 | -------------------------------------------------------------------------------- /userbot/plugins/mf.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from telethon import events, functions, __version__ 3 | from userbot.utils import admin_cmd 4 | 5 | 6 | @borg.on(admin_cmd(pattern="mf ?(.*)", allow_sudo=True)) # pylint:disable=E0602 7 | async def _(event): 8 | if event.fwd_from: 9 | return 10 | splugin_name = event.pattern_match.group(1) 11 | if splugin_name in borg._plugins: 12 | s_help_string = borg._plugins[splugin_name].__doc__ 13 | else: 14 | s_help_string = "" 15 | help_string = """ 16 | ......................................../´¯/) 17 | ......................................,/¯../ 18 | ...................................../..../ 19 | ..................................../´.¯/ 20 | ..................................../´¯/ 21 | ..................................,/¯../ 22 | ................................../..../ 23 | ................................./´¯./ 24 | ................................/´¯./ 25 | ..............................,/¯../ 26 | ............................./..../ 27 | ............................/´¯/ 28 | ........................../´¯./ 29 | ........................,/¯../ 30 | ......................./..../ 31 | ....................../´¯/ 32 | ....................,/¯../ 33 | .................../..../ 34 | ............./´¯/'...'/´¯¯`·¸ 35 | ........../'/.../..../......./¨¯\ 36 | ........('(...´...´.... ¯~/'...') 37 | .........\.................'...../ 38 | ..........''...\.......... _.·´ 39 | ............\..............( 40 | ..............\.............\... 41 | """.format( 42 | sys.version, 43 | __version__ 44 | ) 45 | tgbotusername = Config.TG_BOT_USER_NAME_BF_HER # pylint:disable=E0602 46 | if tgbotusername is not None: 47 | results = await borg.inline_query( # pylint:disable=E0602 48 | tgbotusername, 49 | help_string + "\n\n" + s_help_string 50 | ) 51 | await results[0].click( 52 | event.chat_id, 53 | reply_to=event.reply_to_msg_id, 54 | hide_via=True 55 | ) 56 | await event.delete() 57 | else: 58 | await event.reply(help_string + "\n\n" + s_help_string) 59 | await event.delete() 60 | 61 | 62 | @borg.on(admin_cmd(pattern="dc")) # pylint:disable=E0602 63 | async def _(event): 64 | if event.fwd_from: 65 | return 66 | result = await borg(functions.help.GetNearestDcRequest()) # pylint:disable=E0602 67 | await event.edit(result.stringify()) 68 | 69 | 70 | @borg.on(admin_cmd(pattern="config")) # pylint:disable=E0602 71 | async def _(event): 72 | if event.fwd_from: 73 | return 74 | result = await borg(functions.help.GetConfigRequest()) # pylint:disable=E0602 75 | result = result.stringify() 76 | logger.info(result) # pylint:disable=E0602 77 | await event.edit("""Telethon UserBot powered by @UniBorg""") 78 | -------------------------------------------------------------------------------- /userbot/plugins/moon.py: -------------------------------------------------------------------------------- 1 | """Emoji 2 | 3 | Available Commands: 4 | 5 | .emoji shrug 6 | 7 | .emoji apple 8 | 9 | .emoji :/ 10 | 11 | .emoji -_-""" 12 | 13 | from telethon import events 14 | 15 | import asyncio 16 | 17 | 18 | 19 | 20 | 21 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 22 | 23 | async def _(event): 24 | 25 | if event.fwd_from: 26 | 27 | return 28 | 29 | animation_interval = 0.1 30 | 31 | animation_ttl = range(0, 101) 32 | 33 | input_str = event.pattern_match.group(1) 34 | 35 | if input_str == "smoon": 36 | 37 | await event.edit(input_str) 38 | 39 | animation_chars = [ 40 | 41 | "🌗🌗🌗🌗🌗\n🌓🌓🌓🌓🌓\n🌗🌗🌗🌗🌗\n🌓🌓🌓🌓🌓\n🌗🌗🌗🌗🌗", 42 | "🌘🌘🌘🌘🌘\n🌔🌔🌔🌔🌔\n🌘🌘🌘🌘🌘\n🌔🌔🌔🌔🌔\n🌘🌘🌘🌘🌘", 43 | "🌑🌑🌑🌑🌑\n🌕🌕🌕🌕🌕\n🌑🌑🌑🌑🌑\n🌕🌕🌕🌕🌕\n🌑🌑🌑🌑🌑", 44 | "🌒🌒🌒🌒🌒\n🌖🌖🌖🌖🌖\n🌒🌒🌒🌒🌒\n🌖🌖🌖🌖🌖\n🌒🌒🌒🌒🌒", 45 | "🌓🌓🌓🌓🌓\n🌓🌓🌓🌓🌓\n🌓🌓🌓🌓🌓\n🌗🌗🌗🌗🌗\n🌓🌓🌓🌓🌓", 46 | "🌔🌔🌔🌔🌔\n🌘🌘🌘🌘🌘\n🌔🌔🌔🌔🌔\n🌘🌘🌘🌘🌘\n🌔🌔🌔🌔🌔", 47 | "🌕🌕🌕🌕🌕\n🌑🌑🌑🌑🌑\n🌕🌕🌕🌕🌕\n🌑🌑🌑🌑🌑\n🌕🌕🌕🌕🌕", 48 | "🌖🌖🌖🌖🌖\n🌒🌒🌒🌒🌒\n🌖🌖🌖🌖🌖\n🌒🌒🌒🌒🌒\n🌖🌖🌖🌖🌖" 49 | ] 50 | 51 | for i in animation_ttl: 52 | 53 | await asyncio.sleep(animation_interval) 54 | 55 | await event.edit(animation_chars[i % 8]) 56 | 57 | 58 | 59 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 60 | 61 | async def _(event): 62 | 63 | if event.fwd_from: 64 | 65 | return 66 | 67 | animation_interval = 0.1 68 | 69 | animation_ttl = range(0, 117) 70 | 71 | input_str = event.pattern_match.group(1) 72 | 73 | if input_str == "tmoon": 74 | 75 | await event.edit(input_str) 76 | 77 | animation_chars = [ 78 | 79 | "🌗", 80 | "🌘", 81 | "🌑", 82 | "🌒", 83 | "🌓", 84 | "🌔", 85 | "🌕", 86 | "🌖", 87 | "🌗", 88 | "🌘", 89 | "🌑", 90 | "🌒", 91 | "🌓", 92 | "🌔", 93 | "🌕", 94 | "🌖", 95 | "🌗", 96 | "🌘", 97 | "🌑", 98 | "🌒", 99 | "🌓", 100 | "🌔", 101 | "🌕", 102 | "🌖", 103 | "🌗", 104 | "🌘", 105 | "🌑", 106 | "🌒", 107 | "🌓", 108 | "🌔", 109 | "🌕", 110 | "🌖" 111 | ] 112 | 113 | for i in animation_ttl: 114 | 115 | await asyncio.sleep(animation_interval) 116 | 117 | await event.edit(animation_chars[i % 117]) 118 | 119 | -------------------------------------------------------------------------------- /userbot/plugins/mtn.py: -------------------------------------------------------------------------------- 1 | """Emoji 2 | Available Commands: 3 | .emoji shrug 4 | .emoji apple 5 | .emoji :/ 6 | .emoji -_-""" 7 | 8 | from telethon import events 9 | 10 | import asyncio 11 | 12 | 13 | 14 | 15 | 16 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 17 | 18 | async def _(event): 19 | 20 | if event.fwd_from: 21 | 22 | return 23 | 24 | animation_interval = 1 25 | 26 | animation_ttl = range(0, 19) 27 | 28 | input_str = event.pattern_match.group(1) 29 | 30 | if input_str == "mtn": 31 | 32 | await event.edit(input_str) 33 | 34 | animation_chars = [ 35 | 36 | "`Connecting To MTN NG ....`", 37 | "`█ ▇ ▆ ▅ ▄ ▂ ▁`", 38 | "`▒ ▇ ▆ ▅ ▄ ▂ ▁`", 39 | "`▒ ▒ ▆ ▅ ▄ ▂ ▁`", 40 | "`▒ ▒ ▒ ▅ ▄ ▂ ▁`", 41 | "`▒ ▒ ▒ ▒ ▄ ▂ ▁`", 42 | "`▒ ▒ ▒ ▒ ▒ ▂ ▁`", 43 | "`▒ ▒ ▒ ▒ ▒ ▒ ▁`", 44 | "`▒ ▒ ▒ ▒ ▒ ▒ ▒`", 45 | "*Optimising Network...*", 46 | "`▒ ▒ ▒ ▒ ▒ ▒ ▒`", 47 | "`▁ ▒ ▒ ▒ ▒ ▒ ▒`", 48 | "`▁ ▂ ▒ ▒ ▒ ▒ ▒`", 49 | "`▁ ▂ ▄ ▒ ▒ ▒ ▒`", 50 | "`▁ ▂ ▄ ▅ ▒ ▒ ▒`", 51 | "`▁ ▂ ▄ ▅ ▆ ▒ ▒`", 52 | "`▁ ▂ ▄ ▅ ▆ ▇ ▒`", 53 | "`▁ ▂ ▄ ▅ ▆ ▇ █`", 54 | "**MTN Network Boosted....**" 55 | 56 | ] 57 | 58 | for i in animation_ttl: 59 | 60 | await asyncio.sleep(animation_interval) 61 | 62 | await event.edit(animation_chars[i % 19]) 63 | -------------------------------------------------------------------------------- /userbot/plugins/music.py: -------------------------------------------------------------------------------- 1 | """ 2 | Available Commands: 3 | .music""" 4 | 5 | from telethon import events 6 | 7 | import asyncio 8 | 9 | 10 | 11 | 12 | 13 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 14 | 15 | async def _(event): 16 | 17 | if event.fwd_from: 18 | 19 | return 20 | 21 | animation_interval = 1.5 22 | 23 | animation_ttl = range(0, 11) 24 | 25 | input_str = event.pattern_match.group(1) 26 | 27 | if input_str == "music": 28 | 29 | await event.edit(input_str) 30 | 31 | animation_chars = [ 32 | "⬤⬤⬤ 81% ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀`✖️`\n\n⠀⠀⠀⠀⠀[cee jay Music Player](tg://user?id=689811472)\n\n⠀⠀⠀⠀**Now Playing:Kamasutra BGM**\n\n**00:00** ▱▱▱▱▱▱▱▱▱▱ **00:10**\n\n⠀⠀⠀⠀⠀`🔂` `⏮️` `⏪️` `▶️` `⏩️` `⏭️`\n\n**⠀Next Song:** __I Am Sexy And I Know It.__\n\n⠀⠀⠀⠀**⠀Device: Nokia 1100**", 33 | "⬤⬤⬤ 81% ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀`✖️`\n\n⠀⠀⠀⠀⠀[cee jay Music Player](tg://user?id=689811472)\n\n⠀⠀⠀⠀**Now Playing:Kamasutra BGM**\n\n**00:01** ▰▱▱▱▱▱▱▱▱▱ **00:10**\n\n⠀⠀⠀⠀⠀`🔂` `⏮️` `⏪️` `⏸️` `⏩️` `⏭️`\n\n**⠀Next Song:** __I Am Sexy And I Know It.__\n\n⠀⠀⠀⠀**⠀Device: Nokia 1100**", 34 | "⬤⬤⬤ 81% ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀`✖️`\n\n⠀⠀⠀⠀⠀[cee jay Music Player](tg://user?id=689811472)\n\n⠀⠀⠀⠀**Now Playing:Kamasutra BGM**\n\n**00:02** ▰▰▱▱▱▱▱▱▱▱ **00:10**\n\n⠀⠀⠀⠀⠀`🔂` `⏮️` `⏪️` `⏸️` `⏩️` `⏭️`\n\n**⠀Next Song:** __I Am Sexy And I Know It.__\n\n⠀⠀⠀⠀**⠀Device: Nokia 1100**", 35 | "⬤⬤⬤ 81% ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀`✖️`\n\n⠀⠀⠀⠀⠀[cee jay Music Player](tg://user?id=689811472)\n\n⠀⠀⠀⠀**Now Playing:Kamasutra BGM**\n\n**00:03** ▰▰▰▱▱▱▱▱▱▱ **00:10**\n\n⠀⠀⠀⠀⠀`🔂` `⏮️` `⏪️` `⏸️` `⏩️` `⏭️`\n\n**⠀Next Song:** __I Am Sexy And I Know It.__\n\n⠀⠀⠀⠀**⠀Device: Nokia 1100**", 36 | "⬤⬤◯ 80% ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀`✖️`\n\n⠀⠀⠀⠀⠀[cee jay Music Player](tg://user?id=689811472)\n\n⠀⠀⠀⠀**Now Playing:Kamasutra BGM**\n\n**00:04** ▰▰▰▰▱▱▱▱▱▱ **00:10**\n\n⠀⠀⠀⠀⠀`🔂` `⏮️` `⏪️` `⏸️` `⏩️` `⏭️`\n\n**⠀Next Song:** __I Am Sexy And I Know It.__\n\n⠀⠀⠀⠀**⠀Device: Nokia 1100**", 37 | "⬤⬤◯ 80% ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀`✖️`\n\n⠀⠀⠀⠀⠀[cee jay Music Player](tg://user?id=689811472)\n\n⠀⠀⠀⠀**Now Playing:Kamasutra BGM**\n\n**00:05** ▰▰▰▰▱▱▱▱▱▱ **00:10**\n\n⠀⠀⠀⠀⠀`🔂` `⏮️` `⏪️` `⏸️` `⏩️` `⏭️`\n\n**⠀Next Song:** __I Am Sexy And I Know It.__\n\n⠀⠀⠀⠀**⠀Device: Nokia 1100**", 38 | "⬤⬤◯ 80% ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀`✖️`\n\n⠀⠀⠀⠀⠀[cee jay Music Player](tg://user?id=689811472)\n\n⠀⠀⠀⠀**Now Playing:Kamasutra BGM**\n\n**00:06** ▰▰▰▰▰▰▱▱▱▱ **00:10**\n\n⠀⠀⠀⠀⠀`🔂` `⏮️` `⏪️` `⏸️` `⏩️` `⏭️`\n\n**⠀Next Song:** __I Am Sexy And I Know It.__\n\n⠀⠀⠀⠀**⠀Device: Nokia 1100**", 39 | "⬤⬤◯ 80% ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀`✖️`\n\n⠀⠀⠀⠀⠀[cee jay Music Player](tg://user?id=689811472)\n\n⠀⠀⠀⠀**Now Playing:Kamasutra BGM**\n\n**00:07** ▰▰▰▰▰▰▰▱▱▱ **00:10**\n\n⠀⠀⠀⠀⠀`🔂` `⏮️` `⏪️` `⏸️` `⏩️` `⏭️`\n\n**⠀Next Song:** __I Am Sexy And I Know It.__\n\n⠀⠀⠀⠀**⠀Device: Nokia 1100**", 40 | "⬤⬤◯ 80% ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀`✖️`\n\n⠀⠀⠀⠀⠀[cee jay Music Player](tg://user?id=689811472)\n\n⠀⠀⠀⠀**Now Playing:Kamasutra BGM**\n\n**00:08** ▰▰▰▰▰▰▰▰▱▱ **00:10**\n\n⠀⠀⠀⠀⠀`🔂` `⏮️` `⏪️` `⏸️` `⏩️` `⏭️`\n\n**⠀Next Song:** __I Am Sexy And I Know It.__\n\n⠀⠀⠀⠀**⠀Device: Nokia 1100**", 41 | "⬤⬤◯ 80% ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀`✖️`\n\n⠀⠀⠀⠀⠀[cee jay Music Player](tg://user?id=689811472)\n\n⠀⠀⠀⠀**Now Playing:Kamasutra BGM**\n\n**00:09** ▰▰▰▰▰▰▰▰▰▱ **00:10**\n\n⠀⠀⠀⠀⠀`🔂` `⏮️` `⏪️` `⏸️` `⏩️` `⏭️`\n\n**⠀Next Song:** __I Am Sexy And I Know It.__\n\n⠀⠀⠀⠀**⠀Device: Nokia 1100**", 42 | "⬤⬤◯ 80% ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀`✖️`\n\n⠀⠀⠀⠀⠀[cee jay Music Player](tg://user?id=689811472)\n\n⠀⠀⠀⠀**Now Playing:Kamasutra BGM**\n\n**00:10** ▰▰▰▰▰▰▰▰▰▰ **00:10**\n\n⠀⠀⠀⠀⠀`🔂` `⏮️` `⏪️` `⏺️` `⏩️` `⏭️`\n\n**⠀Next Song:** __I Am Sexy And I Know It.__\n\n⠀⠀⠀⠀**⠀Device: Nokia 1100**" 43 | ] 44 | 45 | for i in animation_ttl: 46 | 47 | await asyncio.sleep(animation_interval) 48 | 49 | await event.edit(animation_chars[i % 11]) 50 | -------------------------------------------------------------------------------- /userbot/plugins/muth.py: -------------------------------------------------------------------------------- 1 | """ 2 | Available Commands 3 | .muth""" 4 | 5 | from telethon import events 6 | 7 | import asyncio 8 | 9 | 10 | 11 | 12 | 13 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 14 | 15 | async def _(event): 16 | 17 | if event.fwd_from: 18 | 19 | return 20 | 21 | animation_interval = 0.3 22 | 23 | animation_ttl = range(0, 100) 24 | 25 | input_str = event.pattern_match.group(1) 26 | 27 | if input_str == "muth": 28 | 29 | await event.edit(input_str) 30 | 31 | animation_chars = [ 32 | 33 | "8✊️===D", 34 | 35 | "8=✊️==D", 36 | 37 | "8==✊️=D", 38 | 39 | "8===✊️D", 40 | 41 | "8==✊️=D", 42 | 43 | "8=✊️==D", 44 | 45 | "8✊️===D", 46 | 47 | "8===✊️D💦", 48 | 49 | "8==✊️=D💦💦", 50 | 51 | "8=✊️==D💦💦💦" 52 | 53 | ] 54 | 55 | for i in animation_ttl: 56 | 57 | await asyncio.sleep(animation_interval) 58 | 59 | await event.edit(animation_chars[i % 8]) 60 | 61 | -------------------------------------------------------------------------------- /userbot/plugins/nakal.py: -------------------------------------------------------------------------------- 1 | """Emoji 2 | 3 | Available Commands: 4 | 5 | .emoji shrug 6 | 7 | .emoji apple 8 | 9 | .emoji :/ 10 | 11 | .emoji -_-""" 12 | 13 | from telethon import events 14 | from userbot.utils import admin_cmd 15 | import asyncio 16 | 17 | 18 | 19 | 20 | 21 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 22 | 23 | async def _(event): 24 | 25 | if event.fwd_from: 26 | 27 | return 28 | 29 | animation_interval = 0.5 30 | 31 | animation_ttl = range(0, 11) 32 | 33 | input_str = event.pattern_match.group(1) 34 | 35 | if input_str == "nakal": 36 | 37 | await event.edit(input_str) 38 | 39 | animation_chars = [ 40 | 41 | "`⠀⠀⠀⣠⣶⡾⠏⠉⠙⠳⢦⡀⠀⠀⠀⢠⠞⠉⠙⠲⡀⠀\n ⠀⣴⠿⠏⠀⠀⠀⠀⠀ ⢳⡀⠀⡏⠀⠀⠀ ⠀⢷\n⢠⣟⣋⡀⢀⣀⣀⡀⠀⣀⡀⣧⠀⢸⠀⠀⠀ ⠀ ⡇\n⢸⣯⡭⠁⠸⣛⣟⠆⡴⣻⡲⣿ ⣸ Nikal ⡇\n ⣟⣿⡭⠀⠀⠀⠀⠀⢱⠀⠀ ⣿ ⢹⠀ ⡇\n ⠙⢿⣯⠄⠀⠀⠀__⠀⠀⡿ ⠀⡇⠀⠀⠀⠀ ⡼\n⠀⠀⠀⠹⣶⠆⠀⠀⠀⠀⠀⡴⠃⠀ ⠘⠤⣄⣠⠞⠀\n⠀⠀⠀⠀⢸⣷⡦⢤⡤⢤⣞⣁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n⠀⢀⣤⣴⣿⣏⠁⠀⠀⠸⣏⢯⣷⣖⣦⡀⠀⠀⠀⠀⠀⠀\n⢀⣾⣽⣿⣿⣿⣿⠛⢲⣶⣾⢉⡷⣿⣿⠵⣿⠀⠀⠀⠀⠀⠀\n⣼⣿⠍⠉⣿⡭⠉⠙⢺⣇⣼⡏⠀⠀ ⠀⣄⢸⠀⠀⠀⠀⠀⠀`", 42 | "`⠀⠀⠀⣠⣶⡾⠏⠉⠙⠳⢦⡀⠀⠀⠀⢠⠞⠉⠙⠲⡀⠀\n ⠀⣴⠿⠏⠀⠀⠀⠀⠀ ⠀⢳⡀⠀⡏⠀⠀⠀ ⠀⢷\n⢠⣟⣋⡀⢀⣀⣀⡀⠀⣀⡀⣧⠀⢸⠀⠀⠀ ⡇\n⢸⣯⡭⠁⠸⣛⣟⠆⡴⣻⡲⣿ ⣸ Lavde ⡇\n ⣟⣿⡭⠀⠀⠀⠀⠀⢱⠀⠀ ⣿ ⢹⠀ ⡇\n ⠙⢿⣯⠄⠀⠀|__|⠀⠀⡿ ⠀⡇⠀⠀⠀⠀ ⡼\n⠀⠀⠀⠹⣶⠆⠀⠀⠀⠀⠀⡴⠃⠀ ⠘⠤⣄⣠⠞⠀\n⠀⠀⠀⠀⢸⣷⡦⢤⡤⢤⣞⣁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n⠀⢀⣤⣴⣿⣏⠁⠀⠀⠸⣏⢯⣷⣖⣦⡀⠀⠀⠀⠀⠀⠀\n⢀⣾⣽⣿⣿⣿⣿⠛⢲⣶⣾⢉⡷⣿⣿⠵⣿⠀⠀⠀⠀⠀⠀\n⣼⣿⠍⠉⣿⡭⠉⠙⢺⣇⣼⡏⠀⠀ ⠀⣄⢸⠀⠀⠀⠀⠀⠀`", 43 | "`⠀⠀⠀⣠⣶⡾⠏⠉⠙⠳⢦⡀⠀⠀⠀⢠⠞⠉⠙⠲⡀⠀\n ⠀⣴⠿⠏⠀⠀ ⠀⢳⡀⠀⡏⠀⠀ ⠀⢷\n⢠⣟⣋⡀⢀⣀⣀⡀⠀⣀⡀⣧⠀⢸⠀⠀⠀⠀ ⡇\n⢸⣯⡭⠁⠸⣛⣟⠆⡴⣻⡲⣿ ⣸ Pehli ⡇\n ⣟⣿⡭⠀⠀⠀⠀⠀⢱⠀⠀ ⣿ ⢹⠀ ⡇\n ⠙⢿⣯⠄⠀⠀(P)⠀⠀⡿ ⠀⡇⠀⠀⠀⠀ ⡼\n⠀⠀⠀⠹⣶⠆⠀⠀⠀⠀⠀⡴⠃⠀ ⠘⠤⣄⣠⠞⠀\n⠀⠀⠀⠀⢸⣷⡦⢤⡤⢤⣞⣁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n⠀⢀⣤⣴⣿⣏⠁⠀⠀⠸⣏⢯⣷⣖⣦⡀⠀⠀⠀⠀⠀⠀\n⢀⣾⣽⣿⣿⣿⣿⠛⢲⣶⣾⢉⡷⣿⣿⠵⣿⠀⠀⠀⠀⠀⠀\n⣼⣿⠍⠉⣿⡭⠉⠙⢺⣇⣼⡏⠀⠀ ⠀⣄⢸⠀⠀⠀⠀⠀⠀`", 44 | "`⠀⠀⠀⣠⣶⡾⠏⠉⠙⠳⢦⡀⠀⠀⠀⢠⠞⠉⠙⠲⡀⠀\n ⠀⣴⠿⠏⠀⠀ ⠀⢳⡀⠀⡏⠀⠀ ⠀⢷\n⢠⣟⣋⡀⢀⣀⣀⡀⠀⣀⡀⣧⠀⢸⠀ ⠀ ⡇\n⢸⣯⡭⠁⠸⣛⣟⠆⡴⣻⡲⣿ ⣸ Fursat ⡇\n ⣟⣿⡭⠀⠀⠀⠀⠀⢱⠀ ⣿ ⢹⠀ ⡇\n ⠙⢿⣯⠄⠀⠀⠀__ ⠀⠀⡿ ⠀⡇⠀⠀⠀⠀ ⡼\n⠀⠀⠀⠹⣶⠆⠀⠀⠀⠀⠀⡴⠃⠀ ⠘⠤⣄⣠⠞⠀\n⠀⠀⠀⠀⢸⣷⡦⢤⡤⢤⣞⣁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n⠀⢀⣤⣴⣿⣏⠁⠀⠀⠸⣏⢯⣷⣖⣦⡀⠀⠀⠀⠀⠀⠀\n⢀⣾⣽⣿⣿⣿⣿⠛⢲⣶⣾⢉⡷⣿⣿⠵⣿⠀⠀⠀⠀⠀⠀\n⣼⣿⠍⠉⣿⡭⠉⠙⢺⣇⣼⡏⠀⠀ ⠀⣄⢸⠀⠀⠀⠀⠀⠀`", 45 | "`⠀⠀⠀⣠⣶⡾⠏⠉⠙⠳⢦⡀⠀⠀⠀⢠⠞⠉⠙⠲⡀⠀\n ⠀⣴⠿⠏⠀⠀⠀⠀⠀ ⢳⡀⠀⡏⠀⠀ ⠀⢷\n⢠⣟⣋⡀⢀⣀⣀⡀⠀⣀⡀⣧⠀⢸⠀⠀ ⠀ ⡇\n⢸⣯⡭⠁⠸⣛⣟⠆⡴⣻⡲⣿ ⣸ Meeee ⡇\n ⣟⣿⡭⠀⠀⠀⠀⠀⢱⠀⠀ ⣿ ⢹⠀ ⡇\n ⠙⢿⣯⠄⠀⠀|__| ⠀⡿ ⠀⡇⠀⠀⠀⠀ ⡼\n⠀⠀⠀⠹⣶⠆⠀⠀⠀⠀⠀⡴⠃⠀ ⠘⠤⣄⣠⠞⠀\n⠀⠀⠀⠀⢸⣷⡦⢤⡤⢤⣞⣁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n⠀⢀⣤⣴⣿⣏⠁⠀⠀⠸⣏⢯⣷⣖⣦⡀⠀⠀⠀⠀⠀⠀\n⢀⣾⣽⣿⣿⣿⣿⠛⢲⣶⣾⢉⡷⣿⣿⠵⣿⠀⠀⠀⠀⠀⠀\n⣼⣿⠍⠉⣿⡭⠉⠙⢺⣇⣼⡏⠀⠀ ⠀⣄⢸⠀⠀⠀⠀⠀⠀`", 46 | "`⠀⠀⠀⣠⣶⡾⠏⠉⠙⠳⢦⡀⠀⠀⠀⢠⠞⠉⠙⠲⡀⠀\n ⠀⣴⠿⠏⠀⠀⠀⠀⠀ ⠀⢳⡀⠀⡏⠀⠀ ⠀⢷\n⢠⣟⣋⡀⢀⣀⣀⡀⠀⣀⡀⣧⠀⢸⠀ ⠀ ⡇\n⢸⣯⡭⠁⠸⣛⣟⠆⡴⣻⡲⣿ ⣸ Nikal ⡇\n ⣟⣿⡭⠀⠀⠀⠀⠀⢱⠀ ⣿ ⢹⠀ ⡇\n ⠙⢿⣯⠄⠀⠀lodu⠀⠀⡿ ⠀⡇⠀⠀⠀⠀ ⡼\n⠀⠀⠀⠹⣶⠆⠀⠀⠀⠀⠀⡴⠃⠀ ⠘⠤⣄⣠⠞⠀\n⠀⠀⠀⠀⢸⣷⡦⢤⡤⢤⣞⣁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n⠀⢀⣤⣴⣿⣏⠁⠀⠀⠸⣏⢯⣷⣖⣦⡀⠀⠀⠀⠀⠀⠀\n⢀⣾⣽⣿⣿⣿⣿⠛⢲⣶⣾⢉⡷⣿⣿⠵⣿⠀⠀⠀⠀⠀⠀\n⣼⣿⠍⠉⣿⡭⠉⠙⢺⣇⣼⡏⠀⠀ ⠀⣄⢸⠀⠀⠀⠀⠀⠀`", 47 | ] 48 | 49 | for i in animation_ttl: 50 | 51 | await asyncio.sleep(animation_interval) 52 | 53 | await event.edit(animation_chars[i % 11]) 54 | -------------------------------------------------------------------------------- /userbot/plugins/none.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /userbot/plugins/ocr.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2019 The Raphielscape Company LLC. 2 | # 3 | # Licensed under the Raphielscape Public License, Version 1.c (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | 6 | from telethon import events 7 | import os 8 | import requests 9 | import logging 10 | from userbot import bot, OCR_SPACE_API_KEY, CMD_HELP, TEMP_DOWNLOAD_DIRECTORY 11 | from userbot.utils import register 12 | 13 | 14 | async def ocr_space_file(filename, 15 | overlay=False, 16 | api_key=OCR_SPACE_API_KEY, 17 | language='eng'): 18 | """ OCR.space API request with local file. 19 | Python3.5 - not tested on 2.7 20 | :param filename: Your file path & name. 21 | :param overlay: Is OCR.space overlay required in your response. 22 | Defaults to False. 23 | :param api_key: OCR.space API key. 24 | Defaults to 'helloworld'. 25 | :param language: Language code to be used in OCR. 26 | List of available language codes can be found on https://ocr.space/OCRAPI 27 | Defaults to 'en'. 28 | :return: Result in JSON format. 29 | """ 30 | 31 | payload = { 32 | 'isOverlayRequired': overlay, 33 | 'apikey': api_key, 34 | 'language': language, 35 | } 36 | with open(filename, 'rb') as f: 37 | r = requests.post( 38 | 'https://api.ocr.space/parse/image', 39 | files={filename: f}, 40 | data=payload, 41 | ) 42 | return r.json() 43 | 44 | 45 | @register(pattern="^.ocr(?: |$)(.*)", outgoing=True) 46 | async def ocr(event): 47 | await event.edit("`Reading...`") 48 | if not os.path.isdir(TEMP_DOWNLOAD_DIRECTORY): 49 | os.makedirs(TEMP_DOWNLOAD_DIRECTORY) 50 | lang_code = event.pattern_match.group(1) 51 | downloaded_file_name = await bot.download_media( 52 | await event.get_reply_message(), TEMP_DOWNLOAD_DIRECTORY) 53 | test_file = await ocr_space_file(filename=downloaded_file_name, 54 | language=lang_code) 55 | try: 56 | ParsedText = test_file["ParsedResults"][0]["ParsedText"] 57 | except BaseException: 58 | await event.edit("`Couldn't read it.`\n`I guess I need new glasses.`") 59 | else: 60 | await event.edit(f"`Here's what I could read from it:`\n\n{ParsedText}" 61 | ) 62 | os.remove(downloaded_file_name) 63 | 64 | 65 | CMD_HELP.update({ 66 | 'ocr': 67 | ".ocr \nUsage: Reply to an image or sticker to extract text from it.\n\nGet language codes from [here](https://ocr.space/ocrapi)" 68 | }) 69 | -------------------------------------------------------------------------------- /userbot/plugins/ok.py: -------------------------------------------------------------------------------- 1 | """Emoji 2 | 3 | Available Commands: 4 | 5 | .ok""" 6 | 7 | from telethon import events 8 | 9 | import asyncio 10 | 11 | from userbot.utils import admin_cmd 12 | 13 | @borg.on(admin_cmd("(.*)")) 14 | async def _(event): 15 | if event.fwd_from: 16 | return 17 | animation_interval = 0.00001 18 | animation_ttl = range(0, 90) 19 | input_str = event.pattern_match.group(1) 20 | if input_str == "ok": 21 | await event.edit(input_str) 22 | animation_chars = [ 23 | "F", 24 | "U", 25 | "C", 26 | "K", 27 | "Y", 28 | "O", 29 | "U", 30 | "B", 31 | "C", 32 | "FK", 33 | "UU", 34 | "FCUK", 35 | "UOY", 36 | "C", 37 | "F", 38 | "Y", 39 | "F", 40 | "Ok Sar 😇" 41 | ] 42 | 43 | for i in animation_ttl: 44 | 45 | await asyncio.sleep(animation_interval) 46 | await event.edit(animation_chars[i % 18]) 47 | -------------------------------------------------------------------------------- /userbot/plugins/padmin.py: -------------------------------------------------------------------------------- 1 | """Emoji 2 | 3 | Available Commands: 4 | 5 | .padmin""" 6 | 7 | from telethon import events 8 | 9 | import asyncio 10 | 11 | 12 | 13 | 14 | 15 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 16 | 17 | async def _(event): 18 | 19 | if event.fwd_from: 20 | 21 | return 22 | 23 | animation_interval = 1 24 | 25 | animation_ttl = range(0, 20) 26 | 27 | input_str = event.pattern_match.group(1) 28 | 29 | if input_str == "padmin": 30 | 31 | await event.edit(input_str) 32 | 33 | animation_chars = [ 34 | 35 | "**Promoting User As Admin...**", 36 | "**Enabling All Permissions To User...**", 37 | "**(1) Send Messages: ☑️**", 38 | "**(1) Send Messages: ✅**", 39 | "**(2) Send Media: ☑️**", 40 | "**(2) Send Media: ✅**", 41 | "**(3) Send Stickers & GIFs: ☑️**", 42 | "**(3) Send Stickers & GIFs: ✅**", 43 | "**(4) Send Polls: ☑️**", 44 | "**(4) Send Polls: ✅**", 45 | "**(5) Embed Links: ☑️**", 46 | "**(5) Embed Links: ✅**", 47 | "**(6) Add Users: ☑️**", 48 | "**(6) Add Users: ✅**", 49 | "**(7) Pin Messages: ☑️**", 50 | "**(7) Pin Messages: ✅**", 51 | "**(8) Change Chat Info: ☑️**", 52 | "**(8) Change Chat Info: ✅**", 53 | "**Permission Granted Successfully**", 54 | "**pRoMooTeD SuCcEsSfUlLy bY: @A_Dark_Princ3**" 55 | 56 | ] 57 | 58 | for i in animation_ttl: 59 | 60 | await asyncio.sleep(animation_interval) 61 | 62 | await event.edit(animation_chars[i % 20]) 63 | -------------------------------------------------------------------------------- /userbot/plugins/pastebin.py: -------------------------------------------------------------------------------- 1 | """IX.IO pastebin like site 2 | Syntax: .paste""" 3 | from telethon import events 4 | import asyncio 5 | from datetime import datetime 6 | import os 7 | import requests 8 | from userbot.utils import admin_cmd 9 | 10 | 11 | def progress(current, total): 12 | logger.info("Downloaded {} of {}\nCompleted {}".format(current, total, (current / total) * 100)) 13 | 14 | 15 | @borg.on(admin_cmd("paste ?(.*)")) 16 | async def _(event): 17 | if event.fwd_from: 18 | return 19 | start = datetime.now() 20 | if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): 21 | os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) 22 | input_str = event.pattern_match.group(1) 23 | message = "SYNTAX: `.paste `" 24 | if input_str: 25 | message = input_str 26 | elif event.reply_to_msg_id: 27 | previous_message = await event.get_reply_message() 28 | if previous_message.media: 29 | downloaded_file_name = await borg.download_media( 30 | previous_message, 31 | Config.TMP_DOWNLOAD_DIRECTORY, 32 | progress_callback=progress 33 | ) 34 | m_list = None 35 | with open(downloaded_file_name, "rb") as fd: 36 | m_list = fd.readlines() 37 | message = "" 38 | for m in m_list: 39 | message += m.decode("UTF-8") + "\r\n" 40 | os.remove(downloaded_file_name) 41 | else: 42 | message = previous_message.message 43 | else: 44 | message = "SYNTAX: `.paste `" 45 | url = "https://del.dog/documents" 46 | r = requests.post(url, data=message.encode("UTF-8")).json() 47 | url = f"https://del.dog/{r['key']}" 48 | end = datetime.now() 49 | ms = (end - start).seconds 50 | if r["isUrl"]: 51 | nurl = f"https://del.dog/v/{r['key']}" 52 | await event.edit("Dogged to {} in {} seconds. GoTo Original URL: {}".format(url, ms, nurl)) 53 | else: 54 | await event.edit("Dogged to {} in {} seconds".format(url, ms)) 55 | -------------------------------------------------------------------------------- /userbot/plugins/pin_message.py: -------------------------------------------------------------------------------- 1 | """Pins the replied message 2 | Syntax: .cpin [LOUD]""" 3 | from telethon import events 4 | from telethon.tl import functions, types 5 | from userbot.utils import admin_cmd 6 | 7 | 8 | @borg.on(admin_cmd("cpin ?(.*)")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | silent = True 13 | input_str = event.pattern_match.group(1) 14 | if input_str: 15 | silent = False 16 | if event.message.reply_to_msg_id is not None: 17 | message_id = event.message.reply_to_msg_id 18 | try: 19 | await borg(functions.messages.UpdatePinnedMessageRequest( 20 | event.chat_id, 21 | message_id, 22 | silent 23 | )) 24 | except Exception as e: 25 | await event.edit(str(e)) 26 | else: 27 | await event.delete() 28 | else: 29 | await event.edit("Reply to a message to pin the message in this Channel.") 30 | -------------------------------------------------------------------------------- /userbot/plugins/ping.py: -------------------------------------------------------------------------------- 1 | from telethon import events 2 | from datetime import datetime 3 | 4 | 5 | @command(pattern="^.ping") 6 | async def _(event): 7 | if event.fwd_from: 8 | return 9 | start = datetime.now() 10 | await event.edit("Pong!") 11 | end = datetime.now() 12 | ms = (end - start).microseconds / 1000 13 | await event.edit("Pong!\n{}".format(ms)) 14 | -------------------------------------------------------------------------------- /userbot/plugins/plane.py: -------------------------------------------------------------------------------- 1 | #By STARKTM1 2 | from telethon import events 3 | import asyncio 4 | import os 5 | import sys 6 | 7 | 8 | @borg.on(events.NewMessage(pattern=r"\.plane", outgoing=True)) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | 13 | 14 | await event.edit("✈-------------") 15 | await event.edit("-✈------------") 16 | await event.edit("--✈-----------") 17 | await event.edit("---✈----------") 18 | await event.edit("----✈---------") 19 | await event.edit("-----✈--------") 20 | await event.edit("------✈-------") 21 | await event.edit("-------✈------") 22 | await event.edit("--------✈-----") 23 | await event.edit("---------✈----") 24 | await event.edit("----------✈---") 25 | await event.edit("-----------✈--") 26 | await event.edit("------------✈-") 27 | await event.edit("-------------✈") 28 | await asyncio.sleep(3) 29 | await event.delete() 30 | 31 | -------------------------------------------------------------------------------- /userbot/plugins/power_tools.py: -------------------------------------------------------------------------------- 1 | """Restart or Terminate the bot from any chat 2 | Available Commands: 3 | .restart 4 | .shutdown""" 5 | # This Source Code Form is subject to the terms of the GNU 6 | # General Public License, v.3.0. If a copy of the GPL was not distributed with this 7 | # file, You can obtain one at https://www.gnu.org/licenses/gpl-3.0.en.html 8 | from telethon import events 9 | import asyncio 10 | import os 11 | import sys 12 | from userbot.utils import admin_cmd 13 | 14 | 15 | @borg.on(admin_cmd("restart")) 16 | async def _(event): 17 | if event.fwd_from: 18 | return 19 | # await asyncio.sleep(2) 20 | # await event.edit("Restarting [██░] ...\n`.ping` me or `.help` to check if I am online after a lil bit.") 21 | # await asyncio.sleep(2) 22 | # await event.edit("Restarting [███]...\n`.ping` me or `.help` to check if I am online after a lil bit.") 23 | # await asyncio.sleep(2) 24 | await event.edit("Restarted. `.ping` me or `.helpme` to check if I am online") 25 | await borg.disconnect() 26 | # https://archive.is/im3rt 27 | os.execl(sys.executable, sys.executable, *sys.argv) 28 | # You probably don't need it but whatever 29 | quit() 30 | 31 | 32 | @borg.on(admin_cmd("shutdown")) 33 | async def _(event): 34 | if event.fwd_from: 35 | return 36 | await event.edit("Turning off ...Manually turn me on later") 37 | await borg.disconnect() 38 | -------------------------------------------------------------------------------- /userbot/plugins/pro_nub.py: -------------------------------------------------------------------------------- 1 | """Available Commands: 2 | 3 | .unoob 4 | .menoob 5 | .upro 6 | .mepro 7 | 8 | @arnab431""" 9 | 10 | from telethon import events 11 | 12 | import asyncio 13 | 14 | from userbot.utils import admin_cmd 15 | 16 | 17 | 18 | 19 | 20 | @borg.on(admin_cmd("(.*)")) 21 | 22 | async def _(event): 23 | 24 | if event.fwd_from: 25 | 26 | return 27 | 28 | animation_interval = 0.5 29 | 30 | 31 | animation_ttl = range(0, 9) 32 | 33 | input_str = event.pattern_match.group(1) 34 | 35 | if input_str == "unoob": 36 | 37 | await event.edit(input_str) 38 | 39 | animation_chars = [ 40 | "EvErYbOdY", 41 | "iZ", 42 | "BiGGeSt", 43 | "NoOoB" , 44 | "uNtiL", 45 | "YoU", 46 | "aRriVe", 47 | "😈", 48 | "EvErYbOdY iZ BiGGeSt NoOoB uNtiL YoU aRriVe 😈" 49 | ] 50 | 51 | for i in animation_ttl: 52 | 53 | 54 | await event.edit(animation_chars[i % 9]) 55 | await asyncio.sleep(animation_interval) 56 | 57 | @borg.on(admin_cmd("(.*)")) 58 | 59 | async def _(event): 60 | 61 | if event.fwd_from: 62 | 63 | return 64 | 65 | animation_interval = 0.5 66 | 67 | 68 | animation_ttl = range(0, 9) 69 | 70 | input_str = event.pattern_match.group(1) 71 | 72 | if input_str == "menoob": 73 | 74 | await event.edit(input_str) 75 | 76 | animation_chars = [ 77 | "EvErYbOdY", 78 | "iZ", 79 | "BiGGeSt", 80 | "NoOoB" , 81 | "uNtiL", 82 | "i", 83 | "aRriVe", 84 | "😈", 85 | "EvErYbOdY iZ BiGGeSt NoOoB uNtiL i aRriVe 😈" 86 | ] 87 | 88 | for i in animation_ttl: 89 | 90 | 91 | await event.edit(animation_chars[i % 9]) 92 | await asyncio.sleep(animation_interval) 93 | 94 | @borg.on(admin_cmd("(.*)")) 95 | 96 | async def _(event): 97 | 98 | if event.fwd_from: 99 | 100 | return 101 | 102 | animation_interval = 0.5 103 | 104 | 105 | animation_ttl = range(0, 8) 106 | 107 | input_str = event.pattern_match.group(1) 108 | 109 | if input_str == "upro": 110 | 111 | await event.edit(input_str) 112 | 113 | animation_chars = [ 114 | "EvErYbOdY", 115 | "iZ", 116 | "PeRu" , 117 | "uNtiL", 118 | "YoU", 119 | "aRriVe", 120 | "😈", 121 | "EvErYbOdY iZ PeRu uNtiL YoU aRriVe 😈" 122 | ] 123 | 124 | for i in animation_ttl: 125 | 126 | 127 | await event.edit(animation_chars[i % 8]) 128 | await asyncio.sleep(animation_interval) 129 | 130 | @borg.on(admin_cmd("(.*)")) 131 | 132 | async def _(event): 133 | 134 | if event.fwd_from: 135 | 136 | return 137 | 138 | animation_interval = 0.5 139 | 140 | 141 | animation_ttl = range(0, 8) 142 | 143 | input_str = event.pattern_match.group(1) 144 | 145 | if input_str == "mepro": 146 | 147 | await event.edit(input_str) 148 | 149 | animation_chars = [ 150 | "EvErYbOdY", 151 | "iZ", 152 | "PeRu" , 153 | "uNtiL", 154 | "i", 155 | "aRriVe", 156 | "😈", 157 | "EvErYbOdY iZ PeRu uNtiL i aRriVe 😈" 158 | ] 159 | 160 | for i in animation_ttl: 161 | 162 | 163 | await event.edit(animation_chars[i % 8]) 164 | await asyncio.sleep(animation_interval) 165 | -------------------------------------------------------------------------------- /userbot/plugins/purnhub_download.py: -------------------------------------------------------------------------------- 1 | """ 2 | Pornhub downloader by @anubisxx 3 | Syntax: .phd link 4 | """ 5 | import datetime 6 | import asyncio 7 | import requests 8 | from bs4 import BeautifulSoup 9 | import os 10 | from pySmartDL import SmartDL 11 | from telethon import events 12 | from telethon.tl.functions.channels import JoinChannelRequest 13 | from telethon.errors.rpcerrorlist import YouBlockedUserError, UserAlreadyParticipantError 14 | from telethon.tl.functions.account import UpdateNotifySettingsRequest 15 | from telethon.tl.functions.messages import ImportChatInviteRequest 16 | from userbot.utils import admin_cmd 17 | 18 | @borg.on(admin_cmd("phd ?(.*)")) 19 | async def _(event): 20 | if event.fwd_from: 21 | return 22 | d_link = event.pattern_match.group(1) 23 | bot = "@phsavebot" 24 | r = requests.get(d_link) 25 | soup = BeautifulSoup(r.content, 'html.parser') 26 | temporary_variable = soup.find("span", {"class": "inlineFree"}) 27 | title = temporary_variable.text 28 | temp = soup.find("div", {"class": "thumbnail"}) 29 | view = soup.find("span", {"class": "count"}) 30 | views = view.text 31 | temporary_variable_to_use = temp.find("img") 32 | thumb_image_link = temporary_variable_to_use["data-src"] 33 | if "pornhub" not in d_link: 34 | await event.edit("` I need a link to download something pro.`**(._.)**") 35 | else: 36 | await event.edit("**💦Preparing to upload Video💦 **\n**Title**: `{}`\n**Total Views**: `{}`".format(title, views)) 37 | await asyncio.sleep(2) 38 | 39 | 40 | async with event.client.conversation("@phsavebot") as conv: 41 | try: 42 | await conv.send_message("/start") 43 | oop = await conv.get_response() 44 | if "language" in oop.text: 45 | await borg.send_message(event.chat_id, "**Please go to** @phsavebot **and select your language**") 46 | await asyncio.sleep(2) 47 | me = await borg.get_me() 48 | my_id = me.id 49 | # Necessary for the bot to work ;-; 50 | try: 51 | await borg(ImportChatInviteRequest('AAAAAFbNNkKLy3gleaD5sA')) 52 | await borg(ImportChatInviteRequest('AAAAAFZPuYvdW1A8mrT8Pg')) 53 | except UserAlreadyParticipantError: 54 | await asyncio.sleep(0.00000069420) 55 | await conv.send_message(d_link) 56 | response = await conv.get_response() 57 | if "Downloading" in response.text: 58 | video_hehe = await conv.get_response() 59 | 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)) 60 | elif "Unfortunately" in response.text: 61 | await event.edit("`Woops, Incorrect link!`\n**Please check and try again.**") 62 | elif "correct" in response.text: 63 | await borg.send_message(event.chat_id, response.text) 64 | except YouBlockedUserError: 65 | await event.reply("**Please unblock** @phsavebot **and try again**") 66 | return 67 | 68 | -------------------------------------------------------------------------------- /userbot/plugins/randomsticker.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | 5 | """ Command: .dab , .brain 6 | 7 | credit: lejend @r4v4n4""" 8 | 9 | import random 10 | 11 | from telethon import events, types, functions, utils 12 | 13 | 14 | def choser(cmd, pack, blacklist={}): 15 | docs = None 16 | @borg.on(events.NewMessage(pattern=rf'\.{cmd}', outgoing=True)) 17 | async def handler(event): 18 | await event.delete() 19 | 20 | nonlocal docs 21 | if docs is None: 22 | docs = [ 23 | utils.get_input_document(x) 24 | for x in (await borg(functions.messages.GetStickerSetRequest(types.InputStickerSetShortName(pack)))).documents 25 | if x.id not in blacklist 26 | ] 27 | 28 | await event.respond(file=random.choice(docs)) 29 | 30 | 31 | choser('brain', 'supermind') 32 | choser('dab', 'DabOnHaters', { 33 | 1653974154589768377, 34 | 1653974154589768312, 35 | 1653974154589767857, 36 | 1653974154589768311, 37 | 1653974154589767816, 38 | 1653974154589767939, 39 | 1653974154589767944, 40 | 1653974154589767912, 41 | 1653974154589767911, 42 | 1653974154589767910, 43 | 1653974154589767909, 44 | 1653974154589767863, 45 | 1653974154589767852, 46 | 1653974154589768677 47 | }) 48 | -------------------------------------------------------------------------------- /userbot/plugins/remove.bg.py: -------------------------------------------------------------------------------- 1 | # (c) Shrimadhav U K 2 | # 3 | # This file is part of @UniBorg 4 | # 5 | # @UniBorg is free software; you cannot redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published 7 | # by the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # @UniBorg is not distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | """Remove.BG Plugin for @UniBorg 16 | Syntax: .rmbg https://link.to/image.extension 17 | Syntax: .rmbg as reply to a media""" 18 | import asyncio 19 | from datetime import datetime 20 | import io 21 | import os 22 | import requests 23 | from telethon import events 24 | from userbot.utils import progress, admin_cmd 25 | 26 | 27 | @borg.on(admin_cmd("rmbg ?(.*)")) 28 | async def _(event): 29 | HELP_STR = "`.rmbg` as reply to a media, or give a link as an argument to this command" 30 | if event.fwd_from: 31 | return 32 | if Config.REM_BG_API_KEY is None: 33 | await event.edit("You need API token from remove.bg to use this plugin.") 34 | return False 35 | input_str = event.pattern_match.group(1) 36 | start = datetime.now() 37 | message_id = event.message.id 38 | if event.reply_to_msg_id: 39 | message_id = event.reply_to_msg_id 40 | reply_message = await event.get_reply_message() 41 | # check if media message 42 | await event.edit("`Parsing the image.`") 43 | try: 44 | downloaded_file_name = await borg.download_media( 45 | reply_message, 46 | Config.TMP_DOWNLOAD_DIRECTORY 47 | ) 48 | except Exception as e: 49 | await event.edit(str(e)) 50 | return 51 | else: 52 | await event.edit("sending to ReMove.BG") 53 | output_file_name = ReTrieveFile(downloaded_file_name) 54 | os.remove(downloaded_file_name) 55 | elif input_str: 56 | await event.edit("sending to ReMove.BG") 57 | output_file_name = ReTrieveURL(input_str) 58 | else: 59 | await event.edit(HELP_STR) 60 | return 61 | contentType = output_file_name.headers.get("content-type") 62 | if "image" in contentType: 63 | with io.BytesIO(output_file_name.content) as remove_bg_image: 64 | remove_bg_image.name = "BG_less.png" 65 | await borg.send_file( 66 | event.chat_id, 67 | remove_bg_image, 68 | force_document=True, 69 | supports_streaming=False, 70 | allow_cache=False, 71 | reply_to=message_id 72 | ) 73 | end = datetime.now() 74 | ms = (end - start).seconds 75 | await event.edit("Removed image's Background in {} seconds, powered by @XtraTgBot".format(ms)) 76 | else: 77 | await event.edit("ReMove.BG API returned Errors. Please report to @XtraTgBot\n`{}".format(output_file_name.content.decode("UTF-8"))) 78 | 79 | 80 | # this method will call the API, and return in the appropriate format 81 | # with the name provided. 82 | def ReTrieveFile(input_file_name): 83 | headers = { 84 | "X-API-Key": Config.REM_BG_API_KEY, 85 | } 86 | files = { 87 | "image_file": (input_file_name, open(input_file_name, "rb")), 88 | } 89 | r = requests.post( 90 | "https://api.remove.bg/v1.0/removebg", 91 | headers=headers, 92 | files=files, 93 | allow_redirects=True, 94 | stream=True 95 | ) 96 | return r 97 | 98 | 99 | def ReTrieveURL(input_url): 100 | headers = { 101 | "X-API-Key": Config.REM_BG_API_KEY, 102 | } 103 | data = { 104 | "image_url": input_url 105 | } 106 | r = requests.post( 107 | "https://api.remove.bg/v1.0/removebg", 108 | headers=headers, 109 | data=data, 110 | allow_redirects=True, 111 | stream=True 112 | ) 113 | return r 114 | -------------------------------------------------------------------------------- /userbot/plugins/rename.py: -------------------------------------------------------------------------------- 1 | # Code from pro sar Spechide's fork of Uniborg. 2 | """Rename Telegram Files 3 | Syntax: 4 | .rnupload file.name""" 5 | 6 | import asyncio 7 | import time 8 | from datetime import datetime 9 | from hachoir.metadata import extractMetadata 10 | from hachoir.parser import createParser 11 | from base64 import b64decode 12 | import io 13 | import math 14 | import os 15 | from pySmartDL import SmartDL 16 | from telethon.tl.types import DocumentAttributeVideo 17 | from uniborg.util import progress, humanbytes, time_formatter, admin_cmd 18 | 19 | 20 | thumb_image_path = Config.TMP_DOWNLOAD_DIRECTORY + "/thumb_image.jpg" 21 | 22 | 23 | @borg.on(admin_cmd(pattern="rnupload (.*)")) 24 | async def _(event): 25 | if event.fwd_from: 26 | return 27 | thumb = None 28 | if os.path.exists(thumb_image_path): 29 | thumb = thumb_image_path 30 | await event.edit("⚡️`Rename and upload in progress, please wait!`⚡️") 31 | input_str = event.pattern_match.group(1) 32 | if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY): 33 | os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY) 34 | if event.reply_to_msg_id: 35 | start = datetime.now() 36 | end = datetime.now() 37 | file_name = input_str 38 | reply_message = await event.get_reply_message() 39 | to_download_directory = Config.TMP_DOWNLOAD_DIRECTORY 40 | downloaded_file_name = os.path.join(to_download_directory, file_name) 41 | downloaded_file_name = await borg.download_media( 42 | reply_message, 43 | downloaded_file_name, 44 | ) 45 | ms_one = (end - start).seconds 46 | if os.path.exists(downloaded_file_name): 47 | c_time = time.time() 48 | await borg.send_file( 49 | event.chat_id, 50 | downloaded_file_name, 51 | force_document=True, 52 | supports_streaming=False, 53 | allow_cache=False, 54 | reply_to=event.message.id, 55 | thumb=thumb, 56 | ) 57 | end_two = datetime.now() 58 | os.remove(downloaded_file_name) 59 | ms_two = (end_two - end).seconds 60 | await event.edit("Downloaded in {} seconds. Uploaded in {} seconds.".format(ms_one, ms_two)) 61 | else: 62 | await event.edit("File Not Found {}".format(input_str)) 63 | else: 64 | await event.edit("Syntax // .rnupload file.name as reply to a Telegram media") 65 | 66 | -------------------------------------------------------------------------------- /userbot/plugins/repeat.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | from asyncio import wait 3 | from userbot.utils import admin_cmd 4 | 5 | 6 | @borg.on(admin_cmd("repeat ?(.*)")) 7 | async def _(event): 8 | message = event.text[10:] 9 | count = int(event.text[8:10]) 10 | repmessage = message * count 11 | await wait([event.respond(repmessage)for i in range(count)]) 12 | await event.delete() 13 | -------------------------------------------------------------------------------- /userbot/plugins/sca.py: -------------------------------------------------------------------------------- 1 | """Send Chat Actions 2 | Syntax: .scha