本文整理汇总了TypeScript中botbuilder.Prompts.text方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Prompts.text方法的具体用法?TypeScript Prompts.text怎么用?TypeScript Prompts.text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类botbuilder.Prompts
的用法示例。
在下文中一共展示了Prompts.text方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
function (session, args, next) {
if (!session.userData.nameAlreadyAsked) {
builder.Prompts.text(session, "May i know your name please?");
}
else {
next();
}
},
示例2: function
function(session, args, next) {
console.log("args :: \n" + JSON.stringify(args.entities));
var symbol = builder.EntityRecognizer.findEntity(args.entities, 'company');
if (!symbol) {
builder.Prompts.text(session, "Which company stock you are intrested in?");
} else {
next({ response: symbol.entity });
}
},
示例3:
(session, args, next) => {
const botName = '<%= botName %>';
const description = `<%= botDescription %>`;
session.send(`Hi there! I'm ${botName}`);
session.send(`In a nutshell, here's what I can do:\n\n${description}`);
builder.Prompts.text(session, `What's your name?`);
},
示例4: function
function (session, results, next) {
if (true === results.response) {
session.userData.channelSearchResultsShown = false;
builder.Prompts.text(session, "Hey .. that’s cool.. Can i have the channel names which you are looking for?");
}
else {
delete session.userData.channelSearchResultsShown;
session.endDialog("Thanks! Say 'Hi', if you want to chat with me again...");
}
},
示例5: getCharacterName
private getCharacterName(session: Session, results, next) {
var charData = session.dialogData.character;
console.log('getcharname', charData);
if (results.response) {
charData.name = results.response;
}
if (!charData.realm) {
Prompts.text(session, "What is the realm of the character?");
} else {
next();
}
}
示例6: step1
private static async step1(session: builder.Session, args?: any | builder.IDialogResult<any>, next?: (args?: builder.IDialogResult<any>) => void): Promise<void> {
if (!isMessageFromChannel(session.message)) {
session.send(Strings.cmd_only_works_in_channel);
session.endDialog();
return;
}
let channelNameInput = args.intent.matched[1].trim();
if (channelNameInput) {
next({ response: channelNameInput });
} else {
builder.Prompts.text(session, Strings.choose_channel_prompt);
}
}