Turn off Adaptive Card response confirmation for MS Teams bot app - bots

Adaptive cards for bots in MS Teams now appear to be displaying a confirmation of "your response was sent to the app" message when a button on the card is clicked.
Is there a way to turn this notification off?

This is by design, and cannot be disabled.

In a MS Teams if you have your message formatted as Adaptive Card you have different kind of buttons (Actions),
Some of them are resulting with "Your response was sent to the app" some of them not.
We had same issue and found out that if you are using type Action.Submit - it will show this notification, but if you use Action.Execute, it will not.
...
{
type: 'Action.Execute',
title: 'My Button',
data: {
msteams: {
type: 'task/submit',
},
somePayload: '<data>',
},
},
....
Hope it'll be helpful to someone stumbled upon the same issue.

Related

How to make Amazon Pay open in a popup window instead of refreshing?

What I am trying to do: I am trying to integrate Amazon Pay in my React-Express website following this documentation here.
My Problem: Whenever someone clicks on Amazon Pay Checkout Button, it redirects (refreshes the current page) to the Amazon Pay website to complete the payment. The problem in doing so is that, all the states get reset. What I am trying to do is, open it in a popup window.
Note: I have tried Googling, and there were very few information about it, and most of them says its not possible to do, but it is possible. This site here uses Amazon Pay and is built using React, AND this site is from Amazon itself for a demo. Here the Amazon Pay button opens a popup instead of refreshing, but I could not find the source code of this website anywhere.
My Progress:
In my backend Express server, this is what I did,
const payload = {
storeId: AMAZON_STORE_ID,
scopes: ["name", "email", "billingAddress"],
deliverySpecifications: {
specialRestrictions: ["RestrictPOBoxes"],
},
paymentDetails: {
chargeAmount: {
amount: account.price,
currencyCode: 'EUR'
},
},
// popup: true
}
const signature = amazonPayClient.generateButtonSignature(payload)
console.log(`Sign: ${signature}`)
return res.json({ sign: signature, payLoad: JSON.stringify(payload) })
and then in my frontend React,
amazon.Pay.renderButton('#amazon-pay', {
// set checkout environment
merchantId: config.AMAZON_MERCHANT_ID,
publicKeyId: config.AMAZON_PUBLIC_KEY_ID,
ledgerCurrency: 'EUR',
checkoutLanguage: 'en_GB',
productType: 'PayAndShip',
placement: 'Checkout',
buttonColor: 'Gold',
createCheckoutSessionConfig: {
payloadJSON,
signature
},
popup: true
})
Thanks for helping in advance :D
The reason, my Amazon Pay was opening in a new page, and the one in the Amazon Pay Demo website in a popup was because of currency. If, I change my currency from 'EUR' to 'USD', popup appears.
In the demo site, if you change your currency from USD to EUR from top right corner, you will see the changes take place.
So, to fix this issue, I just have to use US Region, and the USD currency

Update message card in Teams via webhook connector

I have a build machine from which I want to post updates in Microsoft Teams. I created a webhook connector for my channel in Teams and I can send a simple POST request to the webhook url to post a message card in Teams with this json payload:
{
"#type": "MessageCard",
"#context": "http://schema.org/extensions",
"summary": "Build Status",
"sections": [{
"facts": [{
"name": "Status",
"value": "<build status>"
}]
}]
}
Now I want to update the <build status> value as the build progresses and maybe add another fact with download link when the build is finished. Is it possible to update an existing card once it is posted? It seems like a common use case to me, but I was not able to find an answer to it. There are some blogs about updating card as a result of an action, but I don't have or want to have any actions. And obviously I don't want to keep adding cards for the same build process.
Currently update card via web-hook is supported in teams. Could you please Raise a user voice
Sorry, I jumped the gun on that. It appears it isn't supported from webhooks.
https://techcommunity.microsoft.com/t5/microsoft-teams/refresh-cards-not-working-in-teams/m-p/93282

How to create Card response in Dialogflow fulfillment?

Dialogflow fulfillment index.js
function fallback(agent) {
let user_input = agent.query;
let google = 'https://www.google.co.th'
agent.add('Your word is '+ user_input);
agent.add(google);
}
I want change the reply 'google link' to card or something for perfect chatbot
to
The card depends upon the client what you are using if you are using any custom web application client then you have to build a custom payload as per the client application.
Dialogflow uses rich responses to display visual elements to enhance user interactions, basically you have to init the Card object in the fulfillment index.js and include the button inside the Card
function fallback(agent) {
agent.add(new Card({
title: `Title: this is a card title`,
text: `This is the body text of a card. You can even use line\n breaks and emoji! 💁`,
buttonText: 'Click me',
buttonUrl: 'https://assistant.google.com/'
})
);
}
In addition to that, in this post there is a different way to perform the cards. In this question there is more detailed information of how to add a button into a card.
Finally, there is an unofficial repository that includes multiple buttons in the Dialogflow response that is integrated and tested with Facebook messenger platform. You can see some Dialogflow integrations with multiple conversations platforms that already have buttons into a Card.

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.

Google Dialogflow Quick Replies formatting issues in Telegram

I had create a chatbot using Dialogflow and integrated it with Facebook Messenger & Telegram. I noticed that for the Quick Replies in Telegram (Link 1) appears differently in FB Messenger (Link 2). Is there any way to make it nicer and more presentable in Telegram?
Telegram
Facebook Messenger
This is my Quick Replies settings in Dialogflow.
Dialogflow
in DialogFlow you can indeed (as Marc pointed out) use a Custom Payload for Telegram, here it is an example:
{
"telegram": {
"text": "What would you like help with?",
"reply_markup": {
"inline_keyboard": [
[
{
"text": "Daily News",
"callback_data": "news"
}
],
[
{
"text": "New Features",
"callback_data": "features"
}
]
]
}
}
}
The quick replies appear a buttons you can click (notice the actual response is sent but not displayed within the chat).
All the best!
Beppe
SHORT ANSWER:
That is NOT possible.
DETAILED ANSWER:
Each Channel (Facebook Messenger, Telegram etc.) has its own UI components and its own styling. Those can't be changed as they are rendered/controlled by the channel it self.
What Dialogflow doing is giving you the ability to show these UI components in each channel without making you handle the different implementation needed for each channel.
Dialogflow also gives you the ability to send Custom Payloads where you can send a custom JSON (that should be compatible with the channel you are connected to) That can be used if the channel for example has a UI component that is not yet supported by Dialogflow.
If the channel gives you an option to change a property in the UI components you are using, you could do that using Custom JSON, But still you are always limited to how each channel renders the UI components and what features they provide us

Resources