Microsoft Bot Framework

Sample implementation

An example of bot implementation with integration to mluvii is available on github.

Supported formats of Microsoft Hero Cards

At this moment, mluvii supports the following card functionality Hero Card: Hero Card Type (contentType):

  • application/vnd.microsoft.card.hero

  • application/vnd.microsoft.card.thumbnail

Attachment Layout:

  • List

  • Carousel

Chat input properties:

Integration with mluvii

The chatbot created in the Microsoft Bot Framework can communicate through ChannelData. For example, it can list the available operators or send an email from the client.

Example of submitting a request

private async Task ConnectToOperator(IDialogContext context)
  {
      var data = JObject.Parse(@"{ ""Activity"": ""Forward"" }");
      var act = context.MakeMessage();
      act.ChannelData = data;
      await context.PostAsync(act);
  }

Example of answer

private async Task OnMessageRecieved(IDialogContext context, IAwaitable<IMessageActivity> result)
  {
      var activity = await result;
      if (activity.AsEventActivity() != null && activity.ChannelData != null)
      {
          var availibleOperatorsInfo =
              JsonConvert.DeserializeObject<GetAvailableOperatorsResponse>(activity.ChannelData);
          await OnAvailibleOperatorsResponse(context, availibleOperatorsInfo);
      }
  }

Mluvii channel identification

When communicating with a bot, the speech is identified by constant Id “mluvii_guest” in theFromfield. E.g.:

"channelId": "directline"
...
"from": {
    "id": "mluvii_guest"
}
...
"conversation": {

Next stpes

Check supported activities and events

results matching ""

    No results matching ""