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

separate adapters #16

Merged
merged 4 commits into from
May 14, 2023
Merged

separate adapters #16

merged 4 commits into from
May 14, 2023

Conversation

MeetWq
Copy link
Member

@MeetWq MeetWq commented May 10, 2023

No description provided.

@MeetWq MeetWq requested a review from he0119 May 10, 2023 12:08
Copy link
Collaborator

@he0119 he0119 left a comment

Choose a reason for hiding this comment

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

多适配器的注册方式要不要改一改?

onebot_v12 = "OneBot V12"


def get_message_class_by_adapter_name(adapter_name: str) -> Type[Message]:
Copy link
Collaborator

@he0119 he0119 May 10, 2023

Choose a reason for hiding this comment

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

这个要不要弄成和 saa 差不多的那种 register 呢?然后在每个文件中单独注册。

@overload
def deserialize_message(msg: JsonMsg, msg_class: Type[V11Msg]) -> V11Msg:
...
def serialize_message(msg: Message) -> JsonMsg:
Copy link
Collaborator

Choose a reason for hiding this comment

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

这些地方也是,可以单独注册处理函数。

@codecov-commenter
Copy link

codecov-commenter commented May 11, 2023

Codecov Report

Patch coverage: 83.57% and project coverage change: +1.52 🎉

Comparison is base (3288496) 84.59% compared to head (d185e50) 86.11%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #16      +/-   ##
==========================================
+ Coverage   84.59%   86.11%   +1.52%     
==========================================
  Files           8       15       +7     
  Lines         305      389      +84     
==========================================
+ Hits          258      335      +77     
- Misses         47       54       +7     
Impacted Files Coverage Δ
nonebot_plugin_chatrecorder/adapters/exception.py 50.00% <50.00%> (ø)
nonebot_plugin_chatrecorder/adapters/onebot_v11.py 70.27% <70.27%> (ø)
nonebot_plugin_chatrecorder/adapters/utils.py 88.88% <88.88%> (ø)
nonebot_plugin_chatrecorder/adapters/onebot_v12.py 90.69% <90.69%> (ø)
nonebot_plugin_chatrecorder/adapters/message.py 92.50% <92.50%> (ø)
nonebot_plugin_chatrecorder/__init__.py 100.00% <100.00%> (+7.01%) ⬆️
nonebot_plugin_chatrecorder/adapters/__init__.py 100.00% <100.00%> (ø)
nonebot_plugin_chatrecorder/adapters/consts.py 100.00% <100.00%> (ø)
nonebot_plugin_chatrecorder/config.py 100.00% <100.00%> (ø)
nonebot_plugin_chatrecorder/dirs.py 100.00% <100.00%> (ø)
... and 3 more

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MeetWq MeetWq requested a review from he0119 May 11, 2023 02:09
@MeetWq MeetWq merged commit e1a8957 into main May 14, 2023
14 checks passed
@MeetWq MeetWq deleted the change/adapters branch July 27, 2023 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants