diff --git a/inline_query.py b/inline_query.py index cde8280..ca83f2d 100644 --- a/inline_query.py +++ b/inline_query.py @@ -38,7 +38,7 @@ async def inline_query(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No async def answer_query( - update: Update, context: ContextTypes.DEFAULT_TYPE, query: int, data + update: Update, context: ContextTypes.DEFAULT_TYPE, query: int, data ) -> None: characters = humanize_tags_from_json(data["tag_string_character"], "no characters") copyrights = humanize_tags_from_json( @@ -53,8 +53,6 @@ async def answer_query( "Show information", 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}"), ] ] @@ -92,6 +90,8 @@ async def answer_query( await update.inline_query.answer(results) return + keyboard[0].append(InlineKeyboardButton("View original", url=data["file_url"])) + results = [ InlineQueryResultArticle( id=str(uuid4()), @@ -102,12 +102,15 @@ async def answer_query( " ".join( [ HtmlFormat.code(f"#{query}"), - " ".join( - [ - HtmlFormat.bold(f"{characters} ({copyrights})"), - "drawn by", - HtmlFormat.bold(artists), - ] + HtmlFormat.hyperlink( + " ".join( + [ + HtmlFormat.bold(f"{characters} ({copyrights})"), + "drawn by", + HtmlFormat.bold(artists), + ] + ), + f"{config.app.protocol}://{config.app.hostname}/posts/{query}", ), rating, ]