From 712b5d22abe0959a69925d2c2f10e562ddd14c2a Mon Sep 17 00:00:00 2001 From: Profitroll <47523801+profitrollgame@users.noreply.github.com> Date: Mon, 5 Dec 2022 20:52:21 +0100 Subject: [PATCH] Silenced some useless warnings --- app.py | 2 +- modules/callbacks/reapply.py | 4 ++-- modules/callbacks/rules.py | 12 ++++++------ modules/commands/reapply.py | 12 ++++++------ modules/commands/rules.py | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app.py b/app.py index bd365a3..f77475d 100644 --- a/app.py +++ b/app.py @@ -6,7 +6,7 @@ app = Client("holochecker", bot_token=configGet("bot_token", "bot"), api_id=conf async def isAnAdmin(admin_id): if admin_id == configGet("owner") or admin_id in configGet("admins"): return True - async for member in app.get_chat_members(configGet("admin_group")): + async for member in app.get_chat_members(configGet("admin_group")): # type: ignore if member.user.id == admin_id: return True return False \ No newline at end of file diff --git a/modules/callbacks/reapply.py b/modules/callbacks/reapply.py index b516afc..c961a66 100644 --- a/modules/callbacks/reapply.py +++ b/modules/callbacks/reapply.py @@ -89,7 +89,7 @@ async def callback_query_reapply_old(app, clb): configSet(["approved"], False, file=str(clb.from_user.id)) configSet(["refused"], False, file=str(clb.from_user.id)) await confirm_yes(app, message) - await clb.message.edit(clb.message.text, reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(locale("done", "button"), "nothing")]])) + await clb.message.edit(clb.message.text, reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(locale("done", "button"), "nothing")]])) # type: ignore # Start a new application when user reapplies after leaving the chat @app.on_callback_query(filters.regex("reapply_new_[\s\S]*")) # type: ignore @@ -106,7 +106,7 @@ async def callback_query_reapply_new(app, clb): message = await app.get_messages(clb.from_user.id, int(fullclb[2])) await welcome_pass(app, message, once_again=True) logWrite(f"User {clb.from_user.id} restarted the application after leaving the chat earlier") - await clb.message.edit(clb.message.text, reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(locale("done", "button"), "nothing")]])) + await clb.message.edit(clb.message.text, reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(locale("done", "button"), "nothing")]])) # type: ignore # Abort application fill in progress and restart it @app.on_callback_query(filters.regex("reapply_stop_[\s\S]*")) # type: ignore diff --git a/modules/callbacks/rules.py b/modules/callbacks/rules.py index d79f1a9..7fe684f 100644 --- a/modules/callbacks/rules.py +++ b/modules/callbacks/rules.py @@ -17,24 +17,24 @@ async def callback_query_rule(app, clb): if rule_num == len(locale("rules")): lower_buttons = [ - InlineKeyboardButton(locale("rules_prev", "button"), callback_data=f"rule_{rule_num-1}") + InlineKeyboardButton(locale("rules_prev", "button"), callback_data=f"rule_{rule_num-1}") # type: ignore ] elif rule_num == 1: lower_buttons = [ - InlineKeyboardButton(locale("rules_next", "button"), callback_data=f"rule_{rule_num+1}") + InlineKeyboardButton(locale("rules_next", "button"), callback_data=f"rule_{rule_num+1}") # type: ignore ] else: lower_buttons = [ - InlineKeyboardButton(locale("rules_prev", "button"), callback_data=f"rule_{rule_num-1}"), - InlineKeyboardButton(locale("rules_next", "button"), callback_data=f"rule_{rule_num+1}") + InlineKeyboardButton(locale("rules_prev", "button"), callback_data=f"rule_{rule_num-1}"), # type: ignore + InlineKeyboardButton(locale("rules_next", "button"), callback_data=f"rule_{rule_num+1}") # type: ignore ] try: await clb.message.edit(text=locale("rules")[rule_num-1], disable_web_page_preview=True, reply_markup=InlineKeyboardMarkup( [ [ - InlineKeyboardButton(locale("rules_home", "button"), callback_data="rules_home"), - InlineKeyboardButton(locale("rules_additional", "button"), callback_data="rules_additional") + InlineKeyboardButton(locale("rules_home", "button"), callback_data="rules_home"), # type: ignore + InlineKeyboardButton(locale("rules_additional", "button"), callback_data="rules_additional") # type: ignore ], lower_buttons ] diff --git a/modules/commands/reapply.py b/modules/commands/reapply.py index 131ead9..d628e40 100644 --- a/modules/commands/reapply.py +++ b/modules/commands/reapply.py @@ -21,25 +21,25 @@ async def cmd_reapply(app, msg): else: await msg.reply_text(locale("reapply_left_chat", "message"), reply_markup=InlineKeyboardMarkup([ [ - InlineKeyboardButton(locale("reapply_old_one", "button"), f"reapply_old_{msg.id}") + InlineKeyboardButton(locale("reapply_old_one", "button"), f"reapply_old_{msg.id}") # type: ignore ], [ - InlineKeyboardButton(locale("reapply_new_one", "button"), f"reapply_new_{msg.id}") + InlineKeyboardButton(locale("reapply_new_one", "button"), f"reapply_new_{msg.id}") # type: ignore ] ])) else: - await msg.reply_text(locale("reapply_in_progress", "message").format(locale("confirm", "keyboard")[1][0]), reply_markup=InlineKeyboardMarkup([ + await msg.reply_text(locale("reapply_in_progress", "message").format(locale("confirm", "keyboard")[1][0]), reply_markup=InlineKeyboardMarkup([ # type: ignore [ - InlineKeyboardButton(locale("applying_stop", "button"), f"reapply_stop_{msg.id}") + InlineKeyboardButton(locale("applying_stop", "button"), f"reapply_stop_{msg.id}") # type: ignore ] ])) # type: ignore else: if configGet("sent", file=str(msg.from_user.id)): await msg.reply_text(locale("reapply_forbidden", "message")) else: - await msg.reply_text(locale("reapply_in_progress", "message").format(locale("confirm", "keyboard")[1][0]), reply_markup=InlineKeyboardMarkup([ + await msg.reply_text(locale("reapply_in_progress", "message").format(locale("confirm", "keyboard")[1][0]), reply_markup=InlineKeyboardMarkup([ # type: ignore [ - InlineKeyboardButton(locale("applying_stop", "button"), f"reapply_stop_{msg.id}") + InlineKeyboardButton(locale("applying_stop", "button"), f"reapply_stop_{msg.id}") # type: ignore ] ])) # type: ignore # ============================================================================================================================== \ No newline at end of file diff --git a/modules/commands/rules.py b/modules/commands/rules.py index f4cfe37..fe7c3a6 100644 --- a/modules/commands/rules.py +++ b/modules/commands/rules.py @@ -7,8 +7,8 @@ from modules.utils import locale default_rules_markup = InlineKeyboardMarkup( [ [ - InlineKeyboardButton(locale("rules_home", "button"), callback_data="rules_home"), - InlineKeyboardButton(locale("rules_additional", "button"), callback_data="rules_additional") + InlineKeyboardButton(locale("rules_home", "button"), callback_data="rules_home"), # type: ignore + InlineKeyboardButton(locale("rules_additional", "button"), callback_data="rules_additional") # type: ignore ], [ InlineKeyboardButton("1", callback_data="rule_1"),