/football-chat-bot

Telegram bot for football weekend chat

Primary LanguageJavaScriptMIT LicenseMIT

football-chat-bot

Telegram bot for football weekend chat

Build Status Coverage Status Open Source Love Dependency Status PRs Welcome

forthebadge forthebadge forthebadge forthebadge

Installation

  • Clone repository: git clone https://github.com/tormozz48/football-chat-bot.git
  • Move to repo folder: cd football-chat-bot
  • Install npm dependencies: npm install

Configuration

Configuration files are:

  • default - default configuration file
  • production - configuration file for production environment

To use production configuration you should launch application with NODE_ENV envrironment variable equal to production. You can read more about configuration files here.

Paramenters

  • port - http server port number

  • bot - telegram bot settings

  • cron -

    • serverPing - cron expression for setting http-server ping interval
  • mongo - mongo database connection parameters.

    • user - mongo database user.
    • password - mongo database password.
    • host - database host. Default: 127.0.0.1
    • port - database port. Default: 27017
    • database - name of database.
  • eventDate - function which returns date of new created event.

Some of configuration parameters may be overrided by environment variables:

  • BOT_TOKEN overrides token parameter in bot config section.
  • MONGO_USER overrides user parameter in mongo database section.
  • MONGO_PASSWORD overrides password parameter in mongo database section.

Launch

For development purposes it suitable to launch application in dev-mode with embedded nodemon hot reload functionality.

npm run start-dev

For launch in production mode you should use:

npm run start-prod

Development

  • Launch code linting tool: npm run lint.
  • Launch unit-tests: npm run test-unit.
  • Launch code linting and unit-tests together: npm test.
  • Launch unit-tests with code coverage calculation: npm run cover.

Also code linter checks your code before every commit.

License

MIT