-
Notifications
You must be signed in to change notification settings - Fork 36
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
forbid adding platform that needs browser in no-browser env #609
Conversation
✅ Deploy Preview for nonebot-bison ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #609 +/- ##
=======================================
Coverage 85.28% 85.29%
=======================================
Files 91 91
Lines 4777 4787 +10
=======================================
+ Hits 4074 4083 +9
- Misses 703 704 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
nonebot_bison/sub_manager/add_sub.py
Outdated
@@ -39,6 +40,8 @@ async def parse_platform(state: T_State, platform: str = ArgPlainText()) -> None | |||
elif platform == "取消": | |||
await add_sub.finish("已中止订阅") | |||
elif platform in platform_manager: | |||
if platform_manager[platform].site.require_browser and not plugin_config.bison_use_browser: |
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.
感觉提供一个platform_manager.active_platforms
好一点
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.
这样就不知道为什么某个 platform 添加不了咯
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.
这个在注册阶段日志提醒一下就好吧,订阅的时候让他自己检查日志?不然这里看着也太丑了(
或者加一个inactive_platforms,记录[{"platform_name": "xxx", "reason": "xxx"}]
?
83aa7c4
to
eccf0e3
Compare
6d38c94
to
a84379f
Compare
a84379f
to
9af49f4
Compare
|
||
|
||
# platform => reason for not available | ||
unavailable_paltforms: dict[str, str] = _get_unavailable_platforms() |
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.
话说为什么unavailable_paltforms不是platform_manager的方法
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.
platform_manager 是个 dict
fix #539