shipengqi / sactive-bot Goto Github PK
View Code? Open in Web Editor NEW:smiling_imp: An extensible chat bot framework. sactive-bot is an evolution of the open source hubot project. - https://www.shipengqi.top/sactive-bot .
License: MIT License
:smiling_imp: An extensible chat bot framework. sactive-bot is an evolution of the open source hubot project. - https://www.shipengqi.top/sactive-bot .
License: MIT License
在example.js中的示例上进行修改:
robot.$.registerAPICallback('example', 'exampleforapicall', info => {
if(info.body.room==='testRoom'){
robot.messageRoom('testRoom', 'testMessage');
return Promise.resolve(info.body);
}else{
throw new Error('Error: invalid room.');
}
});
在Postman中发送正确的消息,Body:
{"room":"testRoom","message":"testMessage"}
频道正确发送消息,Postman收到返回值:
{
"code": 200,
"msg": "success.",
"data": {
"room": "testRoom",
"message": "testMessage"
}
}
当发送的消息为错误的消息,Body:
{"room":"noRoom","message":"testMessage"}
Postman收到返回值:
{
"code": 500,
"msg": "Error: invalid room."
}
在发送以上错误消息之后,重新发送正确的消息,Body:
{"room":"testRoom","message":"testMessage"}
机器人会执行正确的流程发送频道消息,但Postman收到返回值仍然是:
{
"code": 500,
"msg": "Error: invalid room."
}
重新启动机器人后,Postman中收到的返回值会恢复正确。
Hey there!
Great repo! Thanks a lot!
I get an error from the filter_middleware.
error: TypeError: Cannot read property 'startsWith' of undefined
at filterMiddleware (/Users/Rtsouroplis/Documents/GitHub/sactive-bot/lib/middlewares/filter_middleware.js:48:72)
at /Users/Rtsouroplis/Documents/GitHub/sactive-bot/node_modules/hubot/src/middleware.coffee:36:24
at /Users/Rtsouroplis/Documents/GitHub/sactive-bot/node_modules/async/lib/async.js:269:13
at iterate (/Users/Rtsouroplis/Documents/GitHub/sactive-bot/node_modules/async/lib/async.js:146:13)
at Object.async.eachSeries (/Users/Rtsouroplis/Documents/GitHub/sactive-bot/node_modules/async/lib/async.js:162:9)
at Object.async.reduce (/Users/Rtsouroplis/Documents/GitHub/sactive-bot/node_modules/async/lib/async.js:268:15)
at /Users/Rtsouroplis/Documents/GitHub/sactive-bot/node_modules/hubot/src/middleware.coffee:49:13
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
It doesn't get anything back from msg.message.user.mm.roles
as it seems.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.