New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use @mention #127
Comments
@fc-ds I do not believe that mentioning someone via incoming webhooks is permitted by Microsoft Teams. At least, it wasn't when I last looked into the support for it. I don't have the original references I looked at available to cite, but I specifically recall looking into this in the past and found it wasn't an option. If you find that this is now supported via Incoming Webhooks, please share those details so we can look further into it. It would be useful to have that support in this library. |
You can mention someone with following: curl -X POST -H "Content-type: application/json" -d '{
"type": "message",
"text": "Hey <at>Some User</at> check out this message",
"entities": [
{
"type":"mention",
"mentioned":{
"id":"some.user@company.com",
"name":"Some User"
},
"text": "<at>Some User</at>"
}
]
}' <webhook_url> |
@ghokun thanks for sharing! |
@fc-ds Thanks to the feedback from @ghokun, we now know that this (much requested) feature is available in Microsoft Teams. I'll first prototype the support in a small project that I maintain which uses this library, then land the applicable changes here. No estimates for when that will be, but I'll be sure to let you know when it does. Thanks for opening this issue and your interest. |
As previously noted, this example works as intended. However, I'm having some trouble finding a good reference for the JSON format. This doesn't appear to be the legacy MessageCard format or the Adaptive Card format, but potentially the format noted here: If this library implements the Adaptive Card format, the desired mention support would be provided, but the JSON snippet you provided appears to be much simpler. If this library implements support for that format, the desired functionality can be added sooner. I expect that I'm overlooking it, but if you happen to have a reference to share that would be appreciated. |
I was looking for a way to mention user names when a pull request is opened on gitlab through gitlab-teams integration. I was not successful but saw this repository. I think this message format is for bot api but works in webhooks regardless. There is a website for designing adaptive cards : https://adaptivecards.io/designer/ |
Summary: - deprecate the current `API` interface - expose `TeamsClient` to take its place - create common interfaces and helper code to abstract any specific Microsoft Teams message format - create new `botapi` package (limited functionality) - extend existing `MessageCard` type (where needed) type to support new behavior - port existing `goteamsnotify.MessageCard` types/functions/methods to a new `messagecard` package and deprecate existing `MessageCard` functionality provided by the `goteamsnotify` "base" package - update examples to reflect changes - restore support for overriding default `http.Client` - restore default project-specific user agent, support for overriding the default from client code While making these changes I've refactored code and attempted to clearly communicate which existing code/functionality is being deprecated, all without introducing breaking changes for client code. The `botapi` package added in this collection of changes is a minimal implementation. This package is intended to provide limited user mention functionality for channel updates as a "bridge" until future `Adaptive Card` support can be implemented. A future implementation of `Adaptive Card` support would provide a more complete experience, presumably providing a superset of the limited support in the `botapi` package and existing `MessageCard` functionality. refs GH-127 refs GH-134 refs GH-135 refs GH-154
Initial support available here: https://github.com/atc0005/go-teams-notify/releases/tag/v2.7.0-alpha.1 Example here: go-teams-notify/examples/user-mention/main.go Lines 35 to 58 in 2b9b721
Feedback is welcome. This is a pretty limited implementation; a more complete implementation is planned for a future release once |
Initial https://github.com/atc0005/go-teams-notify/releases/tag/v2.7.0-alpha.2 Feedback is very much encouraged so issues can be found/resolved before the stable v2.7.0 release (date TBD). Discussion thread here: #163 The Examples for the new package can be found here: https://github.com/atc0005/go-teams-notify/tree/master/examples/adaptivecard An equivalent example for what I provided previously: go-teams-notify/examples/adaptivecard/user-mention-single/main.go Lines 37 to 65 in b24de89
Thanks for your interest in this project. |
No negative feedback has been received for the v2.7.0-alpha.2 release thus far. I'm considering this resolved for the v2.7.0 release. |
Hello,
I'm trying to mention someone in the cards like I do manually with @user .
Is there a way to do that with this lib ?
The text was updated successfully, but these errors were encountered: