feat: replace View original with Open in App
All checks were successful
Build / Upload to production (push) Successful in 1m17s
All checks were successful
Build / Upload to production (push) Successful in 1m17s
y'all can always use Show information button anyway Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
f7a9bf9f13
commit
1d40f6ae5d
1 changed files with 9 additions and 12 deletions
|
@ -38,7 +38,7 @@ async def inline_query(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No
|
||||||
|
|
||||||
|
|
||||||
async def answer_query(
|
async def answer_query(
|
||||||
update: Update, context: ContextTypes.DEFAULT_TYPE, query: int, data
|
update: Update, context: ContextTypes.DEFAULT_TYPE, query: int, data
|
||||||
) -> None:
|
) -> None:
|
||||||
characters = humanize_tags_from_json(data["tag_string_character"], "no characters")
|
characters = humanize_tags_from_json(data["tag_string_character"], "no characters")
|
||||||
copyrights = humanize_tags_from_json(
|
copyrights = humanize_tags_from_json(
|
||||||
|
@ -53,6 +53,8 @@ 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}"),
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -90,8 +92,6 @@ 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()),
|
||||||
|
@ -102,15 +102,12 @@ async def answer_query(
|
||||||
" ".join(
|
" ".join(
|
||||||
[
|
[
|
||||||
HtmlFormat.code(f"#{query}"),
|
HtmlFormat.code(f"#{query}"),
|
||||||
HtmlFormat.hyperlink(
|
" ".join(
|
||||||
" ".join(
|
[
|
||||||
[
|
HtmlFormat.bold(f"{characters} ({copyrights})"),
|
||||||
HtmlFormat.bold(f"{characters} ({copyrights})"),
|
"drawn by",
|
||||||
"drawn by",
|
HtmlFormat.bold(artists),
|
||||||
HtmlFormat.bold(artists),
|
]
|
||||||
]
|
|
||||||
),
|
|
||||||
f"{config.app.protocol}://{config.app.hostname}/posts/{query}",
|
|
||||||
),
|
),
|
||||||
rating,
|
rating,
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue