GithubHelp home page GithubHelp logo

Comments (6)

joeyguerra avatar joeyguerra commented on June 10, 2024

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.

KeesCBakker avatar KeesCBakker commented on June 10, 2024

Awesome! Let me upgrade some code. Looks like we also need to update hubot-mock-adapter.

image

from hubot.

KeesCBakker avatar KeesCBakker commented on June 10, 2024

Fortunately the upgrade was not very hard: KeesCBakker/hubot-command-mapper@2504fd5

from hubot.

joeyguerra avatar joeyguerra commented on June 10, 2024

@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.

KeesCBakker avatar KeesCBakker commented on June 10, 2024

Yeah, we can close it. Should I open a new ticket for the mock adapter peer dependency?

from hubot.

joeyguerra avatar joeyguerra commented on June 10, 2024

@KeesCBakker yes please. That way it stands out as I continue to monitor issues from the main repo page.

from hubot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.