Compare commits
2 commits
1d40f6ae5d
...
e2f8653441
Author | SHA1 | Date | |
---|---|---|---|
e2f8653441 | |||
40b9ca48c9 |
1 changed files with 7 additions and 5 deletions
|
@ -53,11 +53,11 @@ async def answer_query(
|
||||||
"Show information",
|
"Show information",
|
||||||
url=helpers.create_deep_linked_url(context.bot.username, str(query)),
|
url=helpers.create_deep_linked_url(context.bot.username, str(query)),
|
||||||
),
|
),
|
||||||
InlineKeyboardButton(f"Open in {config.app.name}",
|
|
||||||
url=f"{config.app.protocol}://{config.app.hostname}/posts/{query}"),
|
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
id_string = HtmlFormat.hyperlink(f"#{query}", f"{config.app.protocol}://{config.app.hostname}/posts/{query}")
|
||||||
|
|
||||||
if data["is_banned"]:
|
if data["is_banned"]:
|
||||||
results = [
|
results = [
|
||||||
InlineQueryResultArticle(
|
InlineQueryResultArticle(
|
||||||
|
@ -67,7 +67,7 @@ async def answer_query(
|
||||||
input_message_content=InputTextMessageContent(
|
input_message_content=InputTextMessageContent(
|
||||||
" ".join(
|
" ".join(
|
||||||
[
|
[
|
||||||
HtmlFormat.code(f"#{query}"),
|
id_string,
|
||||||
HtmlFormat.strikethrough(
|
HtmlFormat.strikethrough(
|
||||||
" ".join(
|
" ".join(
|
||||||
[
|
[
|
||||||
|
@ -92,6 +92,8 @@ async def answer_query(
|
||||||
await update.inline_query.answer(results)
|
await update.inline_query.answer(results)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
keyboard[0].append(InlineKeyboardButton("View original", url=data["file_url"]))
|
||||||
|
|
||||||
results = [
|
results = [
|
||||||
InlineQueryResultArticle(
|
InlineQueryResultArticle(
|
||||||
id=str(uuid4()),
|
id=str(uuid4()),
|
||||||
|
@ -101,7 +103,7 @@ async def answer_query(
|
||||||
input_message_content=InputTextMessageContent(
|
input_message_content=InputTextMessageContent(
|
||||||
" ".join(
|
" ".join(
|
||||||
[
|
[
|
||||||
HtmlFormat.code(f"#{query}"),
|
id_string,
|
||||||
" ".join(
|
" ".join(
|
||||||
[
|
[
|
||||||
HtmlFormat.bold(f"{characters} ({copyrights})"),
|
HtmlFormat.bold(f"{characters} ({copyrights})"),
|
||||||
|
@ -129,7 +131,7 @@ async def invalid_query(update: Update, query: int) -> None:
|
||||||
title=f"#{query}",
|
title=f"#{query}",
|
||||||
description="Error",
|
description="Error",
|
||||||
input_message_content=InputTextMessageContent(
|
input_message_content=InputTextMessageContent(
|
||||||
" ".join([HtmlFormat.code(f"#{query}"), "That record was not found."]),
|
" ".join([HtmlFormat.strikethrough(f"#{query}"), "That record was not found."]),
|
||||||
parse_mode=ParseMode.HTML,
|
parse_mode=ParseMode.HTML,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue