Spaces:
Paused
Paused
1Danish-00
Amit Sharma
New-Dev0
commited on
Commit
·
ef8cb74
1
Parent(s):
66ed3e4
Re-Fixes v0.1.1
Browse filesCo-authored-by: Amit Sharma <[email protected]>
Co-authored-by: New-Dev0 <[email protected]>
- assistant/initial.py +3 -0
- assistant/inlinestuff.py +6 -4
- assistant/manager/_help.py +1 -1
- plugins/_inline.py +28 -25
- plugins/admintools.py +8 -6
- plugins/audiotools.py +15 -10
- plugins/bot.py +1 -1
- plugins/converter.py +6 -2
- plugins/globaltools.py +6 -2
- plugins/groups.py +0 -1
- plugins/image.py +1 -0
- plugins/imagetools.py +2 -1
- plugins/instagram.py +1 -1
- plugins/stickertools.py +34 -58
- requirements.txt +2 -2
- vcbot/__init__.py +3 -2
- vcbot/_help.py +0 -8
- vcbot/radio.py +1 -1
- vcbot/ytplaylist.py +2 -2
assistant/initial.py
CHANGED
@@ -20,6 +20,9 @@ STRINGS = {
|
|
20 |
❣ Made by **@TeamUltroid**""",
|
21 |
3: """**💡• FAQs •**
|
22 |
|
|
|
|
|
|
|
23 |
-> [Setting up TimeZone](https://t.me/UltroidUpdates/22)
|
24 |
-> [About Inline PmPermit](https://t.me/UltroidUpdates/21)
|
25 |
-> [About Dual Mode](https://t.me/UltroidUpdates/18)
|
|
|
20 |
❣ Made by **@TeamUltroid**""",
|
21 |
3: """**💡• FAQs •**
|
22 |
|
23 |
+
-> [Username Tracker](https://t.me/UltroidUpdates/24)
|
24 |
+
-> [Keeping Custom Addons Repo](https://t.me/UltroidUpdates/28)
|
25 |
+
-> [Disabling Deploy message](https://t.me/UltroidUpdates/27)
|
26 |
-> [Setting up TimeZone](https://t.me/UltroidUpdates/22)
|
27 |
-> [About Inline PmPermit](https://t.me/UltroidUpdates/21)
|
28 |
-> [About Dual Mode](https://t.me/UltroidUpdates/18)
|
assistant/inlinestuff.py
CHANGED
@@ -11,6 +11,7 @@ from random import choice
|
|
11 |
from re import compile as re_compile
|
12 |
from re import findall
|
13 |
|
|
|
14 |
import requests
|
15 |
from bs4 import BeautifulSoup as bs
|
16 |
from play_scraper import search
|
@@ -388,11 +389,12 @@ async def xda_dev(event):
|
|
388 |
[], switch_pm="Enter Query to Search", switch_pm_param="start"
|
389 |
)
|
390 |
le = "https://www.xda-developers.com/search/" + query.replace(" ", "+")
|
391 |
-
|
|
|
|
|
392 |
ml = bs(ct, "html.parser", from_encoding="utf-8")
|
393 |
ml = ml.find_all("div", re_compile("layout_post_"), id=re_compile("post-"))
|
394 |
out = []
|
395 |
-
builder = event.builder
|
396 |
for on in ml:
|
397 |
data = on.find_all("img", "xda_image")[0]
|
398 |
title = data["alt"]
|
@@ -402,11 +404,11 @@ async def xda_dev(event):
|
|
402 |
thumb = wb(thumb, 0, "image/jpeg", [])
|
403 |
text = f"[{title}]({hre})"
|
404 |
out.append(
|
405 |
-
await builder.article(
|
406 |
title=title, description=desc, url=hre, thumb=thumb, text=text
|
407 |
)
|
408 |
)
|
409 |
uppar = "|| XDA Search Results ||"
|
410 |
-
if
|
411 |
uppar = "No Results Found :("
|
412 |
await event.answer(out, switch_pm=uppar, switch_pm_param="start")
|
|
|
11 |
from re import compile as re_compile
|
12 |
from re import findall
|
13 |
|
14 |
+
import aiohttp
|
15 |
import requests
|
16 |
from bs4 import BeautifulSoup as bs
|
17 |
from play_scraper import search
|
|
|
389 |
[], switch_pm="Enter Query to Search", switch_pm_param="start"
|
390 |
)
|
391 |
le = "https://www.xda-developers.com/search/" + query.replace(" ", "+")
|
392 |
+
async with aiohttp.ClientSession() as requests:
|
393 |
+
async with requests.get(le) as out:
|
394 |
+
ct = await out.read()
|
395 |
ml = bs(ct, "html.parser", from_encoding="utf-8")
|
396 |
ml = ml.find_all("div", re_compile("layout_post_"), id=re_compile("post-"))
|
397 |
out = []
|
|
|
398 |
for on in ml:
|
399 |
data = on.find_all("img", "xda_image")[0]
|
400 |
title = data["alt"]
|
|
|
404 |
thumb = wb(thumb, 0, "image/jpeg", [])
|
405 |
text = f"[{title}]({hre})"
|
406 |
out.append(
|
407 |
+
await event.builder.article(
|
408 |
title=title, description=desc, url=hre, thumb=thumb, text=text
|
409 |
)
|
410 |
)
|
411 |
uppar = "|| XDA Search Results ||"
|
412 |
+
if not out:
|
413 |
uppar = "No Results Found :("
|
414 |
await event.answer(out, switch_pm=uppar, switch_pm_param="start")
|
assistant/manager/_help.py
CHANGED
@@ -115,7 +115,7 @@ async def helpish(event):
|
|
115 |
@owner
|
116 |
async def ehwhshd(e):
|
117 |
buttons = get_buttons()
|
118 |
-
buttons
|
119 |
await e.edit(buttons=buttons)
|
120 |
|
121 |
|
|
|
115 |
@owner
|
116 |
async def ehwhshd(e):
|
117 |
buttons = get_buttons()
|
118 |
+
buttons.append([Button.inline("<< Back", "open")])
|
119 |
await e.edit(buttons=buttons)
|
120 |
|
121 |
|
plugins/_inline.py
CHANGED
@@ -56,32 +56,32 @@ SUP_BUTTONS = [
|
|
56 |
# --------------------BUTTONS--------------------#
|
57 |
|
58 |
|
59 |
-
@
|
60 |
-
@in_owner
|
61 |
async def inline_alive(o):
|
62 |
-
if
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
)
|
68 |
-
|
69 |
-
|
70 |
-
str(o.id),
|
71 |
-
"photo",
|
72 |
-
send_message=await b._message(
|
73 |
-
text=MSG,
|
74 |
-
media=True,
|
75 |
-
buttons=SUP_BUTTONS,
|
76 |
-
),
|
77 |
-
title="Ultroid Userbot",
|
78 |
-
description="Userbot | Telethon",
|
79 |
-
url=TLINK,
|
80 |
-
thumb=WEB0,
|
81 |
-
content=InputWebDocument(TLINK, 0, "image/jpg", []),
|
82 |
-
)
|
83 |
-
]
|
84 |
-
await o.answer(RES, switch_pm="👥 ULTROID PORTAL", switch_pm_param="start")
|
85 |
|
86 |
|
87 |
@in_pattern("ultd")
|
@@ -161,7 +161,10 @@ async def on_vc_callback_query_handler(event):
|
|
161 |
xhelps = "**Voice Chat Help Menu for {}**\n**Available Commands:** `{}`\n\n@TeamUltroid".format(
|
162 |
OWNER_NAME, len(VC_HELP)
|
163 |
)
|
164 |
-
|
|
|
|
|
|
|
165 |
await event.edit(f"{xhelps}", buttons=buttons, link_preview=False)
|
166 |
|
167 |
|
|
|
56 |
# --------------------BUTTONS--------------------#
|
57 |
|
58 |
|
59 |
+
@inline
|
|
|
60 |
async def inline_alive(o):
|
61 |
+
if o.text or not str(o.sender_id) in owner_and_sudos():
|
62 |
+
return
|
63 |
+
b = o.builder
|
64 |
+
MSG = "• **Ultroid Userbot •**"
|
65 |
+
WEB0 = InputWebDocument(
|
66 |
+
"https://telegra.ph/file/55dd0f381c70e72557cb1.jpg", 0, "image/jpg", []
|
67 |
+
)
|
68 |
+
RES = [
|
69 |
+
InputBotInlineResult(
|
70 |
+
str(o.id),
|
71 |
+
"photo",
|
72 |
+
send_message=await b._message(
|
73 |
+
text=MSG,
|
74 |
+
media=True,
|
75 |
+
buttons=SUP_BUTTONS,
|
76 |
+
),
|
77 |
+
title="Ultroid Userbot",
|
78 |
+
description="Userbot | Telethon",
|
79 |
+
url=TLINK,
|
80 |
+
thumb=WEB0,
|
81 |
+
content=InputWebDocument(TLINK, 0, "image/jpg", []),
|
82 |
)
|
83 |
+
]
|
84 |
+
await o.answer(RES, switch_pm="👥 ULTROID PORTAL", switch_pm_param="start")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
|
87 |
@in_pattern("ultd")
|
|
|
161 |
xhelps = "**Voice Chat Help Menu for {}**\n**Available Commands:** `{}`\n\n@TeamUltroid".format(
|
162 |
OWNER_NAME, len(VC_HELP)
|
163 |
)
|
164 |
+
try:
|
165 |
+
buttons = page_num(0, VC_HELP, "vchelp", "vc")
|
166 |
+
except ZeroDivisionError:
|
167 |
+
return await event.answer("Vc not Active.")
|
168 |
await event.edit(f"{xhelps}", buttons=buttons, link_preview=False)
|
169 |
|
170 |
|
plugins/admintools.py
CHANGED
@@ -291,7 +291,6 @@ async def unp(ult):
|
|
291 |
type=["official", "manager"],
|
292 |
)
|
293 |
async def fastpurger(purg):
|
294 |
-
chat = await purg.get_input_chat()
|
295 |
match = purg.pattern_match.group(1)
|
296 |
try:
|
297 |
ABC = purg.text[6]
|
@@ -299,9 +298,13 @@ async def fastpurger(purg):
|
|
299 |
ABC = None
|
300 |
if ABC and purg.text[6] in ["m", "a"]:
|
301 |
return
|
302 |
-
if not purg._client._bot and match and
|
303 |
p = 0
|
304 |
-
async for msg in purg.client.iter_messages(
|
|
|
|
|
|
|
|
|
305 |
await msg.delete()
|
306 |
p += 0
|
307 |
return await eor(purg, f"Purged {p} Messages! ", time=5)
|
@@ -309,13 +312,12 @@ async def fastpurger(purg):
|
|
309 |
return await eor(purg, "`Reply to a message to purge from.`", time=10)
|
310 |
try:
|
311 |
await purg.client.delete_messages(
|
312 |
-
|
313 |
)
|
314 |
except Exception as er:
|
315 |
LOGS.info(er)
|
316 |
-
count = purg.id - purg.reply_to_msg_id
|
317 |
await purg.respond(
|
318 |
-
"__Fast purge complete!__
|
319 |
)
|
320 |
|
321 |
|
|
|
291 |
type=["official", "manager"],
|
292 |
)
|
293 |
async def fastpurger(purg):
|
|
|
294 |
match = purg.pattern_match.group(1)
|
295 |
try:
|
296 |
ABC = purg.text[6]
|
|
|
298 |
ABC = None
|
299 |
if ABC and purg.text[6] in ["m", "a"]:
|
300 |
return
|
301 |
+
if not purg._client._bot and ((match) or (purg.is_reply and purg.is_private)):
|
302 |
p = 0
|
303 |
+
async for msg in purg.client.iter_messages(
|
304 |
+
purg.chat_id,
|
305 |
+
limit=int(match) if match else None,
|
306 |
+
min_id=purg.reply_to_msg_id if purg.is_reply else None,
|
307 |
+
):
|
308 |
await msg.delete()
|
309 |
p += 0
|
310 |
return await eor(purg, f"Purged {p} Messages! ", time=5)
|
|
|
312 |
return await eor(purg, "`Reply to a message to purge from.`", time=10)
|
313 |
try:
|
314 |
await purg.client.delete_messages(
|
315 |
+
purg.chat_id, [a for a in range(purg.reply_to_msg_id, purg.id + 1)]
|
316 |
)
|
317 |
except Exception as er:
|
318 |
LOGS.info(er)
|
|
|
319 |
await purg.respond(
|
320 |
+
"__Fast purge complete!__",
|
321 |
)
|
322 |
|
323 |
|
plugins/audiotools.py
CHANGED
@@ -145,7 +145,7 @@ async def trim_aud(e):
|
|
145 |
@ultroid_cmd(pattern="extractaudio$")
|
146 |
async def ex_aud(e):
|
147 |
reply = await e.get_reply_message()
|
148 |
-
if not (reply and reply.video):
|
149 |
return await eor(e, "`Reply to Video File..`")
|
150 |
name = reply.file.name or "video.mp4"
|
151 |
vfile = reply.media.document
|
@@ -167,18 +167,23 @@ async def ex_aud(e):
|
|
167 |
attributes = [
|
168 |
DocumentAttributeAudio(
|
169 |
duration=duration,
|
170 |
-
title=reply.file.name.split(".")[0]
|
|
|
|
|
171 |
performer=artist,
|
172 |
)
|
173 |
]
|
174 |
f_time = time.time()
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
|
|
|
|
|
|
182 |
await e.client.send_file(
|
183 |
e.chat_id,
|
184 |
fo,
|
@@ -187,4 +192,4 @@ async def ex_aud(e):
|
|
187 |
attributes=attributes,
|
188 |
reply_to=e.reply_to_msg_id,
|
189 |
)
|
190 |
-
await
|
|
|
145 |
@ultroid_cmd(pattern="extractaudio$")
|
146 |
async def ex_aud(e):
|
147 |
reply = await e.get_reply_message()
|
148 |
+
if not (reply and reply.media and mediainfo(reply.media).startswith("video")):
|
149 |
return await eor(e, "`Reply to Video File..`")
|
150 |
name = reply.file.name or "video.mp4"
|
151 |
vfile = reply.media.document
|
|
|
167 |
attributes = [
|
168 |
DocumentAttributeAudio(
|
169 |
duration=duration,
|
170 |
+
title=reply.file.name.split(".")[0]
|
171 |
+
if reply.file.name
|
172 |
+
else "Extracted Audio",
|
173 |
performer=artist,
|
174 |
)
|
175 |
]
|
176 |
f_time = time.time()
|
177 |
+
try:
|
178 |
+
fo = await uploader(
|
179 |
+
out_file,
|
180 |
+
out_file,
|
181 |
+
f_time,
|
182 |
+
msg,
|
183 |
+
"Uploading " + out_file + "...",
|
184 |
+
)
|
185 |
+
except FileNotFoundError:
|
186 |
+
return await eor(msg, "`No Audio Found...`")
|
187 |
await e.client.send_file(
|
188 |
e.chat_id,
|
189 |
fo,
|
|
|
192 |
attributes=attributes,
|
193 |
reply_to=e.reply_to_msg_id,
|
194 |
)
|
195 |
+
await msg.delete()
|
plugins/bot.py
CHANGED
@@ -126,7 +126,7 @@ async def is_on(ult):
|
|
126 |
kk,
|
127 |
)
|
128 |
buttons = [
|
129 |
-
Button.inline("Stats", "alive"),
|
130 |
[
|
131 |
Button.url("Repo", "https://github.com/TeamUltroid/Ultroid"),
|
132 |
Button.url("Support", "t.me/UltroidSupport"),
|
|
|
126 |
kk,
|
127 |
)
|
128 |
buttons = [
|
129 |
+
[Button.inline("Stats", "alive")],
|
130 |
[
|
131 |
Button.url("Repo", "https://github.com/TeamUltroid/Ultroid"),
|
132 |
Button.url("Support", "t.me/UltroidSupport"),
|
plugins/converter.py
CHANGED
@@ -79,11 +79,15 @@ async def imak(event):
|
|
79 |
if hasattr(reply.media, "document"):
|
80 |
file = reply.media.document
|
81 |
image = await downloader(
|
82 |
-
reply.file.name
|
|
|
|
|
|
|
|
|
83 |
)
|
84 |
file = image.name
|
85 |
else:
|
86 |
-
file = await event.download_media(reply)
|
87 |
os.rename(file, inp)
|
88 |
k = time.time()
|
89 |
xxx = await uploader(inp, inp, k, xx, "Uploading...")
|
|
|
79 |
if hasattr(reply.media, "document"):
|
80 |
file = reply.media.document
|
81 |
image = await downloader(
|
82 |
+
reply.file.name if reply.file.name else str(time.time()),
|
83 |
+
reply.media.document,
|
84 |
+
xx,
|
85 |
+
t,
|
86 |
+
"Downloading...",
|
87 |
)
|
88 |
file = image.name
|
89 |
else:
|
90 |
+
file = await event.client.download_media(reply.media)
|
91 |
os.rename(file, inp)
|
92 |
k = time.time()
|
93 |
xxx = await uploader(inp, inp, k, xx, "Uploading...")
|
plugins/globaltools.py
CHANGED
@@ -371,7 +371,9 @@ async def gcast(event):
|
|
371 |
elif event.is_reply:
|
372 |
msg = await event.get_reply_message()
|
373 |
else:
|
374 |
-
return eor(
|
|
|
|
|
375 |
kk = await eor(event, "`Globally Broadcasting Msg...`")
|
376 |
er = 0
|
377 |
done = 0
|
@@ -406,7 +408,9 @@ async def gucast(event):
|
|
406 |
elif event.is_reply:
|
407 |
msg = await event.get_reply_message()
|
408 |
else:
|
409 |
-
return eor(
|
|
|
|
|
410 |
kk = await eor(event, "`Globally Broadcasting Msg...`")
|
411 |
er = 0
|
412 |
done = 0
|
|
|
371 |
elif event.is_reply:
|
372 |
msg = await event.get_reply_message()
|
373 |
else:
|
374 |
+
return await eor(
|
375 |
+
event, "`Give some text to Globally Broadcast or reply a message..`"
|
376 |
+
)
|
377 |
kk = await eor(event, "`Globally Broadcasting Msg...`")
|
378 |
er = 0
|
379 |
done = 0
|
|
|
408 |
elif event.is_reply:
|
409 |
msg = await event.get_reply_message()
|
410 |
else:
|
411 |
+
return await eor(
|
412 |
+
event, "`Give some text to Globally Broadcast or reply a message..`"
|
413 |
+
)
|
414 |
kk = await eor(event, "`Globally Broadcasting Msg...`")
|
415 |
er = 0
|
416 |
done = 0
|
plugins/groups.py
CHANGED
@@ -22,7 +22,6 @@
|
|
22 |
from telethon.tl.functions.channels import EditPhotoRequest
|
23 |
from telethon.tl.types import (
|
24 |
ChannelParticipantsKicked,
|
25 |
-
ChatBannedRights,
|
26 |
UserStatusEmpty,
|
27 |
UserStatusLastMonth,
|
28 |
UserStatusLastWeek,
|
|
|
22 |
from telethon.tl.functions.channels import EditPhotoRequest
|
23 |
from telethon.tl.types import (
|
24 |
ChannelParticipantsKicked,
|
|
|
25 |
UserStatusEmpty,
|
26 |
UserStatusLastMonth,
|
27 |
UserStatusLastWeek,
|
plugins/image.py
CHANGED
@@ -33,6 +33,7 @@ async def f2i(e):
|
|
33 |
html = r.text
|
34 |
else:
|
35 |
return await eod(e, "`Either reply to any file or give any text`")
|
|
|
36 |
shot = WebShot(quality=85)
|
37 |
css = "body {background: white;} p {color: red;}"
|
38 |
pic = await shot.create_pic_async(html=html, css=css)
|
|
|
33 |
html = r.text
|
34 |
else:
|
35 |
return await eod(e, "`Either reply to any file or give any text`")
|
36 |
+
html = html.replace("\n", "<br>")
|
37 |
shot = WebShot(quality=85)
|
38 |
css = "body {background: white;} p {color: red;}"
|
39 |
pic = await shot.create_pic_async(html=html, css=css)
|
plugins/imagetools.py
CHANGED
@@ -595,7 +595,7 @@ async def ok(event):
|
|
595 |
col_ = col.split(";", maxsplit=1)
|
596 |
wh = int(col_[1])
|
597 |
col = col_[0]
|
598 |
-
col = [
|
599 |
except ValueError:
|
600 |
return await eor(event, "`Not a Valid Input...`")
|
601 |
okla = await hm.download_media()
|
@@ -605,6 +605,7 @@ async def ok(event):
|
|
605 |
await event.client.send_file(event.chat.id, "output.png")
|
606 |
os.remove("output.png")
|
607 |
os.remove(okla)
|
|
|
608 |
|
609 |
|
610 |
@ultroid_cmd(pattern="pixelator ?(.*)")
|
|
|
595 |
col_ = col.split(";", maxsplit=1)
|
596 |
wh = int(col_[1])
|
597 |
col = col_[0]
|
598 |
+
col = [int(col) for col in col.split(",")[:2]]
|
599 |
except ValueError:
|
600 |
return await eor(event, "`Not a Valid Input...`")
|
601 |
okla = await hm.download_media()
|
|
|
605 |
await event.client.send_file(event.chat.id, "output.png")
|
606 |
os.remove("output.png")
|
607 |
os.remove(okla)
|
608 |
+
await event.delete()
|
609 |
|
610 |
|
611 |
@ultroid_cmd(pattern="pixelator ?(.*)")
|
plugins/instagram.py
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
• `{i}instadata <username>`
|
15 |
`Get Instagram Data of someone or self`
|
16 |
|
17 |
-
• Fill `INSTA_USERNAME` and `
|
18 |
before using it..
|
19 |
|
20 |
"""
|
|
|
14 |
• `{i}instadata <username>`
|
15 |
`Get Instagram Data of someone or self`
|
16 |
|
17 |
+
• Fill `INSTA_USERNAME` and `INSTA_PASSWORD`
|
18 |
before using it..
|
19 |
|
20 |
"""
|
plugins/stickertools.py
CHANGED
@@ -41,11 +41,8 @@ import numpy as np
|
|
41 |
import requests
|
42 |
from carbonnow import Carbon
|
43 |
from PIL import Image, ImageDraw
|
44 |
-
from telethon.errors import
|
45 |
-
|
46 |
-
PackShortNameOccupiedError,
|
47 |
-
YouBlockedUserError,
|
48 |
-
)
|
49 |
from telethon.tl.types import (
|
50 |
DocumentAttributeFilename,
|
51 |
DocumentAttributeSticker,
|
@@ -148,68 +145,47 @@ async def uconverter(event):
|
|
148 |
@ultroid_cmd(pattern="packkang")
|
149 |
async def pack_kangish(_):
|
150 |
_e = await _.get_reply_message()
|
151 |
-
if not _e:
|
152 |
return await eor(_, "`Reply to Sticker.`")
|
153 |
if len(_.text) > 9:
|
154 |
_packname = _.text.split(" ", maxsplit=1)[1]
|
155 |
else:
|
156 |
_packname = f"Ultroid Kang Pack By {_.sender_id}"
|
157 |
-
if _e
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
)
|
164 |
)
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
)
|
173 |
-
)
|
174 |
-
try:
|
175 |
-
eval(udB.get("PACKKANG"))
|
176 |
-
except BaseException:
|
177 |
-
udB.set("PACKKANG", "{}")
|
178 |
-
ok = eval(udB.get("PACKKANG"))
|
179 |
-
try:
|
180 |
-
pack = ok[_.sender_id] + 1
|
181 |
-
except BaseException:
|
182 |
-
pack = 1
|
183 |
-
try:
|
184 |
-
_r_e_s = await asst(
|
185 |
-
functions.stickers.CreateStickerSetRequest(
|
186 |
-
user_id=_.sender_id,
|
187 |
-
title=_packname,
|
188 |
-
short_name=f"u{_.sender_id}_{pack}_by_{(await tgbot.get_me()).username}",
|
189 |
-
stickers=stiks,
|
190 |
-
)
|
191 |
)
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
short_name=f"u{_.sender_id}_{pack}_by_{(await tgbot.get_me()).username}",
|
202 |
-
stickers=stiks,
|
203 |
-
)
|
204 |
)
|
205 |
-
ok.update({_.sender_id: pack})
|
206 |
-
udB.set("PACKKANG", str(ok))
|
207 |
-
await eor(
|
208 |
-
_,
|
209 |
-
f"Pack Kanged Successfully.\nKanged Pack: [link](https://t.me/addstickers/{_r_e_s.set.short_name})",
|
210 |
)
|
211 |
-
|
212 |
-
|
|
|
|
|
|
|
|
|
|
|
213 |
|
214 |
|
215 |
@ultroid_cmd(
|
|
|
41 |
import requests
|
42 |
from carbonnow import Carbon
|
43 |
from PIL import Image, ImageDraw
|
44 |
+
from telethon.errors import ChatSendStickersForbiddenError, YouBlockedUserError
|
45 |
+
from telethon.tl.functions.stickers import SuggestShortNameRequest
|
|
|
|
|
|
|
46 |
from telethon.tl.types import (
|
47 |
DocumentAttributeFilename,
|
48 |
DocumentAttributeSticker,
|
|
|
145 |
@ultroid_cmd(pattern="packkang")
|
146 |
async def pack_kangish(_):
|
147 |
_e = await _.get_reply_message()
|
148 |
+
if not (_e and _e.sticker):
|
149 |
return await eor(_, "`Reply to Sticker.`")
|
150 |
if len(_.text) > 9:
|
151 |
_packname = _.text.split(" ", maxsplit=1)[1]
|
152 |
else:
|
153 |
_packname = f"Ultroid Kang Pack By {_.sender_id}"
|
154 |
+
if _e.file.mime_type == "image/webp":
|
155 |
+
return await eor(_, "`Animated Stickers are not Supported...`")
|
156 |
+
_id = _e.media.document.attributes[1].stickerset.id
|
157 |
+
_hash = _e.media.document.attributes[1].stickerset.access_hash
|
158 |
+
_get_stiks = await _.client(
|
159 |
+
functions.messages.GetStickerSetRequest(
|
160 |
+
stickerset=types.InputStickerSetID(id=_id, access_hash=_hash)
|
161 |
)
|
162 |
+
)
|
163 |
+
stiks = []
|
164 |
+
for i in _get_stiks.documents:
|
165 |
+
x = get_input_document(i)
|
166 |
+
stiks.append(
|
167 |
+
types.InputStickerSetItem(
|
168 |
+
document=x,
|
169 |
+
emoji=(i.attributes[1]).alt,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
)
|
171 |
+
)
|
172 |
+
try:
|
173 |
+
short_name = (await _.client(SuggestShortNameRequest(_packname))).short_name
|
174 |
+
_r_e_s = await asst(
|
175 |
+
functions.stickers.CreateStickerSetRequest(
|
176 |
+
user_id=_.sender_id,
|
177 |
+
title=_packname,
|
178 |
+
short_name=f"u{short_name}_by_{asst.me.username}",
|
179 |
+
stickers=stiks,
|
|
|
|
|
|
|
180 |
)
|
|
|
|
|
|
|
|
|
|
|
181 |
)
|
182 |
+
except BaseException as er:
|
183 |
+
LOGS.exception(er)
|
184 |
+
return await eor(_, str(er))
|
185 |
+
await eor(
|
186 |
+
_,
|
187 |
+
f"**Pack Kanged Successfully**.\n**Kanged Pack:** [link](https://t.me/addstickers/{_r_e_s.set.short_name})",
|
188 |
+
)
|
189 |
|
190 |
|
191 |
@ultroid_cmd(
|
requirements.txt
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
https://github.com/New-dev0/Telethon/archive/Crunch.zip
|
2 |
-
py-Ultroid==2021.9.13
|
3 |
-
pytgcalls==3.0.0.dev19
|
|
|
1 |
https://github.com/New-dev0/Telethon/archive/Crunch.zip
|
2 |
+
py-Ultroid==2021.9.13.1
|
3 |
+
pytgcalls==3.0.0.dev19
|
vcbot/__init__.py
CHANGED
@@ -40,6 +40,7 @@ from pyUltroid.functions.vc_group import get_chats as get_vc
|
|
40 |
from pyUltroid.misc import owner_and_sudos, sudoers
|
41 |
from pyUltroid.misc._assistant import admin_check, in_pattern
|
42 |
from pyUltroid.misc._wrappers import eod, eor
|
|
|
43 |
from telethon import events
|
44 |
from telethon.tl import functions, types
|
45 |
from telethon.utils import get_display_name
|
@@ -101,7 +102,7 @@ class Player:
|
|
101 |
VIDEO_ON.clear()
|
102 |
await asyncio.sleep(3)
|
103 |
if self._video:
|
104 |
-
for chats in CLIENTS:
|
105 |
if chats != self._chat:
|
106 |
await CLIENTS[chats].stop()
|
107 |
del CLIENTS[chats]
|
@@ -219,7 +220,7 @@ def vc_asst(dec, from_users=VC_AUTHS(), vc_auth=True):
|
|
219 |
LOGS.exception(Exception)
|
220 |
await asst.send_message(
|
221 |
LOG_CHANNEL,
|
222 |
-
f"VC Error - <code>{e.
|
223 |
parse_mode="html",
|
224 |
)
|
225 |
|
|
|
40 |
from pyUltroid.misc import owner_and_sudos, sudoers
|
41 |
from pyUltroid.misc._assistant import admin_check, in_pattern
|
42 |
from pyUltroid.misc._wrappers import eod, eor
|
43 |
+
from pyUltroid.version import __version__ as UltVer
|
44 |
from telethon import events
|
45 |
from telethon.tl import functions, types
|
46 |
from telethon.utils import get_display_name
|
|
|
102 |
VIDEO_ON.clear()
|
103 |
await asyncio.sleep(3)
|
104 |
if self._video:
|
105 |
+
for chats in list(CLIENTS):
|
106 |
if chats != self._chat:
|
107 |
await CLIENTS[chats].stop()
|
108 |
del CLIENTS[chats]
|
|
|
220 |
LOGS.exception(Exception)
|
221 |
await asst.send_message(
|
222 |
LOG_CHANNEL,
|
223 |
+
f"VC Error - <code>{UltVer}</code>\n\n<code>{e.text}</code>\n\n<code>{format_exc()}</code>",
|
224 |
parse_mode="html",
|
225 |
)
|
226 |
|
vcbot/_help.py
CHANGED
@@ -9,13 +9,9 @@ from telethon import Button
|
|
9 |
|
10 |
from . import *
|
11 |
|
12 |
-
ID_CACHE = []
|
13 |
-
|
14 |
|
15 |
@vc_asst("vchelp")
|
16 |
async def helper(event):
|
17 |
-
if not ID_CACHE:
|
18 |
-
ID_CACHE.append(str((await vcClient.get_me()).id))
|
19 |
res = await event.client.inline_query(asst.me.username, "vchelp")
|
20 |
try:
|
21 |
await res[0].click(event.chat_id)
|
@@ -25,10 +21,6 @@ async def helper(event):
|
|
25 |
|
26 |
@in_pattern("vchelp")
|
27 |
async def wiqhshd(e):
|
28 |
-
if not ID_CACHE:
|
29 |
-
ID_CACHE.append(str((await vcClient.get_me()).id))
|
30 |
-
if str(e.sender_id) not in [*owner_and_sudos(), *ID_CACHE]:
|
31 |
-
return
|
32 |
builder = e.builder
|
33 |
res = [
|
34 |
await builder.article(
|
|
|
9 |
|
10 |
from . import *
|
11 |
|
|
|
|
|
12 |
|
13 |
@vc_asst("vchelp")
|
14 |
async def helper(event):
|
|
|
|
|
15 |
res = await event.client.inline_query(asst.me.username, "vchelp")
|
16 |
try:
|
17 |
await res[0].click(event.chat_id)
|
|
|
21 |
|
22 |
@in_pattern("vchelp")
|
23 |
async def wiqhshd(e):
|
|
|
|
|
|
|
|
|
24 |
builder = e.builder
|
25 |
res = [
|
26 |
await builder.article(
|
vcbot/radio.py
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
✘ Commands Available -
|
10 |
|
11 |
• `{i}radio <link>`
|
12 |
-
Stream Live Radio.
|
13 |
|
14 |
• `{i}ytlive <link>`
|
15 |
Stream Live YouTube.
|
|
|
9 |
✘ Commands Available -
|
10 |
|
11 |
• `{i}radio <link>`
|
12 |
+
Stream Live Radio m3u8 links.
|
13 |
|
14 |
• `{i}ytlive <link>`
|
15 |
Stream Live YouTube.
|
vcbot/ytplaylist.py
CHANGED
@@ -41,7 +41,7 @@ async def live_stream(e):
|
|
41 |
except BaseException:
|
42 |
return await eor(xx, f"`Only Youtube Playlist please.`")
|
43 |
await xx.edit("`Keep patience... It'll take some time.`")
|
44 |
-
file, thumb, title, link, duration = await dl_playlist(chat,
|
45 |
ultSongs = Player(chat, e)
|
46 |
if not ultSongs.group_call.is_connected:
|
47 |
if not (await ultSongs.vc_joiner()):
|
@@ -57,7 +57,7 @@ async def live_stream(e):
|
|
57 |
await xx.delete()
|
58 |
await ultSongs.group_call.start_audio(file)
|
59 |
else:
|
60 |
-
from_user = html_mention(e
|
61 |
add_to_queue(chat, file, title, link, thumb, from_user, duration)
|
62 |
return await eor(
|
63 |
xx,
|
|
|
41 |
except BaseException:
|
42 |
return await eor(xx, f"`Only Youtube Playlist please.`")
|
43 |
await xx.edit("`Keep patience... It'll take some time.`")
|
44 |
+
file, thumb, title, link, duration = await dl_playlist(chat, html_mention(e), song)
|
45 |
ultSongs = Player(chat, e)
|
46 |
if not ultSongs.group_call.is_connected:
|
47 |
if not (await ultSongs.vc_joiner()):
|
|
|
57 |
await xx.delete()
|
58 |
await ultSongs.group_call.start_audio(file)
|
59 |
else:
|
60 |
+
from_user = html_mention(e)
|
61 |
add_to_queue(chat, file, title, link, thumb, from_user, duration)
|
62 |
return await eor(
|
63 |
xx,
|