I am new to MS Botframework Composer and was working on one of my initial chatbots when I noticed that am not able to Trigger Intents from buttons. Although, the same features were working in the tutorials from MS.
Created a simple prompt with two buttons: Help and Cancel. I want that Help and Cancel Intents (Triggers which I have created within the same Dialog) should be triggered whenever a user clicks on the button. Currently, this is not happening for me and need your help to resolve it? Please refer the images to refer the dialog flow and intents.
HELP and CANCEL Buttons in flow
` [Activity
Text = Select Options?
SuggestedActions = Help | Cancel
]`
CANCEL Trigger
Emulator Screenshot
I'm not familiar with that exact approach (would you mind linking to the portion of the tutorial?), but you can create a Choice Prompt action (Choice Input action from the AskingQuestionsSample is pretty good example). I set mine to be of style suggestedaction, then I also set my allowInterruptions to true (my cancel and help intents/dialogs are in my main dialog).
"actions": [
{
"$kind": "Microsoft.ChoiceInput",
"$designer": {
"id": "673028",
"name": "Prompt with multi-choice"
},
"property": "user.style",
"prompt": "Please select a value from below:",
"maxTurnCount": 3,
"alwaysPrompt": true,
"allowInterruptions": "true",
"outputFormat": "value",
"choices": [
{
"value": "Cancel"
},
{
"value": "Help"
}
],
"defaultLocale": "en-us",
"style": "suggestedAction",
"choiceOptions": {
"inlineSeparator": ", ",
"inlineOr": " or ",
"inlineOrMore": ", or ",
"includeNumbers": true
},
"recognizerOptions": {
"noValue": false,
"noAction": false,
"recognizeOrdinals": true
}
}
I was able to resolve this by defining the intent in main dialog and setting up the action in a new dialog. So, whenever LUIS identified an intent, it will action the new dialog.
Related
Trying to manage a conversation flow by "Go to action" action (sorry for tautology). All tests to call all types of actions by ID from *.dialog return error.
ClassName:"System.ArgumentException" Message:"GotoAction: could not find an action of "cW0raQ"."
How reference looks
I didn't find any mention in the documentation how to work with this action, therefore it must be pretty simple, but I can't catch the correct way.
As usually, answer myself.
Had a look at MS tests in their repo https://github.com/microsoft/botbuilder-dotnet/ and found out that it requires creating ID for action manually. Automatic $designer.id doesn't work.
{
"$kind": "Microsoft.GotoAction",
"$designer": {
"id": "uFOn5P"
},
"actionId": "targetID"
},
...
{
"id": "targetID",
"$kind": "Microsoft.SendActivity",
"$designer": {
"id": "oWxpDh",
"comment": "",
"name": "GoTo test"
},
"activity": "${SendActivity_oWxpDh()}"
}
Moreover, this action works in scope of trigger only, not dialog.
I'm trying to post a direct message to a specific Slack user. I'm using chat.postMethod method. The below example works fine when channel is a channel ID. But when I change it to a users ID (as described in this documentation), I get back a messages_tab_disabled error.
POST URL: https://slack.com/api/chat.postMessage
{
"channel": "U02F7EXXXXX",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Hello"
}
}
]
}
I get back...
{
"ok": false,
"error": "messages_tab_disabled"
}
I can't find much on this other than a description on the documentation page that just says "Messages tab for the app is disabled.".
Where is it and how do I enable it?
I stumbled upon how to fix this when I was poking around settings for my app. In case this helps anyone else in the future...
In your apps configuration page, under Features > App Home, scroll down to the Show Tabs section and there is an option called Messages Tab that is off by default. I turned it on and now I can message users directly.
Below is a screen shot of Cypress 6.8 runner. I am interested in accessing the data printed in the console shown on the right.
In order to see this information within the browser window where tests are executed, you would open the developer tools and click a row. In the example, I had clicked row 8 which is shown by the purple pin and tooltip stating that "Printed output to your console".
Is it possible to programmatically access to this same information printed in the console? For example, could I get access to the command, applied to and any other information that might be logged. My understanding is this information only appears when clicking the row.
I would like to access this information using a custom plugin. Can you please provide insight into how this might be possible? I've been experimenting with the plugins/index.js module exports which provides access to on. But, at this time I don't have any meaningful code to share. I'm in the learning stage trying to determine if its feasible to access this information. Thanks.
At the top of your spec or in cypress/support/index.js you can add an event listener which listens for log:added, ref Catalog of Events.
Cypress.on('log:added', (logObject) => console.log(logObject))
This provides your callback a stream of the "log attributes" objects in the first parameter, which have a console.props property, which is what is printed when you click a line in the LHS Cypress log.
{
"message": "http://example.com/",
"timeout": 60000,
"name": "visit",
"type": "parent",
"event": false,
"id": 3,
"state": "passed",
"instrument": "command",
"url": "http://example.com/",
"hookId": "r2",
"testId": "r2",
"testCurrentRetry": 0,
"viewportWidth": 1000,
"viewportHeight": 660,
"wallClockStartedAt": "2021-03-20T03:12:21.490Z",
"chainerId": "chainer4",
"consoleProps": {
"Command": "visit",
"Resolved Url": "http://example.com/",
"Redirects": [],
"Cookies Set": []
},
"renderProps": {},
"totalTime": 218,
"snapshots": [
{
"htmlAttrs": {},
"body": {}
}
],
"ended": true
}
We are trying out messaging extensions capability in our Microsoft Teams App that has a command which fetch dynamic set of parameters from the bot when invoked from the compose box.
When the user clicks the messaging extension our app receives payload type 'invoke' and name as 'composeExtension/fetchTask'
Our app process the data and in return it responds with a Adaptive card in task with 'type':'continue' and the Adaptive card is having a link to open URL as below
"task": {
"type": "continue",
"value": {
"card": {
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2",
"body": [{
"type": "ActionSet",
"actions": [{
"type": "Action.OpenUrl",
"title": "Open Facebook",
"url": <URL to open Facebook>
}],
}
]
}
}
}
}
MSTeams shows this card in a task module popup window. When the User click the Action button it open the Facebook page in a new browser tab but the task module popup window is not closed.
Is there anyway to close the task module popup window when the user clicks the Action button ?
Note : We are not using Bot Framework SDK and Microsoft Teams Javascript client SDK.
The only way I know of to do two things on one user action is by using a web based task module.
Do some simple layout with a button. In the click handler use window.open(, "_blank") and when that completes call the microsoftTeams.tasks.submitTask(...) method of the javascript SDK.
this might be late.
But the documentation is wrong try to call the submitTask(data) twice once with data and once without any params submitTask() to close the taskmodule.
I made a custom connector for teams that display notifications on channels and add Tab on teams.
For the tab parts -> Everything is working well
But I have a problem for the connector parts, I get an error when I try to save my settings in the developer console:
Received error from connectors {"seq":1585127802210,"timestamp":1585127814174,"flightSettings":{"Name":"ConnectorFrontEndSettings","AriaSDKT....
-> registerOnSaveHandler is called
-> setSettings is correctly set with entityId, contentUrl (same configurationUrl as the connector configuration) and the configName.
getSettings -> is called to save to my app the webhook url -> it works
-> notifySuccess is then called and
I checked on the connector dashboard everything seems fine, on the App Studio everything is green also!
I don't know what is happening..
My manifest
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
"manifestVersion": "1.5",
"version": "1.0.0",
"id": "ca153ede-92f2-46e7-8695-3726b5343bf4",
"packageName": "com.kagilum.icescrum",
"developer": {
"name": "Kagilum SAS",
"websiteUrl": "https://www.icescrum.com",
"privacyUrl": "https://www.icescrum.com/privacy",
"termsOfUseUrl": "https://www.icescrum.com/termsofuser"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "iceScrum",
"full": "Connect with iceScrum"
},
"description": {
"short": "A true Agile project management tool",
"full": "iceScrum is a web application for using Scrum while keeping the spirit of a collaborative workspace. It also offers virtual boards with post-its for sprint backlog, product backlog and others."
},
"accentColor": "#FFFFFF",
"configurableTabs": [
{
"configurationUrl": "https://preview.icescrum.com/msTeams/setupTab/",
"canUpdateConfiguration": true,
"scopes": [
"team",
"groupchat"
],
"supportedSharePointHosts": [
"sharePointFullPage",
"sharePointWebPart"
]
}
],
"connectors": [
{
"connectorId": "f00d8890-daa8-4c87-89f5-83cbab0bccd4",
"configurationUrl": "https://preview.icescrum.com/msTeams/setup/",
"scopes": [
"team"
]
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"preview.icescrum.com"
]
}
Piece of code related to
microsoftTeams.settings.registerOnSaveHandler(function(saveEvent) {
microsoftTeams.settings.setSettings({
entityId: 'icescrum-pkey-' + $scope.settings.project.pkey,
contentUrl: isSettings.serverUrl + '/msTeams/setup/',
configName: $scope.settings.project.name
});
microsoftTeams.settings.getSettings(function(settings) {
$scope.settings.webhookUrl = settings.webhookUrl;
return FormService.httpPost('msTeams/save', $scope.settings, true).then(function() {
saveEvent.notifySuccess(); //wait that the settings are really saved on iceScrum side
});
});
});
microsoftTeams.settings.getSettings(function(settings) {
$scope.setup = !settings.configName;
var tokenData = JSON.parse(localStorage.getItem("msTeams-oauth"));
var userData = JSON.parse(localStorage.getItem("msTeams-user"));
if (tokenData) {
FormService.httpGet('ws/project/user/' + userData.id + '?light=true', {headers: {'Authorization': 'Bearer ' + tokenData['accessToken']}}, true).then(function(projects) {
$scope.projects = projects;
if (settings.entityId) {
$scope.settings.project = _.find($scope.projects, {pkey: settings.entityId.split('icescrum-pkey-')[1]});
}
$scope.ready = true;
});
}
});
Full error:
angular.min.js:113 2020-03-25T20:35:25.953Z Received error from connectors {"seq":1585168484680,"timestamp":1585168525943,"flightSettings":{"Name":"ConnectorFrontEndSettings","AriaSDKToken":"d127f72a3abd41c9b9dd94faca947689-d58285e6-3a68-4cab-a458-37b9d9761d35-7033","SPAEnabled":true,"ClassificationFilterEnabled":true,"ClientRoutingEnabled":true,"EnableYammerGroupOption":true,"EnableFadeMessage":false,"EnableDomainBasedOwaConnectorList":false,"EnableDomainBasedTeamsConnectorList":false,"DevPortalSPAEnabled":true,"ShowHomeNavigationButtonOnConfigurationPage":false,"DisableConnectToO365InlineDeleteFeedbackPage":true},"status":500,"clientType":"SkypeSpaces","connectorType":"f00d8890-daa8-4c87-89f5-83cbab0bccd4","name":"handleMessageError"}
In case this helps anyone else, I spent ages today trying to get to the bottom of this and couldn't find a solution. Until...as a last gasp show of desperation I decide to use App Studio to recreate the entire connector manifest from scratch, including creating a new connector in the portal.
For some reason, this then worked fine - even though I can see that the two manifest files are identical with the exception of the ID (and I already tried regenerating the ID for the original one).
Bit late to the story, but having followed multiple github issues like this and stack overflow posts, I'm pretty convinced that its the problem with Connectors dashboard. If you made any change to settings, they are not really propageted/saved correctly.
So for example, if you changed validDomains or configurationPage URL, they won't actually do anything. You can verify that with your devtools. For me, after changing the configurationPage the Teams is still making request to old URL as well as the new one, but the old request produces error that's listed in question.
The only workaround I was able to find is to recreate connector in dashboard. Reported problem to MS Teams dev team, waiting to hear back.
Also late here, but I ran into this problem and the below was the solution after 3 days of frustration.
Despite everything mentioned in the documentation, the following is required otherwise you'll get this error. This fixed things for me.
microsoftTeams.settings.registerOnSaveHandler(saveEvent => {
microsoftTeams.settings.setSettings({
contentUrl: "https://xxxxxx.ngrok.io/teams/connector"
});
saveEvent.notifySuccess();
});
The documentation states that registering a save handler is optional and Teams will handle notify success if it's not declared. WRONG. You must register a save handler.
The documentation does not state that setSettings is required. WRONG. You must set settings or else you will receive this error.
The documentation does not state that you must save a contentURL. WRONG. You must set content URL in the setSettings. You can apparently omit other things when setting your settings, but not content URL.
The documentation does not specifically mention it, but the contentURL must comply with your validURLs in your manifest. If it does not, you'll also see this error.
So in your case, you must ensure that isSettings.serverUrl (setSettings() contentURL) does match preview.icescrum.com (manifest validURLs). If they do not, you'll see this error.