From 19f3a9a41cd4e7cd3d48a0cb013d15a1077fd149 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 03:40:43 +0530
Subject: [PATCH 01/26] Update client.py
---
tronx/clients/client.py | 49 +++++++++++++----------------------------
1 file changed, 15 insertions(+), 34 deletions(-)
diff --git a/tronx/clients/client.py b/tronx/clients/client.py
index da53c1b0..e0385a92 100644
--- a/tronx/clients/client.py
+++ b/tronx/clients/client.py
@@ -14,24 +14,15 @@ def __init__(self):
workers=self.WORKERS,
)
self.start()
-
- def tron(self):
- return print(self.get_me())
-
- def dc_id(self):
- return (self.get_me())
-
- def id(self):
- return (self.get_me())
-
- def name(self):
- return (self.get_me())
-
- def username(self):
- return "@" + (self.get_me()) if (self.get_me()) else ""
-
-
- class bot(Client, Utils):
+ self.bot = self.Bot()
+ self.me = self.get_me()
+ self.id = self.me.id
+ self.dc_id = self.me.dc_id
+ self.name = self.me.first_name
+ self.username = "@" + self.me.username if self.me.username else ""
+ self.stop()
+
+ class Bot(Client, Utils):
""" Assistant (Nora) """
def __init__(self):
super().__init__(
@@ -41,19 +32,9 @@ def __init__(self):
bot_token=self.TOKEN,
)
self.start()
-
- def nora(self):
- return self.bot.get_me()
-
- def dc_id(self):
- return (self.bot.get_me())
-
- def id(self):
- return (self.bot.get_me())
-
- def name(self):
- return (self.bot.get_me())
-
- def username(self):
- return "@" + (self.bot.get_me())
-
+ self.me = self.get_me()
+ self.id = self.me.id
+ self.dc_id = self.me.dc_id
+ self.name = self.me.first_name
+ self.username = "@" + self.me.username
+ self.stop()
From 9551e054441a3fb0a6214f9772a22d0e28d0fd21 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 03:41:40 +0530
Subject: [PATCH 02/26] Update functions.py
---
tronx/helpers/functions.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tronx/helpers/functions.py b/tronx/helpers/functions.py
index a0140135..38efa451 100644
--- a/tronx/helpers/functions.py
+++ b/tronx/helpers/functions.py
@@ -136,11 +136,11 @@ async def send_edit(
formats = [mono, bold, italic, strike, underline]
format_dict = {
- "mono" : f"{text}",
- "bold" : f"{text}",
- "italic" : f"{text}",
- "strike" : f"{text}",
- "underline" : f"{text}"
+ mono : f"{text}",
+ bold : f"{text}",
+ italic : f"{text}",
+ strike : f"{text}",
+ underline : f"{text}"
}
edited = False
@@ -150,7 +150,7 @@ async def send_edit(
await self.edit_text(
m,
format_dict[x],
- disable_wab_page_preview=disable_wab_page_preview,
+ disable_web_page_preview=disable_web_page_preview,
parse_mode=parse_mode
)
edited = True
From a7702f223f75328bee333903a73731383f298934 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 03:44:22 +0530
Subject: [PATCH 03/26] Update help.py
---
tronx/modules/help.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tronx/modules/help.py b/tronx/modules/help.py
index c8c9b499..b406b9a3 100644
--- a/tronx/modules/help.py
+++ b/tronx/modules/help.py
@@ -32,7 +32,7 @@
-@app.bot.on_callback_query(filters.regex("delete-dex") & filters.user(app.id()))
+@app.bot.on_callback_query(filters.regex("delete-dex") & filters.user(app.id))
@app.alert_user
async def delete_helpdex(_, cb: CallbackQuery):
if bool(app.message_ids) is False:
@@ -64,7 +64,7 @@ async def help_menu(app, m):
if args is False:
await app.send_edit(m, ". . .", mono=True)
result = await app.get_inline_bot_results(
- app.bot.username(),
+ app.bot.username,
"#t5r4o9nn6"
)
if result:
From 07c2d0da7d86c1444f84d456170b74e1e95e2866 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 03:46:17 +0530
Subject: [PATCH 04/26] Update __main__.py
---
tronx/__main__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tronx/__main__.py b/tronx/__main__.py
index c1702336..7b1227ad 100644
--- a/tronx/__main__.py
+++ b/tronx/__main__.py
@@ -43,7 +43,7 @@ async def start_bot():
print(f"\n\n{_mods} modules Loaded")
await start_assistant()
await start_userbot()
- idle()
+ await idle()
From c2e91b8ab1c140cc6c640197874a8ed43eba1c19 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 03:48:59 +0530
Subject: [PATCH 05/26] Update __main__.py
---
tronx/__main__.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tronx/__main__.py b/tronx/__main__.py
index 7b1227ad..215cc1fd 100644
--- a/tronx/__main__.py
+++ b/tronx/__main__.py
@@ -12,6 +12,7 @@
async def start_assistant():
""" Start assistant """
if app.bot:
+ await app.bot.start()
app.log.info("Assistant activated, startup in progress . . .\n")
else:
app.log.info("Assistant start unsuccessful, please check that you have given the bot token.\n")
@@ -23,6 +24,7 @@ async def start_assistant():
async def start_userbot():
""" Start userbot """
if app:
+ await app.start()
app.log.info("Userbot activated, startup in progress . . .\n")
else:
app.log.info("Userbot startup unsuccessful, please check everything again ...")
From d6fc9be091cc9ab9659b33bff2c4e19f8f438e07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 03:52:20 +0530
Subject: [PATCH 06/26] Update alive.py
---
tronx/modules/alive.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tronx/modules/alive.py b/tronx/modules/alive.py
index 60947ebd..394b08f0 100644
--- a/tronx/modules/alive.py
+++ b/tronx/modules/alive.py
@@ -39,7 +39,7 @@ async def simple_alive(_, m: Message):
alive_msg = f"\n"
if BIO:
alive_msg += f"⦿ {BIO}\n\n"
- alive_msg += f"⟜ **Owner:** {app.mymention()}\n"
+ alive_msg += f"⟜ **Owner:** {app.UserMention()}\n"
alive_msg += f"⟜ **Tron:** `{app.userbot_version}`\n"
alive_msg += f"⟜ **Python:** `{app.python_version}`\n"
alive_msg += f"⟜ **Pyrogram:** `{app.pyrogram_version}`\n"
@@ -106,7 +106,7 @@ async def inline_quote(_, m: Message):
try:
await app.send_edit(m,". . .")
try:
- result = await app.get_inline_bot_results(BOT_USERNAME, "#q7o5e")
+ result = await app.get_inline_bot_results(app.bot.username, "#q7o5e")
except BotInvalid:
return await app.send_edit(m,"This bot can't be used in inline mode.", delme=2)
From 7f4d678b58310264ed1a651afe8994cbf2cbf2a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 03:54:24 +0530
Subject: [PATCH 07/26] Update afk.py
---
tronx/modules/afk.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tronx/modules/afk.py b/tronx/modules/afk.py
index 144fb575..64bb492b 100644
--- a/tronx/modules/afk.py
+++ b/tronx/modules/afk.py
@@ -35,7 +35,7 @@ async def go_offline(_, m: Message):
app.set_afk(True, m.text.split(None, 1)[1], start) # with reason
await app.send_edit(
m,
- "{} is now Offline.\nBecause: {}".format(app.mymention(), m.text.split(None, 1)[1]),
+ "{} is now Offline.\nBecause: {}".format(app.UserMention(), m.text.split(None, 1)[1]),
delme=2
)
elif app.long(m) == 1 and app.long(m) < 4096:
@@ -51,7 +51,7 @@ async def go_offline(_, m: Message):
app.set_afk(True, "", start) # without reason
await app.send_edit(
m,
- "{} is now offline.".format(app.mymention()),
+ "{} is now offline.".format(app.UserMention()),
delme=2
)
except Exception as e:
@@ -79,14 +79,14 @@ async def offline_mention(_, m: Message):
if get["reason"] and get["afktime"]:
msg = await app.send_message(
m.chat.id,
- "Sorry {} is currently offline !\n**Time:** {}\n**Because:** {}".format(app.mymention(), otime, get['reason']),
+ "Sorry {} is currently offline !\n**Time:** {}\n**Because:** {}".format(app.UserMention(), otime, get['reason']),
reply_to_message_id=m.message_id
)
await delete(msg, 3)
elif get["afktime"] and not get["reason"]:
await app.send_message(
m.chat.id,
- "Sorry {} is currently offline !\n**Time:** {}".format(app.mymention(), otime),
+ "Sorry {} is currently offline !\n**Time:** {}".format(app.UserMention(), otime),
reply_to_message_id=m.message_id
)
await delete(msg, 3)
@@ -135,7 +135,7 @@ async def back_online(_, m: Message):
afk_time = app.GetReadableTime(end - get["afktime"])
msg = await app.send_message(
m.chat.id,
- f"{app.mymention()} is now online !\n**Time:** `{afk_time}`"
+ f"{app.UserMention()} is now online !\n**Time:** `{afk_time}`"
)
app.set_afk(False, "", 0)
else:
From cbc8d071856a815bc5de6c2210be83e11e4ba3f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 03:55:06 +0530
Subject: [PATCH 08/26] Update carbon.py
---
tronx/modules/carbon.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tronx/modules/carbon.py b/tronx/modules/carbon.py
index a5585d77..60eec945 100644
--- a/tronx/modules/carbon.py
+++ b/tronx/modules/carbon.py
@@ -107,7 +107,7 @@ async def create_carbon(m: Message, text, colour):
await app.send_document(
m.chat.id,
filename,
- caption=f"**Carbon Made by:** {app.mymention()}",
+ caption=f"**Carbon Made by:** {app.UserMention()}",
reply_to_message_id=reply_msg_id,
)
await m.delete()
From 8e91070954b8dfed151a31d495435f94eab1d89d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 03:58:32 +0530
Subject: [PATCH 09/26] Update download.py
---
tronx/modules/download.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tronx/modules/download.py b/tronx/modules/download.py
index 91892ed8..99492c9c 100644
--- a/tronx/modules/download.py
+++ b/tronx/modules/download.py
@@ -66,9 +66,9 @@ async def list_directories(_, m: Message):
for file in files:
if not file.endswith(".session") and not file in ["__pycache__", ".git", ".github", ".profile.d", ".heroku", ".cache"]:
if os.path.isfile(f"{location}/{file}"):
- collect.append(f"📑 `{file}` ({DictSize(os.path.abspath(location+file))})")
+ collect.append(f"📑 `{file}` ({app.DictSize(os.path.abspath(location+file))})")
if os.path.isdir(f"{location}/{file}"):
- collect.append(f"🗂️ `{file}` ({DictSize(os.path.abspath(location+file))})")
+ collect.append(f"🗂️ `{file}` ({app.DictSize(os.path.abspath(location+file))})")
collect.sort() # sort the files
file = "\n".join(collect)
From 56f1f429354036e491e6fcdbca747d51f0fbbfa3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 04:00:37 +0530
Subject: [PATCH 10/26] Update user.py
---
tronx/helpers/user.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tronx/helpers/user.py b/tronx/helpers/user.py
index 88aa7269..9138d6f4 100644
--- a/tronx/helpers/user.py
+++ b/tronx/helpers/user.py
@@ -17,7 +17,7 @@ def UserUsername(self):
# mention of bot owner
def UserMention(self):
- return self.mention_markdown(self.UserId(), self.UserName()) if self.UserName() and self.UserId() else None
+ return self.MentionMarkdown(self.UserId(), self.UserName()) if self.UserName() and self.UserId() else None
# telegram id of bot owner
From 67f4f25d040923b847dcac5475493288d17df3a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 04:02:12 +0530
Subject: [PATCH 11/26] Update decorators.py
---
tronx/helpers/decorators.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tronx/helpers/decorators.py b/tronx/helpers/decorators.py
index 83398c4c..a91972cc 100644
--- a/tronx/helpers/decorators.py
+++ b/tronx/helpers/decorators.py
@@ -8,7 +8,7 @@
class Decorators(object):
def alert_user(self, func):
async def wrapper(_, cb: CallbackQuery):
- if cb.from_user and not cb.from_user.id in self.USER_ID:
+ if cb.from_user and not cb.from_user.id == self.id:
await cb.answer(
f"Sorry, but you can't use this userbot ! make your own userbot at @tronuserbot",
show_alert=True
From ef8cb4ab2cf81f071557623529479483a54edd9e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 04:03:59 +0530
Subject: [PATCH 12/26] Update inlinequery.py
---
tronx/plugins/inlinequery.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tronx/plugins/inlinequery.py b/tronx/plugins/inlinequery.py
index 8cefead8..a850fed3 100644
--- a/tronx/plugins/inlinequery.py
+++ b/tronx/plugins/inlinequery.py
@@ -30,7 +30,7 @@
# via bot messages
@app.bot.on_inline_query(filters.user(app.id))
-def inline_res(_, inline_query):
+def inline_result(_, inline_query):
query = inline_query.query
if query.startswith("#p0e3r4m8i8t5"):
inline_query.answer(
@@ -64,7 +64,7 @@ def inline_res(_, inline_query):
inline_query.answer(
results=[
InlineQueryResultPhoto(
- photo_url=ialive_pic(),
+ photo_url=app.ialive_pic(),
title="Inline alive",
description="This is same as alive command, the difference is that this command have inline button.",
caption=f"**⛊ Inline Status:**\n\n**⟐** {Config.USER_BIO}\n\n**⟜ Owner**: [{USER_NAME}](https://t.me/{USER_USERNAME})\n**⟜ Tron:** `{userbot_version}`\n**⟜ Python:** `{python_version}`\n⟜ **Pyrogram:** `{pyrogram_version}`\n⟜ **uptime:** `{uptime()}\n\n",
From 239acd00093b3d43dbaef4444a5b1b306c49040b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 04:05:05 +0530
Subject: [PATCH 13/26] Update start.py
---
tronx/plugins/start.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tronx/plugins/start.py b/tronx/plugins/start.py
index 4956e813..2a0eec92 100644
--- a/tronx/plugins/start.py
+++ b/tronx/plugins/start.py
@@ -16,7 +16,7 @@ async def send_help(_, m: Message):
@app.bot.on_message(filters.new_chat_members & filters.group)
async def added_to_group_msg(_, m: Message):
- if m.new_chat_members[0].id == app.REAL_BOT_ID:
+ if m.new_chat_members[0].id == app.bot.id:
try:
await app.bot.send_message(
m.chat.id,
From ee74c857b336214dd925a4c50763ce9167bb97ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 04:11:43 +0530
Subject: [PATCH 14/26] Update user.py
---
tronx/helpers/user.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tronx/helpers/user.py b/tronx/helpers/user.py
index 9138d6f4..4028a82c 100644
--- a/tronx/helpers/user.py
+++ b/tronx/helpers/user.py
@@ -32,3 +32,10 @@ def UserId(self):
def UserDc(self):
data = self.USER_DC if self.USER_DC else self.dc_id
return data if data else None
+
+
+ # custom user pic
+ def UserPic(self):
+ var = self.getdv("USER_PIC")
+ one = var if bool(var) is True else self.USER_PIC
+ return one if one else None
From 5a90f3c1170e9adcf2e865cf1515945e7c62009e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 04:15:58 +0530
Subject: [PATCH 15/26] Update inlinequery.py
---
tronx/plugins/inlinequery.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tronx/plugins/inlinequery.py b/tronx/plugins/inlinequery.py
index a850fed3..6558b8c4 100644
--- a/tronx/plugins/inlinequery.py
+++ b/tronx/plugins/inlinequery.py
@@ -67,7 +67,7 @@ def inline_result(_, inline_query):
photo_url=app.ialive_pic(),
title="Inline alive",
description="This is same as alive command, the difference is that this command have inline button.",
- caption=f"**⛊ Inline Status:**\n\n**⟐** {Config.USER_BIO}\n\n**⟜ Owner**: [{USER_NAME}](https://t.me/{USER_USERNAME})\n**⟜ Tron:** `{userbot_version}`\n**⟜ Python:** `{python_version}`\n⟜ **Pyrogram:** `{pyrogram_version}`\n⟜ **uptime:** `{uptime()}\n\n",
+ caption=f"**⛊ Inline Status:**\n\n**⟐** {app.USER_BIO}\n\n**⟜ Owner**: [{app.name}](https://t.me/{app.username})\n**⟜ Tron:** `{app.userbot_version}`\n**⟜ Python:** `{app.python_version}`\n⟜ **Pyrogram:** `{app.pyrogram_version}`\n⟜ **uptime:** `{app.uptime()}\n\n",
parse_mode="combined",
reply_markup=InlineKeyboardMarkup([home_back])
)
From a3c0fb6ecc0b27695c9903502ce0277ae4caeca2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 04:19:24 +0530
Subject: [PATCH 16/26] Update config.py
---
config.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config.py b/config.py
index 0f861952..882f9176 100644
--- a/config.py
+++ b/config.py
@@ -75,6 +75,6 @@ class Config(object):
THUMB_PIC = os.getenv("THUMB_PIC", "material/images/tron.png")
# ---------------------
TL_NAME = os.getenv("TL_NAME")
-
+ HELP_EMOJI = os.getenv("HELP_EMOJI")
From 3f71755ccfdd7ba0b67bb2abcb4e28e149a82d8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 04:27:29 +0530
Subject: [PATCH 17/26] Update callback.py
---
tronx/plugins/callback.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tronx/plugins/callback.py b/tronx/plugins/callback.py
index bebbaabc..695398d4 100644
--- a/tronx/plugins/callback.py
+++ b/tronx/plugins/callback.py
@@ -95,7 +95,7 @@ async def give_plugin_cmds(_, cb):
@app.alert_user
async def _stats(_, cb):
await cb.edit_message_text(
- text=app.stat_string,
+ text=app.stat_string(),
reply_markup=InlineKeyboardMarkup([home_back]),
)
@@ -159,7 +159,7 @@ async def _extra(_, cb):
@app.alert_user
async def _close(_, cb: CallbackQuery):
await cb.edit_message_text(
- text=app.closed_menu_string,
+ text=app.closed_menu_string(),
reply_markup=InlineKeyboardMarkup(
[
[
From 2643014a96f8ea7515b7a9c98c1032dab5f90cf7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 04:31:19 +0530
Subject: [PATCH 18/26] Update afk.py
---
tronx/modules/afk.py | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/tronx/modules/afk.py b/tronx/modules/afk.py
index 64bb492b..3e87c056 100644
--- a/tronx/modules/afk.py
+++ b/tronx/modules/afk.py
@@ -82,14 +82,14 @@ async def offline_mention(_, m: Message):
"Sorry {} is currently offline !\n**Time:** {}\n**Because:** {}".format(app.UserMention(), otime, get['reason']),
reply_to_message_id=m.message_id
)
- await delete(msg, 3)
+ await app.delete(msg, 3)
elif get["afktime"] and not get["reason"]:
- await app.send_message(
+ msg = await app.send_message(
m.chat.id,
"Sorry {} is currently offline !\n**Time:** {}".format(app.UserMention(), otime),
reply_to_message_id=m.message_id
)
- await delete(msg, 3)
+ await app.delete(msg, 3)
content, message_type = app.GetMessageType(m)
if message_type == app.TEXT:
if m.text:
@@ -138,8 +138,6 @@ async def back_online(_, m: Message):
f"{app.UserMention()} is now online !\n**Time:** `{afk_time}`"
)
app.set_afk(False, "", 0)
- else:
- return
except Exception as e:
await app.error(m, e)
From fd9a6f7553fdce60a9afd6f0288a82d70c735777 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 04:38:37 +0530
Subject: [PATCH 19/26] Update callback.py
---
tronx/plugins/callback.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tronx/plugins/callback.py b/tronx/plugins/callback.py
index 695398d4..d5a851b6 100644
--- a/tronx/plugins/callback.py
+++ b/tronx/plugins/callback.py
@@ -76,7 +76,7 @@ async def give_plugin_cmds(_, cb):
plugs = await app.data(plugin_name)
help_string = f"PLUGIN: {plugin_name}\n\n" + "".join(plugs)
await cb.edit_message_text(
- app.help_string,
+ help_string,
reply_markup=InlineKeyboardMarkup(
[
[
From 5a2454dc4ba3273898c9cc1ccd6a67bdef958ff4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 04:41:24 +0530
Subject: [PATCH 20/26] Update callback.py
---
tronx/plugins/callback.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tronx/plugins/callback.py b/tronx/plugins/callback.py
index d5a851b6..201d73e5 100644
--- a/tronx/plugins/callback.py
+++ b/tronx/plugins/callback.py
@@ -43,7 +43,7 @@ async def modules(_, cb):
@app.alert_user
async def give_next_page(_, cb):
current_page_number = int(cb.matches[0].group(1))
- buttons = app.helpDex(current_page_number + 1, app.CMD_HELP, "helpme")
+ buttons = app.HelpDex(current_page_number + 1, app.CMD_HELP, "helpme")
print(cb.matches[0])
print(dir(cb.matches[0]))
await cb.edit_message_reply_markup(reply_markup=InlineKeyboardMarkup(buttons))
@@ -54,7 +54,7 @@ async def give_next_page(_, cb):
@app.alert_user
async def give_old_page(_, cb):
current_page_number = int(cb.matches[0].group(1))
- buttons = app.Helpdex(current_page_number - 1, app.CMD_HELP, "helpme")
+ buttons = app.HelpDex(current_page_number - 1, app.CMD_HELP, "helpme")
await cb.edit_message_reply_markup(reply_markup=InlineKeyboardMarkup(buttons))
From d2e0f43b6816c0d837a5194e82d4ce1ddb0552c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 04:46:56 +0530
Subject: [PATCH 21/26] Update utilities.py
---
tronx/helpers/utilities.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tronx/helpers/utilities.py b/tronx/helpers/utilities.py
index 86a0b2c3..2ca6da0e 100644
--- a/tronx/helpers/utilities.py
+++ b/tronx/helpers/utilities.py
@@ -348,7 +348,7 @@ def SizeFormat(self, b, factor=1024, suffix="B"):
def DictSize(self, location):
- return SizeFormat(DictSizeInBytes(location))
+ return self.SizeFormat(self.DictSizeInBytes(location))
def CleanHtml(self, raw_html):
From 712cbcae8e9e13ca3beae6f2aabee6d88b9437fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 04:49:27 +0530
Subject: [PATCH 22/26] Update utilities.py
---
tronx/helpers/utilities.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tronx/helpers/utilities.py b/tronx/helpers/utilities.py
index 2ca6da0e..5d780c2a 100644
--- a/tronx/helpers/utilities.py
+++ b/tronx/helpers/utilities.py
@@ -329,7 +329,7 @@ def DictSizeInBytes(self, directory):
elif entry.is_dir():
# if it's a directory, recursively call this function
- total += DictSizeInBytes(entry.path)
+ total += self.DictSizeInBytes(entry.path)
except NotADirectoryError:
# if `directory` isn't a directory, get the file size then
return os.path.getsize(directory)
From 47035a1e1b5d44154e845fbada9e35086665dda9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 04:56:14 +0530
Subject: [PATCH 23/26] Update fun.py
---
tronx/modules/fun.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tronx/modules/fun.py b/tronx/modules/fun.py
index cf5bdf1d..3b6411eb 100644
--- a/tronx/modules/fun.py
+++ b/tronx/modules/fun.py
@@ -42,7 +42,7 @@ async def slap_friends(app, m):
try:
await app.send_edit(m,"...")
- my_info = app.mymention()
+ my_info = app.UserMention()
user = m.reply_to_message.from_user
user_info = app.mention_markdown(user.id, user.first_name)
TASK = (
From 2e1f339b61b485ef6e59806986d2f05f7c1e3ad9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 04:59:41 +0530
Subject: [PATCH 24/26] Update google.py
---
tronx/modules/google.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tronx/modules/google.py b/tronx/modules/google.py
index 9d3f330e..f471da51 100644
--- a/tronx/modules/google.py
+++ b/tronx/modules/google.py
@@ -73,10 +73,9 @@ async def image_sauce(_, m: Message):
file_name="./downloads/" + universe
)
else:
- await app.send_edit(m, "Only photo & animation media supported.", delme=3)
- return
+ return await app.send_edit(m, "Only photo & animation media supported.", delme=3)
searchUrl = 'http://www.google.co.id/searchbyimage/upload'
- filePath = 'tronx/downloads/{}'.format(universe)
+ filePath = './downloads/{}'.format(universe)
multipart = {'encoded_image': (filePath, open(filePath, 'rb')), 'image_content': ''}
response = requests.post(searchUrl, files=multipart, allow_redirects=False)
fetchUrl = response.headers['Location']
From ac20158a17e1eb181e06abde0ab549098f04ee76 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 05:15:02 +0530
Subject: [PATCH 25/26] Update group.py
---
tronx/modules/group.py | 30 ++++++++++--------------------
1 file changed, 10 insertions(+), 20 deletions(-)
diff --git a/tronx/modules/group.py b/tronx/modules/group.py
index 9675b1ff..d5109b31 100644
--- a/tronx/modules/group.py
+++ b/tronx/modules/group.py
@@ -17,9 +17,10 @@
{"group" : (
"group",
{
- "group [group name]" : "Creates a basic group.",
+ "bgroup [group name]" : "Creates a basic group.",
"sgroup [group name]" : "Creates a super group.",
- "unread" : "Mark a chat as unread in your telegram folders."
+ "unread" : "Mark a chat as unread in your telegram folders.",
+ "channel [channel name]" : "Create a channel through this command."
}
)
}
@@ -31,21 +32,16 @@
@app.on_message(gen(["bgroup", "bgp"]))
async def create_basic_group(_, m: Message):
if app.long(m) < 2:
- return await app.send_edit(m, f"`Usage: {app.PREFIX}group [group name]`", delme=3)
+ return await app.send_edit(m, f"`Usage: {app.PREFIX}bgroup [group name]`", delme=3)
args = m.text.split(None, 1)
grpname = args[1]
grptype = "basic"
user_id = "@Alita_Robot"
try:
- if grptype == "basic":
- try:
- await app.send_edit(m, f"Creating a new basic group: `{grpname}`")
- groupjson = await app.create_group(f"{grpname}", user_id)
- print(groupjson)
- except Exception as e:
- await app.error(m, e)
- await app.send_edit(m, f"**Created a new basic group:** `{grpname}`")
+ await app.send_edit(m, f"Creating a new basic group: `{grpname}`")
+ groupjson = await app.create_group(f"{grpname}", user_id)
+ await app.send_edit(m, f"**Created a new basic group:** `{grpname}`")
except Exception as e:
await app.error(m, e)
@@ -62,15 +58,9 @@ async def create_supergroup(_, m: Message):
grptype = "super"
user_id = "@Alita_Robot"
try:
- if grptype == "super":
- try:
- await app.send_edit(m, f"Creating a new super Group: `{grpname}`")
- await app.create_group(
- f"{grpname}", user_id
- )
- except Exception as e:
- await app.error(m, e)
- await app.send_edit(m, f"**Created a new super Group:** `{grpname}`")
+ await app.send_edit(m, f"Creating a new super Group: `{grpname}`")
+ await app.create_supergroup(f"{grpname}", user_id)
+ await app.send_edit(m, f"**Created a new super Group:** `{grpname}`")
except Exception as e:
await app.error(m, e)
From d7e96ccb77a110ef06ce84ae2e3642907cf98c30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=BF=87=E2=80=A2=E1=BA=9E=E1=97=B4=E1=97=A9S=D4=B5?=
=?UTF-8?q?=E2=80=A2=E0=BF=87?=
<80647839+beastzx18@users.noreply.github.com>
Date: Tue, 25 Jan 2022 05:25:03 +0530
Subject: [PATCH 26/26] Update heroku.py
---
tronx/modules/heroku.py | 29 +++++++++--------------------
1 file changed, 9 insertions(+), 20 deletions(-)
diff --git a/tronx/modules/heroku.py b/tronx/modules/heroku.py
index b7e1c1d6..7fee9739 100644
--- a/tronx/modules/heroku.py
+++ b/tronx/modules/heroku.py
@@ -117,7 +117,7 @@ async def dynostats(_, m: Message):
r = requests.get(heroku_api + path, headers=headers)
if r.status_code != 200:
return await app.send_edit(
- msg,
+ m,
"Error: something bad happened`\n\n" f"> {r.reason}\n",
mono=True
)
@@ -144,7 +144,7 @@ async def dynostats(_, m: Message):
AppMinutes = math.floor(AppQuotaUsed % 60)
await app.send_edit(
- msg,
+ m,
"**Dyno Usage**:\n\n"
f"**Total Dyno Hours:** `550 Hours`\n\n"
f"**⧓ Dyno usage for App:** __`{app.HEROKU_APP_NAME}`__\n"
@@ -318,11 +318,7 @@ async def delvar(_, m: Message):
@app.on_message(gen("logs"))
async def logs(_, m: Message):
await not_heroku(m)
- await app.send_edit(
- m,
- "⏳ • hold on . . .",
- mono=True
- )
+ await app.send_edit(m, "⏳ • hold on . . .", mono=True)
try:
Heroku = heroku3.from_key(app.HEROKU_API_KEY)
zen = Heroku.app(app.HEROKU_APP_NAME)
@@ -336,23 +332,19 @@ async def logs(_, m: Message):
data = zen.get_log()
if data:
try:
- file = open(f"{app.username()}_logs.txt", "w+")
+ file = open(f"{app.username}_logs.txt", "w+")
file.write(data)
file.close()
await app.send_document(
m.chat.id,
- f"{app.username()}_logs.txt",
- caption=f"Uploaded By: {app.mymention()}")
- os.remove(f"{app.username()}_logs.txt")
+ f"{app.username}_logs.txt",
+ caption=f"Uploaded By: {app.UserMention()}")
+ os.remove(f"{app.username}_logs.txt")
await m.delete()
except Exception as e:
await app.error(m, e)
else:
- await app.send_edit(
- m,
- "Failed to get logs . . .",
- delme=3
- )
+ await app.send_edit(m, "Failed to get logs . . .", delme=3)
@@ -361,10 +353,7 @@ async def logs(_, m: Message):
@app.on_message(gen(["textlogs", "tlogs"]))
async def logs_in_text(_, m: Message):
await not_heroku(m)
- await app.send_edit(
- m,
- "⏳ • hold on . . . ", mono=True
- )
+ await app.send_edit(m, "⏳ • hold on . . . ", mono=True)
try:
Heroku = heroku3.from_key(app.HEROKU_API_KEY)
zen = Heroku.app(app.HEROKU_APP_NAME)