nonebot-bison
nonebot-bison copied to clipboard
:sparkles: 添加新的订阅平台 Twitter
- 添加订阅平台 Twitter
- 修改了 Readme
Codecov Report
Base: 79.68% // Head: 80.84% // Increases project coverage by +1.15%
:tada:
Coverage data is based on head (
7b10da2
) compared to base (cce34ab
). Patch coverage: 94.73% of modified lines in pull request are covered.
Additional details and impacted files
@@ Coverage Diff @@
## main #193 +/- ##
==========================================
+ Coverage 79.68% 80.84% +1.15%
==========================================
Files 46 47 +1
Lines 2722 2965 +243
==========================================
+ Hits 2169 2397 +228
- Misses 553 568 +15
Flag | Coverage Δ | |
---|---|---|
smoke-test | 80.84% <94.73%> (+1.15%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
src/plugins/nonebot_bison/platform/twitter.py | 94.73% <94.73%> (ø) |
|
src/plugins/nonebot_bison/send.py | 79.36% <0.00%> (-2.12%) |
:arrow_down: |
src/plugins/nonebot_bison/scheduler/aps.py | 100.00% <0.00%> (+5.55%) |
:arrow_up: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
当然整体完成度已经很高了
大概看了一下,看起来用 bison ScheduleConfig 向 Platform 中注入 httpx Client 的方式也可以完成代码中实现的逻辑,但是不能实现失败后reset session然后重新请求的功能,我也得想想这个怎么做
https://www.python-httpx.org/advanced/#event-hooks 或许可行?在 Response 中添加一个 Event Hook,若 403 则重新配置 session。
不太行,稍微看了一下 httpx 的源代码,event_hooks 里只能执行同步的代码,不能执行异步的逻辑。
所以要不在发现 credentials 过期的时候抛出一个异常,然后执行 ScheduleConfig 中的某个函数(暂定refresh_client
?),再重新访问