From 822693decc56f0f598ded92b19c5559791bfd7c3 Mon Sep 17 00:00:00 2001 From: profitroll Date: Fri, 11 Aug 2023 21:33:08 +0200 Subject: [PATCH] Fixes and improvements --- locale/en.json | 6 +++--- plugins/callbacks/ban.py | 2 +- plugins/callbacks/emoji_button.py | 2 +- plugins/callbacks/nothing.py | 2 +- plugins/callbacks/verify.py | 2 +- plugins/handlers/bot_join.py | 2 +- plugins/handlers/user_join.py | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/locale/en.json b/locale/en.json index d37c6be..f85373e 100644 --- a/locale/en.json +++ b/locale/en.json @@ -4,8 +4,8 @@ "name": "English", "codes": [ "en", - "en-US", - "en-GB" + "en-GB", + "en-US" ] }, "commands": { @@ -27,7 +27,7 @@ "captcha_mistake": "Invalid answer. Remaining attempts: {remaining}.", "captcha_passed": "You have passed the captcha. Welcome!", "locale_set": "Group's language is now: {locale}", - "nothing": "This actions has already been finished.", + "nothing": "This action has already been finished.", "wrong_user": "This message is not for you." }, "buttons": { diff --git a/plugins/callbacks/ban.py b/plugins/callbacks/ban.py index 67f42f6..8b8d5f2 100644 --- a/plugins/callbacks/ban.py +++ b/plugins/callbacks/ban.py @@ -11,7 +11,7 @@ from classes.pyrogroup import PyroGroup logger = logging.getLogger(__name__) -@PyroClient.on_callback_query(filters.regex(r"ban;[\s\S]*")) +@PyroClient.on_callback_query(filters.regex(r"ban;[\s\S]*")) # type: ignore async def callback_ban(app: PyroClient, callback: CallbackQuery): group = await PyroGroup.create_if_not_exists(callback.message.chat.id, None, True) locale = group.select_locale(app, callback.message.from_user) diff --git a/plugins/callbacks/emoji_button.py b/plugins/callbacks/emoji_button.py index eb29b43..836c0c8 100644 --- a/plugins/callbacks/emoji_button.py +++ b/plugins/callbacks/emoji_button.py @@ -16,7 +16,7 @@ from classes.pyrogroup import PyroGroup logger = logging.getLogger(__name__) -@PyroClient.on_callback_query(filters.regex(r"emoji;[\s\S]*")) +@PyroClient.on_callback_query(filters.regex(r"emoji;[\s\S]*")) # type: ignore async def callback_emoji_button(app: PyroClient, callback: CallbackQuery): parsed = CallbackEmoji.from_callback(callback) group = await PyroGroup.create_if_not_exists(callback.message.chat.id, None, True) diff --git a/plugins/callbacks/nothing.py b/plugins/callbacks/nothing.py index 4d41f6d..58d6800 100644 --- a/plugins/callbacks/nothing.py +++ b/plugins/callbacks/nothing.py @@ -5,7 +5,7 @@ from classes.pyroclient import PyroClient from classes.pyrogroup import PyroGroup -@PyroClient.on_callback_query(filters.regex(r"nothing")) +@PyroClient.on_callback_query(filters.regex(r"nothing")) # type: ignore async def callback_nothing(app: PyroClient, callback: CallbackQuery): group = await PyroGroup.create_if_not_exists(callback.message.chat.id, None, True) locale = group.select_locale(app, callback.message.from_user) diff --git a/plugins/callbacks/verify.py b/plugins/callbacks/verify.py index b53b294..996d56b 100644 --- a/plugins/callbacks/verify.py +++ b/plugins/callbacks/verify.py @@ -17,7 +17,7 @@ from modules.utils import get_captcha_image logger = logging.getLogger(__name__) -@PyroClient.on_callback_query(filters.regex(r"verify;[\s\S]*")) +@PyroClient.on_callback_query(filters.regex(r"verify;[\s\S]*")) # type: ignore async def callback_verify(app: PyroClient, callback: CallbackQuery): parsed = CallbackVerify.from_callback(callback) group = await PyroGroup.create_if_not_exists(callback.message.chat.id, None, True) diff --git a/plugins/handlers/bot_join.py b/plugins/handlers/bot_join.py index 4840588..f8e82be 100644 --- a/plugins/handlers/bot_join.py +++ b/plugins/handlers/bot_join.py @@ -9,7 +9,7 @@ from classes.pyrogroup import PyroGroup logger = logging.getLogger(__name__) -@PyroClient.on_message(filters.new_chat_members & filters.group & filters.me) +@PyroClient.on_message(filters.new_chat_members & filters.group & filters.me) # type: ignore async def handler_bot_join(app: PyroClient, message: Message): logger.info("Bot has joined the group %s") await PyroGroup.create_if_not_exists(message.chat.id, None, True) diff --git a/plugins/handlers/user_join.py b/plugins/handlers/user_join.py index c35bab5..4d9f3a9 100644 --- a/plugins/handlers/user_join.py +++ b/plugins/handlers/user_join.py @@ -21,7 +21,7 @@ logger = logging.getLogger(__name__) @PyroClient.on_message( - filters.new_chat_members & filters.group & ~filters.me & ~filters.bot + filters.new_chat_members & filters.group & ~filters.me & ~filters.bot # type: ignore ) async def handler_user_join(app: PyroClient, message: Message): group = await PyroGroup.create_if_not_exists(message.chat.id, None, True)