Skip to content

Commit 7eb5e58

Browse files
iAkashPattnaikAakashxditya1Danish-00buddhhu
committed
Release v0.0.6
Co-authored-by: Aakash <BLUE-DEVIL1134@users.noreply.github.com> Co-authored-by: Aditya <me@xditya.me> Co-authored-by: Danish <danish@ultroid.tech> Co-authored-by: buddhhu <buddhuu@users.noreply.github.com> 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> Co-authored-by: Programming Error <error@notavailable.live> Co-authored-by: New-dev0 <New-dev0@notavailable.live>
1 parent adb2e3e commit 7eb5e58

Some content is hidden

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

80 files changed

+4876
-966
lines changed

.env.sample

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
API_ID=
44
API_HASH=
55
SESSION=
6-
BOT_USERNAME=
76
BOT_TOKEN=
87
REDIS_URI=
98
REDIS_PASSWORD=
10-
LOG_CHANNEL=
9+
LOG_CHANNEL=

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ addons/
1818
ultroid.log
1919
target/npmlist.json
2020
node_modules
21-
glitch_me/
21+
glitch_me/
22+
.idea
23+
venv/

Dockerfile

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,14 @@
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 ultroidteam/ultroid:0.0.3
7-
#RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
8-
# dpkg -i ./google-chrome-stable_current_amd64.deb; apt -fqqy install && \
9-
# rm ./google-chrome-stable_current_amd64.deb
10-
#RUN wget -O chromedriver.zip http://chromedriver.storage.googleapis.com/$(curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip && \
11-
# unzip chromedriver.zip chromedriver -d /usr/bin/ && \
12-
# rm chromedriver.zip
13-
RUN curl --silent --location https://deb.nodesource.com/setup_15.x | bash -
14-
RUN apt-get install -y nodejs
6+
FROM programmingerror/ultroid:v0.0.1
7+
158
RUN git clone https://github.com/TeamUltroid/Ultroid.git /root/TeamUltroid/
9+
1610
RUN git clone https://github.com/1Danish-00/glitch_me.git && pip install -e ./glitch_me
1711
WORKDIR /root/TeamUltroid/
18-
RUN pip install -r requirements.txt
19-
RUN rm -rf /usr/local/lib/python3.9/site-packages/.wh*
20-
RUN npm install -g npm@7.9.0 && npm install
12+
13+
RUN pip3 install -r requirements.txt
14+
RUN npm install -g npm@7.11.2 -g
15+
RUN npm install
2116
RUN npm run build

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
[![Open Source Love svg2](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)](https://github.com/TeamUltroid/Ultroid)
1616
[![Contributors](https://img.shields.io/github/contributors/TeamUltroid/Ultroid?style=flat-square&color=green)](https://github.com/TeamUltroid/Ultroid/graphs/contributors)
1717
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)
18-
[![License](https://img.shields.io/badge/License-AGPL-blue)](https://github.com/TeamUltroid/Ultroid/blob/main/LICENSE)
19-
[![HitCount](http://hits.dwyl.com/Teamultroid/Teamultroid/Ultroid.svg)](http://hits.dwyl.com/Teamultroid/Teamultroid/Ultroid)
18+
[![License](https://img.shields.io/badge/License-AGPL-blue)](https://github.com/TeamUltroid/Ultroid/blob/main/LICENSE)
2019
[![Sparkline](https://stars.medv.io/Teamultroid/Ultroid.svg)](https://stars.medv.io/TeamUltroid/Ultroid)
2120

2221
----
@@ -104,3 +103,4 @@ Ultroid is licensed under [GNU Affero General Public License](https://www.gnu.or
104103
* [![TeamUltroid-Devs](https://img.shields.io/static/v1?label=Teamultroid&message=devs&color=critical)](https://t.me/UltroidDevs)
105104
* [Lonami](https://github.com/LonamiWebs/) for [Telethon.](https://github.com/LonamiWebs/Telethon)
106105
* [AndrewLaneX](https://github.com/AndrewLaneX) for [tgcalls.](http://github.com/tgcallsjs/tgcalls)
106+

app.json

Lines changed: 11 additions & 5 deletions
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_USERNAME": {
26-
"description": "Make a bot from @BotFather, and enter it's username here, with '@'",
27-
"value": ""
28-
},
2925
"BOT_TOKEN": {
3026
"description": "Make a bot from @BotFather, and enter it's api token here.",
3127
"value": ""
@@ -56,5 +52,15 @@
5652
"description": "Create a private group. Add @missrose_bot and your BOT_USERNAME bot. Do /id. Paste that here",
5753
"value": ""
5854
}
55+
},
56+
"formation": {
57+
"worker": {
58+
"quantity": 1,
59+
"size": "free"
60+
},
61+
"web": {
62+
"quantity": 0,
63+
"size": "free"
64+
}
5965
}
60-
}
66+
}

assistant/inlinestuff.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
from bs4 import BeautifulSoup
1515
from orangefoxapi import OrangeFoxAPI
1616
from play_scraper import search
17-
from rextester_py import rexec_aio
18-
from rextester_py.rextester_aio import UnknownLanguage
1917
from search_engine_parser import GoogleSearch, YahooSearch
2018
from telethon import Button
2119
from telethon.tl.types import InputWebDocument as wb
@@ -28,14 +26,6 @@
2826
yeah = "https://telegra.ph/file/e3c67885e16a194937516.jpg"
2927
ps = "https://telegra.ph/file/de0b8d9c858c62fae3b6e.jpg"
3028
ultpic = "https://telegra.ph/file/4136aa1650bc9d4109cc5.jpg"
31-
rex_langs = """ada, bash, brainfuck, c (clang), c, c (vc),
32-
c#, c++ (clang), c++, c++ (vc++), d, elixir,
33-
erlang, f#, fortran, go, haskell, java, js,
34-
kotlin, lisp, lua, mysql, nasm, node,
35-
objective-c, ocaml, octave, oracle, pascal,
36-
perl, php, postgresql, prolog, python,
37-
python3, r, ruby, scala, scheme, sql server,
38-
swift, tcl, vb.net"""
3929

4030
ofox_api = OrangeFoxAPI()
4131

@@ -156,6 +146,11 @@ async def repo(e):
156146
text="• **ULTROID USERBOT** •",
157147
buttons=[
158148
[Button.url("Repo", url="https://github.com/TeamUltroid/Ultroid")],
149+
[
150+
Button.url(
151+
"Addons", url="https://github.com/TeamUltroid/UltroidAddons"
152+
)
153+
],
159154
[Button.url("Support", url="t.me/UltroidSupport")],
160155
],
161156
),

assistant/localization.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ async def settt(event):
3636
udB.set("language", f"{lang}")
3737
await event.edit(
3838
f"Your language has been set to {languages[lang]['natively']} [{lang}].",
39+
buttons=get_back_button("lang"),
3940
)

assistant/othervars.py

Lines changed: 115 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
# PLease read the GNU Affero General Public License in
66
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
77

8-
import os
8+
import re
9+
from os import execl, remove
910

11+
import requests
1012
from telegraph import Telegraph
1113
from telegraph import upload_file as upl
1214

@@ -22,6 +24,109 @@
2224
TOKEN_FILE = "resources/auths/auth_token.txt"
2325

2426

27+
@callback("updatenow")
28+
@owner
29+
async def update(eve):
30+
repo = Repo()
31+
ac_br = repo.active_branch
32+
ups_rem = repo.remote("upstream")
33+
if Var.HEROKU_API:
34+
import heroku3
35+
36+
heroku = heroku3.from_key(Var.HEROKU_API)
37+
heroku_app = None
38+
heroku_applications = heroku.apps()
39+
for app in heroku_applications:
40+
if app.name == Var.HEROKU_APP_NAME:
41+
heroku_app = app
42+
if heroku_app is None:
43+
await eve.edit("`Invalid Heroku credentials for updating userbot dyno.`")
44+
repo.__del__()
45+
return
46+
await eve.edit(
47+
"`Userbot dyno build in progress, please wait for it to complete.`"
48+
)
49+
ups_rem.fetch(ac_br)
50+
repo.git.reset("--hard", "FETCH_HEAD")
51+
heroku_git_url = heroku_app.git_url.replace(
52+
"https://", "https://api:" + Var.HEROKU_API + "@"
53+
)
54+
if "heroku" in repo.remotes:
55+
remote = repo.remote("heroku")
56+
remote.set_url(heroku_git_url)
57+
else:
58+
remote = repo.create_remote("heroku", heroku_git_url)
59+
try:
60+
remote.push(refspec=f"HEAD:refs/heads/{ac_br}", force=True)
61+
except GitCommandError as error:
62+
await eve.edit(f"`Here is the error log:\n{error}`")
63+
repo.__del__()
64+
return
65+
await eve.edit("`Successfully Updated!\nRestarting, please wait...`")
66+
else:
67+
try:
68+
ups_rem.pull(ac_br)
69+
except GitCommandError:
70+
repo.git.reset("--hard", "FETCH_HEAD")
71+
await updateme_requirements()
72+
await eve.edit(
73+
"`Successfully Updated!\nBot is restarting... Wait for a second!`"
74+
)
75+
execl(sys.executable, sys.executable, "-m", "pyUltroid")
76+
77+
78+
@callback("changes")
79+
@owner
80+
async def changes(okk):
81+
repo = Repo.init()
82+
ac_br = repo.active_branch
83+
changelog, tl_chnglog = await gen_chlog(repo, f"HEAD..upstream/{ac_br}")
84+
changelog_str = changelog + f"\n\nClick the below button to update!"
85+
tldr_str = tl_chnglog + f"\n\nClick the below button to update!"
86+
if len(changelog_str) > 1024:
87+
await okk.edit(get_string("upd_4"))
88+
file = open(f"ultroid_updates.txt", "w+")
89+
file.write(tldr_str)
90+
file.close()
91+
await okk.edit(
92+
get_string("upd_5"),
93+
file="ultroid_updates.txt",
94+
buttons=Button.inline("Update Now", data="updatenow"),
95+
)
96+
remove(f"ultroid_updates.txt")
97+
return
98+
else:
99+
await okk.edit(
100+
changelog_str,
101+
buttons=Button.inline("Update Now", data="updatenow"),
102+
parse_mode="html",
103+
)
104+
105+
106+
@callback(re.compile("pasta-(.*)"))
107+
@owner
108+
async def _(e):
109+
ok = e.data_match.group(1)
110+
hmm = open(ok)
111+
hmmm = hmm.read()
112+
hmm.close()
113+
key = (
114+
requests.post("https://nekobin.com/api/documents", json={"content": hmmm})
115+
.json()
116+
.get("result")
117+
.get("key")
118+
)
119+
await e.edit(
120+
f"Pasted to Nekobin\n 👉[Link](https://nekobin.com/{key})\n 👉[Raw Link](https://nekobin.com/raw/{key})",
121+
buttons=Button.switch_inline(
122+
"Search Again..?",
123+
query="send ",
124+
same_peer=True,
125+
),
126+
link_preview=False,
127+
)
128+
129+
25130
@callback("authorise")
26131
@owner
27132
async def _(e):
@@ -54,7 +159,7 @@ async def _(e):
54159
+ "1. Open Google Drive App.\n"
55160
+ "2. Create Folder.\n"
56161
+ "3. Make that folder public.\n"
57-
+ "4. Copy link of that folder."
162+
+ "4. Copy link of that folder.\n"
58163
+ "5. Send all characters which is after id= .",
59164
)
60165
async with ultroid_bot.asst.conversation(e.sender_id) as conv:
@@ -492,7 +597,7 @@ async def media(event):
492597
try:
493598
x = upl(media)
494599
url = f"https://telegra.ph/{x[0]}"
495-
os.remove(media)
600+
remove(media)
496601
except BaseException:
497602
return await conv.send_message(
498603
"Terminated.",
@@ -561,6 +666,11 @@ async def name(event):
561666
buttons=get_back_button("pmcstm"),
562667
)
563668
else:
669+
if len(themssg) > 4090:
670+
return await conv.send_message(
671+
"Message too long!\nGive a shorter message please!!",
672+
buttons=get_back_button("pmcstm"),
673+
)
564674
await setit(event, var, themssg)
565675
await conv.send_message(
566676
"{} changed to {}\n\nAfter Setting All Things Do restart".format(
@@ -633,7 +743,7 @@ async def media(event):
633743
try:
634744
x = upl(media)
635745
url = f"https://telegra.ph/{x[0]}"
636-
os.remove(media)
746+
remove(media)
637747
except BaseException:
638748
return await conv.send_message(
639749
"Terminated.",
@@ -783,7 +893,7 @@ async def chbot(event):
783893
buttons=[
784894
[Button.inline("Cʜᴀᴛ Bᴏᴛ Oɴ", data="onchbot")],
785895
[Button.inline("Cʜᴀᴛ Bᴏᴛ Oғғ", data="ofchbot")],
786-
[Button.inline("Bᴏᴛ Wᴇʟᴄᴏɴᴇ", data="bwel")],
896+
[Button.inline("Bᴏᴛ Wᴇʟᴄᴏᴍᴇ", data="bwel")],
787897
[Button.inline("« Bᴀᴄᴋ", data="setter")],
788898
],
789899
link_preview=False,

assistant/pmbot/incoming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# if incoming
1818

1919

20-
@asst.on(events.NewMessage(func=lambda e: e.is_private))
20+
@asst.on(events.NewMessage(incoming=True, func=lambda e: e.is_private))
2121
async def on_new_mssg(event):
2222
incoming = event.raw_text
2323
who = event.sender_id

assistant/pmbot/outgoing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# outgoing
1515

1616

17-
@asst.on(events.NewMessage(func=lambda e: e.is_private))
17+
@asst.on(events.NewMessage(incoming=True, func=lambda e: e.is_private))
1818
async def on_out_mssg(event):
1919
x = await event.get_reply_message()
2020
if x is None:

0 commit comments

Comments
 (0)