How To Post A Message On Behalf Of The User In Microsoft Teams App? - botframework

I'm working on an integration between Microsoft Teams and Slack.
I'm building a Microsoft Teams application which is connected to a Microsoft Bot.
Additionally, I created a server for:
Listening to messages which were sent by users in Slack (via Slack webhooks)
Posting them in Microsoft Teams conversation as a user message to the bot (outgoing message)
I receive messages from Slack (which were sent by a Slack user) to my server and I wish to post them in Microsoft Teams as messages from the user to the bot and I'm not able to do so.
I'm able to send messages from Bot to user in Microsoft Teams app via Microsoft Bot's "botbuilder" Node.js SDK:
session.send(message);
How can I send the message on the other direction (from user to bot)?

You can't. See this question for more info, but the short version is:
The BotFramework has no direct way to do this.
Even the Teams Graph API doesn't currently support this. They're working on it, but don't have an ETA.
The closest thing to a workaround would be:
User writes message in Slack to Bot
Bot receives message and posts a proactive message in Teams, something like:
User #louis1600 said: "blah blah blah"
Resources:
Proactive Messages in Teams
#mention-ing users in Teams with a Bot
The many other Teams Bot related questions I've answered

Related

Microsoft Teams no install event - can't send welcome message

Up until this Friday, MS Teams would always send a conversationUpdate event payload to our bot messaging endpoint whenever a user installed our app in Teams.
This stopped happening suddenly and now we only get a message when an app is added to a Team scope and not just personal scope.
Given that: how do we know to send a Welcome message via our bot to a user that installed our app if we receive no message, no payload. Nothing hits our bot messaging endpoint.

Sending a message to users as a bot in bot channel of Microsoft Teams using the Graph API

I have created a bot by following the steps mentioned in the doc.I have authenticated user using oauth 2.0 (auth code grant) as mentioned in the doc and in reverse I got a access token. But when I send message to channel in the teams using (/teams/{id}/channels/{id}/messages) API the message was sent on behalf of me. But I want my bot as the sender of message. Here is the image of the message that I have sent using the above API. and is there any way to send direct message to user as a bot?
Instead of using the Graph, there's another approach using the Bot Framework itself, to send a message to a team channel, a group chat, or a 1-1 conversation. The code doesn't even need to live inside the bot itself, it just needs to leverage the bot framework under the covers (for example, I have several Azure Functions that pro-actively message users). This idea is called "Proactive messaging" and you can read more about it in the docs here.
You do need to get certain fields when the user first installs the bot though, or any time the bot receives a message. I've described that more at Programmatically sending a message to a bot in Microsoft Teams. You haven't said what language you're using, but there are examples for a bunch of them - I can send you links if you let me know what you're using.

Problems Intergrating Bot Framework with SMS

I have been working on azure chat bot using the bot framework SDK v4 and I have ran into an issue. My bot needs to initiate a conversation first. I have seen some examples with proactive bot but that requires us to save the user credentials as a cookie. What I need is a chat bot that sends the first message to user via SMS to initiate the conversation. The bots needs to be able to set the recipient phone number dynamically. I have looked at integrating the Twillio channel to my bot, but the problem is that the user has to initiate the conversation to the Twillio phone number which then forwards the text to Azure chat bot. I was wondering if there is anything out there which will allow the chat bot to initiate the conversation first via SMS and the phone number of the recipient should be set dynamically. Is there anything out there currently on Microsoft stack? Our company has been a long partner with Microsoft so I would like to have the chat bot using the Microsoft Azure Bot Service. Can you please guide me or forward some documentation? Any help would be appreciated.

How to send private message in Microsoft Teams using bot on behalf of user in Teams?

We can send private messages from a Microsoft Bot to a Teams user. It appears as a chat between bot and a user.
But I need a functionality where a bot can send message on behalf of user in Teams and it would exactly appears as a 1:1 chat of two users in Teams, not as a chat between bot and a user.
Thanks

Microsoft botframework and Slack configuration

I'm using Microsoft's botframework to create a Slack bot, however I'm running into 2 problems.
When I do "Test connection to your bot" I'm getting
InternalServerError
no_text
When I type in the test chat console on the botframework page, the messages are received in my slack general channel. However, when I as a user in my slack and type in the general channel, whatever I type the bot also generate the same message. i.e.
me: Hello
bot: Hello
I think it's how I set up my configuration for the slack bot app and/or the messaging endpoint of my botframework bot.
Thanks.

Resources