GithubHelp home page GithubHelp logo

Comments (7)

pgoldweic avatar pgoldweic commented on June 11, 2024 1

Thanks again @benbrown for your help. I'll check it out.

from botkit.

pgoldweic avatar pgoldweic commented on June 11, 2024 1

Perfect. Thanks @benbrown

from botkit.

benbrown avatar benbrown commented on June 11, 2024

It looks like there is not a great way to handle this error if you use the automatically created webhook endpoints. However, you can manage your own endpoint and call the adapter directly as seen in the example below:

controller.webserver.post('/api/facebook', (req, res) => {

from botkit.

benbrown avatar benbrown commented on June 11, 2024

@pgoldweic let me know if I can help more...

from botkit.

pgoldweic avatar pgoldweic commented on June 11, 2024

Thanks @benbrown for your input here. I have two follow-up questions though:
1- Since I don't create the built-in Botkit adapter (which is the one used for Microsoft's webchat), how do I reference it so that I can call its 'processActivity' method? (this is what's used in the example you shared - thanks for pointing to this code), and also,
2- Is there any disadvantage in defining manually the webhook endpoint in this manner vs. using the automated one? (meaning, is there more that needs to be implemented, or does that code example reflect the totality of what's needed?).
Thanks in advance.

from botkit.

benbrown avatar benbrown commented on June 11, 2024
  1. You would tell botkit NOT to create the webhook automatically. Basically, you would disable the built in feature, and provide your own version.

To do this, you actually need to set up your own instance of Express, then set up the /api/messages endpoint.

That said, you can basically copy the code from inside Botkit:
https://github.com/howdyai/botkit/blob/main/packages/botkit/src/core.ts#L374

Alas, It is a little bit involved.

  1. There shouldn't be any major disadvantage. Just make sure to set up the express instance with the same options that Botkit would internally.

from botkit.

benbrown avatar benbrown commented on June 11, 2024

@pgoldweic I created a sample that demonstrates how to use your own instance of Express, thus gain access to some of these internal features.

https://github.com/howdyai/botkit/blob/main/packages/testbot/custom_express.js

from botkit.

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.