Skip to content

Commit

Permalink
Ultroid v0.0.7 2021/05/22
Browse files Browse the repository at this point in the history
Co-authored-by: New-dev0 <New-dev0@notavailable.live>
Co-authored-by: Danish <danish@ultroid.tech>
Co-authored-by: Amit Sharma <48654350+buddhhu@users.noreply.github.com>
Co-authored-by: Programming Error <error@notavailable.live>
Co-authored-by: Aakash <BLUE-DEVIL1134@users.noreply.github.com>
Co-authored-by: Aditya <me@xditya.me>
Co-authored-by: sppidy <sppidy@users.noreply.github.com>
Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com>
Co-authored-by: divkix <divkix@users.noreply.github.com>
Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com>
  • Loading branch information
10 people committed May 22, 2021
1 parent 427b6f5 commit 68839e9
Show file tree
Hide file tree
Showing 84 changed files with 3,905 additions and 1,491 deletions.
2 changes: 0 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
API_ID=
API_HASH=
SESSION=
BOT_TOKEN=
REDIS_URI=
REDIS_PASSWORD=
LOG_CHANNEL=
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
.env
venv/
__pycache__
BOT_TOKEN.session-journal
BOT_TOKEN.session
ultroid.session-journal
ultroid.session
*.mp3
*.webm
*.webp
*.mp4
*.tgs
logs-ultroid.txt
.vscode/*
ultroid-log.txt
/*.jpg
/*.png
/*.mp4
addons/
ultroid.log
target/npmlist.json
node_modules
node_modules/
glitch_me/
.idea
venv/
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.

FROM programmingerror/ultroid:v0.0.1
FROM programmingerror/ultroid:v0.0.2

ENV TZ=Asia/Kolkata
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get autoremove --purge

RUN git clone https://github.com/TeamUltroid/Ultroid.git /root/TeamUltroid/

RUN git clone https://github.com/1Danish-00/glitch_me.git && pip install -e ./glitch_me
WORKDIR /root/TeamUltroid/

RUN pip3 install -r requirements.txt
RUN npm install -g npm@7.11.2 -g
RUN npm install -g npm@7.12.1 -g
RUN npm install
RUN npm run build
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ Get the [Necessary Variables](#Necessary-Variables) and then click the button be
- `API_ID` - Your API_ID from [my.telegram.org](https://my.telegram.org/)
- `API_HASH` - Your API_HASH from [my.telegram.org](https://my.telegram.org/)
- `SESSION` - SessionString for your accounts login session. Get it from [here](#Session-String)
- `BOT_TOKEN` - The token of your bot from [@BotFather](https://t.me/BotFather)
- `BOT_USERNAME` - The username of your bot from [@BotFather](https://t.me/BotFather)
- `LOG_CHANNEL` - A private group/channel id.
- `REDIS_URI` - Redis endpoint URL, from [redislabs](http://redislabs.com/), tutorial [here.](./resources/extras/redistut.md)
- `REDIS_PASSWORD ` - Redis endpoint Password, from [redislabs](http://redislabs.com/), tutorial [here.](./resources/extras/redistut.md)

Expand All @@ -102,5 +99,5 @@ Ultroid is licensed under [GNU Affero General Public License](https://www.gnu.or
# Credits
* [![TeamUltroid-Devs](https://img.shields.io/static/v1?label=Teamultroid&message=devs&color=critical)](https://t.me/UltroidDevs)
* [Lonami](https://github.com/LonamiWebs/) for [Telethon.](https://github.com/LonamiWebs/Telethon)
* [AndrewLaneX](https://github.com/AndrewLaneX) for [tgcalls.](http://github.com/tgcallsjs/tgcalls)
* [AndrewLaneX](https://github.com/AndrewLaneX) for [tgcalls-base.](http://github.com/tgcallsjs/tgcalls)

8 changes: 0 additions & 8 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
"description": "You api hash, from my.telegram.org or @ScrapperRoBot.",
"value": ""
},
"BOT_TOKEN": {
"description": "Make a bot from @BotFather, and enter it's api token here.",
"value": ""
},
"SESSION": {
"description": "Your session string. Can be added now, or after deploy. (The bot will NOT work without a session string!!)",
"value": ""
Expand All @@ -47,10 +43,6 @@
"description": "Name of your heroku app, given in the first blank on this page. To be added if deploying to heroku ONLY.",
"value": "",
"required": false
},
"LOG_CHANNEL": {
"description": "Create a private group. Add @missrose_bot and your BOT_USERNAME bot. Do /id. Paste that here",
"value": ""
}
},
"formation": {
Expand Down
109 changes: 45 additions & 64 deletions assistant/inlinestuff.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# PLease read the GNU Affero General Public License in
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.

from random import randrange
import base64
from random import choice
from re import compile as re_compile
from re import findall
from urllib.request import urlopen
Expand All @@ -29,6 +30,16 @@

ofox_api = OrangeFoxAPI()

api1 = base64.b64decode("QUl6YVN5QXlEQnNZM1dSdEI1WVBDNmFCX3c4SkF5NlpkWE5jNkZV").decode(
"ascii"
)
api2 = base64.b64decode("QUl6YVN5QkYwenhMbFlsUE1wOXh3TVFxVktDUVJxOERnZHJMWHNn").decode(
"ascii"
)
api3 = base64.b64decode("QUl6YVN5RGRPS253blB3VklRX2xiSDVzWUU0Rm9YakFLSVFWMERR").decode(
"ascii"
)


@in_pattern("ofox")
@in_owner
Expand Down Expand Up @@ -75,15 +86,13 @@ async def _(e):
],
)
)
await e.answer(fox)
await e.answer(
fox, switch_pm="OrangeFox Recovery Search.", switch_pm_param="start"
)
else:
sed = e.builder.article(
title="Not Found",
description="Wrong Codename",
text="OʀᴀɴɢFᴏx Rᴇᴄᴏᴠᴇʀʏ Fᴏʀ Yᴏᴜʀ Pʜᴏɴᴇ Is Eɪᴛʜᴇʀ Nᴏᴛ Oғғɪᴄɪᴀʟʟʏ Bᴜɪʟᴛ Oʀ Yᴏᴜ Hᴀᴠᴇ Eɴᴛᴇʀᴇᴅ Wʀᴏɴɢ Cᴏᴅᴇɴᴀᴍᴇ",
buttons=Button.switch_inline("Sᴇᴀʀᴄʜ Aɢᴀɪɴ", query="ofox ", same_peer=True),
await e.answer(
[], switch_pm="OrangeFox Recovery Search.", switch_pm_param="start"
)
await e.answer([sed])


@in_pattern("fl2lnk ?(.*)")
Expand Down Expand Up @@ -116,7 +125,7 @@ async def _(e):
title="fl2lnk",
text="File not found",
)
await e.answer([lnk])
await e.answer([lnk], switch_pm="File to Link.", switch_pm_param="start")


@callback(
Expand Down Expand Up @@ -145,17 +154,17 @@ async def repo(e):
thumb=wb(ultpic, 0, "image/jpeg", []),
text="• **ULTROID USERBOT** •",
buttons=[
[Button.url("Repo", url="https://github.com/TeamUltroid/Ultroid")],
[
Button.url("Repo", url="https://github.com/TeamUltroid/Ultroid"),
Button.url(
"Addons", url="https://github.com/TeamUltroid/UltroidAddons"
)
),
],
[Button.url("Support", url="t.me/UltroidSupport")],
],
),
]
await e.answer(res)
await e.answer(res, switch_pm="Ultroid Repo.", switch_pm_param="start")


@in_pattern("go")
Expand All @@ -164,13 +173,9 @@ async def gsearch(q_event):
try:
match = q_event.text.split(" ", maxsplit=1)[1]
except IndexError:
kkkk = q_event.builder.article(
title="Search Something",
thumb=wb(gugirl, 0, "image/jpeg", []),
text="**Gᴏᴏɢʟᴇ Sᴇᴀʀᴄʜ**\n\nYou didn't search anything",
buttons=Button.switch_inline("Sᴇᴀʀᴄʜ Aɢᴀɪɴ", query="go ", same_peer=True),
await q_event.answer(
[], switch_pm="Google Search. Enter a query!", switch_pm_param="start"
)
await q_event.answer([kkkk])
searcher = []
page = findall(r"page=\d+", match)
cache = False
Expand Down Expand Up @@ -216,7 +221,7 @@ async def gsearch(q_event):
)
except IndexError:
break
await q_event.answer(searcher)
await q_event.answer(searcher, switch_pm="Google Search.", switch_pm_param="start")


@in_pattern("rex")
Expand Down Expand Up @@ -251,33 +256,29 @@ async def rextester(event):
description=f"Language-`{lang}` & Code-`{code}`",
text=f"Language:\n`{lang}`\n\nCode:\n`{code}`\n\nResult:\n`{outputt}`\n\nStats:\n`{stats}`",
)
await event.answer([resultm])
await event.answer(
[resultm], switch_pm="RexTester.", switch_pm_param="start"
)
except UnknownLanguage:
resultm = builder.article(
title="Error", # By @ProgrammingError
description="Invalid language choosen",
text=f"The list of valid languages are\n\n{rex_langs}\n\n\nFormat to use Rextester is `@Yourassistantusername rex langcode|code`",
)
await event.answer([resultm])
await event.answer(
[resultm], switch_pm="RexTester. Invalid Language!", switch_pm_param="start"
)


@in_pattern("yahoo")
@in_owner
async def gsearch(q_event):
async def yahoosearch(q_event):
try:
match = q_event.text.split(" ", maxsplit=1)[1]
except IndexError:
kkkk = q_event.builder.article(
title="Search Something",
thumb=wb(yeah, 0, "image/jpeg", []),
text="**Yᴀʜᴏᴏ Sᴇᴀʀᴄʜ**\n\nYou didn't search anything",
buttons=Button.switch_inline(
"Sᴇᴀʀᴄʜ Aɢᴀɪɴ",
query="yahoo ",
same_peer=True,
),
await q_event.answer(
[], switch_pm="Yahoo Search. Enter a query!", switch_pm_param="start"
)
await q_event.answer([kkkk])
searcher = []
page = findall(r"page=\d+", match)
cache = False
Expand Down Expand Up @@ -323,7 +324,7 @@ async def gsearch(q_event):
)
except IndexError:
break
await q_event.answer(searcher)
await q_event.answer(searcher, switch_pm="Yahoo Search.", switch_pm_param="start")


@in_pattern("app")
Expand All @@ -332,13 +333,9 @@ async def _(e):
try:
f = e.text.split(" ", maxsplit=1)[1]
except IndexError:
kkkk = e.builder.article(
title="Search Something",
thumb=wb(ps, 0, "image/jpeg", []),
text="**Pʟᴀʏ Sᴛᴏʀᴇ**\n\nYou didn't search anything",
buttons=Button.switch_inline("Sᴇᴀʀᴄʜ Aɢᴀɪɴ", query="app ", same_peer=True),
await e.answer(
[], switch_pm="App search. Enter app name!", switch_pm_param="start"
)
await e.answer([kkkk])
foles = []
aap = search(f)
for z in aap:
Expand Down Expand Up @@ -377,7 +374,7 @@ async def _(e):
],
),
)
await e.answer(foles)
await e.answer(foles, switch_pm="Application Searcher.", switch_pm_param="start")


@in_pattern("mods")
Expand All @@ -386,21 +383,12 @@ async def _(e):
try:
quer = e.text.split(" ", maxsplit=1)[1]
except IndexError:
kkkk = e.builder.article(
title="Search Something",
text="**Mᴏᴅᴅᴇᴅ Aᴘᴘs**\n\nYou didn't search anything",
buttons=Button.switch_inline("Sᴇᴀʀᴄʜ Aɢᴀɪɴ", query="mods ", same_peer=True),
await e.answer(
[], switch_pm="Mod Apps Search. Enter app name!", switch_pm_param="start"
)
await e.answer([kkkk])
page = 1
start = (page - 1) * 3 + 1
urd = randrange(1, 3)
if urd == 1:
da = "AIzaSyAyDBsY3WRtB5YPC6aB_w8JAy6ZdXNc6FU"
if urd == 2:
da = "AIzaSyBF0zxLlYlPMp9xwMQqVKCQRq8DgdrLXsg"
if urd == 3:
da = "AIzaSyDdOKnwnPwVIQ_lbH5sYE4FoXjAKIQV0DQ"
da = choice([api1, api2, api3])
url = f"https://www.googleapis.com/customsearch/v1?key={da}&cx=25b3b50edb928435b&q={quer}&start={start}"
data = requests.get(url).json()
search_items = data.get("items")
Expand Down Expand Up @@ -435,7 +423,7 @@ async def _(e):
],
),
)
await e.answer(modss)
await e.answer(modss, switch_pm="Search Mod Applications.", switch_pm_param="start")


@in_pattern("clipart")
Expand All @@ -444,16 +432,7 @@ async def clip(e):
try:
quer = e.text.split(" ", maxsplit=1)[1]
except IndexError:
kkkk = e.builder.article(
title="Search Something",
text="**Cʟɪᴘᴀʀᴛ Sᴇᴀʀᴄʜ**\n\nYou didn't search anything",
buttons=Button.switch_inline(
"Sᴇᴀʀᴄʜ Aɢᴀɪɴ",
query="clipart ",
same_peer=True,
),
)
await e.answer([kkkk])
await e.answer([], switch_pm="ClipArt Search.", switch_pm_param="start")
quer = quer.replace(" ", "+")
sear = f"https://clipartix.com/search/{quer}"
html = urlopen(sear)
Expand All @@ -463,4 +442,6 @@ async def clip(e):
hm = []
for res in resul:
hm += [buil.photo(include_media=True, file=res["src"])]
await e.answer(hm, gallery=True)
await e.answer(
hm, gallery=True, switch_pm="Clipart Searcher.", switch_pm_param="start"
)

0 comments on commit 68839e9

Please sign in to comment.