diff --git a/docs/inline.md b/docs/inline.md index c9899d1..ec96fee 100755 --- a/docs/inline.md +++ b/docs/inline.md @@ -279,6 +279,13 @@ await query.answer( from .. import utils ``` Затем можно указывать rand(20) в значении атрибута id -### Полезные сокращения -`await query.e404()` - Уведомляет пользователя о том, что требуемый результат не найден + +### Полезные сокращения + +`await query.e400()` - Неверные аргументы +`await query.e403()` - Недостаточно прав для доступа к ресурсу +`await query.e404()` - Требуемый результат не найден +`await query.e426()` - Необходимо обновление юзербота +`await query.e500()` - Ошибка модуля. Смотри логи + diff --git a/hikka/inline/types.py b/hikka/inline/types.py index 173d22d..8dbf3d0 100644 --- a/hikka/inline/types.py +++ b/hikka/inline/types.py @@ -59,6 +59,44 @@ class InlineQuery: else "" ) + async def e400(self) -> None: + await self.answer( + [ + InlineQueryResultArticle( + id=utils.rand(20), + title="🚫 400", + description="Bad request. You need to pass right arguments, follow module's documentation", + input_message_content=InputTextMessageContent( + "😶‍🌫️ There is nothing here...", + parse_mode="HTML", + ), + thumb_url="https://img.icons8.com/color/344/swearing-male--v1.png", + thumb_width=128, + thumb_height=128, + ) + ], + cache_time=0, + ) + + async def e403(self) -> None: + await self.answer( + [ + InlineQueryResultArticle( + id=utils.rand(20), + title="🚫 403", + description="You have no permissions to access this result", + input_message_content=InputTextMessageContent( + "😶‍🌫️ There is nothing here...", + parse_mode="HTML", + ), + thumb_url="https://img.icons8.com/external-wanicon-flat-wanicon/344/external-forbidden-new-normal-wanicon-flat-wanicon.png", + thumb_width=128, + thumb_height=128, + ) + ], + cache_time=0, + ) + async def e404(self) -> None: await self.answer( [ @@ -77,3 +115,41 @@ class InlineQuery: ], cache_time=0, ) + + async def e426(self) -> None: + await self.answer( + [ + InlineQueryResultArticle( + id=utils.rand(20), + title="🚫 426", + description="You need to update Hikka before sending this request", + input_message_content=InputTextMessageContent( + "😶‍🌫️ There is nothing here...", + parse_mode="HTML", + ), + thumb_url="https://img.icons8.com/fluency/344/approve-and-update.png", + thumb_width=128, + thumb_height=128, + ) + ], + cache_time=0, + ) + + async def e500(self) -> None: + await self.answer( + [ + InlineQueryResultArticle( + id=utils.rand(20), + title="🚫 500", + description="Internal userbot error while processing request. More info in logs", + input_message_content=InputTextMessageContent( + "😶‍🌫️ There is nothing here...", + parse_mode="HTML", + ), + thumb_url="https://img.icons8.com/external-vitaliy-gorbachev-flat-vitaly-gorbachev/344/external-error-internet-security-vitaliy-gorbachev-flat-vitaly-gorbachev.png", + thumb_width=128, + thumb_height=128, + ) + ], + cache_time=0, + ) diff --git a/hikka/version.py b/hikka/version.py index 198f316..6b28a74 100644 --- a/hikka/version.py +++ b/hikka/version.py @@ -1 +1 @@ -__version__ = (1, 0, 14) +__version__ = (1, 0, 15) diff --git a/web-resources/static/root.js b/web-resources/static/root.js index c47e646..4e40ce2 100644 --- a/web-resources/static/root.js +++ b/web-resources/static/root.js @@ -95,7 +95,7 @@ function finish_login() { $(".blur").fadeOut(1500); setTimeout(() => { window.location.href = "/"; - }, response == "0" ? 10000 : 1500); + }, 8000); }) .catch(() => { error_state();