A weather bot app for slack that reports the weather in real-time for any city.
- Ruby
To test the bot in your local environment you will have to follow the next steps
- You must have a slack account
- Make a new workspace
- Go to the Slack app directory and into Custom Integrations to make a Bot user for your workspace or use this link https://slack.com/services/new/bot (The app works with classic bots only so make sure you create the bot from here)
- Add the bot to a channel
- The bot also uses the OpenWeatherMap API. To take a token for that, simply go to https://openweathermap.org/api and subscribe for the Current Weather Data, make an account and take your token (note that the token might take a few minutes to activate)
git clone git@github.com:patrick-angelos/SlackBot.git
cd SlackBot
- Create a .env file on the root directory where you will store your tokens, like so
- SLACK_API_TOKEN=xoxb-...
- WEATHER_TOKEN=1234...
- run
bundle install
- run
ruby bin/main.rb
- Your WeatherBot is ready to go
To Bot accepts the following commands
- help: for a description of the commands
- hi: Replies with Hello
- weather "city": reports the weather in the specified city
- detailed "city": for a more detailed weather report in the specified city
Remember that the bot will reply only when tagged.
For example @WeatherBot weather Athens
will give you a weather report for Athens
👤 Patrikis Angelos
- GitHub: @patrick-angelos
- Twitter: @AngelosPatrikis
- LinkedIn: Angelos Patrikis
Contributions, issues, and feature requests are welcome!
Give a ⭐️ if you like this project!
- To Microverse for their
README
template. - To Slack for their awesome documentation
- To OpenWeatherMap.org for their API
- To dblock for his slack-ruby-bot gem
MIT License