feat: add token in config.ini
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
6ec797a387
commit
1178c80831
4 changed files with 24 additions and 12 deletions
|
@ -20,7 +20,7 @@ async def inline_query(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No
|
|||
return
|
||||
|
||||
from main import config
|
||||
response = requests.get(f"https://{config.get('General', 'Domain')}/posts/{query}.json")
|
||||
response = requests.get(f"https://{config.get('Service', 'Domain')}/posts/{query}.json")
|
||||
|
||||
if response.status_code != 200:
|
||||
await invalid_query(update, query)
|
||||
|
@ -37,8 +37,8 @@ async def answer_query(update, query, config, data):
|
|||
artists = humanize_tags_from_json(data['tag_string_artist'], "unknown artist")
|
||||
keyboard = [
|
||||
[
|
||||
InlineKeyboardButton(f"Open in {config.get('General', 'Name')}",
|
||||
url=f"https://{config.get('General', 'Domain')}/posts/{query}"),
|
||||
InlineKeyboardButton(f"Open in {config.get('Service', 'Name')}",
|
||||
url=f"https://{config.get('Service', 'Domain')}/posts/{query}"),
|
||||
InlineKeyboardButton("View original", url=data['file_url'])
|
||||
]
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue