Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Add missing methods to d.ts #1359

Merged
merged 2 commits into from
Jul 9, 2018
Merged

Add missing methods to d.ts #1359

merged 2 commits into from
Jul 9, 2018

Conversation

ypresto
Copy link
Contributor

@ypresto ypresto commented May 25, 2018

I want to use say() without casting bot to any. 😃
Also fixes BotFrameworkController.createWebhookEndpoints() accepts TwilioSMSBot by mistake.

Copy link
Contributor

@Naktibalda Naktibalda left a 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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
interface JabberController extends Controller<JabberSpawnConfiguration, JabberMessage, JabberBot> {
}
interface JabberMessage extends Message {
Copy link
Contributor

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> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interface TeamsController extends Controller<TeamsSpawnConfiguration, TeamsMessage, TeamsBot> {
createWebhookEndpoints(): this;
}
interface TeamsMessage extends Message {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Naktibalda
Copy link
Contributor

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.

@ypresto
Copy link
Contributor Author

ypresto commented Jun 1, 2018

Thanks for reviewing! I'll work on it this week end.

@ypresto
Copy link
Contributor Author

ypresto commented Jun 8, 2018

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 createHero() and createThumbnail()), the tap(type: string, title: string, payload: string) method should be tap(type: string, value: string) according to MS official reference.

Also, botkit's doc says The serviceUrl can be extracted from the incoming message payload at message.serviceUrl, but it would be message.raw_message.serviceUrl according to code.

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

@benbrown benbrown merged commit 3b332da into howdyai:master Jul 9, 2018
@ypresto ypresto deleted the update-d-ts branch July 11, 2018 14:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants