Skip to content

Commit

Permalink
Merge branch 'main' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
benbrown authored Aug 21, 2020
2 parents c78b68f + d2d093f commit 93944fe
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 10 deletions.
4 changes: 4 additions & 0 deletions packages/botbuilder-adapter-slack/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# botbuilder-adapter-slack changelog

# 1.0.12

* Adjust startPrivateConversation to use converations.open instead of im.open

# 1.0.11

* Update dependencies to Botkit 4.9, Bot Framework 4.9
Expand Down
2 changes: 1 addition & 1 deletion packages/botbuilder-adapter-slack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "botbuilder-adapter-slack",
"version": "1.0.11",
"version": "1.0.12",
"description": "Connect Botkit or BotBuilder to Slack",
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions packages/botbuilder-adapter-slack/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ Botkit will automatically construct your outgoing messages according to Slack's

The preferred way of composing interactive messages is using Slack's Block Kit. [Read the official Slack documentation here](https://api.slack.com/messaging/composing/layouts). Slack provides a UI to help create your interactive messages. Check out [Block Kit Builder](https://api.slack.com/tools/block-kit-builder).

Additionally, there are open-source libraries available that assist with building out UIs for Slack:

* [**Block Builder**](https://github.com/raycharius/slack-block-builder) – Zero-dependency library, with a SwiftUI-like builder syntax.
* [**JSX-Slack**](https://github.com/speee/jsx-slack) – JSX that transpiles to Slack API-compatible JSON.

Interactive messages using blocks can be sent via any of Botkit's built in functions by passing in the appropriate "blocks" as part of the message. Here is an example:

```javascript
Expand Down
2 changes: 1 addition & 1 deletion packages/botbuilder-adapter-slack/src/botworker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class SlackBotWorker extends BotWorker {
*/
public async startPrivateConversation(userId: string): Promise<any> {
// create the new IM channel
const channel: any = await this.api.im.open({ user: userId });
const channel: any = await this.api.conversations.open({ users: userId });

if (channel.ok === true) {
// now, switch contexts
Expand Down
2 changes: 1 addition & 1 deletion packages/botbuilder-adapter-webex/src/webex_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ export class WebexAdapter extends BotAdapter {
if (activity.conversation && activity.conversation.parentId) {
// @ts-ignore ignore this webex specific field
message.parentId = activity.conversation.parentId;
} else if (activity.channelData.parentId) {
} else if (activity.channelData && activity.channelData.parentId) {
message.parentId = activity.channelData.parentId;
}

Expand Down
9 changes: 7 additions & 2 deletions packages/botkit/src/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -857,8 +857,13 @@ export class BotkitConversation<O extends object = {}> extends Dialog<O> {
}

// copy all the values in channelData fields
for (const key in line.channelData) {
outgoing.channelData = this.parseTemplatesRecursive(JSON.parse(JSON.stringify(line.channelData)), vars)
if (line.channelData && Object.keys(line.channelData).length > 0) {
const channelDataParsed = this.parseTemplatesRecursive(JSON.parse(JSON.stringify(line.channelData)), vars);

outgoing.channelData = {
...outgoing.channelData,
...channelDataParsed
};
}

/*******************************************************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion packages/botkit/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface BotkitConfiguration {
adapterConfig?: {[key: string]: any}; // object with stuff in it

/**
* An instance of Express used to define web endpoints. If not specified, oen will be created internally.
* An instance of Express used to define web endpoints. If not specified, one will be created internally.
* Note: only use your own Express if you absolutely must for some reason. Otherwise, use `controller.webserver`
*/
webserver?: any;
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ or one of the remixable starter kits.

A Botkit application usually has 2 main components: a main app file called `bot.js` where Botkit is configured, and a folder of modules that get automatically loaded into the application.

The bot's features - all of the stuff involved in defining trigger patterns, dialogs, custom middlewares and handlers - are organized into JavaScript modules, and then loaded into the app using [controller.loadModules()](reference/core.md#loadmodules). Each feature file should contain only the code required for a specific feature. This will help to keep the project code well organized and modular.
The bot's features - all of the stuff involved in defining trigger patterns, dialogs, custom middlewares and handlers - are organized into JavaScript modules, and then loaded into the app using [controller.loadModules()](reference/core.md#loadmodules). If you are using Typescript, make sure to include `ts` extension into the second parameter as a string array (default is `['.js']`, and you probably want it to be `['.js', '.ts']`). Each feature file should contain only the code required for a specific feature. This will help to keep the project code well organized and modular.

The feature modules follow the form below:

Expand Down
6 changes: 3 additions & 3 deletions packages/docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 93944fe

Please sign in to comment.