1.0.15: Add more errors to `query` aka `query.e500()`

pull/1/head
hikari.ftg 2022-03-31 20:44:56 +00:00
parent 1fc0b26e66
commit a5497fdf9d
4 changed files with 87 additions and 4 deletions

View File

@ -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()` - Ошибка модуля. Смотри логи

View File

@ -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(
"😶‍🌫️ <i>There is nothing here...</i>",
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(
"😶‍🌫️ <i>There is nothing here...</i>",
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(
"😶‍🌫️ <i>There is nothing here...</i>",
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(
"😶‍🌫️ <i>There is nothing here...</i>",
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,
)

View File

@ -1 +1 @@
__version__ = (1, 0, 14)
__version__ = (1, 0, 15)

View File

@ -95,7 +95,7 @@ function finish_login() {
$(".blur").fadeOut(1500);
setTimeout(() => {
window.location.href = "/";
}, response == "0" ? 10000 : 1500);
}, 8000);
})
.catch(() => {
error_state();