You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello Team, posting the question here, as I've already asked here on StackOverflow, and I got an answer on Microsoft Community, to redirect this to the official bot page, I'd like to ask the same question here.
I have created via Azure my CustomQ&A knowledge base language.
Then I've created a bot automatically (via Azure), and then my end goal would be to have QandA (using the bot) on Slack (using Slack integration as well) but with an answer in the same question thread.
Unfortunately it seems that I can only get QandA on completely unrelated messages at the moment.
The auto-generated bot code is the one here on the qnaBotWithMSI.js file:
const { ActivityHandler } = require('botbuilder');
class QnABotWithMSI extends ActivityHandler {
/**
*
* @param {ConversationState} conversationState
* @param {UserState} userState
* @param {Dialog} dialog
*/
constructor(conversationState, userState, dialog) {
super();
if (!conversationState) throw new Error('[QnABotWithMSI]: Missing parameter. conversationState is required');
if (!userState) throw new Error('[QnABotWithMSI]: Missing parameter. userState is required');
if (!dialog) throw new Error('[QnABotWithMSI]: Missing parameter. dialog is required');
this.conversationState = conversationState;
this.userState = userState;
this.dialog = dialog;
this.dialogState = this.conversationState.createProperty('DialogState');
this.onMessage(async (context, next) => {
console.log('Running dialog with Message Activity.');
// Run the Dialog with the new message Activity.
await this.dialog.run(context, this.dialogState);
// By calling next() you ensure that the next BotHandler is run.
await next();
});
// If a new user is added to the conversation:
this.onMembersAdded(async (context, next) => {
const membersAdded = context.activity.membersAdded;
for (let cnt = 0; cnt < membersAdded.length; cnt++) {
if (membersAdded[cnt].id !== context.activity.recipient.id) {
const defaultWelcome = process.env.DefaultWelcomeMessage;
if (defaultWelcome !== '') await context.sendActivity(defaultWelcome);
else await context.sendActivity('Welcome to the QnA Maker');
}
}
await next();
});
}
async run(context) {
await super.run(context);
// Save any state changes. The load happened during the execution of the Dialog.
await this.conversationState.saveChanges(context, false);
await this.userState.saveChanges(context, false);
}
}
If this is possible, may you kindly suggest how to edit the code, in order to get the answer on the same "question thread", rather than having a new message popping up in the channel?
Thank you in advance for your help :)
All details provided above, I'm actually not finding a proper solution for this
The text was updated successfully, but these errors were encountered:
Hello Team, posting the question here, as I've already asked here on StackOverflow, and I got an answer on Microsoft Community, to redirect this to the official bot page, I'd like to ask the same question here.
I have created via Azure my CustomQ&A knowledge base language.
Then I've created a bot automatically (via Azure), and then my end goal would be to have QandA (using the bot) on Slack (using Slack integration as well) but with an answer in the same question thread.
Unfortunately it seems that I can only get QandA on completely unrelated messages at the moment.
The auto-generated bot code is the one here on the qnaBotWithMSI.js file:
If this is possible, may you kindly suggest how to edit the code, in order to get the answer on the same "question thread", rather than having a new message popping up in the channel?
Thank you in advance for your help :)
All details provided above, I'm actually not finding a proper solution for this
The text was updated successfully, but these errors were encountered: