{"action":"reopened","issue":{"url":"https://api.github.com/repos/FaridSafi/react-native-gifted-chat/issues/930","repository_url":"https://api.github.com/repos/FaridSafi/react-native-gifted-chat","labels_url":"https://api.github.com/repos/FaridSafi/react-native-gifted-chat/issues/930/labels{/name}","comments_url":"https://api.github.com/repos/FaridSafi/react-native-gifted-chat/issues/930/comments","events_url":"https://api.github.com/repos/FaridSafi/react-native-gifted-chat/issues/930/events","html_url":"https://github.com/FaridSafi/react-native-gifted-chat/issues/930","id":342150822,"node_id":"MDU6SXNzdWUzNDIxNTA4MjI=","number":930,"title":"Hello, I used Microsoft Bot Framework & direct line Js with Gifted chat. But I am receiving  echo response from microsoft bot. Please see my code and let me know how to remove the echo part","user":{"login":"kiranchaitanya22","id":25836488,"node_id":"MDQ6VXNlcjI1ODM2NDg4","avatar_url":"https://avatars0.githubusercontent.com/u/25836488?v=4","gravatar_id":"","url":"https://api.github.com/users/kiranchaitanya22","html_url":"https://github.com/kiranchaitanya22","followers_url":"https://api.github.com/users/kiranchaitanya22/followers","following_url":"https://api.github.com/users/kiranchaitanya22/following{/other_user}","gists_url":"https://api.github.com/users/kiranchaitanya22/gists{/gist_id}","starred_url":"https://api.github.com/users/kiranchaitanya22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiranchaitanya22/subscriptions","organizations_url":"https://api.github.com/users/kiranchaitanya22/orgs","repos_url":"https://api.github.com/users/kiranchaitanya22/repos","events_url":"https://api.github.com/users/kiranchaitanya22/events{/privacy}","received_events_url":"https://api.github.com/users/kiranchaitanya22/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-18T02:15:42Z","updated_at":"2018-08-17T18:41:11Z","closed_at":null,"author_association":"NONE","body":"#### Issue Description\r\n\r\nHello, I used Microsoft Bot Framework & direct line Js with Gifted chat. But I am receiving echo response from Microsoft bot. Please see my code and let me know how to remove the echo part\r\n\r\n#### Steps to Reproduce / Code Snippets\r\n\r\nimport React, { Component } from 'react'\r\nimport { StyleSheet, View } from 'react-native'\r\nimport { GiftedChat } from 'react-native-gifted-chat'\r\nimport { DirectLine } from 'botframework-directlinejs'\r\n\r\nimport PrimaryBackground from '../../../../components/PrimaryBackground'\r\nimport bg_one from '../../../../assets/images/bg_one.png'\r\n\r\nconst directLine = new DirectLine({\r\n  secret: '' // TODO: Pull this out of the code into a .env variable\r\n})\r\nconst botMessageToGiftedMessage = botMessage => ({\r\n  ...botMessage,\r\n  _id: botMessage.id,\r\n  createdAt: botMessage.timestamp,\r\n  user: {\r\n    _id: 2,\r\n    name: 'kiran',\r\n    avatar:\r\n      'https://vignette.wikia.nocookie.net/mycun-the-movie/images/c/c9/Despicable-Me-2-Minion-names-and-picture-Tom.jpg/revision/latest?cb=20150714154704'\r\n  }\r\n})\r\nfunction giftedMessageToBotMessage(message) {\r\n  return {  \r\n    from: { id: 1, name: 'Kiran C' },\r\n    type: 'message',\r\n    text: message.text\r\n  }\r\n}\r\nexport default class Example extends React.Component {\r\n  state = {\r\n    messages: []\r\n  }\r\n  constructor(props) {\r\n    super(props)\r\n    directLine.activity$.subscribe(botMessage => {\r\n      console.log('botMessage', botMessage)\r\n      const newMessage = botMessageToGiftedMessage(botMessage)\r\n      this.setState({ messages: [newMessage, ...this.state.messages] })\r\n    })\r\n  } \r\n  onSend = messages => {\r\n    this.setState({ messages: [...messages, ...this.state.messages] })\r\n    messages.forEach(message => {\r\n      directLine\r\n        .postActivity(giftedMessageToBotMessage(message))\r\n        .subscribe(() => console.log('success'), () => console.log('failed'))\r\n    })\r\n  }\r\n  render() {\r\n    \r\n    return (\r\n      <View style={styles.container}>\r\n        <PrimaryBackground source={bg_one} />\r\n        <GiftedChat\r\n          \r\n          placeholder={'Hello Kiran! Please type the message'}\r\n          user={{ _id: 1 }}\r\n          messages={this.state.messages}\r\n          onSend={this.onSend}\r\n        />\r\n      </View>\r\n      \r\n    )\r\n  }\r\n}\r\nconst styles = StyleSheet.create({\r\n  container: {\r\n    flex: 1\r\n  }\r\n})\r\n\r\n#### Expected Results\r\n<img width=\"358\" alt=\"screen shot 2018-07-18 at 1 31 01 pm\" src=\"https://user-images.githubusercontent.com/25836488/42906124-ff028764-8a8e-11e8-88a6-66f34a67b81f.png\">\r\n\r\n\r\n\r\n#### Actual Result\r\n\r\n<img width=\"355\" alt=\"screen shot 2018-07-18 at 1 31 47 pm\" src=\"https://user-images.githubusercontent.com/25836488/42906155-1b45497a-8a8f-11e8-8e11-b84d9b4dfc34.png\">\r\n\r\n\r\n"}}
{"actor":{"display_login":"kiranchaitanya22"}}