Created
December 23, 2019 14:06
-
-
Save pmbanugo/7a53e20642c6197a0b27c9e86b3f609f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addMessage = ({ message }) => { | |
if (!this.user) { | |
this.user = { name: message.text, id: Date.now().toString() }; | |
let newMessage = Object.assign({}, message); | |
newMessage.text = `Welcome to the chat ${message.text}!`; | |
newMessage.author = this.bot; | |
this.setState({ | |
messages: [...this.state.messages, newMessage] | |
}); | |
} else { | |
//TODO: Send message across the channel | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment