mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2026-05-09 18:27:56 +08:00
开播提醒推送的图片改为使用直播间封面 (#249)
* ✨ 为bilibili直播添加下播提醒,添加直播分区信息 🚸 开播提醒推送的图片改为使用直播间封面 * ♻️ 使用Enum * 🐛 修复bilibili发送视频动态时不推送视频标题的问题 * 🎨 调整LiveAction的注释和jaccard函数代码位置 * 🚨 修改RawPost类型定义,优化bililive类型显示
This commit is contained in:
@@ -98,3 +98,14 @@ if plugin_config.bison_filter_log:
|
||||
if config.log_level is None
|
||||
else config.log_level
|
||||
)
|
||||
|
||||
|
||||
def jaccard_text_similarity(str1: str, str2: str) -> float:
|
||||
"""
|
||||
计算两个字符串(基于字符)的
|
||||
[Jaccard相似系数](https://zh.wikipedia.org/wiki/雅卡尔指数)
|
||||
是否达到阈值
|
||||
"""
|
||||
set1 = set(str1)
|
||||
set2 = set(str2)
|
||||
return len(set1 & set2) / len(set1 | set2)
|
||||
|
||||
Reference in New Issue
Block a user