Created
July 8, 2019 16:31
-
-
Save dongido001/f0d8e81c8f83924e542c7eacf09c5be4 to your computer and use it in GitHub Desktop.
This file contains 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
// [...] | |
const to_username = this.chat.email.replace(/[@\.]/g, '_') | |
const {data} = await axios.post('/api/get-or-create-channel', { | |
from_username: this.username, | |
to_username: to_username, | |
from: this.autheduser.id, | |
to: this.chat.id, | |
}) | |
// Initialize the channel | |
const channel = this.client.channel('messaging', data.channel, { | |
name: 'Awesome channel', | |
members: [this.username, to_username] | |
}); | |
this.channel = channel | |
// [...] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment