Skip to content

Commit 68839e9

Browse files
1Danish-00New-dev0buddhhuTechiErrorAakash
authored
Ultroid v0.0.7 2021/05/22
Co-authored-by: New-dev0 <[email protected]> Co-authored-by: Danish <[email protected]> Co-authored-by: Amit Sharma <[email protected]> Co-authored-by: Programming Error <[email protected]> Co-authored-by: Aakash <[email protected]> Co-authored-by: Aditya <[email protected]> Co-authored-by: sppidy <[email protected]> Co-authored-by: Arnab Paryali <[email protected]> Co-authored-by: divkix <[email protected]> Co-authored-by: hellboi_atul <[email protected]>
1 parent 427b6f5 commit 68839e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+3905
-1491
lines changed

.env.sample

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@
33
API_ID=
44
API_HASH=
55
SESSION=
6-
BOT_TOKEN=
76
REDIS_URI=
87
REDIS_PASSWORD=
9-
LOG_CHANNEL=

.gitignore

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
.env
22
venv/
33
__pycache__
4-
BOT_TOKEN.session-journal
5-
BOT_TOKEN.session
4+
ultroid.session-journal
5+
ultroid.session
66
*.mp3
77
*.webm
88
*.webp
99
*.mp4
1010
*.tgs
11-
logs-ultroid.txt
1211
.vscode/*
13-
ultroid-log.txt
1412
/*.jpg
1513
/*.png
1614
/*.mp4
1715
addons/
1816
ultroid.log
1917
target/npmlist.json
20-
node_modules
18+
node_modules/
2119
glitch_me/
2220
.idea
2321
venv/

Dockerfile

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
44
# PLease read the GNU Affero General Public License in <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
55

6-
FROM programmingerror/ultroid:v0.0.1
6+
FROM programmingerror/ultroid:v0.0.2
7+
8+
ENV TZ=Asia/Kolkata
9+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
10+
RUN apt-get autoremove --purge
711

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

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

1316
RUN pip3 install -r requirements.txt
14-
RUN npm install -g npm@7.11.2 -g
17+
RUN npm install -g npm@7.12.1 -g
1518
RUN npm install
1619
RUN npm run build

README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ Get the [Necessary Variables](#Necessary-Variables) and then click the button be
7979
- `API_ID` - Your API_ID from [my.telegram.org](https://my.telegram.org/)
8080
- `API_HASH` - Your API_HASH from [my.telegram.org](https://my.telegram.org/)
8181
- `SESSION` - SessionString for your accounts login session. Get it from [here](#Session-String)
82-
- `BOT_TOKEN` - The token of your bot from [@BotFather](https://t.me/BotFather)
83-
- `BOT_USERNAME` - The username of your bot from [@BotFather](https://t.me/BotFather)
84-
- `LOG_CHANNEL` - A private group/channel id.
8582
- `REDIS_URI` - Redis endpoint URL, from [redislabs](http://redislabs.com/), tutorial [here.](./resources/extras/redistut.md)
8683
- `REDIS_PASSWORD ` - Redis endpoint Password, from [redislabs](http://redislabs.com/), tutorial [here.](./resources/extras/redistut.md)
8784

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

app.json

-8
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
"description": "You api hash, from my.telegram.org or @ScrapperRoBot.",
2323
"value": ""
2424
},
25-
"BOT_TOKEN": {
26-
"description": "Make a bot from @BotFather, and enter it's api token here.",
27-
"value": ""
28-
},
2925
"SESSION": {
3026
"description": "Your session string. Can be added now, or after deploy. (The bot will NOT work without a session string!!)",
3127
"value": ""
@@ -47,10 +43,6 @@
4743
"description": "Name of your heroku app, given in the first blank on this page. To be added if deploying to heroku ONLY.",
4844
"value": "",
4945
"required": false
50-
},
51-
"LOG_CHANNEL": {
52-
"description": "Create a private group. Add @missrose_bot and your BOT_USERNAME bot. Do /id. Paste that here",
53-
"value": ""
5446
}
5547
},
5648
"formation": {

assistant/inlinestuff.py

+45-64
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# PLease read the GNU Affero General Public License in
66
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
77

8-
from random import randrange
8+
import base64
9+
from random import choice
910
from re import compile as re_compile
1011
from re import findall
1112
from urllib.request import urlopen
@@ -29,6 +30,16 @@
2930

3031
ofox_api = OrangeFoxAPI()
3132

33+
api1 = base64.b64decode("QUl6YVN5QXlEQnNZM1dSdEI1WVBDNmFCX3c4SkF5NlpkWE5jNkZV").decode(
34+
"ascii"
35+
)
36+
api2 = base64.b64decode("QUl6YVN5QkYwenhMbFlsUE1wOXh3TVFxVktDUVJxOERnZHJMWHNn").decode(
37+
"ascii"
38+
)
39+
api3 = base64.b64decode("QUl6YVN5RGRPS253blB3VklRX2xiSDVzWUU0Rm9YakFLSVFWMERR").decode(
40+
"ascii"
41+
)
42+
3243

3344
@in_pattern("ofox")
3445
@in_owner
@@ -75,15 +86,13 @@ async def _(e):
7586
],
7687
)
7788
)
78-
await e.answer(fox)
89+
await e.answer(
90+
fox, switch_pm="OrangeFox Recovery Search.", switch_pm_param="start"
91+
)
7992
else:
80-
sed = e.builder.article(
81-
title="Not Found",
82-
description="Wrong Codename",
83-
text="OʀᴀɴɢFᴏx Rᴇᴄᴏᴠᴇʀʏ Fᴏʀ Yᴏᴜʀ Pʜᴏɴᴇ Is Eɪᴛʜᴇʀ Nᴏᴛ Oғғɪᴄɪᴀʟʟʏ Bᴜɪʟᴛ Oʀ Yᴏᴜ Hᴀᴠᴇ Eɴᴛᴇʀᴇᴅ Wʀᴏɴɢ Cᴏᴅᴇɴᴀᴍᴇ",
84-
buttons=Button.switch_inline("Sᴇᴀʀᴄʜ Aɢᴀɪɴ", query="ofox ", same_peer=True),
93+
await e.answer(
94+
[], switch_pm="OrangeFox Recovery Search.", switch_pm_param="start"
8595
)
86-
await e.answer([sed])
8796

8897

8998
@in_pattern("fl2lnk ?(.*)")
@@ -116,7 +125,7 @@ async def _(e):
116125
title="fl2lnk",
117126
text="File not found",
118127
)
119-
await e.answer([lnk])
128+
await e.answer([lnk], switch_pm="File to Link.", switch_pm_param="start")
120129

121130

122131
@callback(
@@ -145,17 +154,17 @@ async def repo(e):
145154
thumb=wb(ultpic, 0, "image/jpeg", []),
146155
text="• **ULTROID USERBOT** •",
147156
buttons=[
148-
[Button.url("Repo", url="https://github.com/TeamUltroid/Ultroid")],
149157
[
158+
Button.url("Repo", url="https://github.com/TeamUltroid/Ultroid"),
150159
Button.url(
151160
"Addons", url="https://github.com/TeamUltroid/UltroidAddons"
152-
)
161+
),
153162
],
154163
[Button.url("Support", url="t.me/UltroidSupport")],
155164
],
156165
),
157166
]
158-
await e.answer(res)
167+
await e.answer(res, switch_pm="Ultroid Repo.", switch_pm_param="start")
159168

160169

161170
@in_pattern("go")
@@ -164,13 +173,9 @@ async def gsearch(q_event):
164173
try:
165174
match = q_event.text.split(" ", maxsplit=1)[1]
166175
except IndexError:
167-
kkkk = q_event.builder.article(
168-
title="Search Something",
169-
thumb=wb(gugirl, 0, "image/jpeg", []),
170-
text="**Gᴏᴏɢʟᴇ Sᴇᴀʀᴄʜ**\n\nYou didn't search anything",
171-
buttons=Button.switch_inline("Sᴇᴀʀᴄʜ Aɢᴀɪɴ", query="go ", same_peer=True),
176+
await q_event.answer(
177+
[], switch_pm="Google Search. Enter a query!", switch_pm_param="start"
172178
)
173-
await q_event.answer([kkkk])
174179
searcher = []
175180
page = findall(r"page=\d+", match)
176181
cache = False
@@ -216,7 +221,7 @@ async def gsearch(q_event):
216221
)
217222
except IndexError:
218223
break
219-
await q_event.answer(searcher)
224+
await q_event.answer(searcher, switch_pm="Google Search.", switch_pm_param="start")
220225

221226

222227
@in_pattern("rex")
@@ -251,33 +256,29 @@ async def rextester(event):
251256
description=f"Language-`{lang}` & Code-`{code}`",
252257
text=f"Language:\n`{lang}`\n\nCode:\n`{code}`\n\nResult:\n`{outputt}`\n\nStats:\n`{stats}`",
253258
)
254-
await event.answer([resultm])
259+
await event.answer(
260+
[resultm], switch_pm="RexTester.", switch_pm_param="start"
261+
)
255262
except UnknownLanguage:
256263
resultm = builder.article(
257264
title="Error", # By @ProgrammingError
258265
description="Invalid language choosen",
259266
text=f"The list of valid languages are\n\n{rex_langs}\n\n\nFormat to use Rextester is `@Yourassistantusername rex langcode|code`",
260267
)
261-
await event.answer([resultm])
268+
await event.answer(
269+
[resultm], switch_pm="RexTester. Invalid Language!", switch_pm_param="start"
270+
)
262271

263272

264273
@in_pattern("yahoo")
265274
@in_owner
266-
async def gsearch(q_event):
275+
async def yahoosearch(q_event):
267276
try:
268277
match = q_event.text.split(" ", maxsplit=1)[1]
269278
except IndexError:
270-
kkkk = q_event.builder.article(
271-
title="Search Something",
272-
thumb=wb(yeah, 0, "image/jpeg", []),
273-
text="**Yᴀʜᴏᴏ Sᴇᴀʀᴄʜ**\n\nYou didn't search anything",
274-
buttons=Button.switch_inline(
275-
"Sᴇᴀʀᴄʜ Aɢᴀɪɴ",
276-
query="yahoo ",
277-
same_peer=True,
278-
),
279+
await q_event.answer(
280+
[], switch_pm="Yahoo Search. Enter a query!", switch_pm_param="start"
279281
)
280-
await q_event.answer([kkkk])
281282
searcher = []
282283
page = findall(r"page=\d+", match)
283284
cache = False
@@ -323,7 +324,7 @@ async def gsearch(q_event):
323324
)
324325
except IndexError:
325326
break
326-
await q_event.answer(searcher)
327+
await q_event.answer(searcher, switch_pm="Yahoo Search.", switch_pm_param="start")
327328

328329

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

382379

383380
@in_pattern("mods")
@@ -386,21 +383,12 @@ async def _(e):
386383
try:
387384
quer = e.text.split(" ", maxsplit=1)[1]
388385
except IndexError:
389-
kkkk = e.builder.article(
390-
title="Search Something",
391-
text="**Mᴏᴅᴅᴇᴅ Aᴘᴘs**\n\nYou didn't search anything",
392-
buttons=Button.switch_inline("Sᴇᴀʀᴄʜ Aɢᴀɪɴ", query="mods ", same_peer=True),
386+
await e.answer(
387+
[], switch_pm="Mod Apps Search. Enter app name!", switch_pm_param="start"
393388
)
394-
await e.answer([kkkk])
395389
page = 1
396390
start = (page - 1) * 3 + 1
397-
urd = randrange(1, 3)
398-
if urd == 1:
399-
da = "AIzaSyAyDBsY3WRtB5YPC6aB_w8JAy6ZdXNc6FU"
400-
if urd == 2:
401-
da = "AIzaSyBF0zxLlYlPMp9xwMQqVKCQRq8DgdrLXsg"
402-
if urd == 3:
403-
da = "AIzaSyDdOKnwnPwVIQ_lbH5sYE4FoXjAKIQV0DQ"
391+
da = choice([api1, api2, api3])
404392
url = f"https://www.googleapis.com/customsearch/v1?key={da}&cx=25b3b50edb928435b&q={quer}&start={start}"
405393
data = requests.get(url).json()
406394
search_items = data.get("items")
@@ -435,7 +423,7 @@ async def _(e):
435423
],
436424
),
437425
)
438-
await e.answer(modss)
426+
await e.answer(modss, switch_pm="Search Mod Applications.", switch_pm_param="start")
439427

440428

441429
@in_pattern("clipart")
@@ -444,16 +432,7 @@ async def clip(e):
444432
try:
445433
quer = e.text.split(" ", maxsplit=1)[1]
446434
except IndexError:
447-
kkkk = e.builder.article(
448-
title="Search Something",
449-
text="**Cʟɪᴘᴀʀᴛ Sᴇᴀʀᴄʜ**\n\nYou didn't search anything",
450-
buttons=Button.switch_inline(
451-
"Sᴇᴀʀᴄʜ Aɢᴀɪɴ",
452-
query="clipart ",
453-
same_peer=True,
454-
),
455-
)
456-
await e.answer([kkkk])
435+
await e.answer([], switch_pm="ClipArt Search.", switch_pm_param="start")
457436
quer = quer.replace(" ", "+")
458437
sear = f"https://clipartix.com/search/{quer}"
459438
html = urlopen(sear)
@@ -463,4 +442,6 @@ async def clip(e):
463442
hm = []
464443
for res in resul:
465444
hm += [buil.photo(include_media=True, file=res["src"])]
466-
await e.answer(hm, gallery=True)
445+
await e.answer(
446+
hm, gallery=True, switch_pm="Clipart Searcher.", switch_pm_param="start"
447+
)

0 commit comments

Comments
 (0)