Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

ifedyukin/webpurple-tg-bot

Repository files navigation

WebPurple Telegram bot

Build Status Telegram Bot Dependency status Dev Dependency Status Deploy to Heroku

Ryazan FrontEnd community bot.
Project plan - "bot".
Contribute to our site project - @kitos/web-purple.

Features:

  • Send last post from VKontakte community;
  • Send future events information - Moscow time (GMT+3);
  • Send Community and Contribution links;
  • Send event ICS files;
  • Send newsletter and delete messages by command;
  • New posts subscription;
  • News category filtering;
  • Easy Heroku deploy;
  • Simple locale debug;
  • Posting news from VKontakte in public chats and channels;
  • Multilanguage messages.

Development

Requirements

  • Git;
  • MongoDB;
  • NodeJS, npm;
  • Telegram: client, account;
  • Heroku account (deploy test bot);
  • VKontakte account (VK integrations).

ENV variables

ENV Key config.js Values How to get?
PORT port Application port (default: 8000) Autoconfigured for Heroku by runner
NODE_ENV isProduction ENV Autoconfigured: NODE_ENV !== 'development'
MONGODB_URI mongoDB MongoDB full url Autoconfigured for Heroku by mLab
HOOK_URL hookUrl Telegram bot WebHook url For Heroku: https://<your-app-name>.herokuapp.com
BOT_TOKEN botToken Telegram bot-API token Hot do I create bot?
VK_KEY vkSecret VKontakte secret key (any) Think about it 😎
VK_RESPONSE vkResponse VKontakte WebHook response VKontakte Callback API
VK_USER_TOKEN vkUserKey VKontakte User Token VKontakte User Token
VK_COMMUNITY vkCommunity VKontakte community domain Your community custom domain https://vk.com/<domain>
VK_COMMUNITY_ID vkCommunityId VKontakte community id Your community id
VK_SERVICE vkServiceKey VKontakte Service Token VKontakte Service Token
KEEN_PROJECT_ID none Keen project id Autoconfigured for Heroku by Keen
KEEN_WRITE_KEY none Keen API write key Autoconfigured for Heroku by Keen
NOTIFY_USER notifyUserId Telegram user id User for error notification

Run bot locale

  1. Configure environment variables in config.js file.
    Do not publish access keys to public!

  2. Install and run application:

git clone https://github.com/ifedyukin/webpurple-tg-bot
cd webpurple-tg-bot
npm install
npm run development
  1. Run tests and linter
npm run test
npm run lint

Create Heroku instance and deploy bot

  1. Click "Deploy to Heroku" button in the top of README.
  2. Follow the directions.
  3. Navigate to instance Settings page, click Reveal Config Vars and configure environment variables.
  4. Navigate to instance Deploy page, select deployment method (you can configure autodeploy from your fork repository).