• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript botbuilder.BotConnectorBot类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中botbuilder.BotConnectorBot的典型用法代码示例。如果您正苦于以下问题:TypeScript BotConnectorBot类的具体用法?TypeScript BotConnectorBot怎么用?TypeScript BotConnectorBot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了BotConnectorBot类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: require

This is a sample Verizon Bot which helps the customer by prompting series of
questions to understand the customer intents and helping them to assist
the customers by showing the Verizon offers and helping them to order placements.
 
@author: giriganapathy
@since: May 5, 2016 01:32 PM
-----------------------------------------------------------------------------*/
var restify = require("restify");
var builder = require("botbuilder");

var model = process.env.model || "https://api.projectoxford.ai/luis/v1/application?id=588f2ecf-6889-42a9-9e42-6e345e692543&subscription-key=b27a7109bc1046fb9cc7cfa874e3f819&q=";
var modelUri = "https://api.projectoxford.ai/luis/v1/application?id=588f2ecf-6889-42a9-9e42-6e345e692543&subscription-key=b27a7109bc1046fb9cc7cfa874e3f819";

var dialog = new builder.LuisDialog(model);

var bot = new builder.BotConnectorBot();

var currentOffer = "FiOS Triple Play";



bot.use(function (session, next) {
    if (!session.userData.userNameReceivedFlag) {
        session.userData.userNameReceivedFlag = true;
        session.beginDialog("/userProfile");
    }
    else {
        next();
    }
});
开发者ID:giriganapathy,项目名称:VZChatBotApp,代码行数:30,代码来源:server.ts


示例2: function

/*proxy = http://v631754:[email protected]:80
http - proxy=http://v631754:[email protected]:8080
https - proxy=http://v631754:[email protected]:8080


process.env.proxy = "http://v631754:[email protected]:80";
process.env.http_proxy = "http://v631754:[email protected]:80";
process.env.https_proxy = "http://v631754:[email protected]:8080";
globalTunnel.initialize();
*/

var model = process.env.model || "https://api.projectoxford.ai/luis/v1/application?id=573c0d0c-060c-4549-8ef5-650218618c08&subscription-key=b27a7109bc1046fb9cc7cfa874e3f819&q=";
var modelUri = "https://api.projectoxford.ai/luis/v1/application?id=573c0d0c-060c-4549-8ef5-650218618c08&subscription-key=b27a7109bc1046fb9cc7cfa874e3f819";

var dialog = new builder.LuisDialog(model);
var bot = new builder.BotConnectorBot(); //new builder.TextBot();
//globalTunnel.end();

//start with waterfall...
bot.add("/", [
    function (session, args, next) {
        if (session.message.text.indexOf("set tv package") == -1) {
            if (!session.userData.channelSearchResultsShown) {
                if (null == session.userData.selectedPackageName || session.userData.selectedPackageName.length == 0) {
                    session.userData.selectedPackageName = fiosTVPackages["custom_tv_essentials"];
                }
                var packageInfo = "Your current TV package selection is  " + session.userData.selectedPackageName;
                
                builder.Prompts.confirm(session, packageInfo + "<br/>Are you looking for any specific channels in your package?");
            }
            else {
开发者ID:giriganapathy,项目名称:FiOSPackageHelper,代码行数:31,代码来源:server.ts


示例3: require

ďťżvar restify = require("restify");
var builder = require("botbuilder");
//var model = process.env.model || "https://api.projectoxford.ai/luis/v1/application?id=1d4ed816-3795-4a87-a105-ef7c5c904e85&subscription-key=b27a7109bc1046fb9cc7cfa874e3f819&q="
//var dialog = new builder.LuisDialog(model);
var bot = new builder.BotConnectorBot();
bot.add("/", [
    function (session) {
        builder.Prompts.text(session, "Hello...What is your name?");
    },
    function (session, results) {
        session.userData.name = results.response;
        builder.Prompts.choice(session, "Hello " + session.userData.name + " Which product do you like to know the bundle availability?", ["FiOS", "FiOS - Triple Play", "FiOS - Double Play", "Standalone"]);
    },
    function (session, results) {
        session.userData.product = results.response.entity;
        builder.Prompts.number(session, "Can you please tell me your Zip Code?");
    },
    function (session, results) {
        session.userData.zipCode = results.response;
        builder.Prompts.text(session, "Can i have your address please");
    },
    function (session, results) {
        session.userData.address = results.response;
        builder.Prompts.text(session, "Can i tell your country code (2 Letter)");
    },
    function (session, results) {
        session.userData.countryCode = results.response;
        var stateInfo = "";
        var Client = require('node-rest-client').Client;
        var client = new Client();
        // set content-type header and data as json in args parameter 
开发者ID:giriganapathy,项目名称:CheckServiceAvailabilityApp,代码行数:31,代码来源:server.ts


示例4: require

ďťż/*-----------------------------------------------------------------------------
This is a sample bot.
 
@author: giriganapathy
@since: May 5, 2016 01:32 PM
-----------------------------------------------------------------------------*/
var restify = require("restify");
var builder = require("botbuilder");

var model = process.env.model || "https://api.projectoxford.ai/luis/v1/application?id=83b0d263-bcb7-4ded-b197-95b25ee68030&subscription-key=b27a7109bc1046fb9cc7cfa874e3f819&q=";
var key = "embct6154";
var dialog = new builder.LuisDialog(model);

var bot = new builder.BotConnectorBot();//new builder.TextBot();

bot.add("/", dialog);

dialog.on("intent.pnr.enquiry", [
    function (session, args, next) {
        var entity = builder.EntityRecognizer.findEntity(args.entities, 'pnr-number');
        if (null != entity) {
            var pnrNumber = entity.entity;
            if (null != pnrNumber) {
                session.userData.pnrNumber = pnrNumber;
                var Client = require('node-rest-client').Client;
                var client = new Client();
                // set content-type header and data as json in args parameter 
                var options = {
                    headers: { "Content-Type": "application/json" }
                };
开发者ID:giriganapathy,项目名称:TrainStatusApp,代码行数:30,代码来源:server.ts



注:本文中的botbuilder.BotConnectorBot类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap