Forum Discussion
How To Send A Message From User To Bot In Microsoft Teams App?
member11 I've not done this via Node (js) but I've got it working fine in C#, sending on a schedule from an Azure function. Here's the gist of what you need (see the replies): https://stackoverflow.com/questions/42749982/initiate-a-message-from-bot-to-user-on-botframework
Thank you Hilton Giesenow. Actually I'm looking for another behaviour...
In the example you sent the new message arrived from "consoleBot" while I'd like to send it as "User".
In such case the message would be displayed inside a blue bubble and it'd look like the user sent it.
The UX is crucial in this use case.
- Hilton GiesenowNov 06, 2019Brass Contributor
member11 ahh, I see now - that makes sense given what you're trying to do - this is totally the wrong path we're done. What you'd want is the use the Teams API, with delegated permissions, to post on behalf of the user.
By the way, are you aware of https://m.io/ ? I think they already do something similar to what you're trying to achieve, just fyi.
- member11Nov 10, 2019Copper Contributor
Thanks again Hilton Giesenow https://m.io posts messages solely by the bot while I'm willing to post messages as the user without using Teams' UI... Unfortunately, Teams API doesn't allow posting on behalf of the user
- member11Nov 16, 2019Copper Contributor
A related answer on StackOverflow: https://stackoverflow.com/questions/58788187/how-to-post-a-message-on-behalf-of-the-user-in-microsoft-teams-app