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

增加了微信模板回调的实现,麻烦合并 templatesendjobfinish_event 分支请求 #544

Merged
merged 3 commits into from
Mar 3, 2020
Merged

增加了微信模板回调的实现,麻烦合并 templatesendjobfinish_event 分支请求 #544

merged 3 commits into from
Mar 3, 2020

Conversation

mywaiting
Copy link
Contributor

此 PR 是针对 #541 问题的处理

微信公众号(服务号)在调用 Client 发送模板信息后,微信会将该模板信息的推送到用户微信并向开发者的服务器发送其模板信息推送的结果,详情见 公众号文档/模板消息

werobot 在处理该类事件的时候,虽然 werobot.messages.events 已经存在这个 event,但是并没有将其增加到 BaseRoBot.message_types 并且加入到 BaseRoBot 里面

我参考微信官方文档,按照 WeRoBot 的代码习惯增加代码部分实现如下:

  • BaseRoBot.message_types 增加 templatesendjobfinish_event 的引用
  • BaseRoBot 增加方法 templatesendjobfinish_event

测试部分增加/修改细节如下:

  • test_parser.pytemplatesendjobfinish_event 测试改了个名字
  • test_handler.py 增加 templatesendjobfinish_event 的调用测试

文档部分因为增加 templatesendjobfinish_event 调整如下

  • docs/handlers.rst 的表格中增加 templatesendjobfinish_event 事件的说明

测试说明:

  • 连回公司搞了个PY3.8 的环境测试了一下没有问题
  • 其他 python 版本有待 CI 的进一步测试
  • 文档的继承根据 rst 格式编写,也没有测试过

以上~

@TravisBuddy
Copy link

Hey @mywaiting,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 72ad3f80-5d68-11ea-9390-21607e5de829

@codecov
Copy link

codecov bot commented Mar 3, 2020

Codecov Report

Merging #544 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #544      +/-   ##
==========================================
+ Coverage   89.26%   89.29%   +0.02%     
==========================================
  Files          28       28              
  Lines        1435     1438       +3     
==========================================
+ Hits         1281     1284       +3     
  Misses        154      154
Impacted Files Coverage Δ
werobot/robot.py 86.89% <100%> (+0.13%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5f194e...193ec71. Read the comment docs.

@whtsky whtsky merged commit 6deee64 into offu:master Mar 3, 2020
@mywaiting mywaiting deleted the add_robot.templatesendjobfinish_event branch March 3, 2020 16:19
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.

3 participants