Ultroid 0.0.5 - 06/04/21
Co-authored-by: AndrewLaneX <AndrewLaneX@users.noreply.github.com> Co-authored-by: Aditya <me@xditya.me> Co-authored-by: Danish <danish@ultroid.tech> Co-authored-by: buddhhu <buddhuu0@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>
This commit is contained in:
committed by
ProgrammingError
parent
97146a9402
commit
4e8b0543ce
@@ -13,6 +13,7 @@ from math import ceil
|
||||
from platform import python_version as pyver
|
||||
|
||||
from git import Repo
|
||||
from pyUltroid import __version__ as UltVer
|
||||
from support import *
|
||||
from telethon import Button, __version__
|
||||
from telethon.tl.types import InputWebDocument
|
||||
@@ -20,8 +21,8 @@ from telethon.tl.types import InputWebDocument
|
||||
from . import *
|
||||
|
||||
# ================================================#
|
||||
notmine = "This bot is for {}".format(OWNER_NAME)
|
||||
ULTROID_PIC = "https://telegra.ph/file/11245cacbffe92e5d5b14.jpg"
|
||||
notmine = f"This bot is for {OWNER_NAME}"
|
||||
ULTROID_PIC = "https://telegra.ph/file/031957757a4f6a5191040.jpg"
|
||||
helps = get_string("inline_1")
|
||||
|
||||
add_ons = udB.get("ADDONS")
|
||||
@@ -37,17 +38,20 @@ else:
|
||||
async def e(o):
|
||||
if len(o.text) == 0:
|
||||
b = o.builder
|
||||
uptime = grt((time.time() - start_time))
|
||||
uptime = grt(time.time() - start_time)
|
||||
header = udB.get("ALIVE_TEXT") if udB.get("ALIVE_TEXT") else "Hey, I am alive."
|
||||
ALIVEMSG = get_string("alive_1").format(
|
||||
header,
|
||||
OWNER_NAME,
|
||||
ultroid_version,
|
||||
UltVer,
|
||||
uptime,
|
||||
pyver(),
|
||||
__version__,
|
||||
Repo().active_branch,
|
||||
)
|
||||
res = [
|
||||
await b.article(
|
||||
await b.article(
|
||||
title="Ultroid Userbot",
|
||||
url="https://t.me/TeamUltroid",
|
||||
description="Userbot | Telethon ",
|
||||
@@ -57,11 +61,12 @@ async def e(o):
|
||||
[Button.url(text="Support Group", url="t.me/UltroidSupport")],
|
||||
[
|
||||
Button.url(
|
||||
text="Repo", url="https://github.com/Teamultroid/Ultroid"
|
||||
)
|
||||
text="Repo",
|
||||
url="https://github.com/Teamultroid/Ultroid",
|
||||
),
|
||||
],
|
||||
],
|
||||
)
|
||||
),
|
||||
]
|
||||
await o.answer(res, switch_pm=f"👥 ULTROID PORTAL", switch_pm_param="start")
|
||||
|
||||
@@ -91,7 +96,10 @@ if Var.BOT_USERNAME is not None and asst is not None:
|
||||
url="https://t.me/TheUltroid",
|
||||
thumb=InputWebDocument(ULTROID_PIC, 0, "image/jpeg", []),
|
||||
text=get_string("inline_4").format(
|
||||
OWNER_NAME, len(PLUGINS) - 5, len(ADDONS), cmd
|
||||
OWNER_NAME,
|
||||
len(PLUGINS) - 5,
|
||||
len(ADDONS),
|
||||
cmd,
|
||||
),
|
||||
buttons=[
|
||||
[
|
||||
@@ -105,8 +113,8 @@ if Var.BOT_USERNAME is not None and asst is not None:
|
||||
[
|
||||
Button.url(
|
||||
"⚙️Sᴇᴛᴛɪɴɢs⚙️",
|
||||
url=f"https://t.me/{bnn}?start={ultroid_bot.me.id}",
|
||||
)
|
||||
url=f"https://t.me/{bnn}?start=set",
|
||||
),
|
||||
],
|
||||
[Button.inline("••Cʟᴏꜱᴇ••", data="close")],
|
||||
],
|
||||
@@ -123,7 +131,7 @@ if Var.BOT_USERNAME is not None and asst is not None:
|
||||
[
|
||||
Button.url("NekoBin", url=f"{link}"),
|
||||
Button.url("Raw", url=f"{link_raw}"),
|
||||
]
|
||||
],
|
||||
],
|
||||
)
|
||||
await event.answer([result] if result else None)
|
||||
@@ -154,7 +162,7 @@ if Var.BOT_USERNAME is not None and asst is not None:
|
||||
|
||||
@callback("upp")
|
||||
async def _(event):
|
||||
uptime = grt((time.time() - start_time))
|
||||
uptime = grt(time.time() - start_time)
|
||||
pin = f"🙋Uᴘᴛɪᴍᴇ = {uptime}"
|
||||
await event.answer(pin, cache_time=0, alert=True)
|
||||
|
||||
@@ -167,7 +175,7 @@ if Var.BOT_USERNAME is not None and asst is not None:
|
||||
"Sᴇɴᴅ Oғғɪᴄɪᴀʟ Pʟᴜɢɪɴs",
|
||||
query="send",
|
||||
same_peer=True,
|
||||
)
|
||||
),
|
||||
],
|
||||
[
|
||||
Button.switch_inline(
|
||||
@@ -198,7 +206,7 @@ if Var.BOT_USERNAME is not None and asst is not None:
|
||||
"YᴏᴜTᴜʙᴇ Dᴏᴡɴʟᴏᴀᴅᴇʀ",
|
||||
query="yt Ed Sheeran Perfect",
|
||||
same_peer=True,
|
||||
)
|
||||
),
|
||||
],
|
||||
[
|
||||
Button.switch_inline(
|
||||
@@ -212,11 +220,18 @@ if Var.BOT_USERNAME is not None and asst is not None:
|
||||
same_peer=True,
|
||||
),
|
||||
],
|
||||
[
|
||||
Button.switch_inline(
|
||||
"OʀᴀɴɢᴇFᴏx🦊Rᴇᴄᴏᴠᴇʀʏ",
|
||||
query="ofox beryllium",
|
||||
same_peer=True,
|
||||
),
|
||||
],
|
||||
[
|
||||
Button.inline(
|
||||
"<- Bᴀᴄᴋ",
|
||||
data="open",
|
||||
)
|
||||
),
|
||||
],
|
||||
]
|
||||
await e.edit(buttons=button, link_preview=False)
|
||||
@@ -326,8 +341,9 @@ if Var.BOT_USERNAME is not None and asst is not None:
|
||||
],
|
||||
[
|
||||
Button.url(
|
||||
"⚙️Sᴇᴛᴛɪɴɢs⚙️", url=f"https://t.me/{bnn}?start={ultroid_bot.me.id}"
|
||||
)
|
||||
"⚙️Sᴇᴛᴛɪɴɢs⚙️",
|
||||
url=f"https://t.me/{bnn}?start={ultroid_bot.me.id}",
|
||||
),
|
||||
],
|
||||
[Button.inline("••Cʟᴏꜱᴇ••", data="close")],
|
||||
]
|
||||
@@ -338,7 +354,10 @@ if Var.BOT_USERNAME is not None and asst is not None:
|
||||
cmd = len(z) + 10
|
||||
await event.edit(
|
||||
get_string("inline_4").format(
|
||||
OWNER_NAME, len(PLUGINS) - 5, len(ADDONS), cmd
|
||||
OWNER_NAME,
|
||||
len(PLUGINS) - 5,
|
||||
len(ADDONS),
|
||||
cmd,
|
||||
),
|
||||
buttons=buttons,
|
||||
link_preview=False,
|
||||
@@ -367,10 +386,10 @@ if Var.BOT_USERNAME is not None and asst is not None:
|
||||
except BaseException:
|
||||
pass
|
||||
if help_string == "":
|
||||
reply_pop_up_alert = "{} has no detailed help...".format(plugin_name)
|
||||
reply_pop_up_alert = f"{plugin_name} has no detailed help..."
|
||||
else:
|
||||
reply_pop_up_alert = help_string
|
||||
reply_pop_up_alert += "\n© @TheUltroid"
|
||||
reply_pop_up_alert += "\n© @TeamUltroid"
|
||||
try:
|
||||
if event.query.user_id in sed:
|
||||
await event.edit(
|
||||
@@ -384,7 +403,7 @@ if Var.BOT_USERNAME is not None and asst is not None:
|
||||
reply_pop_up_alert = notmine
|
||||
await event.answer(reply_pop_up_alert, cache_time=0)
|
||||
except BaseException:
|
||||
halps = "Do .help {} to get the list of commands.".format(plugin_name)
|
||||
halps = f"Do .help {plugin_name} to get the list of commands."
|
||||
await event.edit(halps)
|
||||
|
||||
@callback(
|
||||
@@ -418,10 +437,10 @@ if Var.BOT_USERNAME is not None and asst is not None:
|
||||
except BaseException:
|
||||
pass
|
||||
if help_string == "":
|
||||
reply_pop_up_alert = "{} has no detailed help...".format(plugin_name)
|
||||
reply_pop_up_alert = f"{plugin_name} has no detailed help..."
|
||||
else:
|
||||
reply_pop_up_alert = help_string
|
||||
reply_pop_up_alert += "\n© @TheUltroid"
|
||||
reply_pop_up_alert += "\n© @TeamUltroid"
|
||||
try:
|
||||
if event.query.user_id in sed:
|
||||
await event.edit(
|
||||
@@ -435,7 +454,7 @@ if Var.BOT_USERNAME is not None and asst is not None:
|
||||
reply_pop_up_alert = notmine
|
||||
await event.answer(reply_pop_up_alert, cache_time=0)
|
||||
except BaseException:
|
||||
halps = "Do .help {} to get the list of commands.".format(plugin_name)
|
||||
halps = f"Do .help {plugin_name} to get the list of commands."
|
||||
await event.edit(halps)
|
||||
|
||||
|
||||
@@ -457,9 +476,11 @@ def paginate_help(page_number, loaded_plugins, prefix):
|
||||
modules = [
|
||||
Button.inline(
|
||||
"{} {} {}".format(
|
||||
random.choice(list(multi)), x, random.choice(list(mult2i))
|
||||
random.choice(list(multi)),
|
||||
x,
|
||||
random.choice(list(mult2i)),
|
||||
),
|
||||
data="us_plugin_{}".format(x),
|
||||
data=f"us_plugin_{x}",
|
||||
)
|
||||
for x in helpable_plugins
|
||||
]
|
||||
@@ -474,13 +495,15 @@ def paginate_help(page_number, loaded_plugins, prefix):
|
||||
] + [
|
||||
(
|
||||
Button.inline(
|
||||
"<- Pʀᴇᴠɪᴏᴜs", data="{}_prev({})".format(prefix, modulo_page)
|
||||
"<- Pʀᴇᴠɪᴏᴜs",
|
||||
data=f"{prefix}_prev({modulo_page})",
|
||||
),
|
||||
Button.inline("-Bᴀᴄᴋ-", data="open"),
|
||||
Button.inline(
|
||||
"Nᴇxᴛ ->", data="{}_next({})".format(prefix, modulo_page)
|
||||
"Nᴇxᴛ ->",
|
||||
data=f"{prefix}_next({modulo_page})",
|
||||
),
|
||||
)
|
||||
),
|
||||
]
|
||||
else:
|
||||
pairs = pairs[
|
||||
@@ -507,9 +530,11 @@ def paginate_addon(page_number, loaded_plugins, prefix):
|
||||
modules = [
|
||||
Button.inline(
|
||||
"{} {} {}".format(
|
||||
random.choice(list(multi)), x, random.choice(list(mult2i))
|
||||
random.choice(list(multi)),
|
||||
x,
|
||||
random.choice(list(mult2i)),
|
||||
),
|
||||
data="add_plugin_{}".format(x),
|
||||
data=f"add_plugin_{x}",
|
||||
)
|
||||
for x in helpable_plugins
|
||||
]
|
||||
@@ -524,13 +549,15 @@ def paginate_addon(page_number, loaded_plugins, prefix):
|
||||
] + [
|
||||
(
|
||||
Button.inline(
|
||||
"<- Pʀᴇᴠɪᴏᴜs", data="{}_prev({})".format(prefix, modulo_page)
|
||||
"<- Pʀᴇᴠɪᴏᴜs",
|
||||
data=f"{prefix}_prev({modulo_page})",
|
||||
),
|
||||
Button.inline("-Bᴀᴄᴋ-", data="open"),
|
||||
Button.inline(
|
||||
"Nᴇxᴛ ->", data="{}_next({})".format(prefix, modulo_page)
|
||||
"Nᴇxᴛ ->",
|
||||
data=f"{prefix}_next({modulo_page})",
|
||||
),
|
||||
)
|
||||
),
|
||||
]
|
||||
else:
|
||||
pairs = pairs[
|
||||
|
||||
Reference in New Issue
Block a user