Compare commits
No commits in common. "00234f691c17f4ab4e2970da127fd2a6996bc630" and "58f289d5d9f090bd38eee2d51feb7fd82ecafee3" have entirely different histories.
00234f691c
...
58f289d5d9
2 changed files with 4 additions and 27 deletions
|
@ -196,7 +196,7 @@ async def handle_inline_query(query: InlineQuery):
|
||||||
title="清理后的链接",
|
title="清理后的链接",
|
||||||
input_message_content=InputTextMessageContent(
|
input_message_content=InputTextMessageContent(
|
||||||
message_text=Text(ExpandableBlockQuote(result)).as_markdown(),
|
message_text=Text(ExpandableBlockQuote(result)).as_markdown(),
|
||||||
parse_mode=ParseMode.MARKDOWN_V2
|
parse_mode=ParseMode.MARKDOWN
|
||||||
),
|
),
|
||||||
description=f"发送清理后的链接:{result}"
|
description=f"发送清理后的链接:{result}"
|
||||||
)
|
)
|
||||||
|
@ -293,26 +293,8 @@ async def handle_inline_query(query: InlineQuery):
|
||||||
message_text="小娜😭",
|
message_text="小娜😭",
|
||||||
parse_mode=ParseMode.MARKDOWN
|
parse_mode=ParseMode.MARKDOWN
|
||||||
),
|
),
|
||||||
description="很抱歉,我还不能理解你说的内容,但你可以试试:"
|
description="很抱歉,我还不能理解你说的内容。"
|
||||||
),
|
)
|
||||||
InlineQueryResultArticle(
|
|
||||||
id="3",
|
|
||||||
title=f"全 部 加 上 空 格",
|
|
||||||
input_message_content=InputTextMessageContent(
|
|
||||||
message_text=" ".join(query_text),
|
|
||||||
parse_mode=ParseMode.MARKDOWN
|
|
||||||
),
|
|
||||||
description="很臭的功能"
|
|
||||||
),
|
|
||||||
InlineQueryResultArticle(
|
|
||||||
id="4",
|
|
||||||
title=f"命令列表",
|
|
||||||
input_message_content=InputTextMessageContent(
|
|
||||||
message_text=query_text,
|
|
||||||
parse_mode=ParseMode.MARKDOWN
|
|
||||||
),
|
|
||||||
description="search, pg, anuo, 将军"
|
|
||||||
),
|
|
||||||
], cache_time=0)
|
], cache_time=0)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -222,10 +222,6 @@ def transform_into_fixed_url(url):
|
||||||
return urlunparse(parsed_url._replace(netloc='www.douyin.com'))
|
return urlunparse(parsed_url._replace(netloc='www.douyin.com'))
|
||||||
if parsed_url.hostname in ['youtu.be','m.youtube.com']:
|
if parsed_url.hostname in ['youtu.be','m.youtube.com']:
|
||||||
# 把 youtu.be 和 m.youtube.com 的链接转换为 www.youtube.com
|
# 把 youtu.be 和 m.youtube.com 的链接转换为 www.youtube.com
|
||||||
if parsed_url.hostname == 'youtu.be':
|
|
||||||
# youtu.be 的链接需要把 path 的 / 替换为 v 参数
|
|
||||||
video_id = parsed_url.path.lstrip('/')
|
|
||||||
return urlunparse(parsed_url._replace(netloc='www.youtube.com', path='/watch', query=urlencode({'v': video_id})))
|
|
||||||
return urlunparse(parsed_url._replace(netloc='www.youtube.com'))
|
return urlunparse(parsed_url._replace(netloc='www.youtube.com'))
|
||||||
return url
|
return url
|
||||||
|
|
||||||
|
@ -294,8 +290,7 @@ async def handle_links(message: Message):
|
||||||
# 回复处理后的链接
|
# 回复处理后的链接
|
||||||
if final_urls:
|
if final_urls:
|
||||||
await message.reply(
|
await message.reply(
|
||||||
f"<blockquote expandable>{"\n\n".join(final_urls)}\n</blockquote>\n消息里有需要被处理的链接,"
|
f"<blockquote expandable>{"\n\n".join(final_urls)}\n</blockquote>\n消息里有包含跟踪参数的链接,已经帮你转换了哦~\n\n"
|
||||||
f"已经帮你处理了哦~\n\n"
|
|
||||||
f"注意:这个功能是试验性的,可能会出现问题。"
|
f"注意:这个功能是试验性的,可能会出现问题。"
|
||||||
f"\n如果你找到了问题,欢迎"
|
f"\n如果你找到了问题,欢迎"
|
||||||
f"把它通过 <code>/report_broken_links 链接 需要去除的参数等等</code> 报告给开发者!")
|
f"把它通过 <code>/report_broken_links 链接 需要去除的参数等等</code> 报告给开发者!")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue