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


TypeScript LuisDialog.onDefault方法代码示例

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


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

示例1: addDialogs

    addDialogs() {
        let dialog = new LuisDialog(this.luisUrl);
		console.log('dialog is ', dialog);
        this.bot.add('/', dialog);
        
        dialog.on('FindItemLevel', [
            this.processLanguage,
            this.getCharacterName,
            this.getRealm,
            this.getIlvl
        ]);
        
        dialog.onDefault(DialogAction.send("I could not understand your request."));
    }
开发者ID:DHainzl,项目名称:ILvlBot,代码行数:14,代码来源:ILvlBot.ts

示例2: if

let model = process.env.LUIS_AI_MODEL
let luisDialog = new builder.LuisDialog(model);
module.exports = luisDialog;


/** Answer users help requests. We can use a DialogAction to send a static message. */
// luisDialog.on('None', function(session) {
//     console.log('Intent Triggered: None')
//     session.send(prompts.helpMessage);
// });
luisDialog.onDefault((session) => {
    if (session.message.text.toLowerCase().indexOf('google') != -1) {
        session.userData.routeProvider = 'google';
        session.send("Ok, I'll use google.");
    } else if (session.message.text.toLowerCase().indexOf('rejseplanen') != -1) {
        session.userData.routeProvider = 'rejseplanen';
        session.send("Ok, I'll use rejseplanen.")
    } else {
        session.send(prompts.helpMessage);
    }
});


luisDialog.on('error', function(message) {
    console.error(message);
});

/** Prompts a user for the title of the task and saves it.  */
luisDialog.on('FindRoute', [
    function (session, args, next) {
        console.log('Intent Triggered: FindRoute');
开发者ID:hoovercj,项目名称:rejseplanenbot,代码行数:31,代码来源:index.ts

示例3: function

    }

    /*,
    function (session, results) {
        if (results.response) {
            session.beginDialog("/");
        }
        else {
            delete session.userData.channelNames;
            session.endDialog();
        }
    }*/
]);

//dialog.onDefault(builder.DialogAction.send("I'm sorry. I didn't understand."));
dialog.onDefault("/query-package");

dialog.on("intent-change-tv-package", [
    function (session, args) {
        //session.userData.selectedPackageName = "Custom TV Essentials";
        //session.send("From:" + session.message.from.channelId);
        var entity = builder.EntityRecognizer.findEntity(args.entities, 'tv-package-name');
        if (null != entity) {
            var tvPackageName = entity.entity;
            if (null != tvPackageName) {
                tvPackageName = tvPackageName.replace(/\s+/g, '');
                if (session.userData.selectedPackageName != fiosTVPackages[tvPackageName]) {
                    session.userData.selectedPackageName = fiosTVPackages[tvPackageName];
                    //session.send("Your current selection: " + session.userData.selectedPackageName);

                    var packageInfo = "Your current selection: " + session.userData.selectedPackageName;
开发者ID:giriganapathy,项目名称:FiOSPackageHelper,代码行数:31,代码来源:server.ts


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