-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Post 添加 category 字段使消息首部可以显示分类信息 #471
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for nonebot-bison ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
url=url, | ||
pics=list(pic), | ||
target_name=target_name, | ||
category=self.categories[self.get_category(raw_post)].rstrip("提醒"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 rstrip 是 why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
沿袭历史
nonebot-bison/nonebot_bison/platform/bilibili.py
Lines 331 to 335 in e165d4e
async def parse(self, raw_post: Info) -> Post: | |
url = f"https://live.bilibili.com/{raw_post.room_id}" | |
pic = [raw_post.cover] if raw_post.category == Category(1) else [raw_post.keyframe] | |
title = f"[{self.categories[raw_post.category].rstrip('提醒')}] {raw_post.title}" | |
target_name = f"{raw_post.uname} {raw_post.area_name}" |
使用 #470 中的方案2
为 Post 类指定 category 字段的值即可生效
鉴于微博的神秘转发判定方法,没有实现和B站类似的 转发自xx 字段