Skip to content

Instantly share code, notes, and snippets.

@dongido001
Created July 8, 2019 16:31
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 dongido001/f0d8e81c8f83924e542c7eacf09c5be4 to your computer and use it in GitHub Desktop.
Save dongido001/f0d8e81c8f83924e542c7eacf09c5be4 to your computer and use it in GitHub Desktop.
// [...]
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