Skip to content

Commit 386eff6

Browse files
1Danish-00New-dev0xdityaamitkr-codessppidy
committed
v0.0.9 18/07/2021
Co-authored-by: New-dev0 <New-dev0@users.noreply.github.com> Co-authored-by: Aditya <me@xditya.me> Co-authored-by: Amit Sharma <48654350+buddhhu@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>
1 parent 71fddc8 commit 386eff6

File tree

140 files changed

+3333
-3038
lines changed

Some content is hidden

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

140 files changed

+3333
-3038
lines changed

.env.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ API_ID=
44
API_HASH=
55
SESSION=
66
REDIS_URI=
7-
REDIS_PASSWORD=
7+
REDIS_PASSWORD=

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ contact_links:
55
about: Please drop your doubts or queries there for an immediate response.
66
- name: Documentation
77
url: https://ultroid.tech/
8-
about: Basic documentation for setting up.
8+
about: Basic documentation for setting up.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ node_modules/
2121
glitch_me/
2222
.idea/
2323
.vscode/
24-
temp/
24+
temp/

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@ WORKDIR /root/TeamUltroid/
1414

1515
RUN pip3 install --no-cache-dir -r requirements.txt
1616

17-
RUN npm install -g npm@7.16.0 -g
18-
RUN npm install
19-
RUN npm run build
17+
CMD ["bash", "resources/startup/startup.sh"]

Makefile

Lines changed: 0 additions & 24 deletions
This file was deleted.

README.md

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

2222
----
@@ -37,16 +37,16 @@
3737
## Deploy to Heroku
3838
Get the [Necessary Variables](#Necessary-Variables) and then click the button below!
3939

40-
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2F1Danish-00%2FUltroid-1)
40+
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2F1Danish-00%2FSideLoad)
4141

