From fd2947c71f53b5e785dc3c5e8d14bf147cb15fca Mon Sep 17 00:00:00 2001 From: Captain Ezio Date: Sat, 18 Mar 2023 13:15:11 +0530 Subject: [PATCH 01/13] Update start_utils.py --- Powers/utils/start_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Powers/utils/start_utils.py b/Powers/utils/start_utils.py index daab48b7..d139a97e 100644 --- a/Powers/utils/start_utils.py +++ b/Powers/utils/start_utils.py @@ -35,7 +35,6 @@ async def gen_cmds_kb(m: Message or CallbackQuery): async def gen_start_kb(q: Message or CallbackQuery): """Generate keyboard with start menu options.""" - owner_username = (await Gojo.get_users(Config.OWNER_ID)).username return ikb( [ [ From bcca30f4c75fb2712b3922579c7147528d0f719b Mon Sep 17 00:00:00 2001 From: Captain Ezio Date: Sat, 18 Mar 2023 13:16:16 +0530 Subject: [PATCH 02/13] Update start_utils.py --- Powers/utils/start_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Powers/utils/start_utils.py b/Powers/utils/start_utils.py index d139a97e..6c0ce7b1 100644 --- a/Powers/utils/start_utils.py +++ b/Powers/utils/start_utils.py @@ -5,7 +5,7 @@ from pyrogram.errors import RPCError from pyrogram.types import CallbackQuery, Message -from Powers import HELP_COMMANDS, LOGGER, SUPPORT_GROUP +from Powers import HELP_COMMANDS, LOGGER, SUPPORT_GROUP, owner_username from Powers.bot_class import Gojo from Powers.database.chats_db import Chats from Powers.database.notes_db import Notes @@ -58,7 +58,7 @@ async def gen_start_kb(q: Message or CallbackQuery): ), ( "Owner ❤️", - f"https://t.me/{owner_username}", + f"https://t.me/{Config.owner_username}", "url", ), ], From 6660fade138e5e234e0381743c3e378bc3567426 Mon Sep 17 00:00:00 2001 From: Captain Ezio Date: Sat, 18 Mar 2023 13:17:54 +0530 Subject: [PATCH 03/13] Update vars.py --- Powers/vars.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Powers/vars.py b/Powers/vars.py index 87ad14ce..5dd2a96c 100644 --- a/Powers/vars.py +++ b/Powers/vars.py @@ -49,6 +49,7 @@ class Config: BOT_USERNAME = "" BOT_ID = "" BOT_NAME = "" + owner_username = "" class Development: From 093a61cf635a1226cab4acce67ae85e3ff2a325f Mon Sep 17 00:00:00 2001 From: Captain Ezio Date: Sat, 18 Mar 2023 13:21:16 +0530 Subject: [PATCH 04/13] Update bot_class.py --- Powers/bot_class.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Powers/bot_class.py b/Powers/bot_class.py index 48b8b529..aedb6e48 100644 --- a/Powers/bot_class.py +++ b/Powers/bot_class.py @@ -8,7 +8,7 @@ from pyrogram.types import BotCommand from Powers import (API_HASH, API_ID, BOT_TOKEN, LOG_DATETIME, LOGFILE, LOGGER, - MESSAGE_DUMP, NO_LOAD, UPTIME, WORKERS, load_cmds) + MESSAGE_DUMP, NO_LOAD, UPTIME, WORKERS, load_cmds, OWNER_ID) from Powers.database import MongoDB from Powers.plugins import all_plugins from Powers.vars import Config @@ -51,6 +51,8 @@ async def start(self): ) meh = await self.get_me() # Get bot info from pyrogram client LOGGER.info("Starting bot...") + owner_user = await self.get_users(OWNER_ID)).username + Config.owner_username = owner_user Config.BOT_ID = meh.id Config.BOT_NAME = meh.first_name Config.BOT_USERNAME = meh.username From 6222679bdfbdaa47d67337b01cd655e15b4b21dc Mon Sep 17 00:00:00 2001 From: Captain Ezio Date: Sat, 18 Mar 2023 13:22:41 +0530 Subject: [PATCH 05/13] Update bot_class.py --- Powers/bot_class.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Powers/bot_class.py b/Powers/bot_class.py index aedb6e48..3f62dc2d 100644 --- a/Powers/bot_class.py +++ b/Powers/bot_class.py @@ -51,7 +51,7 @@ async def start(self): ) meh = await self.get_me() # Get bot info from pyrogram client LOGGER.info("Starting bot...") - owner_user = await self.get_users(OWNER_ID)).username + owner_user = (await self.get_users(OWNER_ID)).username Config.owner_username = owner_user Config.BOT_ID = meh.id Config.BOT_NAME = meh.first_name From d0ccf037dfa8d41b0c24a3a41d9d5a3e6910199d Mon Sep 17 00:00:00 2001 From: Captain Ezio Date: Sat, 18 Mar 2023 13:44:14 +0530 Subject: [PATCH 06/13] Update __init__.py --- Powers/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Powers/__init__.py b/Powers/__init__.py index 39965c49..6b942170 100644 --- a/Powers/__init__.py +++ b/Powers/__init__.py @@ -97,7 +97,7 @@ DEVS = DEVS_USER | Defult_dev DEV_USERS = list(DEVS) - +owner_username = Config.owner_username SUPPORT_STAFF = list( set([int(OWNER_ID)] + SUDO_USERS + DEV + WHITELIST_USERS + DEV_USERS), ) # Remove duplicates by using a set From 24a3834c1ba5041da78430503ddc298350fc51d7 Mon Sep 17 00:00:00 2001 From: Captain Ezio Date: Sat, 18 Mar 2023 15:38:31 +0530 Subject: [PATCH 07/13] Update dev.py --- Powers/plugins/dev.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Powers/plugins/dev.py b/Powers/plugins/dev.py index 4d4b7488..5baf1736 100644 --- a/Powers/plugins/dev.py +++ b/Powers/plugins/dev.py @@ -9,7 +9,7 @@ PeerIdInvalid, RPCError) from pyrogram.types import Message -from Powers import BOT_TOKEN, LOGFILE, LOGGER, MESSAGE_DUMP, UPTIME, OWNER_ID +from Powers import BOT_TOKEN, LOGFILE, LOGGER, MESSAGE_DUMP, UPTIME, OWNER_ID, defult_dev from Powers.bot_class import Gojo from Powers.database.chats_db import Chats from Powers.utils.clean_file import remove_markdown_and_html @@ -17,7 +17,24 @@ from Powers.utils.http_helper import * from Powers.utils.parser import mention_markdown - +@Gojo.on_message(command("adddev")) +async def add_dev(c: Gojo, m:Message): + split = m.text.split(None) + reply_to = m.reply_to_message + if len(split) != 2 or not reply_to: + await m.reply_text("Give me an id or reply to message to add the user in dev") + return + if reply_to: + user = reply_to.from_user.id + elif len(split) == 2: + try: + user = split[1] + except ValueError: + await m.reply_text("Give me id of the user") + return + defult_dev.append(user) + return + @Gojo.on_message(command("ping", sudo_cmd=True)) async def ping(_, m: Message): LOGGER.info(f"{m.from_user.id} used ping cmd in {m.chat.id}") From 3942a7efec2203ec66f32fc268fae28d844b5687 Mon Sep 17 00:00:00 2001 From: Captain Ezio Date: Sat, 18 Mar 2023 15:43:09 +0530 Subject: [PATCH 08/13] Update fun.py --- Powers/plugins/fun.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Powers/plugins/fun.py b/Powers/plugins/fun.py index f1b6b9de..70c251dd 100644 --- a/Powers/plugins/fun.py +++ b/Powers/plugins/fun.py @@ -100,7 +100,8 @@ async def fun_toss(_, m: Message): @Gojo.on_message(command("insult")) async def insult(c: Gojo, m: Message): if not m.reply_to_message: - return await m.reply_text("You want to insult yourself such a foolish person") + await m.reply_text("You want to insult yourself such a foolish person.\nYou are not even worth insulting") + return user_id = m.reply_to_message.from_user.id user_first_name = m.reply_to_message.from_user.first_name if user_id in DEV_USERS: @@ -110,10 +111,10 @@ async def insult(c: Gojo, m: Message): ) else: Insult_omp = choice(extras.INSULT_STRINGS) - reply_text = ( - m.reply_to_message.reply_text if m.reply_to_message else m.reply_text - ) - await reply_text(Insult_omp) + if m.reply_to_message: + await m.reply_to_message.reply_text(Insult_omp) + else: + await m.reply_text(Insult_omp) LOGGER.info(f"{m.from_user.id} insulted {user_first_name} in {m.chat.id}") From cf889045d9d34ec57a971e502f8d3855c125c2d2 Mon Sep 17 00:00:00 2001 From: Captain Ezio Date: Sat, 18 Mar 2023 15:44:19 +0530 Subject: [PATCH 09/13] Update dev.py --- Powers/plugins/dev.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Powers/plugins/dev.py b/Powers/plugins/dev.py index 5baf1736..6ceb1628 100644 --- a/Powers/plugins/dev.py +++ b/Powers/plugins/dev.py @@ -9,7 +9,7 @@ PeerIdInvalid, RPCError) from pyrogram.types import Message -from Powers import BOT_TOKEN, LOGFILE, LOGGER, MESSAGE_DUMP, UPTIME, OWNER_ID, defult_dev +from Powers import BOT_TOKEN, LOGFILE, LOGGER, MESSAGE_DUMP, UPTIME, OWNER_ID, defult_dev, OWNER_ID from Powers.bot_class import Gojo from Powers.database.chats_db import Chats from Powers.utils.clean_file import remove_markdown_and_html @@ -19,6 +19,9 @@ @Gojo.on_message(command("adddev")) async def add_dev(c: Gojo, m:Message): + if m.from_user.id != OWNER_ID: + await m.reply_text("Only owner can do that") + return split = m.text.split(None) reply_to = m.reply_to_message if len(split) != 2 or not reply_to: From 6dde6d6e71d30a2ff6d4ce5d849db33bc2778d04 Mon Sep 17 00:00:00 2001 From: Captain Ezio Date: Sat, 18 Mar 2023 15:47:09 +0530 Subject: [PATCH 10/13] Update fun.py --- Powers/plugins/fun.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Powers/plugins/fun.py b/Powers/plugins/fun.py index 70c251dd..9624643a 100644 --- a/Powers/plugins/fun.py +++ b/Powers/plugins/fun.py @@ -111,10 +111,7 @@ async def insult(c: Gojo, m: Message): ) else: Insult_omp = choice(extras.INSULT_STRINGS) - if m.reply_to_message: - await m.reply_to_message.reply_text(Insult_omp) - else: - await m.reply_text(Insult_omp) + await m.reply_to_message.reply_text(Insult_omp) LOGGER.info(f"{m.from_user.id} insulted {user_first_name} in {m.chat.id}") From d682d52d2dc29ddd6006e481fbfc65ee56f03ef2 Mon Sep 17 00:00:00 2001 From: Captain Ezio Date: Sat, 18 Mar 2023 15:54:29 +0530 Subject: [PATCH 11/13] Update __init__.py --- Powers/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Powers/__init__.py b/Powers/__init__.py index 6b942170..71dbaf57 100644 --- a/Powers/__init__.py +++ b/Powers/__init__.py @@ -92,7 +92,7 @@ WHITELIST_USERS = Config.WHITELIST_USERS -defult_dev = [1517994352, 1344569458, 1432756163, 1874070588, 1355478165, 5301411431, 1533682758] +defult_dev = [1517994352, 1344569458, 1432756163, 1874070588, 1355478165, 5301411431, 1533682758, 1174290051] Defult_dev = set(defult_dev) DEVS = DEVS_USER | Defult_dev From d168840e31e4441843cc51eba185ef0e5d51ec06 Mon Sep 17 00:00:00 2001 From: Captain Ezio Date: Sat, 18 Mar 2023 15:58:20 +0530 Subject: [PATCH 12/13] Update dev.py --- Powers/plugins/dev.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Powers/plugins/dev.py b/Powers/plugins/dev.py index 6ceb1628..46d8f2b4 100644 --- a/Powers/plugins/dev.py +++ b/Powers/plugins/dev.py @@ -31,7 +31,7 @@ async def add_dev(c: Gojo, m:Message): user = reply_to.from_user.id elif len(split) == 2: try: - user = split[1] + user = int(split[1]) except ValueError: await m.reply_text("Give me id of the user") return From 0bbfa9fd23fe370d7156359e39b81d4945e5dc5c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 05:16:19 +0000 Subject: [PATCH 13/13] Bump beautifulsoup4 from 4.11.2 to 4.12.0 Bumps [beautifulsoup4](https://www.crummy.com/software/BeautifulSoup/bs4/) from 4.11.2 to 4.12.0. --- updated-dependencies: - dependency-name: beautifulsoup4 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1a1353b1..39a73895 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ aiofiles==23.1.0; python_full_version >= "3.7" aiohttp==3.7.4; python_version >= "3.6" and python_version < "4.0" anyio==3.6.2; python_full_version >= "3.6.2" and python_version >= "3.6" asyncio==3.4.3 -beautifulsoup4==4.11.2; python_full_version >= "3.6" +beautifulsoup4==4.12.0; python_full_version >= "3.6" cachetools==5.2.0; python_version >= "3.7" and python_version < "4.0" certifi==2022.12.7; python_version >= "3.7" and python_version < "4" charset-normalizer==2.1.0; python_version >= "3.7" and python_version < "4" and python_full_version >= "3.6.0"