<repo_name>BootcampersCollective/slackbot-project<file_sep>/charlieBot/scripts/list-slack-channels.js
// Description:
//    Example scripts for you to examine and try out.
// commands:
var authKey = require('../../authKey.js')
module.exports = function (robot) {
//   robot.hear(/bootcampers/i, function (res) {
//     res.send("It's going");
//   });
  robot.respond(/list channels/i, function (res) {
    var slackURL = "https://slack.com/api/channels.list?token=" + authKey.authKey
    robot.http(slackURL)
      .header('Content-Type', 'application/x-www-form-urlencoded')
      .get()(function (err, response, body) {
        if (err) {
          robot.logger.info(err)
          res.send("Something went wrong")
        } else if (response.statusCode === 200) {
          var data = JSON.parse(body);
          for (var i = 0; i < data.channels.length; i++) {
            res.send("*" + data.channels[i].name+ "*" + ": " + data.channels[i].purpose.value);
          }
          robot.logger.info(data.channels);
          // res.send(JSON.stringify(data));
        } else {
          robot.logger.info(body + response.statusCode)
          res.send("Something went wrong")
        }
      });
  });
};
<file_sep>/README.md
[![Waffle.io - Columns and their card count](https://badge.waffle.io/BootcampersCollective/slackbot-project.png?columns=all)](https://waffle.io/BootcampersCollective/slackbot-project?utm_source=badge)

# slackbot-project
Repository for the BCC Slackbot Project.

## Contributing
* To initially begin working on the project, you'll need to first reach out to <NAME> on [Slack](https://bootcamperscollective.com) to be added to the team.


* Once you have been added to the team, clone the repository to your machine.
    - git clone <insert URL>


* Finally, to begin working on a particular issue, you'll need to branch off of the development branch, write the code to solve the issue, then submit a PR into the development branch. You should use the naming convention [issue-number]-[page]-[quick description].
    - git checkout -b [new branch name]

* Once you have finished building a feature, you will need to submit a PR to the development branch and add <NAME> to review.
    - git push origin [branch name]
    - On code page of repo, you can submit PR.   

- Please check the issues page at [waffle.io](https://waffle.io/BootcampersCollective/slackbot-project/join)


## Technologies Used:
<file_sep>/charlieBot/scripts/joeysTest.js
/*
 * decaffeinate suggestions:
 * DS102: Remove unnecessary code created because of implicit returns
 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
 */
module.exports = function(robot) {
  robot.hear(/meetups/i, function(res) {
    robot.http("https://api.meetup.com/Bootcampers-Collective/events?&sign=true&photo-host=public&page=20")
      .header('Accept', 'application/json')
      .get()(function(err, response, body) {
            // error checking code here
            if (err){
              res.send('done fucked up')
              robot.logger.info(err)
            }
            else if(response.statusCode === 200){
              const data = JSON.parse(body);
              for(var i=0; i < 5; i++){
                res.send(data[i].name + ' : ' + data[i].link);
              }
              robot.logger.info(body);
            } else {
              res.send('done fucked up')
              robot.logger.info(response.statusCode + body)
            }
        })
    });
  };
