Compare commits

..

No commits in common. "3bbfb7b6922ffdc38b721fe498212dec8f70a120" and "20b8bf2432033fd59a46e752fab66ebb6d65b8ed" have entirely different histories.

3 changed files with 5 additions and 7 deletions

View file

@ -1,7 +1,7 @@
import re
def humanize_tags_from_json(value: str, default: str):
def humanize_tags_from_json(value, default):
if value != "":
output = str()
tags = value.split()
@ -14,7 +14,7 @@ def humanize_tags_from_json(value: str, default: str):
return default
def format_rating(value: str):
def format_rating(value):
match value:
case "g":
# Negative Squared Latin Capital Letter G

View file

@ -1,4 +1,3 @@
from configparser import ConfigParser
from uuid import uuid4
import requests
@ -32,8 +31,7 @@ async def inline_query(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No
await answer_query(update, query, config, data)
async def answer_query(update: Update, query: str,
config: ConfigParser, data) -> None:
async def answer_query(update, query, config, data):
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")
@ -65,7 +63,7 @@ async def answer_query(update: Update, query: str,
await update.inline_query.answer(results)
async def invalid_query(update: Update, query: str) -> None:
async def invalid_query(update, query):
results = [
InlineQueryResultArticle(
id=str(uuid4()),

View file

@ -33,7 +33,7 @@ def main() -> None:
application.run_polling(allowed_updates=Update.ALL_TYPES)
def validate_config() -> None:
def validate_config():
# noinspection PyBroadException
try:
response = requests.get(f"https://{config.get('Service', 'Domain')}/profile.json")