how to get the result from the people-picker when the user clicks on the button - bots

Use the bot framework composer to display the adaptive card "people-picker" in my chatbot in Teams.
When I select a person from the people-picker and click on the Check button i get the message:
Your response was send to the app
How can i capture that response in a string variable in the Bot Framework Composer enter image description here?
Greetings,

Related

Can I send Hero cards to whats app by using Twilio

I have chat bot, I build it with bot framework nodejs SDK I integrate this chat bot to whatsapp and I want to display some buttons in the whatsapp chat,
So is there any one found a solution for this problem pleas help me
Note: I try to send a hero card but I run to problem
Error: TwilioWhatsAppAdapter.parseActivity():
An activity text or attachment with contentUrl must be specified.
I don't know how bot framework attempts to send WhatsApp messages with buttons, but I doubt it fits with the way Twilio wants to send them.
Currently, to send a message with buttons, you need to register and use a template message. When you send the text of a message that matches one of your templates, then Twilio will deliver the entire template with buttons as well.
For the future, look out for the Twilio Content API which will streamline templates, buttons and other rich messages across platforms.
It looks like you are using the TwilioWhatsAppAdapter from the botbuilder-community-js repo.
Looking at the adapter's code, it doesn't appear to be configured to handle any card other than a 'signin' card (see here). If you don't mind doing a little leg work on this, I don't see why you couldn't fork this repo and build in functionality that supports a hero card similar to the signin implementation.
I imagine it would look something like this:
case 'application/vnd.microsoft.card.hero':
// eslint-disable-next-line no-case-declarations
const hero = attachment.content;
message.body = `${ hero.text }\n\n`;
message.body += (hero.buttons[0].title ? `*${ hero.buttons[0].title }*\n` : '');
message.body += hero.buttons[0].value;
break;
The above may need a little massaging but it wouldn't be far off from this. Then, you just need to build the library for use.

Bot Dialog Action button issue node.js

I am trying to create bot for MS Teams via Microsoft Bot Framework using some examples from the Internet.
I have created user card that has button "See Report"
function userCard(session, connector, name, workingStatus, TeamsID) {
var card = new builder.HeroCard(session)
.title(name)
.subtitle(workingStatus.toString())
.buttons([
builder.CardAction.dialogAction(session, 'userReport', TeamsID, 'See Report')
]);
return card;
}
Card is displayed without any issues. When I press on button it should trigger new dialog
//Begins the userReport dialog if the button on the userCard is pressed
bot.beginDialogAction('userReport', '/userReport');
This functionality works perfect when I test it in Bot Framework Emulator.
In MS Teams instead of triggering userReport dialog it goes to the main dialog (the one that is used when message is sent). So that this button does not work at all.
Could you, please, advise what should be adjusted/added in order to make this button work in MS Teams?
Thanks in advance!
Thank goodness you're just getting started. It looks like you're using Bot Framework V3, which is severely outdated. You should definitely switch to V4.
Teams has it's own additional trickiness. I recommend trying out and combing through each of these samples:
57.teams-conversation-bot
07.using-adaptive-cards
Then read through the Adaptive Cards blog post.
Basically, a response from an Adaptive Card comes back in activity.value, so in onTurn(), you'll want to use an if statement to watch activity.value for the value sent in your Adaptive Card when the user clicks "See Report". Then, use beginDialog or dialog.run(), as appropriate to start your dialog.

Retrieving PSID from messaging_optins

I'm a new developer building a facebook messenger chatbot using node.js and Microsoft's BotFramework. I've got my chatbot up and running nicely and I'm now trying to personalise the welcome message with the user's first name.
I have a welcome message set up when a user clicks the "Get Started" button and I believe I should be able to retrieve the PSID using messaging_optins.
If so, I've got a a function that processes the Facebook payload in onEvent from the EventActivity.Value:
This cycles through some if/else statements to detect whether the Facebook payload is a Postback, Optin or Quick Reply:
If an Optin is detected it then prints "Optin message received" to the console:
The problem I'm finding is that my code isn't detecting the Optin message and so I'm not then able to write any code to extract the PSID to use to personalise my welcome message.
Can anyone point me in the right direction?
I’ve solved this as I found from the documentation here that it’s messaging_postback that are sent when 'Get Started' is clicked.

Cortana channel - Failed to create bot module

I'm using Azure Bot Channels Registration for my bot, I have working endpoint and bot works well in Web Chat and My settings are:
Display Name: Engine Crave
Invocation Name: Engine Crave
Long Desc, Short Desc etc are all correct and filled and also organization at the last is also selected.
Also, My bot takes no user permissions. But when I save the Cortana Channel, I get a popup:
Unable to save.
There was an error saving the channel:
Failed to create bot module. Trace Id : 87140f58-46f8-4101-a849-17d63af6831c
Trace ID always keeps changing whenever I try.
Pls help!
Yayay! I found answer myself. Go-to settings and make display name same as your bot registration name when you registered on Azure! Mine was crave-engine.
Next goto Channels Registration -> Cortana -> Here you will see
Display Name: crave-engine
Invocation Name: crave-engine
Let these be like this and just click the "Register" button at the bottom. It's ok for now, You can however change these names When you register from https://knowledge.store .
I don't know these was some kind of bug or Azure Bot Team did this on purpose!

How can send the telegram bot location to users?

I want to send location of the bot to users, I very searched about it in google , but i find just this case"send location of users to the bot" I want versa case that mean:"send location of the bot to the users".
this is my idea: the owner of the bot is a driver who that want to share his location with the users of the bot,in the bot i put a button,when the users click on that button, the bot tell them location of driver.the location of bot is variable and it isn't constant
Sample request for send location from Bot to user with URL:
https://api.telegram.org/bot[botToken]/sendlocation?chat_id=[UserID]&latitude=51.6680&longitude=32.6546
Requirement for execute URL:
[botToken], e.g:399684XXX:AAH_NiVFtLXVmh4XXX-XXXEZo3yO6XXX
[UserID], e.g:64326XX
latitude , e.g:51.6680
longitude, e.g:32.6546
You can use sendVenue or sendLocation method to do it.
use sendLocation and not a web request to telegram api, to get the longitude and latitude you can use messageEventArgs.Message.Location.Latitude and messageEventArgs.Message.Location.Longitude with telegram c# bot api

Resources