1.0.0 • Published 5 years ago

slack-command-weather v1.0.0

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
5 years ago

slack-command-weather

Weather Forecast /slash Command for Slack

middleware

var express = require('express')
var weather = require('slack-command-weather')
var auth = {google: 'API key', darksky: 'API key', slack: 'hook token'}

express()
  .use(weather(auth))
  .listen(3000)

api

var express = require('express')
var parser = require('body-parser')
var weather = require('slack-command-weather')
var auth = {google: 'API key', darksky: 'API key', slack: 'hook token'}

express()
  .use(parser.urlencoded({extended: true}))
  .use((req, res) => {
    var input = req.body
    res.json(weather.respond({auth, input}))
    weather.query({auth, input}).catch(console.error)
  })
  .listen(3000)

command

OptionValue
Command/weather
Request URLhttps://website.com/weather
Short DescriptionWeather Forecast
Usage Hint[location]

example

CommandDescription
/weather tokyocurrent weather in Tokyo
/weather helphelp message