Spaces:
Paused
Paused
Devesh Pal
Danish
commited on
Commit
·
f121ebf
1
Parent(s):
7a6b632
Update to [Layer 133] and [Other Minor Fixes].
Browse filesTelegram wants all Unofficial Client to instantly change to new layer (on or above 133).
This Commit may Fix-
- Issue with UnsupportedUser64Bot
- minor errors in [listsudo mediainfo] etc.
Co-authored-by: Danish <[email protected]>
- .github/ISSUE_TEMPLATE/bug-reports.yml +19 -7
- plugins/chat_bot.py +9 -5
- plugins/mediatools.py +6 -2
- plugins/sudo.py +1 -1
- requirements.txt +1 -1
- resources/session/ssgen.py +6 -8
.github/ISSUE_TEMPLATE/bug-reports.yml
CHANGED
@@ -2,11 +2,6 @@ name: Bug Report
|
|
2 |
description: File a bug report
|
3 |
title: "[BUG REPORT]"
|
4 |
labels: [bug]
|
5 |
-
assignees:
|
6 |
-
- xditya
|
7 |
-
- New-dev0
|
8 |
-
- buddhhu
|
9 |
-
- 1Danish-00
|
10 |
body:
|
11 |
- type: markdown
|
12 |
attributes:
|
@@ -35,8 +30,25 @@ body:
|
|
35 |
label: Version
|
36 |
description: What version of Ultroid are you running?
|
37 |
options:
|
38 |
-
- 0.
|
39 |
-
- 0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
validations:
|
41 |
required: true
|
42 |
- type: textarea
|
|
|
2 |
description: File a bug report
|
3 |
title: "[BUG REPORT]"
|
4 |
labels: [bug]
|
|
|
|
|
|
|
|
|
|
|
5 |
body:
|
6 |
- type: markdown
|
7 |
attributes:
|
|
|
30 |
label: Version
|
31 |
description: What version of Ultroid are you running?
|
32 |
options:
|
33 |
+
- 0.2
|
34 |
+
- 0.1
|
35 |
+
- 0.0.9
|
36 |
+
- 0.0.8 (or lesser)
|
37 |
+
validations:
|
38 |
+
required: true
|
39 |
+
- type: dropdown
|
40 |
+
id: hosted
|
41 |
+
attributes:
|
42 |
+
label: Hosted On
|
43 |
+
description: You Hosted Ultroid In Which Platform?
|
44 |
+
options:
|
45 |
+
- Vps
|
46 |
+
- Heroku
|
47 |
+
- Railway
|
48 |
+
- Qovery
|
49 |
+
- Termux
|
50 |
+
- Other
|
51 |
+
- Didn't Deployed Yet
|
52 |
validations:
|
53 |
required: true
|
54 |
- type: textarea
|
plugins/chat_bot.py
CHANGED
@@ -67,23 +67,27 @@ async def lister(event):
|
|
67 |
|
68 |
async def chat_bot_fn(event, type_):
|
69 |
if event.reply_to:
|
70 |
-
|
|
|
|
|
71 |
else:
|
72 |
temp = event.text.split(maxsplit=1)
|
73 |
try:
|
74 |
user = await event.client.get_entity(temp[1])
|
|
|
75 |
except BaseException:
|
76 |
if event.is_private:
|
77 |
-
|
|
|
78 |
else:
|
79 |
return await eod(
|
80 |
event,
|
81 |
get_string("chab_1"),
|
82 |
)
|
83 |
if type_ == "add":
|
84 |
-
add_chatbot(event.chat_id,
|
85 |
if type_ == "remov":
|
86 |
-
rem_chatbot(event.chat_id,
|
87 |
await eor(
|
88 |
-
event, f"**ChatBot:**\n{type_}ed
|
89 |
)
|
|
|
67 |
|
68 |
async def chat_bot_fn(event, type_):
|
69 |
if event.reply_to:
|
70 |
+
re_ = await event.get_reply_message()
|
71 |
+
user = await re_.get_sender()
|
72 |
+
user_id = re_.sender_id
|
73 |
else:
|
74 |
temp = event.text.split(maxsplit=1)
|
75 |
try:
|
76 |
user = await event.client.get_entity(temp[1])
|
77 |
+
user_id = user.id
|
78 |
except BaseException:
|
79 |
if event.is_private:
|
80 |
+
user_id = event.chat_id
|
81 |
+
user = await event.get_chat()
|
82 |
else:
|
83 |
return await eod(
|
84 |
event,
|
85 |
get_string("chab_1"),
|
86 |
)
|
87 |
if type_ == "add":
|
88 |
+
add_chatbot(event.chat_id, user_id)
|
89 |
if type_ == "remov":
|
90 |
+
rem_chatbot(event.chat_id, user_id)
|
91 |
await eor(
|
92 |
+
event, f"**ChatBot:**\n{type_}ed {inline_mention(user)}"
|
93 |
)
|
plugins/mediatools.py
CHANGED
@@ -57,9 +57,13 @@ async def mi(e):
|
|
57 |
naam = await r.download_media()
|
58 |
out, er = await bash(f"mediainfo '{naam}' --Output=HTML")
|
59 |
if er:
|
60 |
-
LOGS.
|
61 |
return await ee.edit(f"**[{xx}]({url})**", link_preview=False)
|
62 |
-
|
|
|
|
|
|
|
|
|
63 |
await ee.edit(
|
64 |
f"**[{xx}]({url})**\n\n[{get_string('mdi_1')}]({urll})", link_preview=False
|
65 |
)
|
|
|
57 |
naam = await r.download_media()
|
58 |
out, er = await bash(f"mediainfo '{naam}' --Output=HTML")
|
59 |
if er:
|
60 |
+
LOGS.exception(er)
|
61 |
return await ee.edit(f"**[{xx}]({url})**", link_preview=False)
|
62 |
+
try:
|
63 |
+
urll = make_html_telegraph("Mediainfo", "Ultroid", out)
|
64 |
+
except Exception as er:
|
65 |
+
LOGS.exception(er)
|
66 |
+
return await ee.edit(f"**ERROR :** `{er}`")
|
67 |
await ee.edit(
|
68 |
f"**[{xx}]({url})**\n\n[{get_string('mdi_1')}]({urll})", link_preview=False
|
69 |
)
|
plugins/sudo.py
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
"""
|
19 |
from pyUltroid.dB.sudos import add_sudo, del_sudo, is_sudo
|
20 |
|
21 |
-
from . import Redis, eor, get_display_name, get_user_id, udB, ultroid_bot, ultroid_cmd
|
22 |
|
23 |
|
24 |
@ultroid_cmd(pattern="addsudo ?(.*)", fullsudo=True)
|
|
|
18 |
"""
|
19 |
from pyUltroid.dB.sudos import add_sudo, del_sudo, is_sudo
|
20 |
|
21 |
+
from . import Redis, eor, get_string, get_display_name, get_user_id, udB, ultroid_bot, ultroid_cmd
|
22 |
|
23 |
|
24 |
@ultroid_cmd(pattern="addsudo ?(.*)", fullsudo=True)
|
requirements.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
# Important Requirements here.
|
2 |
|
3 |
-
https://github.com/New-dev0/Telethon/archive/
|
4 |
py-Ultroid==2021.10.11.1
|
5 |
pytgcalls==3.0.0.dev19
|
|
|
1 |
# Important Requirements here.
|
2 |
|
3 |
+
https://github.com/New-dev0/Telethon/archive/Branch.zip
|
4 |
py-Ultroid==2021.10.11.1
|
5 |
pytgcalls==3.0.0.dev19
|
resources/session/ssgen.py
CHANGED
@@ -25,6 +25,7 @@ def spinner():
|
|
25 |
for frame in r"-\|/-\|/":
|
26 |
print("\b", frame, sep="", end="", flush=True)
|
27 |
sleep(0.1)
|
|
|
28 |
|
29 |
|
30 |
def clear_screen():
|
@@ -54,7 +55,7 @@ def telethon_session():
|
|
54 |
spinner()
|
55 |
|
56 |
x = "\bFound an existing installation of Telethon...\nSuccessfully Imported.\n\n"
|
57 |
-
except
|
58 |
print("Installing Telethon...")
|
59 |
os.system("pip install -U telethon")
|
60 |
|
@@ -82,26 +83,23 @@ def telethon_session():
|
|
82 |
print(
|
83 |
"Your SESSION has been generated. Check your telegram saved messages!"
|
84 |
)
|
85 |
-
exit(0)
|
86 |
except ApiIdInvalidError:
|
87 |
print(
|
88 |
"Your API ID/API HASH combination is invalid. Kindly recheck.\nQuitting..."
|
89 |
)
|
90 |
-
exit(0)
|
91 |
except ValueError:
|
92 |
print("API HASH must not be empty!\nQuitting...")
|
93 |
-
exit(0)
|
94 |
except PhoneNumberInvalidError:
|
95 |
print("The phone number is invalid!\nQuitting...")
|
96 |
-
|
97 |
-
|
98 |
|
99 |
def main():
|
100 |
clear_screen()
|
101 |
print(a)
|
102 |
telethon_session()
|
103 |
-
x = input("Run again? (y/n")
|
104 |
-
if x == "y":
|
105 |
main()
|
106 |
else:
|
107 |
exit(0)
|
|
|
25 |
for frame in r"-\|/-\|/":
|
26 |
print("\b", frame, sep="", end="", flush=True)
|
27 |
sleep(0.1)
|
28 |
+
import telethon
|
29 |
|
30 |
|
31 |
def clear_screen():
|
|
|
55 |
spinner()
|
56 |
|
57 |
x = "\bFound an existing installation of Telethon...\nSuccessfully Imported.\n\n"
|
58 |
+
except ImportError:
|
59 |
print("Installing Telethon...")
|
60 |
os.system("pip install -U telethon")
|
61 |
|
|
|
83 |
print(
|
84 |
"Your SESSION has been generated. Check your telegram saved messages!"
|
85 |
)
|
|
|
86 |
except ApiIdInvalidError:
|
87 |
print(
|
88 |
"Your API ID/API HASH combination is invalid. Kindly recheck.\nQuitting..."
|
89 |
)
|
|
|
90 |
except ValueError:
|
91 |
print("API HASH must not be empty!\nQuitting...")
|
|
|
92 |
except PhoneNumberInvalidError:
|
93 |
print("The phone number is invalid!\nQuitting...")
|
94 |
+
except Exception as er:
|
95 |
+
print(er)
|
96 |
|
97 |
def main():
|
98 |
clear_screen()
|
99 |
print(a)
|
100 |
telethon_session()
|
101 |
+
x = input("Run again? (y/n)")
|
102 |
+
if x.lower() == "y":
|
103 |
main()
|
104 |
else:
|
105 |
exit(0)
|