当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript botbuilder.BotConnectorBot类代码示例

本文整理汇总了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:glAbundance03g$@proxy.ebiz.verizon.com:80
http - proxy=http://v631754:glAbundance03g$@proxy.ebiz.verizon.com:8080
https - proxy=http://v631754:glAbundance03g$@proxy.ebiz.verizon.com:8080


process.env.proxy = "http://v631754:glAbundance03g$@proxy.ebiz.verizon.com:80";
process.env.http_proxy = "http://v631754:glAbundance03g$@proxy.ebiz.verizon.com:80";
process.env.https_proxy = "http://v631754:glAbundance03g$@proxy.ebiz.verizon.com: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;未经允许,请勿转载。