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

[Feature Request] 重构部分实现 #464

Open
mobyw opened this issue Aug 18, 2023 · 2 comments
Open

[Feature Request] 重构部分实现 #464

mobyw opened this issue Aug 18, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@mobyw
Copy link
Contributor

mobyw commented Aug 18, 2023

功能需求

目前 NoneBot 社区已有一些较为完善的 Bot 基础设施,可以考虑用在本项目中。例如:

  • 数据存储管理
  • 多适配器管理

理由

数据存储管理

目前 RSS 订阅配置及拉取的数据是直接保存在 ./data 文件夹下,而大部分其他插件是在该文件下新建了一个插件数据文件夹存放数据,不方便进行插件数据文件的管理,可以进行以下改进:

  • NoneBot 提供了 nonebot-plugin-localstore 插件获取插件的数据与缓存文件夹,方便统一管理。
  • 社区提供的 nonebot-plugin-datastore 插件在官方插件的基础上添加了数据库操作支持,更方便进行数据库的管理、升级与迁移。

多适配器管理

目前项目只支持 OneBot V11 适配器,社区提供的 nonebot-plugin-send-anything-anywhere 插件已对 OneBot v11, OneBot v12, QQ Guild, Kaiheila, Telegram, Feishu 适配器进行适配,以实现统一的消息接收与发送功能,通过该插件可以从接收到的消息中提取出消息对象,该消息对象可在主动推送消息时使用。

多 Bot 实例管理

结合上述“多适配器管理”的消息对象以及 bot_id,即可支持多 Bot 实例的管理。

其他

订阅的逻辑可以修改为进超级管理员可以操作的全局订阅以及区分消息对象的普通订阅,不同消息对象的订阅相互隔离,可以解决订阅的编辑权限问题。

由于添加以上特性后改动过大,需要进行数据迁移等操作,建议提高一个大版本号,如果觉得可以的话可以开一个分支,我过段时间重构一下 PR。

@mobyw mobyw added the enhancement New feature or request label Aug 18, 2023
@Quan666
Copy link
Owner

Quan666 commented Aug 21, 2023

@NekoAria 你怎么看

@NekoAria
Copy link
Collaborator

我没意见。
我是没动力重构了(

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

No branches or pull requests

3 participants