Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Bots with Microsoft Bot Framework

You're reading from  Building Bots with Microsoft Bot Framework

Product type Book
Published in May 2017
Publisher Packt
ISBN-13 9781786463104
Pages 424 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Kishore Gaddam Kishore Gaddam
Profile icon Kishore Gaddam
Toc

Table of Contents (10) Chapters close

Preface 1. Setting up Microsoft Bot Framework Dev Environment 2. Developing Your First Bot Using the Connector and Builder SDK 3. Developing WeatherBot Using Dialogs and LUIS 4. Natural Speech and Intent Processing Bot Using Microsoft Cognitive Services 5. Developing Bots Using LUIS Prompt Dialogs with State and Nearby Bot Using Custom APIs 6. Developing an IVR Bot for a Bank Using Advanced Microsoft Bot Framework Technologies 7. Intelligent Bots with Microsoft Bot Framework and Service Fabric 8. Developing Intelligent Facial Expression Identification Bot for IoT Using Azure and Power BI 9. Publishing a Bot to Skype, Slack, Facebook, and the GroupMe Channel

Messages

Your bot can send rich text, emoticons, pictures, and cards to a user or group. Users can send rich text and pictures to your bot. You can specify the type of content your bot can handle in the Skype settings page for your bot:

Content From user to bot From bot to user Description
Rich text Including emoticons :)
Pictures PNG, JPEG, or GIF up to 20 Mb
Video Coming soon MP4, AAC+h264 up to 15 Mb (approx. 1 minute), plus JPEG thumbnail
Cards

Basic format

Each Skype user is assigned a unique ID for your bot, which is sent along with the display name with every message:

{ 
"text": "Hello (wave)",
"id": "1466182688092",
"type": "message/text",
"timestamp": "2016-06-17T16:58:08.74Z",
"channelId": "skype",
"serviceUrl": "https://apis.skype.com",
"from": {
"id": "29:2hJJkjmGn4ljB2X7YYEju-sgFwgvnISvE6G3abGde8ts",
"name": "Display Name"
},
"conversation": {
"id": "29:2hJJkjmGn4ljB2X7YYEju-sgFwgvnISvE6G3abGde8ts"
},
"recipient": {
"id": "28:29415286-5a43-4a00-9dc5-bcbc2ce1f59e",
"name": "Trivia Master"
}
}

The from field contains the unique user ID (prefixed by 29) and user Display Name. The recipient field contains the app ID (prefixed by 28, which indicates a bot in Skype) and the bot's display name. In Skype, your bot is addressed using the Bot Framework App ID (a GUID).

You cannot currently use slash (/) commands as part of conversations with your bot. This is a reserved character in Skype.

Rich text

Users can communicate with the bot using rich text format as well. Users can make the chat text as bold if needed or a bot can communicate with the user and make certain words as bold. Most of the channels support all the text properties supported by the Microsoft Bot Framework.

Skype emoticons

Skype emoticons can be sent by using the emoticon keyword in parentheses:

{
"text": "(heart)"
}

The output of the preceding code is as follows:

If a user sends your bot an emoticon, it may include <ss> tags around the emoticon, which can be ignored; for example, <ss type="skype">(wave)</ss>. Sending Skype Mojis (short, expressive video clips) is not currently supported.

Welcome messages

To send a welcome message to a user, listen for the contactRelationUpdate activity. To send a welcome message to a group, listen for the conversationUpdate activity.

Pictures and videos

Let's check out, how pictures and videos are sent:

  • Pictures and videos are sent by adding attachments to a message
  • Pictures can be PNG, JPEG, or GIF up to 20 Mb
  • Videos can be MP4 or AAC+h264 up to 15 Mb (approx. 1 minute), plus JPEG thumbnails
You have been reading a chapter from
Building Bots with Microsoft Bot Framework
Published in: May 2017 Publisher: Packt ISBN-13: 9781786463104
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime