├── runtime.txt ├── userbot ├── temp │ └── hi.txt ├── .bin │ ├── car.txt │ └── command.txt ├── utils │ └── __init__.py ├── helper_funcs │ └── __init__.py └── help.py ├── _config.yml ├── Procfile ├── .bin └── neofetch │ └── readme.txt ├── .gitlab-ci.yml ├── MaterLang_Fonts ├── 1942.ttf ├── Nikosh.ttf ├── KgHappy-wWZZ.ttf ├── KgHappySolid-myDG.ttf ├── KgHappyShadows-7KqA.ttf ├── KgHappySolid-myDG-1.ttf ├── NotoNaskhArabicUI-Regular.ttf ├── NotoSansGujarati-Regular.ttf └── NotoSansGujaratiUI-Regular.ttf ├── heroku.yml ├── FUNDING.yml ├── .gitignore ├── uniborg ├── __init__.py ├── hacks.py ├── storage.py └── README.MD ├── english ├── health.yml ├── history.yml ├── trivia.yml ├── greetings.yml ├── food.yml ├── politics.yml ├── botprofile.yml └── movies.yml ├── stdplugins ├── test.py ├── sp_bar.py ├── fp.py ├── lol.py ├── repeat.py ├── thinklol.py ├── flood.py ├── moon_animation.py ├── pingbrog.py ├── Earth.py ├── F.py ├── clock.animation.py ├── shoot.py ├── decide.py ├── listmychatids.py ├── listmyusernames.py ├── duckduckgo.py ├── undo_dlt.py ├── leaveme.py ├── wikipedia.py ├── men.py ├── tagall.py ├── bye.py ├── mentionbitches.py ├── aesthetics.py ├── preview.py ├── whatscrapp.py ├── ifsc.py ├── leave.py ├── unsupported.py ├── call_admin.py ├── all.py ├── Exit.py ├── sp_search.py ├── owner.py ├── coronavirus.py ├── schd.py ├── git.py ├── gangestar.py ├── get_id.py ├── quotes.py ├── pingme.py ├── batch_upload.py ├── fixreply.py ├── shout.py ├── chain.py ├── plane.py ├── clock.py ├── urbandictionary.py ├── cow.py ├── transfer_channel.py ├── wirelesscharge.py ├── ok.py ├── ooof.py ├── fileext.py ├── sleep.py ├── fpost.py ├── fwd.py ├── sp_h.py ├── clock_name.py ├── json.py ├── ding.py ├── purge.py ├── sca.py ├── emojis.py ├── search _images.py ├── bigspam.py ├── bigspamreboot.py ├── coinflip.py ├── heroku_var_details.py ├── xtools.py ├── list.py ├── colors.py ├── get_bot.py ├── follow.py ├── count.py ├── figlet.py ├── sunda001_sakty_code_beautify.py ├── github.py ├── calendar.py ├── translate.py ├── power_tools.py ├── currency.py ├── typewriter.py ├── polls.py ├── code.py ├── instamusic.py ├── stat.py ├── fleaveme.py ├── sysd.py ├── randomsticker.py ├── eye.py ├── jio.py ├── hack.py ├── bombs.py ├── chat_bot.py ├── deploy.py ├── wikimedia.py ├── snow.py ├── nice.py ├── fastdownload.py ├── fgdrive.py ├── being_biblical.py ├── police.py ├── who.py ├── filetoimg.py ├── images.py ├── dictionary.py ├── invite.py ├── README.md ├── padmin.py ├── Qoutly.py ├── king.py ├── think.py ├── screencapture.py ├── countdown.py ├── spamwatch.py ├── db.py ├── shoutadmin.py ├── autopic.py ├── xkcd.py ├── hypnotise.py ├── ninja.py ├── cp.py ├── call.py ├── logpms.py ├── openweathermap.py ├── antivirus.py ├── dumpster.py ├── cry.py ├── exec.py ├── superblock.py ├── ASCII_IMAGE_GENERATOR ├── Webupload-2.py ├── dice.py ├── zipfile.py └── log_pms.py ├── requirements.txt ├── README.md ├── sql_helpers ├── __init__.py ├── no_log_pms_sql.py ├── gmute_sql.py ├── pm_permit_sql.py ├── spam_mute_sql.py ├── pmpermit_sql.py ├── snips_sql.py ├── globals.py ├── lydia_ai_sql.py ├── README.MD └── welcome_sql.py ├── GenerateStringSession.py ├── telesetup.py └── requirements-stdborg.txt /runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.8.2 2 | -------------------------------------------------------------------------------- /userbot/temp/hi.txt: -------------------------------------------------------------------------------- 1 | hi 2 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | worker: python3 -m stdborg 2 | -------------------------------------------------------------------------------- /userbot/.bin/car.txt: -------------------------------------------------------------------------------- 1 | rock is cocking 2 | -------------------------------------------------------------------------------- /.bin/neofetch/readme.txt: -------------------------------------------------------------------------------- 1 | @echo Run \'make install\' to install Neofetch. 2 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | CheckUserBotWorking: 2 | script: 3 | - echo "Nothing" 4 | -------------------------------------------------------------------------------- /userbot/.bin/command.txt: -------------------------------------------------------------------------------- 1 | just copy-paste below regex pattern in COMMAND_HAND_LER 2 | \. 3 | -------------------------------------------------------------------------------- /MaterLang_Fonts/1942.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xditya/BotHub/master/MaterLang_Fonts/1942.ttf -------------------------------------------------------------------------------- /MaterLang_Fonts/Nikosh.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xditya/BotHub/master/MaterLang_Fonts/Nikosh.ttf -------------------------------------------------------------------------------- /heroku.yml: -------------------------------------------------------------------------------- 1 | build: 2 | docker: 3 | worker: Dockerfile 4 | run: 5 | worker: python3 -m stdborg 6 | -------------------------------------------------------------------------------- /FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | custom: www.telegram.dog/Mayur_Karaniya 4 | -------------------------------------------------------------------------------- /MaterLang_Fonts/KgHappy-wWZZ.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xditya/BotHub/master/MaterLang_Fonts/KgHappy-wWZZ.ttf -------------------------------------------------------------------------------- /MaterLang_Fonts/KgHappySolid-myDG.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xditya/BotHub/master/MaterLang_Fonts/KgHappySolid-myDG.ttf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | venv 2 | __pycache__ 3 | 4 | *.session 5 | *.session-journal 6 | data/ 7 | config.py 8 | sessions/ 9 | 10 | -------------------------------------------------------------------------------- /MaterLang_Fonts/KgHappyShadows-7KqA.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xditya/BotHub/master/MaterLang_Fonts/KgHappyShadows-7KqA.ttf -------------------------------------------------------------------------------- /MaterLang_Fonts/KgHappySolid-myDG-1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xditya/BotHub/master/MaterLang_Fonts/KgHappySolid-myDG-1.ttf -------------------------------------------------------------------------------- /MaterLang_Fonts/NotoNaskhArabicUI-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xditya/BotHub/master/MaterLang_Fonts/NotoNaskhArabicUI-Regular.ttf -------------------------------------------------------------------------------- /MaterLang_Fonts/NotoSansGujarati-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xditya/BotHub/master/MaterLang_Fonts/NotoSansGujarati-Regular.ttf -------------------------------------------------------------------------------- /MaterLang_Fonts/NotoSansGujaratiUI-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xditya/BotHub/master/MaterLang_Fonts/NotoSansGujaratiUI-Regular.ttf -------------------------------------------------------------------------------- /uniborg/__init__.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 | from .uniborg import * 6 | -------------------------------------------------------------------------------- /english/health.yml: -------------------------------------------------------------------------------- 1 | categories: 2 | - health 3 | conversations: 4 | - - How is your health? 5 | - I'm not feeling well 6 | - why? 7 | - I have a fever 8 | - Did you take medicine? 9 | - Yes. 10 | - When? 11 | - In the morning 12 | - Get well soon dear 13 | -------------------------------------------------------------------------------- /stdplugins/test.py: -------------------------------------------------------------------------------- 1 | from telethon import events 2 | import asyncio 3 | import os 4 | import sys 5 | 6 | @borg.on(events.NewMessage(pattern=r"\.test", outgoing=True)) 7 | async def test(event): 8 | if event.fwd_from: 9 | return 10 | await event.edit("Test Successfull") 11 | -------------------------------------------------------------------------------- /uniborg/hacks.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 | 6 | class ReverseList(list): 7 | def __iter__(self): 8 | return reversed(self) 9 | -------------------------------------------------------------------------------- /stdplugins/sp_bar.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | from telethon import events 3 | from telethon.tl import types 4 | import re 5 | 6 | @borg.on(events.NewMessage(pattern=re.compile(r"^bar$"), chats=1040270887)) 7 | async def on_bar(event): 8 | if event.from_id == 151462131: 9 | return 10 | await event.reply("foo") 11 | 12 | -------------------------------------------------------------------------------- /stdplugins/fp.py: -------------------------------------------------------------------------------- 1 | """Ported by @NeoMatrix90 (***LEGEND***) cmd is .fp""" 2 | import sys 3 | from telethon import events, functions, __version__ 4 | from uniborg.util import admin_cmd 5 | import asyncio 6 | 7 | @borg.on(admin_cmd(pattern="fp$ ?(.*)", allow_sudo=True)) # pylint:disable=E0602 8 | async def facepalm(e): 9 | """ Facepalm 🤦‍♂ """ 10 | await e.edit("🤦‍♂") 11 | -------------------------------------------------------------------------------- /stdplugins/lol.py: -------------------------------------------------------------------------------- 1 | """cmd .lol""" 2 | 3 | from telethon import events 4 | from uniborg.util import admin_cmd 5 | 6 | 7 | @borg.on(admin_cmd(pattern="lol")) 8 | async def _(event): 9 | if event.fwd_from: 10 | return 11 | await event.edit("😂\n😂\n😂\n😂\n😂😂😂😂\n\n 😂😂😂\n 😂 😂\n😂 😂\n 😂 😂\n 😂😂😂\n\n😂\n😂\n😂\n😂\n😂😂😂😂") 12 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | base 2 | pip>=19.2.3 3 | async_generator 4 | pybase64 5 | pastebin.py 6 | zalgo_text 7 | pyfiglet 8 | lxml 9 | selenium>=4.0.0a5 10 | aria2p 11 | chatterbot 12 | chatterbot_corpus>=1.2.0 13 | -r ./requirements-stdborg.txt 14 | gitpython 15 | dnspython 16 | opencv-contrib-python 17 | opencv_python>=1.1.1 18 | numpy>=1.11.1 19 | hiredis>=1.0.0 20 | dill>=0.3.1.1 21 | redis>=3.3.10 22 | -------------------------------------------------------------------------------- /stdplugins/repeat.py: -------------------------------------------------------------------------------- 1 | """cmd .repeat <#> """ 2 | 3 | import asyncio 4 | from asyncio import wait 5 | from uniborg.util import admin_cmd 6 | 7 | 8 | @borg.on(admin_cmd("repeat ?(.*)")) 9 | async def _(event): 10 | message = event.text[10:] 11 | count = int(event.text[8:10]) 12 | repmessage = message * count 13 | await wait([event.respond(repmessage)for i in range(count)]) 14 | await event.delete() 15 | -------------------------------------------------------------------------------- /stdplugins/thinklol.py: -------------------------------------------------------------------------------- 1 | # (c) @UniBorg 2 | """cmd .tlol""" 3 | 4 | from telethon import events 5 | import asyncio 6 | from collections import deque 7 | 8 | 9 | @borg.on(events.NewMessage(pattern=r"\.tlol", outgoing=True)) 10 | async def _(event): 11 | if event.fwd_from: 12 | return 13 | deq = deque(list("🤔🧐🤔🧐🤔🧐")) 14 | for _ in range(150): 15 | await asyncio.sleep(0.1) 16 | await event.edit("".join(deq)) 17 | deq.rotate(1) 18 | 19 | -------------------------------------------------------------------------------- /stdplugins/flood.py: -------------------------------------------------------------------------------- 1 | """COMMAND : .floodwarn""" 2 | 3 | from telethon import events 4 | import asyncio 5 | from collections import deque 6 | 7 | 8 | @borg.on(events.NewMessage(pattern=r".floodwarn", outgoing=True)) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | deq = deque(list("💙💛💓💔💘💕💜💚💝💞💟")) 13 | for _ in range(100000000): 14 | await asyncio.sleep(0.1) 15 | await event.edit("".join(deq)) 16 | deq.rotate(1) 17 | 18 | -------------------------------------------------------------------------------- /stdplugins/moon_animation.py: -------------------------------------------------------------------------------- 1 | # (c) @UniBorg 2 | """ command: .moon """ 3 | from telethon import events 4 | import asyncio 5 | from collections import deque 6 | 7 | 8 | @borg.on(events.NewMessage(pattern=r"\.moon", outgoing=True)) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | deq = deque(list("🌗🌘🌑🌒🌓🌔🌕🌖")) 13 | for _ in range(32): 14 | await asyncio.sleep(0.1) 15 | await event.edit("".join(deq)) 16 | deq.rotate(1) 17 | 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #Warning: Use this repo at your own risk 2 | 3 | #click_the_BotHub_photo_below_to_deploy 4 | 5 | [![Deploy](https://telegra.ph/file/d04a1724c6dd8a957bd0e.png)](https://heroku.com/deploy) 6 | 7 | [![Warning](https://telegra.ph/file/3e7b54d5ef234d0b6c170.jpg)](https://telegra.ph/file/9c4ab0d3edb3fdd6d17e5.mp4 "CopyLeft Credit Video") 8 | 9 | ![Beautiful](https://telegra.ph/file/9c4ab0d3edb3fdd6d17e5.mp4)[👑👑👑👑👑👑👑](https://telegram.dog/Three_Cube_TeKnoways) 10 | -------------------------------------------------------------------------------- /stdplugins/pingbrog.py: -------------------------------------------------------------------------------- 1 | """ `.ping' to getyour ping""" 2 | 3 | from telethon import events 4 | from datetime import datetime 5 | from uniborg.util import admin_cmd 6 | 7 | 8 | @borg.on(admin_cmd("ping")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | start = datetime.now() 13 | await event.edit("P I N G") 14 | end = datetime.now() 15 | ms = (end - start).microseconds / 1000 16 | await event.edit("`P I N G`\n`{}ms`".format(ms)) 17 | -------------------------------------------------------------------------------- /stdplugins/Earth.py: -------------------------------------------------------------------------------- 1 | # (c) @UniBorg 2 | # Original written by @UniBorg edit by @I_m_Rock 3 | """.earth Plugin for @BotHub""" 4 | 5 | 6 | from telethon import events 7 | import asyncio 8 | from collections import deque 9 | 10 | 11 | @borg.on(events.NewMessage(pattern=r"\.earth", outgoing=True)) 12 | async def _(event): 13 | if event.fwd_from: 14 | return 15 | deq = deque(list("🌏🌍🌎🌎🌍🌏🌍🌎")) 16 | for _ in range(48): 17 | await asyncio.sleep(0.1) 18 | await event.edit("".join(deq)) 19 | deq.rotate(1) 20 | 21 | -------------------------------------------------------------------------------- /stdplugins/F.py: -------------------------------------------------------------------------------- 1 | """.ft & .f Plugin for @UniBorg""" 2 | 3 | from telethon import events 4 | import asyncio 5 | import os 6 | import sys 7 | from uniborg import util 8 | 9 | 10 | @borg.on(util.admin_cmd(pattern="ft ?(.*)")) 11 | async def payf(event): 12 | paytext=event.pattern_match.group(1) 13 | pay = "{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}".format(paytext*8, paytext*8, paytext*2, paytext*2, paytext*2, paytext*6, paytext*6, paytext*2, paytext*2, paytext*2, paytext*2, paytext*2) 14 | await event.edit(pay) 15 | -------------------------------------------------------------------------------- /stdplugins/clock.animation.py: -------------------------------------------------------------------------------- 1 | """COMMAND : .clock animation""" 2 | # (c) @UniBorg 3 | # Original written by @UniBorg edit by @INF1N17Y 4 | 5 | from telethon import events 6 | import asyncio 7 | from collections import deque 8 | 9 | 10 | @borg.on(events.NewMessage(pattern=r"\.clock animation", outgoing=True)) 11 | async def _(event): 12 | if event.fwd_from: 13 | return 14 | deq = deque(list("🕙🕘🕗🕖🕕🕔🕓🕒🕑🕐🕛🕛🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙")) 15 | for _ in range(48): 16 | await asyncio.sleep(0.1) 17 | await event.edit("".join(deq)) 18 | deq.rotate(1) 19 | 20 | -------------------------------------------------------------------------------- /stdplugins/shoot.py: -------------------------------------------------------------------------------- 1 | """use .shoot as reply""" 2 | 3 | import sys 4 | from telethon import events, functions, __version__ 5 | from uniborg.util import admin_cmd 6 | import asyncio 7 | 8 | 9 | @borg.on(admin_cmd(pattern="shoot$ ?(.*)", allow_sudo=True)) # pylint:disable=E0602 10 | async def killing (killed): 11 | """ Dont Kill Too much -_-""" 12 | if not killed.text[0].isalpha() and killed.text[0] not in ("/", "#", "@", "!"): 13 | if await killed.get_reply_message(): 14 | await killed.edit( 15 | "Targeted user killed by Headshot 😈......\n" 16 | "#Game_Over\n" 17 | ) 18 | -------------------------------------------------------------------------------- /stdplugins/decide.py: -------------------------------------------------------------------------------- 1 | """Quickly make a decision 2 | Syntax: .decide""" 3 | from telethon import events 4 | import requests 5 | from uniborg.util 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 | -------------------------------------------------------------------------------- /stdplugins/listmychatids.py: -------------------------------------------------------------------------------- 1 | """ 2 | # For @UniBorg 3 | # (c) Shrimadhav U K 4 | 5 | cmd is -listmychatids 6 | do this in your private group for security purpose. 7 | """ 8 | 9 | from telethon import events, functions, types 10 | import asyncio 11 | 12 | 13 | @borg.on(events.NewMessage(pattern=r"\-listmychatids", outgoing=True)) 14 | async def _(event): 15 | if event.fwd_from: 16 | return 17 | result = await borg(functions.channels.GetAdminedPublicChannelsRequest()) 18 | output_str = "" 19 | for channel_obj in result.chats: 20 | output_str += f"-{channel_obj.id} \n" 21 | await event.edit(output_str) 22 | -------------------------------------------------------------------------------- /stdplugins/listmyusernames.py: -------------------------------------------------------------------------------- 1 | """ 2 | # For @UniBorg 3 | # (c) Shrimadhav U K 4 | 5 | cmd is -listmyusernames 6 | do this in your private group for security purpose. 7 | """ 8 | 9 | from telethon import events, functions, types 10 | import asyncio 11 | 12 | 13 | @borg.on(events.NewMessage(pattern=r"\-listmyusernames", outgoing=True)) 14 | async def _(event): 15 | if event.fwd_from: 16 | return 17 | result = await borg(functions.channels.GetAdminedPublicChannelsRequest()) 18 | output_str = "" 19 | for channel_obj in result.chats: 20 | output_str += f"- {channel_obj.title} @{channel_obj.username} \n" 21 | await event.edit(output_str) 22 | -------------------------------------------------------------------------------- /stdplugins/duckduckgo.py: -------------------------------------------------------------------------------- 1 | """use command .ducduckgo""" 2 | 3 | from telethon import events 4 | import os 5 | import requests 6 | import json 7 | from uniborg.util import admin_cmd 8 | 9 | 10 | @borg.on(admin_cmd("ducduckgo (.*)")) 11 | async def _(event): 12 | if event.fwd_from: 13 | return 14 | input_str = event.pattern_match.group(1) 15 | sample_url = "https://duckduckgo.com/?q={}".format(input_str.replace(" ","+")) 16 | if sample_url: 17 | link = sample_url.rstrip() 18 | await event.edit("Let me 🦆 DuckDuckGo that for you:\n🔎 [{}]({})".format(input_str, link)) 19 | else: 20 | await event.edit("something is wrong. please try again later.") 21 | -------------------------------------------------------------------------------- /stdplugins/undo_dlt.py: -------------------------------------------------------------------------------- 1 | """ cmd is undlt""" 2 | 3 | from telethon import events 4 | from uniborg.util import admin_cmd 5 | import asyncio 6 | 7 | 8 | @borg.on(admin_cmd(pattern="undlt")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | c = await event.get_chat() 13 | if c.admin_rights or c.creator: 14 | a = await borg.get_admin_log(event.chat_id,limit=1, search="", edit=False, delete=True) 15 | for i in a: 16 | await event.reply(i.original.action.message) 17 | else: 18 | await event.edit("You need administrative permissions in order to do this command") 19 | await asyncio.sleep(3) 20 | await event.delete() 21 | -------------------------------------------------------------------------------- /stdplugins/leaveme.py: -------------------------------------------------------------------------------- 1 | # For @UniBorg 2 | # Courtesy @r4v4n4 3 | """ 4 | .leave to kick yourself from any group 5 | """ 6 | 7 | from telethon.tl.functions.channels import LeaveChannelRequest 8 | from uniborg.util import admin_cmd 9 | import time 10 | 11 | 12 | @borg.on(admin_cmd("leave", outgoing=True)) 13 | async def leave(e): 14 | if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"): 15 | await e.edit("`Legend is leaving this chat.....!` @admin `Goodbye aren't forever.. `") 16 | time.sleep(3) 17 | if '-' in str(e.chat_id): 18 | await borg(LeaveChannelRequest(e.chat_id)) 19 | else: 20 | await e.edit('`Sir This is Not A Chat`') 21 | -------------------------------------------------------------------------------- /stdplugins/wikipedia.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: .wiki """ 6 | 7 | from telethon import events 8 | import wikipedia 9 | 10 | 11 | @borg.on(events.NewMessage(pattern=r".wiki (.*)", outgoing=True)) 12 | async def _(event): 13 | if event.fwd_from: 14 | return 15 | await event.edit("Processing ...") 16 | input_str = event.pattern_match.group(1) 17 | result = wikipedia.summary(input_str) 18 | await event.edit("**Search**: {} \n\n **Result**: \n\n {}".format(input_str, result)) 19 | 20 | -------------------------------------------------------------------------------- /stdplugins/men.py: -------------------------------------------------------------------------------- 1 | """Mention/Tag Replied Users\n 2 | `.mention` 3 | """ 4 | # By: @INF1N17Y 5 | 6 | import html 7 | from uniborg.util import admin_cmd 8 | 9 | 10 | @borg.on(admin_cmd(pattern="men (.*)")) 11 | async def _(event): 12 | if event.fwd_from: 13 | return 14 | if event.reply_to_msg_id: 15 | input_str = event.pattern_match.group(1) 16 | reply_msg = await event.get_reply_message() 17 | caption = """{}""".format(reply_msg.from_id, input_str) 18 | await event.delete() 19 | await borg.send_message(event.chat_id, caption, parse_mode="HTML") 20 | else: 21 | await event.edit("Reply to user with `.mention `") 22 | -------------------------------------------------------------------------------- /stdplugins/tagall.py: -------------------------------------------------------------------------------- 1 | """cmd .tagall to tagall members of group""" 2 | 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 | from telethon import events 7 | from uniborg.util import admin_cmd 8 | 9 | 10 | @borg.on(admin_cmd("tagall")) 11 | async def _(event): 12 | if event.fwd_from: 13 | return 14 | mentions = "@SAB" 15 | chat = await event.get_input_chat() 16 | async for x in borg.iter_participants(chat, 100): 17 | mentions += f"[\u2063](tg://user?id={x.id})" 18 | await event.reply(mentions) 19 | await event.delete() 20 | 21 | -------------------------------------------------------------------------------- /stdplugins/bye.py: -------------------------------------------------------------------------------- 1 | # For @UniBorg 2 | 3 | """use cmd `.leave` and kick yourself from the group chat""" 4 | 5 | 6 | 7 | from telethon.tl.functions.channels import LeaveChannelRequest 8 | 9 | from uniborg.util import admin_cmd 10 | 11 | import time 12 | 13 | 14 | 15 | 16 | 17 | @borg.on(admin_cmd("bye", outgoing=True)) 18 | 19 | async def leave(e): 20 | 21 | if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"): 22 | 23 | await e.edit("`I am leaving this chat.....!`") 24 | 25 | time.sleep(3) 26 | 27 | if '-' in str(e.chat_id): 28 | 29 | await borg(LeaveChannelRequest(e.chat_id)) 30 | 31 | else: 32 | 33 | await e.edit('`Sir This is Not A Chat`') 34 | -------------------------------------------------------------------------------- /stdplugins/mentionbitches.py: -------------------------------------------------------------------------------- 1 | """Mention/Tag Replied Users\n 2 | `.men` 3 | """ 4 | # By: @INF1N17Y 5 | 6 | import html 7 | from uniborg.util import admin_cmd 8 | 9 | 10 | @borg.on(admin_cmd(pattern="men (.*)")) 11 | async def _(event): 12 | if event.fwd_from: 13 | return 14 | if event.reply_to_msg_id: 15 | input_str = event.pattern_match.group(1) 16 | reply_msg = await event.get_reply_message() 17 | caption = """{}""".format(reply_msg.from_id, input_str) 18 | await event.delete() 19 | await borg.send_message(event.chat_id, caption, parse_mode="HTML") 20 | else: 21 | await event.edit("Reply to user with `.mention `") 22 | -------------------------------------------------------------------------------- /stdplugins/aesthetics.py: -------------------------------------------------------------------------------- 1 | """COMMAND : .ae""" 2 | 3 | from telethon import events 4 | 5 | PRINTABLE_ASCII = range(0x21, 0x7f) 6 | 7 | 8 | def aesthetify(string): 9 | for c in string: 10 | c = ord(c) 11 | if c in PRINTABLE_ASCII: 12 | c += 0xFF00 - 0x20 13 | elif c == ord(" "): 14 | c = 0x3000 15 | yield chr(c) 16 | 17 | 18 | @borg.on(events.NewMessage(pattern=r'.ae\s+(.+)', outgoing=True)) 19 | @borg.on(events.MessageEdited(pattern=r'.ae\s+(.+)', outgoing=True)) 20 | async def _(event): 21 | text = event.pattern_match.group(1) 22 | text = "".join(aesthetify(text)) 23 | await event.edit(text=text, parse_mode=None, link_preview=False) 24 | raise events.StopPropagation 25 | -------------------------------------------------------------------------------- /stdplugins/preview.py: -------------------------------------------------------------------------------- 1 | """ 2 | Reply to a message with .p to toggle the webpage preview of a message 3 | """ 4 | from telethon.errors import MessageNotModifiedError 5 | from telethon.tl.functions.messages import EditMessageRequest 6 | 7 | from stdplugins.kbass_core import self_reply_cmd 8 | 9 | 10 | @self_reply_cmd(borg, r"^\.p$") 11 | async def on_edit_preview(event, target): 12 | try: 13 | await borg(EditMessageRequest( 14 | peer=await event.get_input_chat(), 15 | id=target.id, 16 | no_webpage=bool(target.media), 17 | message=target.message, 18 | entities=target.entities 19 | )) 20 | except MessageNotModifiedError: 21 | # There was no preview to modify 22 | pass -------------------------------------------------------------------------------- /sql_helpers/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | from sqlalchemy import create_engine 3 | from sqlalchemy.ext.declarative import declarative_base 4 | from sqlalchemy.orm import sessionmaker, scoped_session 5 | 6 | 7 | # the secret configuration specific things 8 | ENV = bool(os.environ.get("ENV", False)) 9 | if ENV: 10 | from sample_config import Config 11 | else: 12 | if os.path.exists("config.py"): 13 | from config import Development as Config 14 | 15 | 16 | def start() -> scoped_session: 17 | engine = create_engine(Config.DB_URI) 18 | BASE.metadata.bind = engine 19 | BASE.metadata.create_all(engine) 20 | return scoped_session(sessionmaker(bind=engine, autoflush=False)) 21 | 22 | 23 | BASE = declarative_base() 24 | SESSION = start() 25 | -------------------------------------------------------------------------------- /stdplugins/whatscrapp.py: -------------------------------------------------------------------------------- 1 | """Syntax: .whatscrapp as reply to a message copied from @WhatsCRApp""" 2 | from telethon import events 3 | from uniborg.util import admin_cmd 4 | 5 | 6 | @borg.on(admin_cmd("whatscrapp")) 7 | async def _(event): 8 | if event.fwd_from: 9 | return 10 | if event.reply_to_msg_id: 11 | previous_message = await event.get_reply_message() 12 | the_real_message = previous_message.text 13 | reply_to_id = event.reply_to_msg_id 14 | the_real_message = the_real_message.replace("*", "**") 15 | the_real_message = the_real_message.replace("_", "__") 16 | await event.edit(the_real_message) 17 | else: 18 | await event.edit("Reply to a message with `.whatscrapp` to format @WhatsCRApp messages to @Telegram") 19 | -------------------------------------------------------------------------------- /stdplugins/ifsc.py: -------------------------------------------------------------------------------- 1 | """Query Indian Financial System Code to get address of the relevant bank or branch 2 | Syntax: .ifsc rp """ 3 | from telethon import events 4 | import requests 5 | import json 6 | from uniborg.util import admin_cmd 7 | 8 | 9 | @borg.on(admin_cmd("ifsc rp (.*)")) 10 | async def _(event): 11 | if event.fwd_from: 12 | return 13 | input_str = event.pattern_match.group(1) 14 | url = "https://ifsc.razorpay.com/{}".format(input_str) 15 | r = requests.get(url) 16 | if r.status_code == 200: 17 | b = r.json() 18 | a = json.dumps(b, sort_keys=True, indent=4) 19 | # https://stackoverflow.com/a/9105132/4723940 20 | await event.edit(str(a)) 21 | else: 22 | await event.edit("`{}`: {}".format(input_str, r.text)) 23 | -------------------------------------------------------------------------------- /GenerateStringSession.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 | -------------------------------------------------------------------------------- /stdplugins/leave.py: -------------------------------------------------------------------------------- 1 | # For @UniBorg 2 | 3 | """fake leave 4 | 5 | .fleave""" 6 | 7 | 8 | 9 | from telethon import events 10 | 11 | from datetime import datetime 12 | 13 | from uniborg.util import admin_cmd 14 | 15 | import importlib.util 16 | 17 | import asyncio 18 | 19 | import random 20 | 21 | import importlib.util 22 | 23 | 24 | 25 | 26 | @borg.on(events.NewMessage(outgoing=True, pattern='^\.(f?f)l ')) 27 | 28 | async def timer_blankx(e): 29 | 30 | txt=e.text[7:] + '\n\n`Processing....` ' 31 | 32 | j=1 33 | 34 | k=j 35 | 36 | for j in range(j): 37 | 38 | await e.edit(txt + str(k)) 39 | 40 | k=k-1 41 | 42 | await asyncio.sleep(1) 43 | 44 | if e.pattern_match.group(1) == 'f': 45 | 46 | await e.edit("`Legend is leaving this chat.....!` @admin `Goodbye aren't forever..` ") 47 | 48 | -------------------------------------------------------------------------------- /stdplugins/unsupported.py: -------------------------------------------------------------------------------- 1 | """Command: `.repo`""" 2 | import asyncio 3 | from telethon import events 4 | from telethon.tl.types import ChannelParticipantsAdmins 5 | from uniborg.util import admin_cmd 6 | 7 | 8 | @borg.on(admin_cmd("repo")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | mentions = "**Link To The Custom Uniborg Repo:** https://github.com/mkaraniya/BotHub " 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 | -------------------------------------------------------------------------------- /userbot/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # TG-UserBot - A modular Telegram UserBot script for Python. 2 | # Copyright (C) 2019 Kandarp 3 | # 4 | # TG-UserBot is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # TG-UserBot is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with TG-UserBot. If not, see . 16 | -------------------------------------------------------------------------------- /userbot/helper_funcs/__init__.py: -------------------------------------------------------------------------------- 1 | # TG-UserBot - A modular Telegram UserBot script for Python. 2 | # Copyright (C) 2019 Kandarp 3 | # 4 | # TG-UserBot is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # TG-UserBot is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with TG-UserBot. If not, see . 16 | -------------------------------------------------------------------------------- /stdplugins/call_admin.py: -------------------------------------------------------------------------------- 1 | """.admin Plugin for @UniBorg to shout admin""" 2 | import asyncio 3 | from telethon import events 4 | from telethon.tl.types import ChannelParticipantsAdmins 5 | from uniborg.util import admin_cmd 6 | 7 | 8 | @borg.on(admin_cmd("admin")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | mentions = "@admin: 🇸 🇵 🇦 🇲 🇸 🇵 🇴 🇹 🇹 🇪 🇩 " 13 | chat = await event.get_input_chat() 14 | async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins): 15 | mentions += f"[\u2063](tg://user?id={x.id})" 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 | -------------------------------------------------------------------------------- /stdplugins/all.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 | """A Plugin to tagall in the chat for @UniBorg and cmd is `.all`""" 5 | 6 | from telethon import events 7 | from uniborg.util import admin_cmd 8 | 9 | # @borg.on(events.NewMessage(pattern=r"\.all", outgoing=True)) 10 | @borg.on(admin_cmd("all")) 11 | async def _(event): 12 | if event.fwd_from: 13 | return 14 | await event.delete() 15 | mentions = "@all" 16 | chat = await event.get_input_chat() 17 | async for x in borg.iter_participants(chat, 100): 18 | mentions += f"[\u2063](tg://user?id={x.id})" 19 | await borg.send_message(chat, mentions, reply_to=event.message.reply_to_msg_id) 20 | -------------------------------------------------------------------------------- /stdplugins/Exit.py: -------------------------------------------------------------------------------- 1 | # For @UniBorg 2 | 3 | """use cmd `.fexit` to create a fake exit""" 4 | 5 | 6 | 7 | from telethon import events 8 | 9 | from datetime import datetime 10 | 11 | from uniborg.util import admin_cmd 12 | 13 | import importlib.util 14 | 15 | import asyncio 16 | 17 | import random 18 | 19 | import importlib.util 20 | 21 | 22 | 23 | 24 | @borg.on(events.NewMessage(outgoing=True, pattern='^\.(f?f)exit')) 25 | 26 | async def timer_blankx(e): 27 | 28 | txt=e.text[7:] + '\n\n`Processing....` ' 29 | 30 | j=1 31 | 32 | k=j 33 | 34 | for j in range(j): 35 | 36 | await e.edit(txt + str(k)) 37 | 38 | k=k-1 39 | 40 | await asyncio.sleep(1) 41 | 42 | if e.pattern_match.group(1) == 'f': 43 | 44 | await e.edit("`Legend is leaving this chat.....!` @admin `Goodbye aren't forever. It was a pleasant time with you guys..` ") 45 | 46 | -------------------------------------------------------------------------------- /stdplugins/sp_search.py: -------------------------------------------------------------------------------- 1 | """ 2 | StartPage Search Plugin for Userbot . //Alternative to Google Search 3 | cmd : .sch search_query 4 | By: @Zero_cool7870 5 | 6 | """ 7 | 8 | import os 9 | import asyncio 10 | import json 11 | from uniborg.util import admin_cmd 12 | 13 | 14 | 15 | @borg.on(admin_cmd(pattern="sch ?(.*)", allow_sudo=True)) 16 | async def sp_search(event): 17 | search_str = event.pattern_match.group(1) 18 | 19 | await event.edit("**Searching for "+search_str+" ...**") 20 | 21 | command = "sp --json "+search_str+" > out.json" 22 | 23 | os.system(command) 24 | 25 | f = open('out.json','r').read() 26 | 27 | data = json.loads(str(f)) 28 | 29 | msg = "**Search Query** \n`"+search_str+"`\n**Results**\n" 30 | 31 | for element in data: 32 | msg = msg + "⁍ ["+element['title']+"]("+element['link']+")\n\n" 33 | 34 | await event.edit(msg) 35 | -------------------------------------------------------------------------------- /stdplugins/owner.py: -------------------------------------------------------------------------------- 1 | """Available Commands: .owner""" 2 | 3 | from telethon import events 4 | 5 | import asyncio 6 | 7 | 8 | 9 | 10 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 11 | 12 | async def _(event): 13 | 14 | if event.fwd_from: 15 | 16 | return 17 | 18 | animation_interval = 0.5 19 | 20 | animation_ttl = range(0, 6) 21 | 22 | input_str = event.pattern_match.group(1) 23 | 24 | if input_str == "owner": 25 | 26 | await event.edit(input_str) 27 | 28 | animation_chars = [ 29 | 30 | "M\nA\nY\nU\nR", 31 | "T\nH\nE", 32 | "K\nI\nN\nG", 33 | "👑\nMAYUR THE KING 👑" 34 | 35 | ] 36 | 37 | for i in animation_ttl: 38 | 39 | await asyncio.sleep(animation_interval) 40 | 41 | await event.edit(animation_chars[i % 6]) 42 | -------------------------------------------------------------------------------- /stdplugins/coronavirus.py: -------------------------------------------------------------------------------- 1 | """CoronaVirus LookUp 2 | Syntax: .COD19 """ 3 | from covid import Covid 4 | from uniborg.util import admin_cmd 5 | 6 | @borg.on(admin_cmd(pattern="COD19 (.*)")) 7 | async def _(event): 8 | covid = Covid() 9 | data = covid.get_data() 10 | country = event.pattern_match.group(1) 11 | country_data = get_country_data(country, data) 12 | output_text = "" 13 | for name, value in country_data.items(): 14 | output_text += "`{}`: `{}`\n".format(str(name), str(value)) 15 | await event.edit("**CoronaVirus Info in {}**:\n\n{}".format(country.capitalize(), output_text)) 16 | 17 | def get_country_data(country, world): 18 | for country_data in world: 19 | if country_data["country"].lower() == country.lower(): 20 | return country_data 21 | return {"Status": "No information yet about this country!"} 22 | -------------------------------------------------------------------------------- /english/history.yml: -------------------------------------------------------------------------------- 1 | categories: 2 | - history 3 | conversations: 4 | - - tell me about the american civil war 5 | - do you think the south was right? 6 | - - do you know about the american civil war 7 | - I am very interested in the war between the states. 8 | - - What is history? 9 | - History is the course of political, economic and military events over time, from 10 | the dawn of man to the age of AI.' 11 | - - what kind of history 12 | - I like to talk about the history of robots and computers. 13 | - - are you interested in history 14 | - I am very interested in history, too. what period do you like? 15 | - - explain history 16 | - history has two broad interpretations, depending on whether you accept the role 17 | of individuals as important or not. 18 | - - who invented the lightbulb 19 | - thomas edison. 20 | - - who invented the steam engine 21 | - james watt. 22 | -------------------------------------------------------------------------------- /stdplugins/schd.py: -------------------------------------------------------------------------------- 1 | """Schedule Plugin for @UniBorg 2 | Syntax: .schd = """ 3 | from telethon import events 4 | import asyncio 5 | from uniborg.util import admin_cmd 6 | 7 | 8 | @borg.on(admin_cmd("schd ?(.*)")) 9 | async def _(event): 10 | if event.fwd_from: 11 | return 12 | input_str = event.pattern_match.group(1) 13 | ttl = 0 14 | message = "SYNTAX: `.schd = `" 15 | if input_str: 16 | await event.delete() 17 | if "=" in input_str: 18 | ttl, message = input_str.split("=") 19 | elif event.reply_to_msg_id: 20 | await event.delete() 21 | ttl = int(input_str) 22 | message = await event.get_reply_message() 23 | await asyncio.sleep(int(ttl)) 24 | await event.respond(message) 25 | else: 26 | await event.edit(message) 27 | -------------------------------------------------------------------------------- /sql_helpers/no_log_pms_sql.py: -------------------------------------------------------------------------------- 1 | from sqlalchemy import Column, String, Numeric 2 | from sql_helpers import SESSION, BASE 3 | 4 | 5 | class NOLogPMs(BASE): 6 | __tablename__ = "no_log_pms" 7 | chat_id = Column(Numeric, primary_key=True) 8 | 9 | def __init__(self, chat_id, reason=""): 10 | self.chat_id = chat_id 11 | 12 | 13 | NOLogPMs.__table__.create(checkfirst=True) 14 | 15 | 16 | def is_approved(chat_id): 17 | try: 18 | return SESSION.query(NOLogPMs).filter(NOLogPMs.chat_id == chat_id).one() 19 | except: 20 | return None 21 | finally: 22 | SESSION.close() 23 | 24 | 25 | def approve(chat_id): 26 | adder = NOLogPMs(chat_id) 27 | SESSION.add(adder) 28 | SESSION.commit() 29 | 30 | 31 | def disapprove(chat_id): 32 | rem = SESSION.query(NOLogPMs).get(chat_id) 33 | if rem: 34 | SESSION.delete(rem) 35 | SESSION.commit() 36 | -------------------------------------------------------------------------------- /stdplugins/git.py: -------------------------------------------------------------------------------- 1 | """cmd : .guthub """ 2 | 3 | from telethon import events 4 | 5 | import asyncio 6 | 7 | 8 | 9 | 10 | 11 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 12 | 13 | async def _(event): 14 | 15 | if event.fwd_from: 16 | 17 | return 18 | 19 | animation_interval = 0.8 20 | 21 | animation_ttl = range(0, 1) 22 | 23 | input_str = event.pattern_match.group(1) 24 | 25 | if input_str == "guthub": 26 | 27 | await event.edit(input_str) 28 | 29 | animation_chars = [ 30 | 31 | "https://github.com/mkaraniya/BotHub", 32 | 33 | "https://github.com/ravana69/UniBorg", 34 | 35 | "https://github.com/spechide/UniBorg" 36 | ] 37 | 38 | for i in animation_ttl: 39 | 40 | await asyncio.sleep(animation_interval) 41 | 42 | await event.edit(animation_chars[i % 3]) 43 | -------------------------------------------------------------------------------- /sql_helpers/gmute_sql.py: -------------------------------------------------------------------------------- 1 | try: 2 | from sql_helpers import SESSION, BASE 3 | except ImportError: 4 | raise AttributeError 5 | 6 | from sqlalchemy import Column, String, UnicodeText 7 | 8 | 9 | class GMute(BASE): 10 | __tablename__ = "gmute" 11 | sender = Column(String(14), primary_key=True) 12 | 13 | def __init__(self, sender): 14 | self.sender = str(sender) 15 | 16 | 17 | GMute.__table__.create(checkfirst=True) 18 | 19 | 20 | def is_gmuted(sender_id): 21 | try: 22 | return SESSION.query(GMute).all() 23 | except BaseException: 24 | return None 25 | finally: 26 | SESSION.close() 27 | 28 | 29 | def gmute(sender): 30 | adder = GMute(str(sender)) 31 | SESSION.add(adder) 32 | SESSION.commit() 33 | 34 | 35 | def ungmute(sender): 36 | rem = SESSION.query(GMute).get((str(sender))) 37 | if rem: 38 | SESSION.delete(rem) 39 | SESSION.commit() 40 | -------------------------------------------------------------------------------- /stdplugins/gangestar.py: -------------------------------------------------------------------------------- 1 | """.gangestar Plugin""" 2 | 3 | from telethon import events 4 | import random, re 5 | from uniborg.util import admin_cmd 6 | import asyncio 7 | 8 | 9 | 10 | @borg.on(admin_cmd("gangestar ?(.*)")) 11 | async def _(event): 12 | if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "@", "!"): 13 | await event.edit("EVERyBOdy") 14 | await asyncio.sleep(0.3) 15 | await event.edit("wAs") 16 | await asyncio.sleep(0.2) 17 | await event.edit("GanGeSTar") 18 | await asyncio.sleep(0.5) 19 | await event.edit("UNtIL ") 20 | await asyncio.sleep(0.2) 21 | await event.edit("I") 22 | await asyncio.sleep(0.3) 23 | await event.edit("ArRivEd") 24 | await asyncio.sleep(0.3) 25 | await event.edit("😎😎😎") 26 | await asyncio.sleep(0.3) 27 | await event.edit("EVERyBOdy wAs GanGeSTar UNtIL I ArRivEd 😎😎😎") 28 | -------------------------------------------------------------------------------- /stdplugins/get_id.py: -------------------------------------------------------------------------------- 1 | """Get ID of any Telegram media, or any user 2 | Syntax: .g_id""" 3 | from telethon import events 4 | from telethon.utils import pack_bot_file_id 5 | from uniborg.util import admin_cmd 6 | 7 | 8 | @borg.on(admin_cmd("g_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 | -------------------------------------------------------------------------------- /stdplugins/quotes.py: -------------------------------------------------------------------------------- 1 | """.quote""" 2 | 3 | import random 4 | import requests 5 | from uniborg.util import admin_cmd 6 | 7 | @borg.on(admin_cmd(pattern="quote ?(.*)")) 8 | async def quote_search(event): 9 | if event.fwd_from: 10 | return 11 | await event.edit("Processing...") 12 | search_string = event.pattern_match.group(1) 13 | input_url = "https://bots.shrimadhavuk.me/Telegram/GoodReadsQuotesBot/?q={}".format(search_string) 14 | headers = {"USER-AGENT": "UniBorg"} 15 | try: 16 | response = requests.get(input_url, headers=headers).json() 17 | except: 18 | response = None 19 | if response is not None: 20 | result = random.choice(response).get("input_message_content").get("message_text") 21 | else: 22 | result = None 23 | if result: 24 | await event.edit(result.replace("", "`").replace("", "`")) 25 | else: 26 | await event.edit("Zero results found") 27 | -------------------------------------------------------------------------------- /stdplugins/pingme.py: -------------------------------------------------------------------------------- 1 | 2 | """ Command: .pingme will show you your loop back ping.. 3 | edited by @Mayur_Karaniya""" 4 | 5 | from telethon import events 6 | from datetime import datetime 7 | from uniborg.util import admin_cmd 8 | from sample_config import Config 9 | from platform import python_version, uname 10 | 11 | # ================= CONSTANT ================= 12 | DEFAULTUSER = Config.ALIVE_NAME if Config.ALIVE_NAME else uname().node 13 | # ============================================ 14 | 15 | 16 | 17 | 18 | @borg.on(admin_cmd(pattern="pingme ?(.*)", allow_sudo=False)) 19 | async def _(event): 20 | if event.fwd_from: 21 | return 22 | await event.delete() 23 | start = datetime.now() 24 | mone = await event.reply(f"{DEFAULTUSER}'s P I N G Is : Calculating...") 25 | end = datetime.now() 26 | ms = (end - start).microseconds * 0.00001 27 | await mone.edit("This is MY P I N G : {} ms".format(ms)) 28 | 29 | -------------------------------------------------------------------------------- /stdplugins/batch_upload.py: -------------------------------------------------------------------------------- 1 | """ 2 | Files Batch Uploader Plugin for userbot. 3 | usage:- .upb 4 | Note:- set TEMP_DIR in Your ENV Vars First. 5 | By:-@Zero_cool7870 6 | 7 | """ 8 | import os 9 | import asyncio 10 | from uniborg.util import admin_cmd 11 | from telethon import events 12 | 13 | 14 | 15 | @borg.on(events.NewMessage(pattern=r"\.upb", outgoing=True)) 16 | async def batch_upload(event): 17 | if event.fwd_from: 18 | return 19 | temp_dir = Config.TEMP_DIR 20 | if os.path.exists(temp_dir): 21 | files = os.listdir(temp_dir) 22 | files.sort() 23 | await event.edit("Uploading Files on Telegram...") 24 | for file in files: 25 | required_file_name = temp_dir+"/"+file 26 | print(required_file_name) 27 | await borg.send_file( 28 | event.chat_id, 29 | required_file_name, 30 | force_document=True 31 | ) 32 | else: 33 | await event.edit("Directory Not Found.") 34 | return 35 | await event.edit("Successfull.") 36 | -------------------------------------------------------------------------------- /stdplugins/fixreply.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 | """.fix """ 6 | 7 | import asyncio 8 | 9 | from telethon import events 10 | 11 | 12 | _last_messages = {} 13 | 14 | 15 | @borg.on(events.NewMessage(outgoing=True)) 16 | async def _(event): 17 | _last_messages[event.chat_id] = event.message 18 | 19 | 20 | @borg.on(events.NewMessage(pattern=r"\.(fix)?reply", outgoing=True)) 21 | async def _(event): 22 | if not event.is_reply or event.chat_id not in _last_messages: 23 | return 24 | 25 | message = _last_messages[event.chat_id] 26 | chat = await event.get_input_chat() 27 | await asyncio.wait([ 28 | borg.delete_messages(chat, [event.id, message.id]), 29 | borg.send_message(chat, message, reply_to=event.reply_to_msg_id) 30 | ]) 31 | -------------------------------------------------------------------------------- /stdplugins/shout.py: -------------------------------------------------------------------------------- 1 | """Shouts a message in MEME way 2 | usage: .shout message 3 | originaly from : @corsicanu_bot 4 | """ 5 | 6 | import sys 7 | from telethon import events, functions 8 | from uniborg.util import admin_cmd 9 | import random 10 | 11 | 12 | @borg.on(events.NewMessage(pattern=r"\.shout", outgoing=True)) 13 | async def shout(args): 14 | if args.fwd_from: 15 | return 16 | else: 17 | msg = "```" 18 | messagestr = args.text 19 | messagestr = messagestr[7:] 20 | text = " ".join(messagestr) 21 | result = [] 22 | result.append(' '.join([s for s in text])) 23 | for pos, symbol in enumerate(text[1:]): 24 | result.append(symbol + ' ' + ' ' * pos + symbol) 25 | result = list("\n".join(result)) 26 | result[0] = text[0] 27 | result = "".join(result) 28 | msg = "\n" + result 29 | await args.edit("`"+msg+"`") 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /stdplugins/chain.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 | """cmd .chain it's just here, but of no use""" 6 | 7 | 8 | from telethon import events 9 | from telethon.tl.functions.messages import SaveDraftRequest 10 | 11 | @borg.on(events.NewMessage(pattern=r"\.chain", outgoing=True)) 12 | async def _(event): 13 | await event.edit("Counting...") 14 | count = -1 15 | message = event.message 16 | while message: 17 | reply = await message.get_reply_message() 18 | if reply is None: 19 | await borg(SaveDraftRequest( 20 | await event.get_input_chat(), 21 | "", 22 | reply_to_msg_id=message.id 23 | )) 24 | message = reply 25 | count += 1 26 | await event.edit(f"Chain length: {count}") 27 | -------------------------------------------------------------------------------- /telesetup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # (c) https://t.me/TelethonChat/37677 3 | 4 | import telethon.sync 5 | from telethon import TelegramClient, events 6 | from telethon.tl import types, functions 7 | import os 8 | from config import Development as Config 9 | 10 | 11 | # https://t.me/TelethonChat/13265 12 | client = TelegramClient(input("Enter your username: @"), Config.APP_ID, Config.API_HASH).start() 13 | 14 | 15 | def progress(current, total): 16 | print("Downloaded: " + str(current) + " of " + str(total) + " Percent: " + str((current / total) * 100)) 17 | 18 | 19 | spechide = client.get_me() 20 | print(spechide.stringify()) 21 | # client.send_message(spechide, "Dummy Message to get active session") 22 | 23 | 24 | """Interactive client to test various things 25 | """ 26 | if __name__ == "__main__": 27 | @client.on(events.NewMessage) 28 | def myeventhandler(event): 29 | print(event.raw_text)""" 30 | print("Loaded") 31 | client.run_until_disconnected() 32 | -------------------------------------------------------------------------------- /stdplugins/plane.py: -------------------------------------------------------------------------------- 1 | """By STARKTM1 2 | cmd : .plane""" 3 | from telethon import events 4 | import asyncio 5 | import os 6 | import sys 7 | 8 | 9 | @borg.on(events.NewMessage(pattern=r"\.plane", outgoing=True)) 10 | async def _(event): 11 | if event.fwd_from: 12 | return 13 | 14 | 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 event.edit("-------------✈") 29 | await asyncio.sleep(3) 30 | await event.delete() 31 | 32 | -------------------------------------------------------------------------------- /stdplugins/clock.py: -------------------------------------------------------------------------------- 1 | """COMMAND : .sclock""" 2 | 3 | from telethon import events 4 | 5 | import asyncio 6 | 7 | 8 | 9 | 10 | 11 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 12 | 13 | async def _(event): 14 | 15 | if event.fwd_from: 16 | 17 | return 18 | 19 | animation_interval = 0.1 20 | 21 | animation_ttl = range(0, 101) 22 | 23 | input_str = event.pattern_match.group(1) 24 | 25 | if input_str == "sclock": 26 | 27 | await event.edit(input_str) 28 | 29 | animation_chars = [ 30 | 31 | "🕛", 32 | "🕐", 33 | "🕑", 34 | "🕒", 35 | "🕓", 36 | "🕔", 37 | "🕕", 38 | "🕖", 39 | "🕗", 40 | "🕘", 41 | "🕙" 42 | ] 43 | 44 | for i in animation_ttl: 45 | 46 | await asyncio.sleep(animation_interval) 47 | 48 | await event.edit(animation_chars[i % 11]) 49 | -------------------------------------------------------------------------------- /stdplugins/urbandictionary.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 | """Urban Dictionary 5 | Syntax: .ud Query""" 6 | from telethon import events 7 | import urbandict 8 | from urbandict import define 9 | import asyncurban 10 | from uniborg.util import admin_cmd 11 | 12 | 13 | @borg.on(admin_cmd("ud (.*)")) 14 | async def _(event): 15 | if event.fwd_from: 16 | return 17 | await event.edit("processing...") 18 | word = event.pattern_match.group(1) 19 | urban = asyncurban.UrbanDictionary() 20 | try: 21 | mean = await urban.get_word(word) 22 | await event.edit("Text: **{}**\n\nMeaning: **{}**\n\nExample: __{}__".format(mean.word, mean.definition, mean.example)) 23 | except asyncurban.WordNotFoundError: 24 | await event.edit("No result found for **" + word + "**") 25 | 26 | -------------------------------------------------------------------------------- /stdplugins/cow.py: -------------------------------------------------------------------------------- 1 | """.cowsay, .tuxsay, .milksay, .kisssay, .wwwsay, .defaultsay, .bunnysay, 2 | .moosesay, .sheepsay, .rensay, .cheesesay, .ghostbusterssay, .skeletonsay, 3 | and may cmd would be added soon.""" 4 | 5 | 6 | import asyncio 7 | from telethon import events 8 | from cowpy import cow 9 | from uniborg.util import admin_cmd 10 | 11 | 12 | @borg.on(events.NewMessage(pattern=r"^.(\w+)say (.*)", outgoing=True)) 13 | async def univsaye(cowmsg): 14 | """ For .cowsay module, uniborg wrapper for cow which says things. """ 15 | if not cowmsg.text[0].isalpha() and cowmsg.text[0] not in ("/", "#", "@", "!"): 16 | arg = cowmsg.pattern_match.group(1).lower() 17 | text = cowmsg.pattern_match.group(2) 18 | 19 | if arg == "cow": 20 | arg = "default" 21 | if arg not in cow.COWACTERS: 22 | return 23 | cheese = cow.get_cow(arg) 24 | cheese = cheese() 25 | 26 | await cowmsg.edit(f"`{cheese.milk(text).replace('`', '´')}`") 27 | -------------------------------------------------------------------------------- /stdplugins/transfer_channel.py: -------------------------------------------------------------------------------- 1 | """Transfer Ownership of Channels 2 | Available Commands: 3 | .otransfer @username""" 4 | 5 | import telethon.password as pwd_mod 6 | # https://t.me/TelethonChat/140200 7 | from telethon.tl import functions, types 8 | from uniborg import util 9 | 10 | 11 | @borg.on(util.admin_cmd("otransfer (.*)")) # pylint:disable=E0602 12 | async def _(event): 13 | if event.fwd_from: 14 | return 15 | user_name = event.pattern_match.group(1) 16 | current_channel = event.chat_id 17 | # not doing any validations, here FN 18 | # MBL 19 | try: 20 | pwd = await borg(functions.account.GetPasswordRequest()) 21 | my_srp_password = pwd_mod.compute_check(pwd, Config.TELE_GRAM_2FA_CODE) 22 | await borg(functions.channels.EditCreatorRequest(channel=current_channel, user_id=user_name, password=my_srp_password)) 23 | except Exception as e: 24 | await event.edit(str(e)) 25 | else: 26 | await event.edit("Transferred 🌚") 27 | 28 | -------------------------------------------------------------------------------- /stdplugins/wirelesscharge.py: -------------------------------------------------------------------------------- 1 | # For @UniBorg 2 | 3 | """Countdown Commands 4 | 5 | .wchar""" 6 | 7 | 8 | 9 | from telethon import events 10 | 11 | from datetime import datetime 12 | 13 | from uniborg.util import admin_cmd 14 | 15 | import importlib.util 16 | 17 | import asyncio 18 | 19 | import random 20 | 21 | import importlib.util 22 | 23 | 24 | 25 | 26 | @borg.on(events.NewMessage(outgoing=True, pattern='^\.(q?w)char')) 27 | 28 | async def timer_blankx(e): 29 | 30 | txt=e.text[7:] + '\n\n`Tesla Wireless Charging (beta) Started...\nDevice Detected: Nokia 1100\nBattery Percentage:` ' 31 | 32 | j=10 33 | 34 | k=j 35 | 36 | for j in range(j): 37 | 38 | await e.edit(txt + str(k)) 39 | 40 | k=k+10 41 | 42 | await asyncio.sleep(1) 43 | 44 | if e.pattern_match.group(1) == 'f': 45 | 46 | await e.edit("`Tesla Wireless Charging (beta) Completed...\nDevice Detected: Nokia 1100 (Space Grey Varient)\nBattery Percentage:` [100%](https://telegra.ph/file/a45aa7450c8eefed599d9.mp4) ", link_preview=True) 47 | 48 | 49 | -------------------------------------------------------------------------------- /stdplugins/ok.py: -------------------------------------------------------------------------------- 1 | """ displays the Truth 2 | use cmd .ok""" 3 | 4 | from telethon import events 5 | 6 | import asyncio 7 | 8 | from uniborg.util import admin_cmd 9 | 10 | @borg.on(admin_cmd("(.*)")) 11 | async def _(event): 12 | if event.fwd_from: 13 | return 14 | animation_interval = 0.05 15 | animation_ttl = range(0, 90) 16 | input_str = event.pattern_match.group(1) 17 | if input_str == "ok": 18 | await event.edit(input_str) 19 | animation_chars = [ 20 | "B", 21 | "O", 22 | "T", 23 | "H", 24 | "U", 25 | "B", 26 | "I", 27 | "S", 28 | "T", 29 | "H", 30 | "E", 31 | "B", 32 | "E", 33 | "S", 34 | "T", 35 | "BOTHUB IS THE BEST , 0K Sir 😇" 36 | ] 37 | 38 | for i in animation_ttl: 39 | 40 | await asyncio.sleep(animation_interval) 41 | await event.edit(animation_chars[i % 78]) 42 | -------------------------------------------------------------------------------- /stdplugins/ooof.py: -------------------------------------------------------------------------------- 1 | """use cmd .oof""" 2 | 3 | from telethon import events 4 | 5 | import asyncio 6 | 7 | 8 | 9 | 10 | 11 | @borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True)) 12 | 13 | async def _(event): 14 | 15 | if event.fwd_from: 16 | 17 | return 18 | 19 | animation_interval = 1 20 | 21 | 22 | animation_ttl = range(0, 103) 23 | 24 | input_str = event.pattern_match.group(1) 25 | 26 | if input_str == "oof": 27 | 28 | await event.edit(input_str) 29 | 30 | animation_chars = [ 31 | 32 | "o", 33 | "oo", 34 | "ooo", 35 | "ooooo", 36 | "oooooo", 37 | "ooooooo", 38 | "oooooooo", 39 | "ooooooooo", 40 | "oooooooooo", 41 | "ooooooooooo", 42 | "oooooooooooo", 43 | "ooooooooooooo", 44 | "oooooooooooooof" 45 | ] 46 | 47 | for i in animation_ttl: 48 | 49 | 50 | await event.edit(animation_chars[i % 103]) 51 | -------------------------------------------------------------------------------- /stdplugins/fileext.py: -------------------------------------------------------------------------------- 1 | """Get info about a File Extension 2 | Syntax: .filext EXTENSION""" 3 | from telethon import events 4 | import requests 5 | from bs4 import BeautifulSoup 6 | from uniborg.util import admin_cmd 7 | 8 | 9 | @borg.on(admin_cmd("filext (.*)")) 10 | async def _(event): 11 | if event.fwd_from: 12 | return 13 | await event.edit("Processing ...") 14 | sample_url = "https://www.fileext.com/file-extension/{}.html" 15 | input_str = event.pattern_match.group(1).lower() 16 | response_api = requests.get(sample_url.format(input_str)) 17 | status_code = response_api.status_code 18 | if status_code == 200: 19 | raw_html = response_api.content 20 | soup = BeautifulSoup(raw_html, "html.parser") 21 | ext_details = soup.find_all("td", {"colspan": "3"})[-1].text 22 | await event.edit("**File Extension**: `{}`\n**Description**: `{}`".format(input_str, ext_details)) 23 | else: 24 | await event.edit("https://www.fileext.com/ responded with {} for query: {}".format(status_code, input_str)) 25 | -------------------------------------------------------------------------------- /stdplugins/sleep.py: -------------------------------------------------------------------------------- 1 | """ use cmd .sleep