1- I have created Group in MS teams and added few members into group and had given group name as "IT Bot Helper".
2- Now I have added our custom built Bot into this group and once BOT is added to this group OnTeamsMembersAddedAsync method is triggered in the C# code using BOT framework.
public class ITAssistantBot : TeamsActivityHandler
{
protected override async Task OnTeamsMembersAddedAsync(IList<TeamsChannelAccount> teamsMembersAdded, TeamInfo teamInfo, ITurnContext<IConversationUpdateActivity> turnContext, CancellationToken cancellationToken)
{
// Once Bot is added to teams group this method get triggers
// I got all the members which is part of this member
}
}
3- OnTeamsMembersAddedAsync :- I also got the GroupId of this group using this turnContext.Activity.Conversation.Id but somehow I am not able to find the group name which is "IT Bot Helper".
Can someone help here to find the Group Name in this method.
You can take a look at the docs on Teams contexts in bots to see how to get data about a team. If the built-in functionality does not work for you, you could also look into using the Microsoft Graph APIs instead. Graph lets you do many things that might not be natively supported in the Teams context.
Related
I am trying to migrate the MyBot that I created and run in echoBot to VirtualAssistant.
But there was one problem at the beginning.
There is no "accessor".
I was able to store user information and conversations via an accessor.
How can I store dynamic information without using accessors?
Below is the code I used.
var someQuery = await _accessors.SomeQuery.GetAsync(stepContext.Context, ()=> new SomeQuery(), cancellationToken);
With the stored query information, I was able to use the query variables at will.
I wonder what the virtual assistant can do to replace this.
I found a solution. Now I know I have an IStatePropertyAccessor. I was too hasty. I thought the Accessor had disappeared because there was no Accessor class.
I am implementing HotChocolate as part of my ASP.NET API. I'm trying to add subscriptions to the chat portion on my app, however, the documentation on the HotChocolate site is not implemented yet. From what I can tell from other sites/frameworks, I can use the C# IObservable<Chat> as the return type for the subscription method.
Can anyone give me an example of a query method or point me towards another resource?
public async Task<IObservable<Message>> GetMessages(Guid chatId) {
var messages = ..Get chats;
return messages;
}
However, how does this work from a query standpoint? How do we trigger an event to update this?
Thanks.
Since the original documentation link became obsolete I am posting this new link that refers to our workshop project.
Chapter 7 shows how to do subscriptions in two variants.
https://github.com/ChilliCream/graphql-workshop/blob/master/docs/7-subscriptions.md
I hope that helps.
I'm trying to create a bot that integrates LUIS whose purpose is to search for recipes and products, but I'm struggling to understand a few concepts.
To begin with, I have an issue regarding the flow of the conversation. Let's say the user asks for a recipe but doesn't specify what products he would like to filter. The bot will check if there are any entities (products) in this utterance and if not, it will reply asking for the specific products. So something like:
User: "I want to see recipes"
Bot: "Please specify the ingredients"
User: "Bananas"
This is where I find my first problem. How will the bot be able to understand that the user's last utterance (bananas) is directed to the Recipes Intent and not the Products one?
To try and work around this, I've trained LUIS to direct these entities to go to the None Intent. I've also created a flag that allows me to detect which was the last Intent the user went through. From this I can redirect the bot to the correct intent.
I feel like there must be a better solution than this. Am I missing something here? Is there a way to keep track of the history of intents used? I've also tried using context.Wait, but I believe the method doesn't receive (or return) a LuisResult, which makes it impossible for me to later detect if there are any entities in the user's message.
My second question is, if it is possible for the user to send a message that won't enter any intent and will just be directed to a certain method?
[LuisIntent("aa")]
[LuisIntent("bb")]
public async Task AaIntentSpecified(IDialogContext context, LuisResult result)
{
}
[LuisIntent("")]
public async Task IntentNotSpecified(IDialogContext context, LuisResult result)
{
}
If you left a method like this in luis dialog, then any intents that not has a function mapped will go to this function. The intent "aa" and "bb", will go to AaaIntentSpecified, any other intents like "cc", "dd" ... will go to IntentNotSpecified.
There seem to be plenty of examples of filtering by single and multiValueExtendedProperties in Microsoft Graph but these seem to be legacy. How do you filter by an OpenTypeExtension created like so?
ev.Extensions.Add(new OpenTypeExtension() {
AdditionalData = bag,
Id = Constants.LibraryId
});
The ultimate goal is to filter events by whether our library created them.
Did you create these as Schema extensions (registering the shape of the extension in advance), or as open extensions? In order to use the filter operation on extended properties, you'll need to be using Schema extensions. In that case, you can filter as you normally would on an resource's property (eg. ~/me/messages?$filter=myExtension/favoriteColor eq 'green'). Here is more information about creating schema extensions on Graph resources.
We can employ form flow to enable user interactions with the bot in a flow of prompts. Here is a great example for doing this for a simple "Order a sandwich" task. I want to know instead of command line prompts can I use real graphical interfaces? And instead of hard-coding the options can I pull the fields from a database or from some external resources through API calls?
None of the messenger channels (i.e. Facebook / Skype / Slack) support complex GUI elements yet (i.e. radio buttons, combo boxes, etc).
If you use the DynamicField elements, you can indeed populate the options from anywhere you like (including a database if you so wish):
.Field(new FieldReflector<BugReport>(nameof(Product))
.SetType(null)
.SetDefine((state, field) =>
{
foreach (var prod in GetProducts())
field
.AddDescription(prod, prod)
.AddTerms(prod, prod);
return Task.FromResult(true);
}))
Where GetProducts returns you a list of products - this could be from a DB, etc.
Sample taken from Dynamic FormFlow Forms in Bot Builder.