botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Is it possible for Bot to proactively message to any specific contact via channel like Skype/FB/Slack?

Open barmangaurav opened this issue 10 years ago • 15 comments

Based on some activity message, I want to send a proactive message from Bot side to a specific user on its contact list using any of the supported messaging channels like Skype/FBMessenger/Slack. This specific user has not done any conversation with the bot yet; but added the bot to its contact list on the same channel. I am using C# to develop my Bot.

Example: Message from me(barmangaurav) to Bot: Please initiate a sale transaction for my car, buyer name: XYZ

Message from Bot to XYZ: A sale transaction has been initiated for the purchase of car, Please ping the OTP to confirm and finish transaction. Seller name: barmangaurav | OTP: s2DwQT4

Message from Bot to me(barmangaurav): As requested, a transaction has been initiated and OTP has been sent to XYZ, your transaction will be finished once buyer confirms by sending the OTP.

P.S. - XYZ is the registered username on any of the channel.

Any help or advice is much appreciated.

barmangaurav avatar Sep 21 '16 08:09 barmangaurav

I can only answer for Facebook and only for doing it without the botframework :D there it is possible only after the user opt-in to be contacted by you ONCE -- e.g. in technical terms you need his page_scoped userId which you get after the user does the opt-in (he doesn't have to message you (!))

the opt-in happens e.g. with the send to messenger plugin which is kinda like the connect to facebook button

Daij-Djan avatar Sep 21 '16 08:09 Daij-Djan

I would love a function bot.startDialog(USER_ID, "/dialog") ... don't wait for a reply.

Daij-Djan avatar Sep 21 '16 08:09 Daij-Djan

It is possible. @EricaWu did this w/ the Olympics Bot:

https://channel9.msdn.com/Blogs/Seth-Juarez/Erica-Wu-on-the-Bot-Framework-and-Cognitive-Services

brandonh-msft avatar Sep 21 '16 16:09 brandonh-msft

awesome - how then :D LG Dominik

Web: https://pich.info Twitter: @DaijDjan Facebook: Dominik.Pich

On Sep 21, 2016, at 6:47 PM, Brandon H [email protected] wrote:

It is possible. @EricaWu https://github.com/EricaWu did this w/ the Olympics Bot https://github.com/ericawu/TwitterStreamEventBot:

https://channel9.msdn.com/Blogs/Seth-Juarez/Erica-Wu-on-the-Bot-Framework-and-Cognitive-Services https://channel9.msdn.com/Blogs/Seth-Juarez/Erica-Wu-on-the-Bot-Framework-and-Cognitive-Services — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Microsoft/BotBuilder/issues/1288#issuecomment-248672143, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJkf2URL8w5IOPUCsk12RZI_BjYENapks5qsV-pgaJpZM4KCgpm.

Daij-Djan avatar Sep 21 '16 17:09 Daij-Djan

that's why i linked the source ;) but here's the method that does it

brandonh-msft avatar Sep 21 '16 17:09 brandonh-msft

sorry and thanks - saw only the huge video on the page :)

LG Dominik

Web: https://pich.info Twitter: @DaijDjan Facebook: Dominik.Pich

On Sep 21, 2016, at 7:44 PM, Brandon H [email protected] wrote:

that's why i linked the source ;) but here's the method that does it https://github.com/ericawu/TwitterStreamEventBot/blob/master/TwitterStreamEventBot/Services/CheckTrends.cs#L47 — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Microsoft/BotBuilder/issues/1288#issuecomment-248688004, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJkf_ND6ptRN-LwT4QEImvonpsqntb-ks5qsWz1gaJpZM4KCgpm.

Daij-Djan avatar Sep 21 '16 18:09 Daij-Djan

That's great news.. Let me implement the same and I share my feedback afterwards.

Thanks a ton @Daij-Djan, @brandonh-msft and @EricaWu

barmangaurav avatar Sep 22 '16 06:09 barmangaurav

Well, after going through the github code, I have learnt that TwitterStreamEventBot is storing user details (Service URL, Recipient and From) into a topic dictionary whenever a user subscribe for any topic. Later, at every 15 seconds if the subscribed topic is a trending one, Bot sends proactive message(trending topic details) to the subscribed user.

This proactive messaging works fine for a user who has already interacted with the Bot once.

My initial query was to proactively messaging a new contact(UserB) which has never interacted with the bot based on some event or a request by any user(UserA) interacting with the bot. I presume that feature is not available in order to avoid spamming. I will work out with current available features and tweak my use case to fit a publisher-subscriber model.

Many thanks for your guideline and support @Daij-Djan , @brandonh-msft , @EricaWu

Regards, Gaurav Barman

barmangaurav avatar Sep 23 '16 07:09 barmangaurav

I have also have the same question but i am developing my bot in Node Js. How can i send message and receive particular reply for that message in Node Js?

Any help or advice is much appreciated.

SurabhiKandi avatar Mar 17 '17 11:03 SurabhiKandi

@SurabhiKandi: https://github.com/Microsoft/BotBuilder-Samples/tree/master/Node/core-CreateNewConversation

brandonh-msft avatar Mar 17 '17 16:03 brandonh-msft

Thanx brandonh-msft , I am able to send the message to user but not able to receive user reply . I am not getting any error and also not receiving any user reply. So, how could i do that ?

SurabhiKandi avatar Mar 17 '17 16:03 SurabhiKandi

@barmangaurav how did it go?

Could you find some way of making a Facebook Messenger bot send a message to their users? By users here I mean users that like the Facebook Page, but never sent a message to the bot.

piffarettig avatar May 10 '17 04:05 piffarettig

@piffarettig have you find a solution ? I'm creating a messenger bot , and i need to create a module to send broadcast message to users in a specific time .

stelazh avatar May 02 '18 15:05 stelazh

@stelazh I think that's not possible, user must send a message to the bot first, via the FB page.

piffarettig avatar May 02 '18 15:05 piffarettig

Ok , this is possible in my case...i will send notification after they will request to be notify ...i want to know how to initialize a conversation when in my database i will have one info .

For example user want to get notification when we have a racing . I have to send notification to user 1 hour before the event will be online

stelazh avatar May 02 '18 15:05 stelazh