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
WIP: Plugin #67
WIP: Plugin #67
Conversation
go-wechaty 插件机制实现思路增加 新增加 功能调用顺序(优先级)按照注册顺序依次调用。 其中,Bot 逻辑代码与插件逻辑代码可以存在交错执行顺序。即: var bot = wechaty.NewWechaty()
bot.OnMessage(func(context *wechaty.Context, message *user.Message) {
// Part A
})
bot.Use(pluginB).Use(pluginC)
bot.OnMessage(func(context *wechaty.Context, message *user.Message) {
// Part D
} 执行顺序:Part A → pluginB → pluginC → Part D 开关
数据传递通过 Context 传递数据,数据只在本轮消息时间有效。 不支持并发读写。 对应方法:Context.SetData(), Context.GetData() |
Add plugin support for go-wechaty
Discussion: wechaty/summer#9
“开源软件供应链点亮计划-暑期2020” 为 go-wechaty 设计实现插件体系项目。