Comments (6)
Yes, there was an API change between 7 and v9. Specifically, the move to async/await style code. The code above would look like the following for v9:
robot.receiveMiddleware(async context => {
var text = context.response.message.text;
var newText = mapping.process(text);
if (text != newText) {
context.response.message.text = newText;
if (robot.logger) {
robot.logger.info(`Routing '${text}' to '${newText}'.`);
}
}
return true;
});
Returning true
will tell the code to continue the pipeline. Returning false
will halt the pipeline. Looking at robot.receive, you'll see the infrastructure that does this.
Please let me know how you move forward. I haven't seen much feedback after resuscitating Hubot's development and am super curious to hear, collaborate and see the community that's still using Hubot.
from hubot.
Awesome! Let me upgrade some code. Looks like we also need to update hubot-mock-adapter
.
from hubot.
Fortunately the upgrade was not very hard: KeesCBakker/hubot-command-mapper@2504fd5
from hubot.
@KeesCBakker I'm really glad to hear that. I've been making some big moves in the codebase with very little feedback to guide decisions.
What are your thoughts about closing this issue?
from hubot.
Yeah, we can close it. Should I open a new ticket for the mock adapter peer dependency?
from hubot.
@KeesCBakker yes please. That way it stands out as I continue to monitor issues from the main repo page.
from hubot.
Related Issues (20)
- Periodic unit test failure on Windows related to loading an adapter by file name
- Update the license HOT 6
- hubot-test-helper broke due to change to Robot constructor HOT 5
- Using Organization Scoped packages as adapters
- Roadmap. The march to `v10` HOT 4
- Does `Response.envelope` really need include the `message` object too? HOT 2
- Hubot Health/Monitoring HOT 11
- Using async calls in hubot scripts HOT 2
- Switch site to GitHub pages HOT 3
- Hubot doesn't respond to `@Hubot help`
- Web service test fails in Node.js 21 HOT 2
- Update some of the modules in the Hubot ecosystem HOT 1
- The road to v11, let's get Hubot caught up to the latest changes in Javascript and Node.js
- `./bin/hubot --help` doesn't work HOT 1
- Test failing on Windows HOT 1
- CoffeeScript removal is in v10.0.4 HOT 1
- Windows: Unable to load script file HOT 1
- Running hubot -a @hubot-friends/hubot-ms-teams fails HOT 1
- Testing Hubot with Express 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hubot.