-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for keeping Typescript definition file up to date and fixing some bugs.
Hovewer you missed a few methods and properties in Teams and Jabber interfaces.
Please add them to make definition complete.
lib/Botkit.d.ts
Outdated
} | ||
interface TeamsConfiguration extends Configuration { | ||
clientId?: string; | ||
clientSecret?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Teams bot has more configuration options:
https://github.com/howdyai/botkit/blob/master/lib/Teams.js#L358-L368
https://github.com/howdyai/botkit/blob/master/lib/Teams.js#L209
} | ||
interface JabberController extends Controller<JabberSpawnConfiguration, JabberMessage, JabberBot> { | ||
} | ||
interface JabberMessage extends Message { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that JabberMessage has custom fields stanza and group, please add them to this interface.
https://github.com/howdyai/botkit/blob/master/lib/JabberBot.js#L192-L195
from_jid field could be useful too.
lib/Botkit.d.ts
Outdated
@@ -465,6 +489,19 @@ declare namespace botkit { | |||
interface Team { | |||
id: string; | |||
} | |||
interface TeamsBot extends Bot<TeamsSpawnConfiguration, TeamsMessage> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TeamsBot has many custom methods:
https://github.com/howdyai/botkit/blob/master/lib/Teams.js#L43-L325
interface TeamsController extends Controller<TeamsSpawnConfiguration, TeamsMessage, TeamsBot> { | ||
createWebhookEndpoints(): this; | ||
} | ||
interface TeamsMessage extends Message { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TeamsMessage has many custom fields.
https://github.com/howdyai/botkit/blob/master/lib/Teams.js#L118-L120
https://github.com/howdyai/botkit/blob/master/lib/Teams.js#L581-L588
This pull request is a good addition on its own and can be merged, but somebody will have to add missing parts of Jabber and Teams bots later. |
Thanks for reviewing! I'll work on it this week end. |
I worked for hours on TeamsBot, and found some of existing code / doc has possible bugs or outdated things. For example, in helper methods of attachment object (returned from Also, botkit's doc says It's outside of scope of this PR so I didn't fixed them. Anyway it costs too much for me, I gave up writing Jabber's interface... |
I want to use
say()
without casting bot toany
. 😃Also fixes
BotFrameworkController.createWebhookEndpoints()
acceptsTwilioSMSBot
by mistake.