message: Update to teams API calls
diff: @@ -184,6 +184,65 @@ function TeamsBot(configuration) {
  );
  };
  + bot.replyWithActivity = function(src, message, cb) {
  + var serviceUrl = src.serviceUrl;
  +
  + var serviceUrl =
  + serviceUrl +
  + '/v3/conversations/' +
  + src.conversation.id +
  + '/activities';
  +
  + var data = {
  + type: 'message',
  + recipient: src.recipient,
  + from: src.from,
  + channelData: {
  + notification: {
  + alert: true
  + }
  + },
  + text: message.text,
  + summary: message.summary,
  + attachments: message.attachments,
  + attachmentLayout: message.attachmentLayout || 'list',
  + };
  +
  + console.log('REQUEST TO',serviceUrl, data);
  +
  + request(
  + {
  + method: 'POST',
  + json: true,
  + headers: {
  + 'content-type': 'application/json',
  + Authorization: 'Bearer ' + token
  + },
  + body: data,
  + uri: serviceUrl
  + },
  + function(err, res, body) {
  +
  + if (err && cb) {
  + return cb(err);
  + }
  + if (!body) {
  + if (cb) { return cb('Error parsing json response'); }
  + }
  +
  + if (body.error) {
  + if (cb) { return cb(body.error) }
  + }
  +
  + if (cb) { cb(null, body); }
  +
  + }
  + );
  + };
  +
  +
  +
  +
  bot.replyToComposeExtension = function(src, resp, cb){
  // console.log('src: ', src);
  src.http_res.send(resp)
  