fix: add is_banned check
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
05cbca7509
commit
ff86c78b21
1 changed files with 19 additions and 0 deletions
|
@ -35,6 +35,25 @@ async def answer_query(update: Update, query: str, data) -> None:
|
|||
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'])
|
||||
|
||||
if data['is_banned']:
|
||||
results = [
|
||||
InlineQueryResultArticle(
|
||||
id=str(uuid4()),
|
||||
title=f"ID: {query}",
|
||||
description=f"{characters} ({copyrights}) drawn by {artists}",
|
||||
input_message_content=InputTextMessageContent(
|
||||
f"ID: <code>{query}</code> {rating}\n"
|
||||
f"<s><b>{characters} ({copyrights})</b> drawn by <b>{artists}</b></s>\n"
|
||||
f"This post has been removed because of a takedown request or rule violation.",
|
||||
parse_mode=ParseMode.HTML
|
||||
)
|
||||
)
|
||||
]
|
||||
|
||||
await update.inline_query.answer(results)
|
||||
return
|
||||
|
||||
keyboard = [
|
||||
[
|
||||
InlineKeyboardButton(f"Open in {app.name}",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue