Skip to content

Instantly share code, notes, and snippets.

@pmbanugo
Created January 6, 2020 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmbanugo/4139ab14b338d1eb3863746266f92d28 to your computer and use it in GitHub Desktop.
Save pmbanugo/4139ab14b338d1eb3863746266f92d28 to your computer and use it in GitHub Desktop.
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