diff --git a/hikka/inline/bot_interaction.py b/hikka/inline/bot_interaction.py index 8c16a10..c1d5d30 100644 --- a/hikka/inline/bot_interaction.py +++ b/hikka/inline/bot_interaction.py @@ -32,7 +32,7 @@ class BotInteractions(InlineUnit): return self.fsm.get(str(user), False) - async def _bot_message_answer( + async def _bot_message_answer( # skipcq: PYL-E0213 mod, text: str = None, message: AiogramMessage = None, diff --git a/hikka/inline/core.py b/hikka/inline/core.py index 03355f0..6ad7d67 100644 --- a/hikka/inline/core.py +++ b/hikka/inline/core.py @@ -11,16 +11,14 @@ # 🌐 https://www.gnu.org/licenses/agpl-3.0.html from aiogram import Bot, Dispatcher +from aiogram.utils.exceptions import Unauthorized, TerminatedByOtherGetUpdates import time import asyncio from telethon.errors.rpcerrorlist import InputUserDeactivatedError - from telethon.utils import get_display_name -from aiogram.utils.exceptions import Unauthorized, TerminatedByOtherGetUpdates - from .gallery import Gallery from .form import Form from .bot_interaction import BotInteractions diff --git a/hikka/inline/token_obtainment.py b/hikka/inline/token_obtainment.py index cb34c7a..9fae9f7 100644 --- a/hikka/inline/token_obtainment.py +++ b/hikka/inline/token_obtainment.py @@ -37,12 +37,12 @@ class TokenObtainment(InlineUnit): uid = utils.rand(6) username = f"hikka_{uid}_bot" - for msg in { + for msg in [ f"👩‍🎤 Hikka Userbot of {self._name}", username, "/setuserpic", username, - }: + ]: m = await conv.send_message(msg) r = await conv.get_response() @@ -154,7 +154,7 @@ class TokenObtainment(InlineUnit): # Enable inline mode or change its # placeholder in case it is not set - for msg in { + for msg in [ "/setinline", button.text, "HikkaQuery", @@ -163,7 +163,7 @@ class TokenObtainment(InlineUnit): "Enabled", "/setuserpic", button.text, - }: + ]: m = await conv.send_message(msg) r = await conv.get_response() diff --git a/hikka/inline/types.py b/hikka/inline/types.py index 939760b..78ae9cf 100644 --- a/hikka/inline/types.py +++ b/hikka/inline/types.py @@ -2,6 +2,7 @@ from aiogram.types import Message as AiogramMessage, InlineQuery as AiogramInlin class InlineCall: + """Modified version of original Aiogram CallbackQuery""" def __init__(self): self.delete = None self.unload = None @@ -10,16 +11,19 @@ class InlineCall: class InlineUnit: + """InlineManager extension type. For internal use only""" def __init__(self): - pass + """Made just for type specification""" class BotMessage(AiogramMessage): + """Modified version of original Aiogram Message""" def __init__(self): super().__init__() class InlineQuery: + """Modified version of original Aiogram InlineQuery""" def __init__(self, inline_query: AiogramInlineQuery) -> None: self.inline_query = inline_query diff --git a/web-resources/static/root.js b/web-resources/static/root.js index bd7e311..c47e646 100644 --- a/web-resources/static/root.js +++ b/web-resources/static/root.js @@ -82,7 +82,7 @@ function finish_login() { credentials: "include" }) .then(response => response.text()) - .then(function (response) { + .then((response) => { window.expanse = true; if(response == "0") { setTimeout(() => { @@ -97,7 +97,7 @@ function finish_login() { window.location.href = "/"; }, response == "0" ? 10000 : 1500); }) - .catch(function () { + .catch(() => { error_state(); error_message("Login confirmation error"); }); @@ -108,7 +108,7 @@ function tg_code() { method: "POST", body: `${_tg_pass}\n${_phone}\n${_2fa_pass}` }) - .then(function (response) { + .then((response) => { if (!response.ok) { if (response.status == 403) { error_state(); @@ -186,7 +186,7 @@ function process_next() { return; } - _api_id = parseInt(api_id); + _api_id = parseInt(api_id, 10); switch_block("api_hash"); return; @@ -206,7 +206,7 @@ function process_next() { body: _api_hash + _api_id, credentials: "include" }) - .then(function (response) { + .then((response) => { if (!response.ok) { error_state(); error_message("Error occured while saving credentials") @@ -214,7 +214,7 @@ function process_next() { switch_block("phone"); } }) - .catch(function () { + .catch(() => { error_state(); error_message("Error occured while saving credentials") }); @@ -235,7 +235,7 @@ function process_next() { body: _phone, credentials: "include" }) - .then(function (response) { + .then((response) => { if (!response.ok) { error_state(); error_message("Code send failed"); @@ -257,7 +257,7 @@ function process_next() { }) } }) - .catch(function () { + .catch(() => { error_state(); error_message("Code send failed"); });