Closed khushleen closed 2 years ago
For Teams, use the bot.startConversationWithUser method...
https://github.com/howdyai/botkit/blob/main/packages/botkit/src/botworker.ts#L274
I got success by using addMessageToConversation() to send the proactive notification to the user. Here is the sample code, I have used for your reference:
`
var config_obj = { clientId: <-- APP ID -->, clientSecret: <--SECRET -->, serviceUrl: <-- URL --> }
input_param = { "recipient":{"id":"29:*","name":<--USERNAME-->}, "type":"direct_message", "from":{"id":"28:","name":<--BOTNAME-->}, "conversation":{"conversationType":"personal","tenantId":,"id":"a:"} }
teamsapi = teamsapi_maker(config_obj) teamsapi.getToken(function(){ teamsapi.addMessageToConversation(input_param.conversation.id, input_param, function(){ }) })
`
Hi, I am trying to send the proactive notification(1:1 user) on MS teams using botkit. I checked all the documentation and wrote the below code, but I am not getting success. It is neither showing any error nor sending a message.
Please suggest the method/function which will be used to send a message from bot to the user without any message/activity/event initiated from the user.