Weather Forecast /slash Command for Slack
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)
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)
Option |
Value |
Command |
/weather |
Request URL |
https://website.com/weather |
Short Description |
Weather Forecast |
Usage Hint |
[location] |
Command |
Description |
/weather tokyo |
current weather in Tokyo |
/weather help |
help message |