microsoft/BotFramework-DirectLineJS

Receiving repeated user input as part of response from direct line bot

Closed this issue · 1 comments

I am using react native and gifted chat and BotFramework-DirectLineJS and connecting it to a Direct Line 3.0 channel for an Azure Bot.

When a user sends text like "hello" direct line is echoing that back to be, and then answering. So if user enters hello, bot responds

hello
Hello! (or whatever is has programmed as a response)

I have found reference to echoUser but am not sure where I can remove that.

I was able to fix my problem using .filter

constructor(props) {
super(props);
directLine.activity$.filter(activity => activity.from.id == 1 ).subscribe(botMessage => {
const newMessage = botMessageToGiftedMessage(botMessage);
this.setState({ messages: [newMessage, ...this.state.messages] });
});
}