From c66b52a29bf9a49b7d6d19b783494185ea747a2c Mon Sep 17 00:00:00 2001 From: mctaylors Date: Mon, 9 Jun 2025 00:01:29 +0300 Subject: [PATCH 1/2] feat: restore ability to open website from an inline query message Signed-off-by: mctaylors --- inline_query.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/inline_query.py b/inline_query.py index 527c605..eaacfb4 100644 --- a/inline_query.py +++ b/inline_query.py @@ -13,6 +13,7 @@ from telegram.constants import ParseMode from telegram.ext import ContextTypes import html_parser +from config import app from extensions import humanize_tags_from_json, format_rating, get_json @@ -102,9 +103,16 @@ async def answer_query( " ".join( [ html_parser.code(f"#{query}"), - html_parser.bold(f"{characters} ({copyrights})"), - "drawn by", - html_parser.bold(artists), + html_parser.hyperlink( + " ".join( + [ + html_parser.bold(f"{characters} ({copyrights})"), + "drawn by", + html_parser.bold(artists), + ] + ), + f"{app.protocol}://{app.hostname}/posts/{query}", + ), rating, ] ), From c64075f84d7bd5fffddf0c4f091feec29d341763 Mon Sep 17 00:00:00 2001 From: mctaylors Date: Mon, 9 Jun 2025 00:07:56 +0300 Subject: [PATCH 2/2] change: do not use from config import * Signed-off-by: mctaylors --- commands.py | 2 +- main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commands.py b/commands.py index 4f93aa3..3ea3f17 100644 --- a/commands.py +++ b/commands.py @@ -9,7 +9,7 @@ from telegram.ext import ContextTypes import html_parser from datetime import datetime, timedelta -from config import * +from config import general, app from extensions import get_json, format_rating, format_status, humanize_filesize diff --git a/main.py b/main.py index 8363813..acce5d9 100644 --- a/main.py +++ b/main.py @@ -3,7 +3,7 @@ import os from telegram.ext import CommandHandler, InlineQueryHandler, ApplicationBuilder -from config import * +from config import general logging.basicConfig( format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO