Giter Club home page Giter Club logo

botbuilder-microsoftteams's People

Contributors

aosolis avatar bakshiraghav avatar bilby91 avatar billbliss avatar dependabot[bot] avatar guillaumemeyer avatar icenuts avatar jinxiwu avatar laujan avatar lindalu-msft avatar maoyu-dev avatar microsoftopensource avatar msftgits avatar oneeman avatar pradeepananth avatar ramjotsingh avatar robin-liao avatar siduppal avatar susanshen96 avatar wajeed-msft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

botbuilder-microsoftteams's Issues

ERROR: Activity resulted into multiple skype activities

Hi,

When i try to update a card with another card i get a message saying "Activity resulted into multiple skype activities"

Test code

Activity cardTest = new Activity();
                            cardTest.withType(ActivityTypes.MESSAGE).withRecipient(activity.from())
                                    .withId(activity.id()).withFrom(activity.recipient())
                                    .withAttachments(Arrays.asList(
                                            new Attachment().withContentType("application/vnd.microsoft.card.thumbnail")
                                                    .withContent(new ThumbnailCard().withTitle("Thumbnail")
                                                            .withSubtitle("card").withText("Thumbnail card"))));

                            String actId = new BotConnectorImpl(activity.serviceUrl())
                                    .sendToConversation(activity.conversation().id(), activity.id(), cardTest);

                            new Runnable() {
                                @Override
                                public void run() {
                                    try {
                                        Thread.sleep(2000);
                                        System.out.println("Sending world");
                                        new BotConnectorImpl(activity.serviceUrl()).updateConversation(
                                                activity.conversation().id(), actId,
                                                new Activity().withType(ActivityTypes.MESSAGE).withText("World")
                                                        .withId(actId)
                                                        .withAttachments(Arrays.asList(new Attachment()
                                                                .withContentType(
                                                                        "application/vnd.microsoft.card.thumbnail")
                                                                .withContent(new ThumbnailCard()
                                                                        .withTitle("Thumbnail new").withSubtitle("card")
                                                                        .withText("Thumbnail card")))));
                                    } catch (Exception e) {
                                        e.printStackTrace();
                                    }
                                }
                            `}.run();`

For the first call i get back the following response

Response{protocol=http/1.1, code=201, message=Created, url=https://smba.trafficmanager.net/inlocal-client-ss.msg/v3/conversations/a:1eqU_84Pldp0o64r8ZSkPs8tFylA2Tl6v-XdbDnRyHkZHbWtdirivh0NTYQ-Y9Ro9cUQN6Txt9HFt49Qgw56ewE7UfvQuttra2tpI0GIHDUXGMVSWiSnuVesjc4GdJuO_/activities/1529042383029}
{"id" = "1:1LOoYnwMp4chbJTW6ltBxMm1EwRp3j13gWgbS-qeY-Zs"}

And in response i get the following for which i am getting the error message

[apache-tomcat-9.0.8]: Response{protocol=http/1.1, code=400, message=Bad Request, url=https://smba.trafficmanager.net/inlocal-client-ss.msg/v3/conversations/a:1eqU_84Pldp0o64r8ZSkPs8tFylA2Tl6v-XdbDnRyHkZHbWtdirivh0NTYQ-Y9Ro9cUQN6Txt9HFt49Qgw56ewE7UfvQuttra2tpI0GIHDUXGMVSWiSnuVesjc4GdJuO_/activities/1:1LOoYnwMp4chbJTW6ltBxMm1EwRp3j13gWgbS-qeY-Zs}

Kindly let me know if anyone has a solution for this error.

Thanks

Not getting back activity id for POST call on sending a message

Hi,

Normally when we send a text message to MS teams we get back the id of the message just send which can be used to update the message.

Eg.
If we send the following to teams via botframework
new Activity().withType(ActivityTypes.MESSAGE).withText("Hello").withRecipient(activity.from())
.withFrom(activity.recipient())
via a POST call to
@post("v3/conversations/{conversationId}/activities/{activityId}")

we get back a response with the activity id like
{"id":"12345"}

but in case we send an attachment say a thumbnail card along with the above message then we do not get back an activity_id.

Does anyone know why this happens or if its a bug?

MS bot with Ms teams channel gives 400 error

I have V3 BOT with Microsoft teams channel. I see following sporadic issue where it seems like teams is failing send response back to bot via serviceURL

Error: POST to 'https://smba.trafficmanager.net/amer-client-ss.msg/v3/conversations/a%3A1qNZgTUu4ASGZkGKPYDtZque7ucUYmAuWHi7pVx2qfw7gtuHtEUybWEJnQDeZl31zAcglGMyoxKUik-VOpLKqGXop4UFTiQ70NZzkj49LHhNSeVlYFnJTCAjVVFtoViDt/activities/1529002753254' failed: [400] Bad Request
    at Request._callback (D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\ChatConnector.js:559:46)
    at Request.self.callback (D:\home\site\wwwroot\node_modules\request\request.js:186:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (D:\home\site\wwwroot\node_modules\request\request.js:1163:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (D:\home\site\wwwroot\node_modules\request\request.js:1085:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1055:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)
``

New handlers are added in a way that breaks existing code at runtime

Before 0.1.7 added onSigninStateVerification(), bots had to handle signin/verifyState in their onInvoke handler. But with the upgrade to 0.1.6->0.1.7, existing code fails at runtime because signinStateVerificationHandler is missing.

TypeError: Cannot read property 'bind' of undefined
at TeamsChatConnector.dispatchEventOrQuery (c:\Projects\my-app\node_modules\botbuilder-teams\lib\TeamsChatConnector.js:212:81)
at TeamsChatConnector.onDispatchEvents (c:\Projects\my-app\node_modules\botbuilder-teams\lib\TeamsChatConnector.js:183:18)
at TeamsChatConnector.ChatConnector.dispatch (c:\Projects\my-app\node_modules\botbuilder\lib\bots\ChatConnector.js:466:18)
at c:\Projects\my-app\node_modules\botbuilder\lib\bots\ChatConnector.js:149:27

There's no warning that this PATCH version increment would break existing code, and there are no release notes.

I think we should pass the event on to the onInvoke() handler if more specific handlers are missing, so that existing code continues to work, and developers can switch to the more specific handlers at their leisure.

Increase timeout on onO365ConnectorCardAction

This error message is shown even the action is handled successfully.

How do I increase the timeout?

screen shot 2018-05-23 at 13 00 48

   "botbuilder": "^3.13.1",
    "botbuilder-teams": "^0.1.7"
connector.onO365ConnectorCardAction(o365CardActionHandler);

ETA for new release ?

Hello!

Was wondering if we could get an ETA for v0.1.7. Some of the fixes are important for us and the next tag is not what master has.

Thanks!

RBAC for Bots

My customer would like to have RBAC capabilities for bots in MS Teams.
Administrators should be able allow custom bots for only target groups of people (AAD security groups).
Administrators should be able to have an audit log about what's going on between user and bot.
DLP features would be valuable feature as well. (for example, block sending files via bot).

Get conversation members when bot is installed only on private conversations

We are experiencing issues when trying to get the members list of a 1vs1 conversation when the bot is installed only for private conversations. We are getting 404 thread not found. The thing is, if the bot is installed on a team, the same call is working . Is this the expected behavior ? If that is the case, how can we get the user information ?

Thanks!

TeamsMiddleware missing from npm package

I was unable to get Strip bot mentions from the message text to make work

TypeError: teams.StripBotAtMentions is not a constructor
    at Object.<anonymous> (C:\bot\app.js:71:26)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:390:7)
    at startup (bootstrap_node.js:150:9)
    at bootstrap_node.js:505:3

ChatConnector vs. TeamsChatConnector

I am not able to decide if I can user builder.ChatConnector() instead teams.TeamsChatConnector() for my nodejs bot service. Can we use ChatConnector for a bot which can be used in MS teams or we can have TeamsChatConnector() for MS teams 1:1 bot & can be used for other channels like Cortana,skype etc. My BOT service currently has ChatConnector() and Cortana channel. We added MS teams channel & thinking if we can just user same bot for 1:1 without having to change ChatConnector & user npm "botbuilder-teams".

Support for List Card type.

There is a specific type of card type - list card that is supported only by Bots in Teams (no support in bot framework). Do you have plans to add support for this card type?
Let me know if you accept PR :)

Use Message Card JSON on TeamsMessage attachments

I've integrated Actionable Message to Outlook and I want to re-use the message generator on Teams.

Is it possible that I re-use the Message Card JSON ( example here https://messagecardplayground.azurewebsites.net/ ) to do something like:

new teams.TeamsMessage(session).summary("Use O365 actionable card").attachments([Message Card JSON]);

I tried and I have this error :

POST to 'https://smba.trafficmanager.net/amer-client-ss.msg/v3/conversations/a:12AlKhSkgnTVfgDzW3Hc4dij0n91QoigLmVoaQhR0yP45ixenSC6l_qyC0OaU89hEFjn8PQh0BrmmyI0YV40KidUNfrDGJx38ladohfWAGsqSEtEhk8VryOXJ5Ri_arXL/activities/1525987601637' failed: [400] Bad Request

NSP check fails

Node botbuilder-teams pulls in an older version of ms-rest which eventually pulls in a version of hoek with a vulnerability.

nsp check fails with the following output:

┌────────────┬────────────────────────────────────────────────────────────────────┐
│            │ Prototype pollution attack                                         │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Name       │ hoek                                                               │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ CVSS       │ 4 (Medium)                                                         │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Installed  │ 2.16.3                                                             │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Vulnerable │ <= 4.2.0 || >= 5.0.0 < 5.0.3                                       │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Patched    │ > 4.2.0 < 5.0.0 || >= 5.0.3                                        │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Path       │ [email protected] > [email protected] > [email protected] >           │
│            │ [email protected] > [email protected] > [email protected]                          │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ More Info  │ https://nodesecurity.io/advisories/566                             │
└────────────┴────────────────────────────────────────────────────────────────────┘

Authenticate a user in Microsoft Teams

Bot Info

  • SDK Platform:Node.js
  • SDK Version: latest
  • Active Channels: MS Teams, CORTANA
  • Deployment Environment: Azure Bot Service, Azure App Service

Issue Description

I have a bot running as Cortana skill which works as meeting room finder. With Cortana channel and using sing-in at skill invocation which popup the sign-in window & authenticates user against Azure ADv1. Once use signed in I an access user information from token as follows

let authorizationToken = session.message.entities.find((e) => {
            return e.type === 'AuthorizationToken';
        });

I am trying to find how can I authenticate user for MS teams ? As per this https://docs.microsoft.com/en-us/microsoftteams/add-bots I'm just user botID to add a bot to teams. and 1:1 chat is initiated. I believe our MS teams has o365 talent as a backbone for corporate users.

Is there any strategy/library I can user to pull a user info in bot code and verify before chat initiated.
OR somehow user AADv1 for user authentication.

Fetch member belongs to an organization

From what I know, if we want to send 1:1 message to all members of an organization, we need to do so:

  1. Create a team which include all members
  2. Add a bot to that team
  3. The bot will fetch team rooster and start 1:1 dialog

connector.fetchMembers(serviceUrl, conversationId, function (err, result) {}

Is that the only way? Can we just register a personal bot for all members by Team Admin?

How to access address.serviceUrl without message

Hi,

The example here constructs dialogs using the session.message.address.serviceUrl parameter. In this example it makes sense to assume that this value will be in the context of a message, because it is in response to a user message. However, if I just want the bot to send a message or create a new conversation or channel on MS teams without the user sending a message first, how can I get the session context (address.serviceUrl) from the connector / bot objects directly?

Please add simple "color" support to O365ConnectorCard.themeColor()

Request: add the special values good, warning, and danger as theme colors. Slack has these and it's a lot easier than looking up the hex values.

I'm not set up to build or test this, but this works in my own version. If you'd rather, I could just submit a PR but it's not very clear how to set up the build environment and run the tests. @robin-liao I'll contact you offline.

Suggested source:

    public themeColor(color: string): this {
        if (color) {
            color = color.toLowerCase();
            switch (color) {
              case "good":
                (<teams.IO365ConnectorCard>this.data.content).themeColor = "#2ea34e"; // Green
                break;
              case "warning":
                (<teams.IO365ConnectorCard>this.data.content).themeColor = "#de9d30"; // Yellow
                break;
              case "danger":
                (<teams.IO365ConnectorCard>this.data.content).themeColor = "#d50000"; // Red
                break;
              default:
                (<teams.IO365ConnectorCard>this.data.content).themeColor = color;
            }
            (<teams.IO365ConnectorCard>this.data.content).themeColor = color;
        } else {
            delete (<teams.IO365ConnectorCard>this.data.content).themeColor;
        }
        return this;
    }

Current source:

    public themeColor(color: string): this {
        if (color) {
            (<teams.IO365ConnectorCard>this.data.content).themeColor = color;
        } else {
            delete (<teams.IO365ConnectorCard>this.data.content).themeColor;
        }
        return this;
    }

GetTextWithoutMentions Exception with Microsoft.Bot.Connector v3.13.0.3

I update the Bot SDK to the latest version (3.13.0.3) and now whenever I try to use the method "GetTextWithoutMentions" I get the following exception:
activity.Text = Connector.Teams.ActivityExtensions.GetTextWithoutMentions(activity);

Microsoft.Bot.Connector.Teams
Method not found: 'System.Collections.Generic.IList`1<Microsoft.Bot.Connector.Entity> Microsoft.Bot.Connector.IMessageActivity.get_Entities()'.
at Microsoft.Bot.Connector.Teams.ActivityExtensions.GetTextWithoutMentions(IMessageActivity activity)
at Microsoft.Bot.Sample.LuisBot.MessagesController.d__0.MoveNext() in ...\Controllers\MessagesController.cs:line 36

The Class 'Activity' does contain a property public IList<Entity> Entities { get; set; }

Any idea about this?

Microsoft.Bot.Connector 3.13.0.3
Microsoft.Bot.Connector.Teams 0.8.0

fetchMembers does not return all the users for different channels of the same team

One of our accounts started a customer request saying that some users didn't get a message from our bot, after doing some researches I noticed that 2 channels of the same team were returning different users (we're using fetchMembers) is there a reason why 2 channels of the same team have more/less users? not sure if a user can change a configuration to not appear there.

I asked this user to remove one of the missing users from the team and then re-add the user, after one hour the user started appearing using fetchMembers, but only that user, this channel has other 4 users that still don't appear, maybe this is helpful to detect the issue.

Thanks

Invalid declaration of ComposeExtensionHandlerType

Shouldn't the following export be changed as follows. Since Error is not a nullable type you always have to send an error?

Current implementation

export type ComposeExtensionHandlerType = 
  (event: builder.IEvent, query: ComposeExtensionQuery, 
  callback: (err: Error, result: IComposeExtensionResponse, statusCode?: number) 
    => void) => void;

Recommended:

export type ComposeExtensionHandlerType = 
  (event: builder.IEvent, query: ComposeExtensionQuery, 
  callback: (err: Error | null, result: IComposeExtensionResponse, statusCode?: number) 
    => void) => void;

Current implementation gives the following TypeScript error when transpiling callback(null, ...): error TS2345: Argument of type 'null' is not assignable to parameter of type 'Error'.

Create wrappers for most of the Node BotBuilder fluent APIs

Consider the following TypeScript code:

        let msg = new msTeamsBuilder.TeamsMessage(session)
            .textFormat(builder.TextFormat.markdown)
            .text(": Retrieving incident IM10272...");
        (msg as msTeamsBuilder.TeamsMessage).addMentionToText({id: "test", name: "@nat.infra"}, msTeamsBuilder.MentionTextLocation.PrependText);

In particular, note the goofy (msg as msTeamsBuilder.TeamsMessage) cast before the botbuilder-teams addMentionToText method. If it's not there, it breaks, saying that addMentionToText is not a method of botbuilder.Message.

Which it isn't - it's a method of TeamsMessage -- but why the error? Because with the Fluent-style APIs used in botbuilder, an explicit cast back to botbuilder.Message is made with every method call (in this case, to .textFormat and .text).

The only way around this, I think, is to create wrappers for all the fluent calls in the TeamsMessage.js library which calls super. That way the objects aren't cast back to the superclass type on every method call of botbuilder.

As it stands now, this is completely mysterious and makes the SDK harder to use.

[Question] Is there a way to get the aadObjectId?

I want to add a link in one email to let users access the 1:1 chat without having to search the private chat manually, the URL looks like https://teams.microsoft.com/_#/conversations/19:(aadObjectId_here)_(bot_id_here)@unq.gbl.spaces?ctx=chat. Is there a way or an endpoint to get that info? or can I build a different URL without the aadObjectId and access the 1:1 chat?

Thanks

[Node] Change signature of startReplyChain to reduce possibility of dev error

The current signature for startReplyChain is prone to dev error, as what's conceptually the same information could be passed in multiple locations:

  • message.address.serviceUrl vs serviceUrl parameter
  • message.address.conversation.id vs. channelId parameter
    The function can fail to return a valid address if the parameters contain inconsistent/incomplete information.

It would be better if the parameters to startReplyChain were parallel to startConversation.
startReplyChain(message: IMessage|IIsMessage, done: (err: Error, address?: IAddress) => void)
where the message's address contains all the necessary routing information.

Bump ms-rest

Would it be possible to bump ms-rest to the latest version ? Current one is using request 2.74 that uses a deprecated version of uuid (node-uuid) ?

[CSharp] How to mention to channel

I'd like to ask about how to mention to channel or team in Microsoft Teams from Bot.
The following document says that such a type of mention is not supported.

https://docs.microsoft.com/ja-jp/microsoftteams/platform/scenarios/bots-channel-conversations#mentions

“At this time, team and channel mentions are not supported.”

Is it not supported even now?
And do you have any plan to support this?

I'd like to make it possible to notify all of the members in a teams channel from Bot.

Authorization on Teams Bot

So I developed this bot for my company that has a few features to make the employees' lives easier. But some of these features should only be accessible for a few of the employees. Is there anyway you would recommend doing this sort of authorization (checking if the user has access to the feature) without the need for a log in action?

I was thinking of using the "message.From.Id" attribute when the user sends his first message to see if that user in on an authorized-user-list, but I'm not 100% sure if this ID is unique and if it doesn't change over time. Any suggestions or insights?

Autocompletion feature for bot commands, like "Who"-Bot in MS Teams

The "Who"-Bot in Microsoft Teams is implementing a very useful autocompletion feature for Bot commands.
Here is how it looks:
screen shot 2018-04-13 at 14 18 47
screen shot 2018-04-13 at 14 19 02

Sadly, I don't see any way to do this currently, with any of the ChatConnectors or MS Teams libraries. Is there a way to use this? If not, would you consider implementing/exposing it?
Thank you!

startReplyChain and UniversalBot

Hello,

Today we found something that now feels obvious but took us a while to figure out. When sending messages using startReplyChain, non of the middlewares of the bot are used. This makes a lot of sense since startReplyChain is only a connector API.

We opened a pull request (microsoft/botframework-sdk#4120) to see if we can standardise this behaviour.

We want to know what are the opinions here to see how we can move forward and solve this issue. We will happily update our connectors https://github.com/suttna/botbuilder-slack and https://github.com/suttna/botbuilder-stride if we can find a common ground for the problem.

Thanks as usual for the support and time!

C# sdk for Bot Framework v4 preview?

Hi,

Just started to play a bit with the preview Bot Framework v4. I was wondering will there be a Teams Bot Connector for Bot Framework v4 or is there a preview package available at this moment?

thanks in advance!

Peter

Get teams a bot belongs to

We having some complications in our application because we didn't cache all the team ids for the accounts that were created with our bot. We think it would be a really good idea to add an endpoint for getting the teams inside a tenant that a user belongs to.

Is this in the pipeline ? If not, could it be possible to add ?

I'm also aware of other people having similar issues with this as well.

starting a new thread everytime the proactive dialog is started

I have a MS Teams bot that records the conversations happening in a group conversation. But of course I am aware that the MS teams bots can't do the group conversations as of now. The conversations need to mention the bot in order to record the conversation and I am recording the conversations in a documentdb document.

I need to push new conversation topics using a proactive dialog, all nice and fine but everytime I push a msg it lands in the same thread.

Is there a way to make sure everytime a new dialog is invoked it starts a new thread.

This is how I start a new dialog

// initiate a dialog proactively 
function startProactiveDialog(address,txid,imageurl,textblurb) {
    console.log(txid); 
    bot.beginDialog(address, "*:/conversationRecorder",[txid,imageurl,textblurb]);  
}

User not able to see anything (Error), when Bot Service returns status code 403

Bot Info

  • SDK Platform: Bot REST Connector
  • SDK Version: N.A.
  • Active Channels: MS Teams
  • Deployment Environment: Own deployment environment

Issue Description

Hi Folks,

I was trying out authentication for Microsoft Bot messages and noticed that user doesn't receives any notification / message / error when the request is rejected with HTTP 403 (forbidden).

User should be able to see something / error for that.

This issue is particular to MS-Teams channel. Works fine on emulator and webchat (tried these 3 so far).

Code Example

Reproduction Steps

  1. Create a bot with Microsoft and use the app id / password to configure you simple bot service.
  2. User sends "Hi" message from the bot. Bot Connector makes a post request to the bot service endpoint.
  3. Try explicitly sending HTTP 403 message as status for the request.
  4. User doesn't see anything / Error on the chat UI.

Expected Behavior

User should be able to see some error message indicating the message wasn't sent/delivered

Actual Results

User is not able to see anything. It appears to user as if the message has been sent.

Failed to trigger welcome messages in 1:1 conversations with BOt

I'm trying to send a welcome message to a user when bot is added to MS teams for 1:1 chat. In this scenario user will be simply pasting BOT_Id in search bar on MS teams and bot should be visible for chat. As mentioned in following document I grabbed a code and modified for teamsAddMembers eventType but it does not work. In my case user has to wake up the bot by typing some command.

https://docs.microsoft.com/en-us/microsoftteams/platform/scenarios/bots-personal-conversations#best-practice-welcome-messages-in-11-conversations

https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/bots/bots-notifications#nodejs

bot.on('conversationUpdate', (msg) => {
    var members = msg.membersAdded;
    if (!members) {
        var members = msg.teamsAddMembers
    }
    // Loop through all members that were just added to the team
    for (var i = 0; i < members.length; i++) {

        // See if the member added was our bot
        if (members[i].id.includes(connector.settings.appId)) {
            var botmessage = new builder.Message()
                .address(msg.address)
                .text('Hello ! Welcome to CAL MS Teams Bot');

            bot.send(botmessage, function (err) { });
        }
    }
});

BOT stopped working in MS teams.

I have a BOT with MS teams channel that is migrated from BF portal to azure couple of weeks back. It has Azure web app running behind where code is deployed. I manage all Bot settings in Azure now as on 31st March BF portal might go away. So far until 28th March my bot in MS teams was working fine. I have a screenshot attached.
This is enterprise level bot which will be used by almost 25k people and its currently under Non-prod UAT testing. The way I ask users to interact with is by sharing following link.

https://teams.microsoft.com/l/chat/0/0?users=28:{BOTID

Yesterday, I flipped the messaging endpoint URL to my local Ngrok url to test something. After that I realized BOT isn't responding in teams. I can confirm azure app service is running and I can test in 'Test we Chat window'. I even have Cortana channel working with same bot. If I flip the url back to azure endpoint still doesnt work. MS teams 100& stopped working. I tried with 2 more bots. No luck.

  1. Is it possible massage URL flip caused something ?
  2. How can I debug the issue ?
  3. Is it possible BOT+teams configuration is cached somewhere so can we clear it ? So it starts working.

image

image

Unable to serialize `ComposeExtensionAttachment`

Repro

  1. Run any sample C# app that uses ToComposeExtensionAttachment() extension method (e.g. https://github.com/OfficeDev/microsoft-teams-sample-get-started/blob/master/CSharp/TeamsToDoApp/Compose/ComposeExtension.cs).
  2. Serialization of https://github.com/OfficeDev/microsoft-teams-sample-get-started/blob/master/CSharp/TeamsToDoApp/Compose/ComposeExtension.cs#L75 blows up with the following error:
Self referencing loop detected for property 'preview' with type 'Microsoft.Bot.Connector.Attachment`

Cause

I suspect the cause of this issue is https://github.com/OfficeDev/BotBuilder-MicrosoftTeams/blob/master/CSharp/Library/Microsoft.Bot.Connector.Teams.Shared/AttachmentExtensions.cs#L60. If previewAttachment is null which is the default, it references itself and this eventually will blow up on JSON serialization.

Workaround

Don't use the extension method

                var composeExtensionAttachment = new ComposeExtensionAttachment
                {
                    Content = attachment.Content,
                    ContentType = attachment.ContentType,
                    ContentUrl = attachment.ContentUrl,
                    Name = attachment.Name,
                    ThumbnailUrl = attachment.ThumbnailUrl,
                };

Using https://www.nuget.org/packages/Microsoft.Bot.Connector.Teams/0.5.6 but looking through the commit history, I suspect this issue has been there since the feature was introduced.

Adaptive cards Action.Submit not working

Hi,

No data is being send back to the bot when using Action.Submit in Adaptive cards.

new Activity().withType(ActivityTypes.MESSAGE).withRecipient(activity.from())
                                    .withId(activity.id()).withFrom(activity.recipient())
                                    .withAttachments(Arrays.asList(new Attachment()
                                            .withContentType("application/vnd.microsoft.card.adaptive")
                                            .withContent(new AdaptiveCard()
                                                    .withActions(Arrays.asList(new Submit().withTitle("Show Details")
                                                            .withData("{\"id\":229,\"name\":\"John\"}")))
                                                    .withBody(Arrays.asList(new Container().withItems(Arrays
                                                            .asList(new TextBlock().withText("Hello World"))))))));

When I try clicking on the button in webchat i get back a response but not in MS Teams.

Any solutions?

Thanks

How to get message details and chat history of conversation using bot

Bot Info

  • SDK Platform: .NET
  • Active Channels: MS Teams
  • Deployment Environment: Azure App Service

Issue Description

My question related to MS teams compose extention
I have side loaded bot using json manifest containing

"composeExtensions": [ { "botId": "39b2dead-ccab-4b8c-8c5d-*********", "scopes": [ "personal", "team" ], "commands": [ { "id": "searchCmd", "title": "Search tasks", "initialRun": false, "description": "Search tasks", "parameters": [ { "name": "search", "title": "Search", "description": "Search tasks" } ] } ] } ],

I will explain use case step by step:

step 1: In channel conversion when user clicks on compose extension button there is bot in compose extension popup user clicks on that bot option then it will call bot api endpoint

step 2 : When bot api endpoint is called i.e. Compose extensions come in as Invokes to bot and bot responding in activity.IsComposeExtensionQuery() event then in the response of activity.IsComposeExtensionQuery() bot create some thumbnail cards CreateComposeExtensionResponse() method and send as response for compose extension such that,

                   `   //Compose extensions come in as Invokes.  Leverage the Teams SDK helper functions
                if (activity.IsComposeExtensionQuery())
                {

                    var invokeResponse = await new ComposeExtension(activity).CreateComposeExtensionResponse();

                    // Return the response
                    return Request.CreateResponse<ComposeExtensionResponse>(HttpStatusCode.OK, invokeResponse);

                }`

Step 3 : Then user see there are some cards in compose extension popup send by bot as compose extension query response

Step 4 : Then User clicks on one of the card from compose extension popup and send it into channel conversation

Step 5 : As the conversation is initiated by user by selecting card from compose extension popup
Then that card is the first message of the conversion

Step 6 : There there is some discussion related to that card by users in that channel conversion but when one of the user in that channel discussion conversion ping like @MYBOT then **how can the bot knows which card from compose extension popup is selected for discussion ** because when on selecting the card from compose extension popup cards there is no call to bot.
i.e. I want information of that card taken for conversion when user ping @MYBOT from that conversion

please reply immediately

Expected Behavior

Guide on Possible solutions:

  1. As that card is first message(thumbnail card) of the conversation discussion, I will get message id of that card message by activity.Conversation.Id but Is this possible that bot will get that card details by message Id or

  2. Is there any other way to read that card message of conversation using message Id or

  3. Is this possible to read that whole current conversation thread by bot

  4. Is there any event when user select card from compose extension popup: So my bot can know which card is selected for discussion among multiple cards .

Actual Results

Bot not able read conversation thread initiated by user

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.