Compare commits
12 commits
e5cbed59d3
...
270e1630d4
Author | SHA1 | Date | |
---|---|---|---|
270e1630d4 | |||
b079d56250 | |||
c70d7fe3be | |||
f07a51f76a | |||
df1735ef36 | |||
0cc77dd42c | |||
d646920210 | |||
0ee018e2ce | |||
7fdf18b5cb | |||
ff86c78b21 | |||
05cbca7509 | |||
b503234b85 |
2 changed files with 4 additions and 13 deletions
|
@ -7,14 +7,7 @@ from config import app
|
||||||
|
|
||||||
def humanize_tags_from_json(value: str, default: str) -> str:
|
def humanize_tags_from_json(value: str, default: str) -> str:
|
||||||
if value != "":
|
if value != "":
|
||||||
output = str()
|
return ", ".join([re.sub('_\\(.*', '', t) for t in value.split()])
|
||||||
tags = value.split()
|
|
||||||
|
|
||||||
for t in tags:
|
|
||||||
output += f"{re.sub('_\\(.*', '', t)}, "
|
|
||||||
output = output[:-2]
|
|
||||||
|
|
||||||
return output
|
|
||||||
return default
|
return default
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,7 @@ async def answer_query(update: Update, query: str, data) -> None:
|
||||||
title=f"ID: {query}",
|
title=f"ID: {query}",
|
||||||
description=f"{characters} ({copyrights}) drawn by {artists}",
|
description=f"{characters} ({copyrights}) drawn by {artists}",
|
||||||
input_message_content=InputTextMessageContent(
|
input_message_content=InputTextMessageContent(
|
||||||
f"ID: <code>{query}</code> {rating}\n"
|
f"<code>#{query}</code> <s><b>{characters} ({copyrights})</b> drawn by <b>{artists}</b></s> {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.",
|
f"This post has been removed because of a takedown request or rule violation.",
|
||||||
parse_mode=ParseMode.HTML
|
parse_mode=ParseMode.HTML
|
||||||
)
|
)
|
||||||
|
@ -66,8 +65,7 @@ async def answer_query(update: Update, query: str, data) -> None:
|
||||||
description=f"{characters} ({copyrights}) drawn by {artists}",
|
description=f"{characters} ({copyrights}) drawn by {artists}",
|
||||||
thumbnail_url=data['preview_file_url'],
|
thumbnail_url=data['preview_file_url'],
|
||||||
input_message_content=InputTextMessageContent(
|
input_message_content=InputTextMessageContent(
|
||||||
f"ID: <code>{query}</code> {rating}\n"
|
f"<code>#{query}</code> <b>{characters} ({copyrights})</b> drawn by <b>{artists}</b> {rating}",
|
||||||
f"<b>{characters} ({copyrights})</b> drawn by <b>{artists}</b>",
|
|
||||||
parse_mode=ParseMode.HTML,
|
parse_mode=ParseMode.HTML,
|
||||||
link_preview_options=LinkPreviewOptions(url=data['large_file_url'])
|
link_preview_options=LinkPreviewOptions(url=data['large_file_url'])
|
||||||
),
|
),
|
||||||
|
@ -85,7 +83,7 @@ async def invalid_query(update: Update, query: str) -> None:
|
||||||
title=f"ID: {query}",
|
title=f"ID: {query}",
|
||||||
description="Error",
|
description="Error",
|
||||||
input_message_content=InputTextMessageContent(
|
input_message_content=InputTextMessageContent(
|
||||||
f"ID: <code>{query}</code>\n"
|
f"<code>#{query}</code>\n"
|
||||||
f"That record was not found.",
|
f"That record was not found.",
|
||||||
parse_mode=ParseMode.HTML
|
parse_mode=ParseMode.HTML
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue