Is it possible to specify the string "User" in the mention banner? - microsoft-teams

Is it possible to specify the string "User" in the banner notification that I receive when I send a message via the connector?
The code of the message you are sending is:
{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "<at>mentioned</at>, Hello! World",
"wrap": true
}
],
"actions": [
{
"type": "Action.OpenUrl",
"url": "https://www.example.com",
"title": "Open Url"
}
],
"msteams": {
"entities": [
{
"type": "mention",
"text": "<at>mentioned</at>",
"mentioned": {
"id": "naoto.omori#msandc.co.jp",
"name": "Naoto Omori"
}
}
]
}
}
}
]
}
banner of mention

It's not possible to do this. specify the string "User" in the banner notification. Could you please raise a user voice here: microsoftteams.uservoice.com/forums/555103-public/filters/new

Related

Find replies on Slack direct message

I'm dumping my direct messages in Slack.
I manage to get all the messages one by one.
However I don't find any property that tells which message is a parent message and which ones are replies.
How can we get this information?
Typical code in C#
ConversationsListResponse conversationListRespons = await slackClient.GetConversationsListAsync("",false,100,types);
foreach (var channel in conversationListRespons.channels)
{
ConversationsMessageHistory messages = await slackClient.GetConversationsHistoryAsync(channel);
Even when I test the api from the slack interface, it's not giving the information.
Are there any other apis than the ones I'm using to get the required information?
Api used: https://api.slack.com/methods/conversations.history
Here is an example: This a main Direct Message with 4 replies.
conversations.history returns them without any relationship between them.
The query in slack test interface:
and the result:
{
"ok": true,
"messages": [
{
"type": "message",
"text": "voici un log",
"files": [
{
"id": "F04M6EAEXGX",
"created": 1675280228,
"timestamp": 1675280228,
"name": "32x32.ico",
"title": "32x32.ico",
"mimetype": "application/octet-stream",
"filetype": "binary",
"pretty_type": "Binary",
"user": "U0XNQGD0R",
"user_team": "T0XN0RW8H",
"editable": false,
"size": 4286,
"mode": "hosted",
"is_external": false,
"external_type": "",
"is_public": false,
"public_url_shared": false,
"display_as_bot": false,
"username": "",
"url_private": "https://files.slack.com/files-pri/T0XN0RW8H-F04M6EAEXGX/32x32.ico",
"url_private_download": "https://files.slack.com/files-pri/T0XN0RW8H-F04M6EAEXGX/download/32x32.ico",
"media_display_type": "unknown",
"permalink": "https://sanitized.slack.com/files/U0XNQGD0R/F04M6EAEXGX/32x32.ico",
"permalink_public": "https://slack-files.com/T0XN0RW8H-F04M6EAEXGX-bb8c68eec7",
"is_starred": false,
"has_rich_preview": false,
"file_access": "visible",
"media_progress": null
}
],
"upload": false,
"user": "U0XNQGD0R",
"display_as_bot": false,
"ts": "1675280236.783609",
"blocks": [
{
"type": "rich_text",
"block_id": "Twy",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "voici un log"
}
]
}
]
}
],
"client_msg_id": "5bda3f9c-64a8-4c1b-8b5e-f37c3b2e2c5d"
},
{
"client_msg_id": "850f4ecc-59c0-4af0-b13f-e527ed7a88de",
"type": "message",
"text": "<#U0XNQ04JD> test",
"user": "U0XNQGD0R",
"ts": "1675280205.367429",
"blocks": [
{
"type": "rich_text",
"block_id": "qi/vH",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "user",
"user_id": "U0XNQ04JD"
},
{
"type": "text",
"text": " test"
}
]
}
]
}
],
"team": "T0XN0RW8H"
},
{
"client_msg_id": "e249a07d-f887-4edb-859a-1cc38559dc7b",
"type": "message",
"text": ":100:",
"user": "U0XNQGD0R",
"ts": "1675280190.138859",
"blocks": [
{
"type": "rich_text",
"block_id": "rGp",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "emoji",
"name": "100",
"unicode": "1f4af"
}
]
}
]
}
],
"team": "T0XN0RW8H"
},
{
"client_msg_id": "df2a2f63-21b1-42d5-91db-3c66b083ed7c",
"type": "message",
"text": "yes<https://www.google.com|link to google>",
"user": "U0XNQGD0R",
"ts": "1675280183.929889",
"blocks": [
{
"type": "rich_text",
"block_id": "GZV",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "yes"
},
{
"type": "link",
"url": "https://www.google.com",
"text": "link to google"
}
]
}
]
}
],
"team": "T0XN0RW8H",
"reactions": [
{
"name": "+1",
"users": [
"U0XNQGD0R"
],
"count": 1
}
]
},
{
"client_msg_id": "116e4fc3-ef4a-4148-84ad-975ff0f227e6",
"type": "message",
"text": "Salut Christophe,\nthis is a test for Slack",
"user": "U0XNQGD0R",
"ts": "1675254487.545169",
"blocks": [
{
"type": "rich_text",
"block_id": "O2s",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Salut ,\nthis is a test for Slack"
}
]
}
]
}
],
"team": "T0XN0RW8H"
}
],
"has_more": false,
"is_limited": false,
"pin_count": 0,
"channel_actions_ts": null,
"channel_actions_count": 0
}
To start, there might be some confusion as to what constitutes a reply or thread on Slack. Your first screenshot seems like several "normal" messages posted by the same user one after the other. In Slack a thread is a message posted by selecting the thread icon that corresponds to a parent message as seen in the screenshot.
With that established, you can retrieve threaded messages by making a call to conversations.replies.

Type ahead search doesn't work when tried from Task module

When I try to write something in the Input.choices component, it doesn't invoke onInvokeActivity while using it from the Task module, I see there's this issue already mentioned around several months ago, but MSFT teams couldn't share the ETA, please help if you come across this and have solved it.
I am attaching the sample code and the onInvokeActivity method here.
{
"type": "AdaptiveCard",
"body": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Heading",
"wrap": true,
"size": "Small",
"weight": "Bolder"
},
{
"type": "Input.ChoiceSet",
"placeholder": "Select something",
"isRequired": true,
"errorMessage": "Select at least one",
"id": "userId",
"choices": "${choices}",
"choices.data": {
"type": "Data.Query",
"dataset": "hello"
},
"spacing": "None",
"style": "filtered",
"value": "${defaultChoice}"
}
],
"spacing": "ExtraLarge"
}
],
"actions": [
{
"data": {
"commandId": "commandId",
"msteams": {
"type": "invoke",
"value": {
"type": "task/submit"
}
}
},
"title": "Submit",
"type": "Action.Submit"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.3"
}
protected async onInvokeActivity(
context: TurnContext
): Promise<InvokeResponse<any>> {
if (context.activity.name === "application/search") {
const { queryText, dataset } = context.activity.value;
if (dataset === "hello") {
console.log({ queryText });
}
}
}
Network tab response while typing:
{
"statusCode": 504,
"message": "App is not installed"
}

Microsoft Teams - multiselect in ms teams bot

How to implement multiselect in drop down list through adaptive cards to fill a form which contains the name of employees to select.
If not what are the other ways to implement multiselect in Ms Teams through bot.
Multiselect like this.
Check and build samples.
Check this sample Adaptive card
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.2",
"speak": "<s>Your meeting about \"Adaptive Card design session\"<break strength='weak'/> is starting at ${formatDateTime(start.dateTime, 'HH:mm')}pm</s><s>Do you want to snooze <break strength='weak'/> or do you want to send a late notification to the attendees?</s>",
"body": [
{
"type": "TextBlock",
"text": "${summary}",
"size": "Large",
"weight": "Bolder"
},
{
"type": "TextBlock",
"text": " ${location} ",
"isSubtle": true
},
{
"type": "TextBlock",
"text": "${formatDateTime(start.dateTime, 'HH:mm')} - ${formatDateTime(end.dateTime, 'hh:mm')}",
"isSubtle": true,
"spacing": "None"
},
{
"type": "TextBlock",
"text": "Snooze for"
},
{
"type": "Input.ChoiceSet",
"id": "snooze",
"value": "${reminders.overrides[0].minutes}",
"choices": [
{
"$data": "${reminders.overrides}",
"title": "${hours} hours",
"value": "${hours}"
},
{
"$data": "${reminders.overrides}",
"title": "${minutes} minutes",
"value": "${minutes}"
},
{
"$data": "${reminders.overrides}",
"title": "${seconds} seconds",
"value": "${seconds}"
}
],
"isMultiSelect": true
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Snooze",
"data": {
"x": "snooze"
}
},
{
"type": "Action.Submit",
"title": "I'll be late",
"data": {
"x": "late"
}
}
]
}

Microsoft Teams Adaptive Card Input.ChoiceSet Apostrophe Rendered Differently

When I create an Adaptive Card for Microsoft Teams with an Input.ChoiceSet value and that value contains an apostrophe, Microsoft Teams OS X and web clients show ', the iOS and Android clients show the apostrophe (correct).
What can I do differently to get the Input.ChoiceSet value to render the apostrophe in every case?
Here's the card schema and a render below.
{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Command Center",
"size": "large",
"weight": "bolder"
},
{
"type": "TextBlock",
"text": "Please choose a scenario to submit."
},
{
"type": "Input.ChoiceSet",
"id": "scenario-id",
"style": "compact",
"isMultiSelect": false,
"value": "71ae62b1-f04e-11e9-b862-577308a243ca",
"choices": [
{
"value": "71ae62b1-f04e-11e9-b862-577308a243ca",
"title": "Foo's Bar"
},
{
"value": "16db3124-f42d-11e9-bde7-819811d8b810",
"title": "Second"
}
]
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"id": "popup",
"title": "Continue...",
"data": {
"msteams": {
"type": "task/fetch"
}
}
}
]
}
}
]
}
Teams OS X and Teams Android Render
#MarkSingleWire Thanks for reporting this. We have raised a bug for this and we are looking into this internally.

Action.Submit on Adaptive Cards not working with Input.Text Python SDK

I am trying the adaptive cards with the Bot Builder v4 Python SDK. I am trying to gather feedback from the user using the Input.text field and then the Action.submit
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
],
"actions": [{
"type": "Action.ShowCard",
"title": "Want to provide feedback",
"card": {
"type": "AdaptiveCard",
"actions": [
{
"type": "Action.Submit",
"data": "Yes, it was helpful",
"title": "Yes"
},
{
"type": "Action.Submit",
"data": "No, it wasn't helpful",
"title": "No"
},
{
"type": "Action.Submit",
"data": "Start Over",
"title": "Start Over"
},
{
"type": "Action.Submit",
"data": "Exit",
"title": "Exit"
},{
"type": "Action.ShowCard",
"title": "Comment",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "Input.Text",
"id": "comment",
"isMultiline": true,
"placeholder": "Enter your comment"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "OK"
}
]
}
}
]
}
}
]}
This is working well on the visualizer. When I write some comments and and click on OK, this works on the visualizer but does not work in practice. It raises a 502 error.
See below screenshot
I'm using the Bot Build v4 SDK for Python and testing this on Web Chat. It seems there is no issue on the Adaptive Card side of this, I suppose this has something to do with the Python SDK. Any pointers as to where the error might be ?
Please try following code snippet for quick test:
def __create_reply_activity(request_activity):
return Activity(
type=ActivityTypes.message,
channel_id=request_activity.channel_id,
conversation=request_activity.conversation,
recipient=request_activity.from_property,
from_property=request_activity.recipient,
attachments=[Attachment(
content_type='application/vnd.microsoft.card.adaptive',
content={
"type": "AdaptiveCard",
"body": [
],
"actions": [{
"type": "Action.ShowCard",
"title": "Want to provide feedback",
"card": {
"type": "AdaptiveCard",
"actions": [
{
"type": "Action.Submit",
"data": "Yes, it was helpful",
"title": "Yes"
},
{
"type": "Action.Submit",
"data": "No, it wasn't helpful",
"title": "No"
},
{
"type": "Action.Submit",
"data": "Start Over",
"title": "Start Over"
},
{
"type": "Action.Submit",
"data": "Exit",
"title": "Exit"
},
{
"type": "Action.ShowCard",
"title": "Comment",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "Input.Text",
"id": "comment",
"isMultiline": "true",
"placeholder": "Enter your comment"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "OK"
}
]
}
}
]
}
}],
},
)],
service_url=request_activity.service_url)
And there is a detailed explain at Adding an adaptive card to bot framework with python

Resources