How to use the @slack/client.RTM_EVENTS.CHANNEL_LEFT 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
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))
      }
    })

    rtm.on(RTM_EVENTS.CHANNEL_LEFT, (obj) => {
      const { channel } = obj
      if (channel) {
        const chObj = new ChannelObject({
          id: channel,
          teamId: this.id,
          type: 'group',
        })
        store.dispatch(removeChannel(chObj))
      }
    })

    rtm.on(RTM_EVENTS.MESSAGE, (msg) => {
      if (msg.type !== 'message' || msg.subtype) {
        return
      }