howdyai / botkit

Botkit is an open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.
MIT License
11.48k stars 2.28k forks source link

Writing a custom adapter + types to use for Typescript #2060

Closed frank-fajardo-a142179 closed 3 years ago

frank-fajardo-a142179 commented 3 years ago

Not an issue but just questions.

I'm creating a custom adapter for LivePerson. LivePerson allows only websockets to its API. But they provide an SDK which takes care of initiating WS connection, keeping it alive and reconnecting when needed. So I do not want my adapter to redo all those.

My questions are:

  1. I made my adapter extend BotAdapter instead of WebAdapter. This is because I cannot implement getConnection(). The LivePerson SDK does not give me access to the WS connection. Is extending BotAdapter instead of WebAdapter the right approach? I noticed the WebAdapter.getConnection() is public. I'm concerned botkit is using it in conjunction with isConnected() at some point. So since I cannot fulfill that, it didn't make sense to extend WebAdapter.
  2. With Botkit Middleware, is the message passed of type BotkitMessage? We are using Typescript and I want to provide typings.

Context:

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.