本文整理汇总了TypeScript中botbuilder.Session.send方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Session.send方法的具体用法?TypeScript Session.send怎么用?TypeScript Session.send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类botbuilder.Session
的用法示例。
在下文中一共展示了Session.send方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getIlvl
private getIlvl(session: Session, args, next) {
var charData = session.dialogData.character;
console.log('getilvl', charData);
if (!charData.name) {
session.send('No name given ...');
} else if (!charData.realm) {
session.send('No realm given ...');
} else {
console.log('got data, sending it to battle net');
bnet.wow.character.items({
origin: 'eu',
realm: 'antonidas',
name: 'hoazl'
}, function (err, data) {
if (err) {
console.log('Error!', err);
session.send('An error occured ..');
} else {
console.log('got data from battle net');
session.send(data);
}
});
}
}
示例2: function
}, function (err, data) {
if (err) {
console.log('Error!', err);
session.send('An error occured ..');
} else {
console.log('got data from battle net');
session.send(data);
}
});
示例3: switch
(session: Session, results: IDialogResult<any>) => {
switch (results.response) {
case true:
session.send('faq.finishConfirmed');
session.endDialog();
break;
default:
session.send('faq.finishUnconfirmed');
whatNow(library, session);
break;
}
}
示例4: onBegin
function onBegin(session: Session, args: any, next: () => void) {
if (args && args.languageChanged) {
session.send('master.languageModified');
whatNow(session);
} else {
next();
}
}
示例5: whatNow
(session: Session, luisResults: IIntentRecognizerResult) => {
const topIntent = luisResults.intent;
const selectedBot = bot.childBots.find(bot => `child.${bot.library.name.toLowerCase()}` === topIntent);
if (selectedBot) {
session.beginDialog(`${selectedBot.library.name}:/`);
} else {
bot.instrumentation.trackCustomEvent('MBFEvent.CustomEvent.Unknown', { text: session.message.text, luisResults: luisResults }, session);
session.send('master.unknown');
whatNow(session);
}
},
示例6: createDialog
(session: Session, results: IDialogResult<any>) => {
if (results.response) {
let language = results.response.entity;
language = language[0].toUpperCase() + language.slice(1);
session.userData.locale = languages[language];
createDialog(bot)(session, { languageChanged: true });
} else {
session.send('master.languageSelectionFailed');
whatNow(session);
}
}
示例7: onHi
function onHi(session: Session, luisResults: IIntentRecognizerResult) {
session.send(new Message(session)
.text('master.hi')
.suggestedActions(getSuggestedActions(session)));
}
示例8: whatNow
function whatNow(library: Library, session: Session) {
session.send(new Message(session)
.text('faq.whatNow')
.suggestedActions(getSuggestedActions(library, session)));
}
示例9: return
return (session: Session, args: any, next: () => void) => {
session.send(new Message(session)
.text('faq.welcome')
.suggestedActions(getSuggestedActions(library, session)));
};