diff --git a/CHANGELOG.md b/CHANGELOG.md index e9c8c78..9fef36d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ - Add switch to mute @BotFather only once in hikka inline - Add ability to forbid certain tl methods using `.config APIRatelimiter` - Add new web interface design +- Add new code input design +- Add new 2fa password input design - Add ability to set custom emojis in `.info` using command `.setinfo`. In order to use it, remove buttons using config - Patch internal help module with bugfixes - Clean type-hint mess, document utils and other methods, which were undocumented @@ -37,6 +39,7 @@ - Enable `joinChannel` and `importChatInvite` calls-by-external-modules blockage for all users by default - Change inline query placeholder to `user@hikka:~$` + legacy migration - Completely drop Heroku support due to legacy code, limits and removing of free tier +- Allow user to send code only once to prevent FloodWaits ## 🌑 Hikka 1.4.2 diff --git a/hikka/main.py b/hikka/main.py index 7165065..d0b0735 100755 --- a/hikka/main.py +++ b/hikka/main.py @@ -81,6 +81,7 @@ try: except Exception: pass + def run_config(data_root: str): """Load configurator.py""" from . import configurator @@ -375,10 +376,7 @@ class Hikka: importlib.invalidate_caches() self._get_api_token() - async def save_client_session( - self, - client: CustomTelegramClient - ): + async def save_client_session(self, client: CustomTelegramClient): if hasattr(client, "_tg_id"): telegram_id = client._tg_id else: diff --git a/hikka/modules/loader.py b/hikka/modules/loader.py index 3036aec..fa5b548 100755 --- a/hikka/modules/loader.py +++ b/hikka/modules/loader.py @@ -732,14 +732,11 @@ class LoaderMod(loader.Module): await utils.answer(message, self.strings("bad_unicode")) return - if ( - not self._db.get( - main.__name__, - "disable_modules_fs", - False, - ) - and not self._db.get(main.__name__, "permanent_modules_fs", False) - ): + if not self._db.get( + main.__name__, + "disable_modules_fs", + False, + ) and not self._db.get(main.__name__, "permanent_modules_fs", False): if message.file: await message.edit("") message = await message.respond("🌘") diff --git a/hikka/modules/updater.py b/hikka/modules/updater.py index af05298..01c8752 100755 --- a/hikka/modules/updater.py +++ b/hikka/modules/updater.py @@ -340,7 +340,9 @@ class UpdaterMod(loader.Module): or not self.inline.init_complete or not await self.inline.form( message=message, - text=self.strings("update_confirm").format(current, current[:8], upcoming, upcoming[:8]) + text=self.strings("update_confirm").format( + current, current[:8], upcoming, upcoming[:8] + ) if upcoming != current else self.strings("no_update"), reply_markup=[ diff --git a/hikka/web/root.py b/hikka/web/root.py index 3362946..eef2ff0 100644 --- a/hikka/web/root.py +++ b/hikka/web/root.py @@ -206,6 +206,9 @@ class Web: if not self._check_session(request): return web.Response(status=401, body="Authorization required") + if self._pending_client: + return web.Response(status=208, body="Already pending") + text = await request.text() phone = telethon.utils.parse_phone(text) diff --git a/web-resources/root.jinja2 b/web-resources/root.jinja2 index 7bb8a67..c972ebd 100755 --- a/web-resources/root.jinja2 +++ b/web-resources/root.jinja2 @@ -29,6 +29,12 @@