fix: use App.HostName (if set) in /about
oh yeah and we're also moving that strange ternary to main.py Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
a41417ee84
commit
d363fa9afd
3 changed files with 6 additions and 4 deletions
|
@ -34,16 +34,15 @@ async def inline_query(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No
|
|||
|
||||
async def answer_query(update: Update, query: str,
|
||||
config: ConfigParser, data) -> None:
|
||||
import main
|
||||
characters = humanize_tags_from_json(data['tag_string_character'], "no characters")
|
||||
copyrights = humanize_tags_from_json(data['tag_string_copyright'], "unknown copyright")
|
||||
artists = humanize_tags_from_json(data['tag_string_artist'], "unknown artist")
|
||||
rating = format_rating(data['rating'])
|
||||
hostname = config.get('App', 'HostName')
|
||||
hostname = hostname if hostname != "" else config.get('App', 'Host')
|
||||
keyboard = [
|
||||
[
|
||||
InlineKeyboardButton(f"Open in {config.get('App', 'Name')}",
|
||||
url=f"https://{hostname}/posts/{query}"),
|
||||
url=f"https://{main.hostname}/posts/{query}"),
|
||||
InlineKeyboardButton("View original", url=data['file_url'])
|
||||
]
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue