Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

AzideCupric
Copy link
Collaborator

使用 #470 中的方案2

[视频] 《明日方舟》EP - 清平乐

2月2日 清平乐 正式上架塞壬唱片官网,网易云音乐及QQ音乐等平台
塞壬唱片官网链接:https://monster-siren.hypergryph.com/m/music

【专辑介绍】
河冰晨渡,风物问谁诉?
却了火烛帷帐,地阔云低垄长。

【歌曲列表】
清平乐
来源: bilibili 明日方舟 
详情: https://www.bilibili.com/video/BV1HT4m1S7Wq

为 Post 类指定 category 字段的值即可生效

鉴于微博的神秘转发判定方法,没有实现和B站类似的 转发自xx 字段

Copy link

netlify bot commented Feb 8, 2024

Deploy Preview for nonebot-bison ready!

Name Link
🔨 Latest commit 4b036f0
🔍 Latest deploy log https://app.netlify.com/sites/nonebot-bison/deploys/65c66292a7d035000854394b
😎 Deploy Preview https://deploy-preview-471--nonebot-bison.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@AzideCupric AzideCupric added the feature New feature label Feb 8, 2024
nonebot_bison/platform/bilibili.py Outdated Show resolved Hide resolved
url=url,
pics=list(pic),
target_name=target_name,
category=self.categories[self.get_category(raw_post)].rstrip("提醒"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 rstrip 是 why

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

沿袭历史

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}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants