From 9e009aea43f616ad2ed2f33ae6e217c951388fcf Mon Sep 17 00:00:00 2001 From: profitroll Date: Thu, 5 Jan 2023 13:01:57 +0100 Subject: [PATCH] Minor naming improvements --- modules/commands/cancel.py | 4 +++- modules/commands/identify.py | 6 ++++-- modules/commands/label.py | 4 +++- modules/commands/resetcommands.py | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/commands/cancel.py b/modules/commands/cancel.py index f0755af..c543ecf 100644 --- a/modules/commands/cancel.py +++ b/modules/commands/cancel.py @@ -6,9 +6,11 @@ from modules.utils import should_quote, logWrite, locale from modules.database import col_tmp, col_spoilers from modules import custom_filters +# Cancel command =============================================================================================================== @app.on_message((custom_filters.enabled_applications | custom_filters.enabled_sponsorships) & ~filters.scheduled & filters.command("cancel", prefixes=["/"])) async def command_cancel(app: Client, msg: Message): col_tmp.delete_many( {"user": msg.from_user.id} ) col_spoilers.delete_many( {"user": msg.from_user.id, "completed": False} ) await msg.reply_text(locale("cancel", "message", locale=msg.from_user), quote=should_quote(msg)) - logWrite(f"Cancelling all ongoing tmp operations for {msg.from_user.id}") \ No newline at end of file + logWrite(f"Cancelling all ongoing tmp operations for {msg.from_user.id}") +# ============================================================================================================================== \ No newline at end of file diff --git a/modules/commands/identify.py b/modules/commands/identify.py index 6f83ed0..953fd42 100644 --- a/modules/commands/identify.py +++ b/modules/commands/identify.py @@ -9,8 +9,9 @@ from classes.holo_user import HoloUser, UserNotFoundError, UserInvalidError from modules.utils import jsonLoad, should_quote, logWrite, locale, download_tmp, create_tmp, find_user from modules import custom_filters +# Identify command ============================================================================================================= @app.on_message((custom_filters.enabled_applications | custom_filters.enabled_sponsorships) & ~filters.scheduled & filters.command("identify", prefixes=["/"]) & custom_filters.admin) -async def command_identify(app: Client, msg: Message): +async def cmd_identify(app: Client, msg: Message): if len(msg.command) != 2: await msg.reply_text(locale("identify_invalid_syntax", "message", locale=msg.from_user)) @@ -60,4 +61,5 @@ async def command_identify(app: Client, msg: Message): quote=should_quote(msg) ) - logWrite(f"User {msg.from_user.id} identified user {holo_user.id}") \ No newline at end of file + logWrite(f"User {msg.from_user.id} identified user {holo_user.id}") +# ============================================================================================================================== \ No newline at end of file diff --git a/modules/commands/label.py b/modules/commands/label.py index cfe5967..e0e711e 100644 --- a/modules/commands/label.py +++ b/modules/commands/label.py @@ -6,6 +6,7 @@ from modules.utils import locale, should_quote, find_user from classes.holo_user import HoloUser, LabelTooLongError from modules import custom_filters +# Label command ================================================================================================================ @app.on_message(custom_filters.enabled_applications & ~filters.scheduled & filters.command(["label"], prefixes=["/"]) & custom_filters.admin) async def cmd_label(app: Client, msg: Message): @@ -34,4 +35,5 @@ async def cmd_label(app: Client, msg: Message): await msg.reply_text(f"Setting **{target.id}**'s label to **{label}**...", quote=should_quote(msg)) else: - await msg.reply_text(f"User not found") \ No newline at end of file + await msg.reply_text(f"User not found") +# ============================================================================================================================== \ No newline at end of file diff --git a/modules/commands/resetcommands.py b/modules/commands/resetcommands.py index 9ed0657..5f5ef15 100644 --- a/modules/commands/resetcommands.py +++ b/modules/commands/resetcommands.py @@ -9,9 +9,9 @@ from modules import custom_filters pid = getpid() -# Shutdown command ============================================================================================================= +# Reset commands command ======================================================================================================= @app.on_message(custom_filters.enabled_general & ~filters.scheduled & filters.private & filters.command(["resetcommands"], prefixes=["/"]) & custom_filters.admin) -async def cmd_kill(app: Client, msg: Message): +async def cmd_resetcommands(app: Client, msg: Message): if msg.from_user.id == configGet("owner"):