teamsBot | NodeJS automation BOT build to automatically join MS Teams | Runtime Evironment library
kandi X-RAY | teamsBot Summary
kandi X-RAY | teamsBot Summary
A NodeJS automation BOT build to automatically join MS Teams meetings. Please note this was build for educational purposes only. please don't use this to actually skip classes... NARAIN OW BOOS ANDERS.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of teamsBot
teamsBot Key Features
teamsBot Examples and Code Snippets
Community Discussions
Trending Discussions on teamsBot
QUESTION
I have created MS Teamsbot with 2 functionality : 1- display proactive messages after request on my API. 2 display duplicate of my message - that I sent in chat. Hosting on Azure - in test chat all working fine.Proactive messages working fine in MS Teams. After my request on API it send message to my bot.
The issue that the chat with my bot is hidden. When I install it, I can see the chat for a second and then it . Each time when I reinstall bot, chat appear for a second and then disappear.
Bot ID - e0dc7704-ffdf-47db-8e8e-3bdfd4d1db32
...ANSWER
Answered 2020-Feb-13 at 20:07isNotificationOnly flag was set to false
QUESTION
IssueThis issue is linked to my previous post related to an issue with MS Bot framework oAuth Authentication in MS Teams Chanel. The OAuth Authentication has started working but, am facing this issue as a result of the suggested code changes to enable OAuth Authentication.
Linked Post URL: Sign-in button prompts for Credentials and successfully authenticates but, doesn't log-in the user
Used the following Git Hub Code Sample as a basis for the OAuth code and retrofitted to my existing ChatBot: https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/46.teams-auth
- The Class hierarchy mention in the question is similar to the above code sample.
The MainDialog class in my case uses both LUIS and Adaptive cards to drive the conversational flow.
Due to the following change in the DialogBot class, the "options" paramater in MainDialog .BeginDialogAsync overridden method now gets NULL value instead of a proper value it used to previously get before the change.
As the MainDialog .BeginDialogAsync overridden method has all the code to detect returned value by the Adaptive Card in the "options" paramater, now that, it is being returned as null, the adaptive cards don't work.
However, the LUIS conversational logic works after successful OAuth Authentication from within MS Teams.
MainDialog.BeginDialogAsync(DialogContext outerDc, object options = null, CancellationToken cancellationToken = default(CancellationToken)){....}
As per the sample oAuth Sample code provided at https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/46.teams-auth
- I inherited DialogBot from TeamsActivityHandler.
Implemented the suggested code in the method TeamsBot.OnTeamsSigninVerifyStateAsync(ITurnContext turnContext, CancellationToken cancellationToken)
Inside the overridden method DialogBot.OnMessageActivityAsync(ITurnContext turnContext, CancellationToken cancellationToken), I replaced "a" with "b"
a. await _dialog.Run(turnContext, _botStateService.DialogStateAccessor, cancellationToken);
b. await _dialog.RunAsync(turnContext, ConversationState.CreateProperty(nameof(DialogState)), cancellationToken);
The simple change of .Run(....) to .RunAsync(....) probably misses the value and makes the Adaptive Card code non-functionl due to the mission "Options" parameter value in MainDialog.BeginDialogAsync(..) method
When It WorksIn the DialogBot.OnMessageActivityAsync(...) , when I replace b with c then, the "options" parameter in MainDialog .BeginDialogAsync(...) starts getting the requisite value to make the Adaptive card code work but, only if the user is already OAuth Authenticated i.e. when clicking sign-in button is not required.(But brings up another issue mentioned in "When It Doesn't Work section")
When It Doesn't Workb. await _dialog.RunAsync(turnContext, ConversationState.CreateProperty(nameof(DialogState)), cancellationToken);
c. await _dialog.Run(turnContext, ConversationState.CreateProperty(nameof(DialogState)), cancellationToken);
After making the change mentioned in the "When It Works" section if, the user types any utterance like "Hi", it causes an exception in the DialogBot.OnTurnAsync(....) method. This error then keeps coming every time and am not able to proceed with the Bot conversation.
- Exception when the user types any utterance i.e. when the user hasn't yet signed it
- Bot Emulator screenshot when the above exception comes up
In this scenario of OAuth Authentication in MS Teams, It's definite that I am messing up in state management in coordination with how Adaptive Card Submit click should be handled i.e. to retrieve user-provided values.
More InformationWould need inputs to handle this scenario where MS Teams OAuth Authentication is involved with a chatbot catering to both LUIS NLP based conversation and Adaptive Cards based dialog flow
- The Adaptive Cards and LUIS based dialog flow was perfectly working until the Above changes for fixing OAuth Authentication in MS Teams were done.
- Am using my Phone HotSpot for internet with no Proxy in between.
ANSWER
Answered 2020-Jan-30 at 16:49Figured out that, when we invoke await dialog.RunAsync(....)_ in DiallogBot class then, the Adaptive Card Submit Json value is available from outerDc.Context.Activity.Value instead of options parameter in the public override Task BeginDialogAsync(....) event of MainDialog
Therefore the only code change I did to make adaptive Card submit feature work i.e. after implementing the OAuth Authentication to the ChatBot is the following:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install teamsBot
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page