4242
## Deploy Locally
4343
- [Traditional Method](#local-deploy---traditional-method)
4444
- [Easy Method](#local-deploy---easy-method)
4545

4646
### Local Deploy - Easy Method
4747
- Linux - `bash -c "$(curl -fsSL https://git.io/JY9UM)"`
48-
- Windows - `cd desktop ; wget https://del.dog/raw/ultroid-termux -o locals.py ; python locals.py`
49-
- Termux - `sh -c "$(curl -fsSL https://del.dog/raw/ultroid-termux-deploy)"`
48+
- Windows - `cd desktop ; wget https://git.io/JY9UM -o locals.py ; python locals.py`
49+
- Termux - `sh -c "$(curl -fsSL https://git.io/JY9UM)"`
5050

5151
### Local Deploy - Traditional Method
5252
- Get your [Necessary Variables](#Necessary-Variables)
@@ -63,11 +63,11 @@ Get the [Necessary Variables](#Necessary-Variables) and then click the button be
6363
- For Linux users:
6464
`bash sessiongen`
6565
or
66-
`bash -c "$(curl -fsSL https://del.dog/ultroid)"`
66+
`bash -c "$(curl -fsSL https://git.io/JY9JI)"`
6767
- For Termux users:
68-
`sh -c "$(curl -fsSL https://da.gd/termux-tel)"`
68+
`sh -c "$(curl -fsSL https://git.io/JqgsR)"`
6969
- For Windows Users:
70-
`cd desktop ; wget https://del.dog/ultroid -o ultroid.py ; python ultroid.py`
70+
`cd desktop ; wget https://git.io/JY9JI -o ultroid.py ; python ultroid.py`
7171
- Fill your details in a `.env` file, as given in [`.env.sample`](https://github.com/TeamUltroid/Ultroid/blob/main/.env.sample).
7272
(You can either edit and rename the file or make a new file named `.env`.)
7373
- Run the bot:
@@ -86,9 +86,10 @@ Get the [Necessary Variables](#Necessary-Variables) and then click the button be
8686
## Session String
8787
Different ways to get your `SESSION`:
8888
* [![Run on Repl.it](https://replit.com/badge/github/TeamUltroid/Ultroid)](https://replit.com/@TeamUltroid/UltroidStringSession)
89-
* Linux : `bash -c "$(curl -fsSL https://del.dog/ultroid)"`
89+
* Linux : `bash -c "$(curl -fsSL https://git.io/JY9JI)"`
9090
* PowerShell : `cd desktop ; wget https://git.io/JY9JI ; python ultroid.py`
9191
* Termux : `sh -c "$(curl -fsSL https://da.gd/termux-tel)"`
92+
* TelegramBot : [@SessionGeneratorBot](https://t.me/SessionGeneratorBot)
9293

9394
Made with 💕 by [@TeamUltroid](https://t.me/TeamUltroid). <br />
9495

@@ -100,5 +101,6 @@ Ultroid is licensed under [GNU Affero General Public License](https://www.gnu.or
100101
# Credits
101102
* [![TeamUltroid-Devs](https://img.shields.io/static/v1?label=Teamultroid&message=devs&color=critical)](https://t.me/UltroidDevs)
102103
* [Lonami](https://github.com/LonamiWebs/) for [Telethon.](https://github.com/LonamiWebs/Telethon)
103-
* [AndrewLaneX](https://github.com/AndrewLaneX) for [tgcalls-base.](http://github.com/tgcallsjs/tgcalls)
104+
* [Dan](https://github.com/delivrance) for [Pyrogram.](https://github.com/pyrogram/pyrogram)
105+
* [Pytgcalls](https://github.com/pytgcalls) for [PyTgCalls.](https://github.com/pytgcalls/pytgcalls)
104106

Lines changed: 81 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
77

88
import re
9+
import urllib
910
from glob import glob
1011
from os import remove
1112
from random import choices
1213

13-
import requests
1414
from telegraph import Telegraph
1515
from telegraph import upload_file as upl
1616

@@ -27,7 +27,33 @@
2727

2828

2929
@callback(
30-
re.compile("sndplug_(.*)"),
30+
re.compile(
31+
"ebk_(.*)",
32+
),
33+
)
34+
async def eupload(event):
35+
match = event.pattern_match.group(1).decode("utf-8")
36+
await event.answer("Uploading..")
37+
try:
38+
await event.edit(
39+
file=f"https://www.gutenberg.org/files/{match}/{match}-pdf.pdf"
40+
)
41+
except BaseException:
42+
book = "Ultroid-Book.epub"
43+
urllib.request.urlretrieve(
44+
"https://www.gutenberg.org/ebooks/132.epub.images", book
45+
)
46+
fn, media, _ = await asst._file_to_media(
47+
book, thumb="resources/extras/ultroid.jpg"
48+
)
49+
await event.edit(file=media)
50+
remove(book)
51+
52+
53+
@callback(
54+
re.compile(
55+
"sndplug_(.*)",
56+
),
3157
)
3258
async def send(eve):
3359
name = (eve.data_match.group(1)).decode("UTF-8")
@@ -133,9 +159,9 @@ async def changes(okk):
133159
changelog_str = changelog + f"\n\nClick the below button to update!"
134160
if len(changelog_str) > 1024:
135161
await okk.edit(get_string("upd_4"))
136-
file = open(f"ultroid_updates.txt", "w+")
137-
file.write(tl_chnglog)
138-
file.close()
162+
await asyncio.sleep(2)
163+
with open(f"ultroid_updates.txt", "w+") as file:
164+
file.write(tl_chnglog)
139165
await okk.edit(
140166
get_string("upd_5"),
141167
file="ultroid_updates.txt",
@@ -159,15 +185,14 @@ async def changes(okk):
159185
@owner
160186
async def _(e):
161187
ok = (e.data_match.group(1)).decode("UTF-8")
162-
hmm = open(ok)
163-
hmmm = hmm.read()
164-
hmm.close()
165-
key = (
166-
requests.post("https://nekobin.com/api/documents", json={"content": hmmm})
167-
.json()
168-
.get("result")
169-
.get("key")
170-
)
188+
with open(ok, "r") as hmm:
189+
_, key = get_paste(hmm.read())
190+
if _ == "dog":
191+
link = "https://del.dog/" + key
192+
raw = "https://del.dog/raw/" + key
193+
else:
194+
link = "https://nekobin.com/" + key
195+
raw = "https://nekobin.com/raw/" + key
171196
if ok.startswith("plugins"):
172197
buttons = [
173198
Button.inline("« Bᴀᴄᴋ", data="back"),
@@ -179,9 +204,10 @@ async def _(e):
179204
Button.inline("••Cʟᴏꜱᴇ••", data="close"),
180205
]
181206
await e.edit(
182-
f"Pasted to Nekobin\n 👉[Link](https://nekobin.com/{key})\n 👉[Raw Link](https://nekobin.com/raw/{key})",
207+
f"<strong>Pasted\n 👉<a href={link}>[Link]</a>\n 👉<a href={raw}>[Raw Link]</a></strong>",
183208
buttons=buttons,
184209
link_preview=False,
210+
parse_mode="html",
185211
)
186212

187213

@@ -220,7 +246,7 @@ async def _(e):
220246
+ "4. Copy link of that folder.\n"
221247
+ "5. Send all characters which is after id= .",
222248
)
223-
async with ultroid_bot.asst.conversation(e.sender_id) as conv:
249+
async with asst.conversation(e.sender_id) as conv:
224250
reply = conv.wait_event(events.NewMessage(from_users=e.sender_id))
225251
repl = await reply
226252
udB.set("GDRIVE_FOLDER_ID", repl.text)
@@ -236,7 +262,7 @@ async def _(e):
236262
if not e.is_private:
237263
return
238264
await e.edit("Send your CLIENT SECRET")
239-
async with ultroid_bot.asst.conversation(e.sender_id) as conv:
265+
async with asst.conversation(e.sender_id) as conv:
240266
reply = conv.wait_event(events.NewMessage(from_users=e.sender_id))
241267
repl = await reply
242268
udB.set("GDRIVE_CLIENT_SECRET", repl.text)
@@ -252,7 +278,7 @@ async def _(e):
252278
if not e.is_private:
253279
return
254280
await e.edit("Send your CLIENT ID ending with .com")
255-
async with ultroid_bot.asst.conversation(e.sender_id) as conv:
281+
async with asst.conversation(e.sender_id) as conv:
256282
reply = conv.wait_event(events.NewMessage(from_users=e.sender_id))
257283
repl = await reply
258284
if not repl.text.endswith(".com"):
@@ -720,11 +746,47 @@ async def alvcs(event):
720746
Button.inline("Sᴇᴛ Wᴀʀɴs", data="swarn"),
721747
Button.inline("Dᴇʟᴇᴛᴇ Pᴍ Mᴇᴅɪᴀ", data="delpmmed"),
722748
],
749+
[Button.inline("PMPermit Type", data="pmtype")],
723750
[Button.inline("« Bᴀᴄᴋ", data="ppmset")],
724751
],
725752
)
726753

727754

755+
@callback("pmtype")
756+
@owner
757+
async def pmtyp(e):
758+
await event.edit(
759+
"Select the type of PMPermit needed.",
760+
buttons=[
761+
[Button.inline("Inline", data="inpm_in")],
762+
[Button.inline("Normal", data="inpm_no")],
763+
[Button.inline("« Bᴀᴄᴋ", data="pmcstm")],
764+
],
765+
)
766+
767+
768+
@callback("inpm_in")
769+
@owner
770+
async def inl_on(event):
771+
var = "INLINE_PM"
772+
await setit(event, var, "True")
773+
await event.edit(
774+
f"Done!! PMPermit type has been set to inline!",
775+
buttons=[[Button.inline("« Bᴀᴄᴋ", data="pmtype")]],
776+
)
777+
778+
779+
@callback("inpm_no")
780+
@owner
781+
async def inl_on(event):
782+
var = "INLINE_PM"
783+
await setit(event, var, "False")
784+
await event.edit(
785+
f"Done!! PMPermit type has been set to normal!",
786+
buttons=[[Button.inline("« Bᴀᴄᴋ", data="pmtype")]],
787+
)
788+
789+
728790
@callback("pmtxt")
729791
@owner
730792
async def name(event):
@@ -988,7 +1050,7 @@ async def name(event):
9881050
name = "Bot Welcome Message:"
9891051
async with event.client.conversation(pru) as conv:
9901052
await conv.send_message(
991-
"**BOT WELCOME MSG**\nEnter the msg which u want to show when someone start your assistant Bot.\n\nUse /cancel to terminate the operation.",
1053+
"**BOT WELCOME MSG**\nEnter the msg which u want to show when someone start your assistant Bot.\nYou Can use `{me}` , `{mention}` Parameters Too\nUse /cancel to terminate the operation.",
9921054
)
9931055
response = conv.wait_event(events.NewMessage(chats=pru))
9941056
response = await response

0 commit comments

Comments
 (0)