Created
January 6, 2020 16:00
-
-
Save pmbanugo/4139ab14b338d1eb3863746266f92d28 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
sendMessage(e: SendMessageEvent): void { | |
const message = e.message; | |
if (!this.user.name) { | |
this.user.name = message.text; | |
let newMessage = Object.assign({}, message); | |
newMessage.text = `Welcome to the chat ${message.text}!`; | |
newMessage.author = this.bot; | |
this.messages = [...this.messages, newMessage]; | |
} else { | |
//TODO: add code to send message in real-time | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment