Skip to content

trinhtt/telegramBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Bot HK Weather

Build Status

This is a Telegram Bot which gives you the current weather and warning informations about Hong Kong weather based on a RSS Feed (https://data.gov.hk/en-data/provider/hk-hko).

screenshot1 screenshot2 screenshot3

Installation

  1. A bot token is needed, to obtain one, talk to @botfather and create a new bot
  2. In index.js at line 8, insert your bot token
  3. You need a running MongoDB server on localhost. Install the MongoDB client and boot the server with the command:
$ mongod --dbpath=/data --port 27017
  1. Run index.js and the bot will listen for inputs

Usage

Available commands:

  • \help: Displays all the available commands
  • \current: Displays the current weather
  • \warning: Displays weather warning
  • \language: Displays the language you will receive the results
  • \subscribe (current|warning): Subscribe to current or warning feed. When there is something new, you will receive a notification
  • \unsubscribe (current|warning): To unsubscribe to a feed. You won't receive notifications anymore.
  • \topics: Topics that you can query the bot
  • \(english)(simplified)(traditional): Change the language you will receive the results

Debug Mode

When you subscribe to a topic, it may take a long time before the RSS Feed updates, so you may want to test it in a different way. In weatherServices.js, set debugmode to true to stop polling the RSS for updates, and use a local file located at ./debug. Change manually the pubDate in the file, and you will receive a notification.

License

About

Telegram Bot Weather HK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published