fix: rewrite message contents in inline_query.py
closes #3 Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
a33df8f28a
commit
28df00e34f
1 changed files with 28 additions and 10 deletions
|
@ -48,13 +48,24 @@ async def answer_query(update: Update, query: str, data) -> None:
|
||||||
title=f"ID: {query}",
|
title=f"ID: {query}",
|
||||||
description=f"{characters} ({copyrights}) drawn by {artists}",
|
description=f"{characters} ({copyrights}) drawn by {artists}",
|
||||||
input_message_content=InputTextMessageContent(
|
input_message_content=InputTextMessageContent(
|
||||||
html_parser.code(f"#{query}")
|
" ".join(
|
||||||
+ html_parser.strikethrough(
|
[
|
||||||
f" {html_parser.bold(f"{characters} ({copyrights})")}"
|
html_parser.code(f"#{query}"),
|
||||||
f"drawn by {html_parser.bold(artists)}"
|
html_parser.strikethrough(
|
||||||
|
" ".join(
|
||||||
|
[
|
||||||
|
html_parser.bold(
|
||||||
|
f"{characters} ({copyrights})"
|
||||||
|
),
|
||||||
|
"drawn by",
|
||||||
|
html_parser.bold(artists),
|
||||||
|
]
|
||||||
)
|
)
|
||||||
+ rating
|
),
|
||||||
+ "\nThis post has been removed because of a takedown request or rule violation.",
|
rating,
|
||||||
|
"\nThis post has been removed because of a takedown request or rule violation.",
|
||||||
|
]
|
||||||
|
),
|
||||||
parse_mode=ParseMode.HTML,
|
parse_mode=ParseMode.HTML,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
@ -80,8 +91,15 @@ async def answer_query(update: Update, query: str, data) -> None:
|
||||||
description=f"{characters} ({copyrights}) drawn by {artists}",
|
description=f"{characters} ({copyrights}) drawn by {artists}",
|
||||||
thumbnail_url=data["preview_file_url"],
|
thumbnail_url=data["preview_file_url"],
|
||||||
input_message_content=InputTextMessageContent(
|
input_message_content=InputTextMessageContent(
|
||||||
html_parser.code(f"#{query}")
|
" ".join(
|
||||||
+ f" {html_parser.bold(f"{characters} ({copyrights})")} drawn by {html_parser.bold(artists)} {rating}",
|
[
|
||||||
|
html_parser.code(f"#{query}"),
|
||||||
|
html_parser.bold(f"{characters} ({copyrights})"),
|
||||||
|
"drawn by",
|
||||||
|
html_parser.bold(artists),
|
||||||
|
rating,
|
||||||
|
]
|
||||||
|
),
|
||||||
parse_mode=ParseMode.HTML,
|
parse_mode=ParseMode.HTML,
|
||||||
link_preview_options=LinkPreviewOptions(url=data["large_file_url"]),
|
link_preview_options=LinkPreviewOptions(url=data["large_file_url"]),
|
||||||
),
|
),
|
||||||
|
@ -99,7 +117,7 @@ async def invalid_query(update: Update, query: str) -> None:
|
||||||
title=f"ID: {query}",
|
title=f"ID: {query}",
|
||||||
description="Error",
|
description="Error",
|
||||||
input_message_content=InputTextMessageContent(
|
input_message_content=InputTextMessageContent(
|
||||||
html_parser.code(f"#{query}") + "That record was not found.",
|
" ".join([html_parser.code(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