change: update config.ini
use definitions from danbooru dotenv, add comments Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
895f27470f
commit
496ea38b5c
4 changed files with 19 additions and 11 deletions
|
@ -21,7 +21,7 @@ async def inline_query(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No
|
|||
return
|
||||
|
||||
from main import config
|
||||
response = requests.get(f"http://{config.get('Service', 'Domain')}/posts/{query}.json")
|
||||
response = requests.get(f"http://{config.get('App', 'Host')}/posts/{query}.json")
|
||||
|
||||
if response.status_code != 200:
|
||||
await invalid_query(update, query)
|
||||
|
@ -40,8 +40,8 @@ async def answer_query(update: Update, query: str,
|
|||
rating = format_rating(data['rating'])
|
||||
keyboard = [
|
||||
[
|
||||
InlineKeyboardButton(f"Open in {config.get('Service', 'Name')}",
|
||||
url=f"https://{config.get('Service', 'PublicDomain')}/posts/{query}"),
|
||||
InlineKeyboardButton(f"Open in {config.get('App', 'Name')}",
|
||||
url=f"https://{config.get('App', 'HostName')}/posts/{query}"),
|
||||
InlineKeyboardButton("View original", url=data['file_url'])
|
||||
]
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue