How to use the @slack/client.RTM_EVENTS.CHANNEL_JOINED function in @slack/client

To help you get started, we’ve selected a few @slack/client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SphereSoftware / RebelChat / lib / Slack.js View on Github external
bind() {
    const { rtm } = this

    rtm.on(RTM_EVENTS.CHANNEL_JOINED, (obj) => {
      const { channel } = obj
      if (channel) {
        const chObj = new ChannelObject({
          id: channel.id,
          teamId: this.id,
          name: channel.name,
          type: 'group',
          topic: channel.topic,
          memberIds: channel.members,
          isMember: channel.is_member,
          unreadCount: channel.unread_count,
          lastRead: channel.last_read,
          status: 'online',
        })
        store.dispatch(addNewChannel(chObj))
      }