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

Commit

Permalink
Merge branch 'fix-cisco-webex-message-send' of https://github.com/viv…
Browse files Browse the repository at this point in the history
…eksyngh/botkit into benbrown/4.7
  • Loading branch information
benbrown committed Mar 11, 2020
2 parents c4f20a2 + eff8233 commit c9c2993
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions packages/botbuilder-adapter-webex/src/webex_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ export class WebexAdapter extends BotAdapter {
event: 'all',
secret: this.options.secret,
name: webhook_name
}).then(function() {
}).then(function () {
debug('Webex: SUCCESSFULLY UPDATED WEBEX WEBHOOKS');
}).catch(function(err) {
}).catch(function (err) {
console.error('FAILED TO REGISTER WEBHOOK', err);
throw new Error(err);
});
Expand All @@ -290,14 +290,14 @@ export class WebexAdapter extends BotAdapter {
event: 'all',
secret: this.options.secret,
name: webhook_name
}).then(function() {
}).then(function () {
debug('Webex: SUCCESSFULLY REGISTERED WEBEX WEBHOOKS');
}).catch(function(err) {
}).catch(function (err) {
console.error('FAILED TO REGISTER WEBHOOK', err);
throw new Error(err);
});
}
}).catch(function(err) {
}).catch(function (err) {
throw new Error(err);
});
}
Expand Down Expand Up @@ -330,9 +330,9 @@ export class WebexAdapter extends BotAdapter {
event: 'all',
secret: this.options.secret,
name: webhook_name
}).then(function() {
}).then(function () {
debug('Webex: SUCCESSFULLY UPDATED WEBEX WEBHOOKS');
}).catch(function(err) {
}).catch(function (err) {
console.error('FAILED TO REGISTER WEBHOOK', err);
throw new Error(err);
});
Expand All @@ -343,14 +343,14 @@ export class WebexAdapter extends BotAdapter {
event: 'all',
secret: this.options.secret,
name: webhook_name
}).then(function() {
}).then(function () {
debug('Webex: SUCCESSFULLY REGISTERED WEBEX WEBHOOKS');
}).catch(function(err) {
}).catch(function (err) {
console.error('FAILED TO REGISTER WEBHOOK', err);
throw new Error(err);
});
}
}).catch(function(err) {
}).catch(function (err) {
throw new Error(err);
});
}
Expand All @@ -370,9 +370,10 @@ export class WebexAdapter extends BotAdapter {

// transform activity into the webex message format
// https://developer.webex.com/docs/api/v1/messages/create-a-message
const message: any = {
files: activity.channelData ? activity.channelData.files : ''
};
const message: any = {};
if (activity.channelData && activity.channelData.files) {
message.files = activity.channelData.files;
}
if (activity.text) {
message.text = activity.text;
}
Expand Down

0 comments on commit c9c2993

Please sign in to comment.