How to start 1:1 conversation with user by sending OAuthPrompt - c#

I'm using Bot Framework v4 and c# to build a teams bot that signs in user when added to channel.
My use case, is that each time a new user is added to the channel, I want to send him an OAuthPrompt in 1:1 in order to sign him in.
The samples provided for proactive message shows only how to send a simple message, and can't find the right resources to solve this problem.

Related

The teams channel getting spammed with Bot intro message

I have added a bot to a Teams channel.
Each time a new user is added to the Teams channel the bot sends a welcome message inside the channel.
I want this message to be sent to the user personally and not to the whole channel.
You can send message to user on 1:1 using proactive message. When the user added to the team you will receive on member added activity there you can send a message to user personally. Please check this docs for more info and also check this sample

Botframework reminder chatbot

Does anyone know how they made bot like this and this? I am using BotFramework V4 and C# and i need to make a reminder feature like this.Does this use proactive bot? and if yes can someone explain in layman how proactive bot works? Thanks!
Update:
That likely uses proactive messaging, yes. I'm not sure if either of those use Bot Framework, but to do that in Bot Framework, you'll need proactive messaging.
Samples:
C#
Node
A proactive message is generally either:
A message sent to a user that hasn't spoken with the bot before (this is how Teams defines it), or
A message sent to a user that the bot has spoken with previously, but the message being sent is not really a part of the previous conversation (this is more how Bot Framework defines it)
Please see the docs linked above for more detail.
The gist of it, however, is that when a user talks with the bot, you save a reference to that conversation. At any future date that you want to talk to that user, you use that reference of the conversation (because it contains all of the pertinent user data) to message the user.
The tricky part with something like a reminder, however, is having the bot perform it at a particular time. Something like Task.Delay doesn't work very well at scale over long periods of time. The best thing to do for long, time-based delays would be set up some kind of other server to keep track of the time. Once that time expires, send a request to the bot to send the proactive message. The Proactive Sample does something kind of like the last part of that by accepting requests at api/notify.

Microsoft Bot Framework and Slack Direct Messaging - Bots Cannot Message Users in External Teams?

Following this post, Microsoft Botframework: Direct Conversation with Bot Channel, I implemented this code into my own bot, getting the error "Bots Cannot Message Users in External Teams". What does this mean and is there a workaround?
Ok, so here's what I did. I went back through Slack and resaved all the settings, and then it worked!. Also, make sure the workspace IDs match for your bot and who you're sending the message to.

Debug msft teams bot channel conversation

I have a bot that collects information in a private chat from User A about User B and then sends it to User B. I am collecting the information via Dialog and then formatting a HeroCard to be sent. I was using the Bot Emulator to test the private chat code, but I'm unable to test creating a new conversation () in the emulator without getting a 500 InternalServerError. When I deploy the code and integrate the bot into an existing Teams channel I receive 400 Bad Request responses.
Is there a tool to use that can help me debug creating a new conversation locally?
You need the user’s (User-B) unique ID and tenant ID to start 1:1 proactive conversation. Typically, these are obtained from a team context, either by fetching the team roster or when a user interacts with your bot in a channel.
Please check the sample code.

3 different channels in the same conversation botframework

I'm trying to do a C# MVC WebApplication for human-hybrid bots support customers, so I can't create a conversation between 3 different channels.
Example:
1-) An user start a chat with my bot in facebook
2-) When the bot receive the activity, he adds a new guy in conversation (directline, that's I have conversationId).
3-) The facebook user now, is chatting with other 2 users (bot and directline User).
Is the correct logic ?
I'm trying to create this group conversation but I'm getting error 500.
This is a common scenario that I've seen addressed by a number of users in the following manner:
Build your customer support interface (CSI) (i.e. the side used by your customer support reps) using Direct Line
Your bot pipes through the all the user messages to the CSI which stores all the conversations. Reps can see a list of all the users interacting with the bot and the history of each of those conversations.
When escalation to a human is needed, the bot flags one of the conversations needing attention
Your bot then brokers conversations between the accounts (i.e. Facebook End User <-> Your Bot <-> CSI). Essentially the customer support rep is creating a response, which is being posted by the bot back to the end user
This means there's no need to add an additional person to the conversation. (Facebook currently only allow 1-on-1 conversations with bots).

Categories