slackOpen(payload) {
    const channels = [];
    const groups = [];
    const mpims = [];

    logger.info(`Welcome to Slack. You are @${payload.self.name} of ${payload.team.name}`);

    if (payload.channels) {
      payload.channels.forEach((channel) => {
        if (channel.is_member) {
          channels.push(`#${channel.name}`);
        }
      });

      logger.info(`You are in: ${channels.join(', ')}`);
    }

    if (payload.groups) {
      payload.groups.forEach((group) => {
        groups.push(`${group.name}`);
      });

      logger.info(`Groups: ${groups.join(', ')}`);
    }

    if (payload.mpims) {
      payload.mpims.forEach((mpim) => {
        mpims.push(`${mpim.name}`);
      });

      logger.info(`Multi-person IMs: ${mpims.join(', ')}`);
    }

    return this;
  }
/**
   * Function to be called on slack open
   *
   * @param {object} payload Connection payload
   * @return {Bot} returns itself
   */
Function to be called on slack open
@param {object} payload Connection payload
@return {Bot} returns itself
Function to be called on slack open @param { object } payload Connection payload @return { Bot } returns itself
slackOpen(payload) {
    const channels = [];
    const groups = [];
    const mpims = [];
    logger.info(`Welcome to Slack. You are @${payload.self.name} of ${payload.team.name}`);
    if (payload.channels) {
      payload.channels.forEach((channel) => {
        if (channel.is_member) {
          channels.push(`#${channel.name}`);
        }
      });
      logger.info(`You are in: ${channels.join(', ')}`);
    }
    if (payload.groups) {
      payload.groups.forEach((group) => {
        groups.push(`${group.name}`);
      });
      logger.info(`Groups: ${groups.join(', ')}`);
    }
    if (payload.mpims) {
      payload.mpims.forEach((mpim) => {
        mpims.push(`${mpim.name}`);
      });
      logger.info(`Multi-person IMs: ${mpims.join(', ')}`);
    }
    return this;
  }
slackOpen ( payload ) { const channels = [ ] ; const groups = [ ] ; const mpims = [ ] ; logger . info ( ` ${ payload . self . name } ${ payload . team . name } ` ) ; if ( payload . channels ) { payload . channels . forEach ( ( channel ) => { if ( channel . is_member ) { channels . push ( ` ${ channel . name } ` ) ; } } ) ; logger . info ( ` ${ channels . join ( ', ' ) } ` ) ; } if ( payload . groups ) { payload . groups . forEach ( ( group ) => { groups . push ( ` ${ group . name } ` ) ; } ) ; logger . info ( ` ${ groups . join ( ', ' ) } ` ) ; } if ( payload . mpims ) { payload . mpims . forEach ( ( mpim ) => { mpims . push ( ` ${ mpim . name } ` ) ; } ) ; logger . info ( ` ${ mpims . join ( ', ' ) } ` ) ; } return this ; }
Function to be called on slack open
 @param {object} payload Connection payload
 @return {Bot} returns itself
Function to be called on slack open @param { object } payload Connection payload @return { Bot } returns itself