npm

Need private packages and team management tools?Check out npm Orgs. »

slackweatherbot

1.0.1 • Public • Published

slackweatherbot

Slack Weather Bot

Uses the Yahoo weather API via HTTPS to return the weather of a specified location/city to your Slack chat, using the RTM API.

Screenshot

Step 1

You first need this bot running on your Slack chat: https://github.com/xBytez/slackbotapi/

Step 2

Once you have your bot running off your script similar to example_bot.js on the xBytez repo, install the slackweatherbot via npm: (sudo) npm install slackweatherbot

Step 3

Require the module in your bot script:

var slackweatherbot = require('slackweatherbot');
weatherBot = new slackweatherbot();
Step 4

Within the switch statement place the following code:

case "weather":
    var location = command[1];
    weatherBot.getWeather(location, function (err, message) {
        if (message) slack.sendMsg(data.channel, message);
    });
    break;
Step 5

The module should work as per the screenshot above.

install

npm i slackweatherbot

Downloadsweekly downloads

2

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability