Lifka / collector-bot

Telegram bot for storing messages using Elasticsearch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Collector bot

Description

This bot will store every message sent in a group and in private mode.

How to use

  1. You need to create a bot with @botfather, then you'll got a TOKEN.
  2. Clone the repository, then move into the root directory of the project.
  3. Install the latest Node.js version.
  4. Install all the dependencies. Do not use sudo or root.
npm install
  1. Configure your token copying the sample configuration and replacing its value with your own value.
cp config.sample.js config.js
  1. Integrate it with the Elastic stack, see ELK-How-to for details.

Creating a system service

  1. Install PM2.
sudo npm install -g pm2
  1. Start the server. Do not use sudo or root.
cd bot-dir/
pm2 start bot.js
  1. Create system service. Do not use sudo or root, use it for the next command.
pm2 startup

Example:

$ pm2 startup
[PM2] You have to run this command as root. Execute the following command:
      sudo su -c "env PATH=$PATH:/home/unitech/.nvm/versions/node/v4.3/bin pm2 startup <distribution> -u <user> --hp <home-path>
  1. Copy the command pm2 startup gave you, and execute it.
  2. Save your services. Do not use sudo or root.
pm2 save

How to contribute?

  1. Follow the "How to use" steps.
  2. Test your changes.
  3. Create a pull request.
  4. Wait for a review.
  5. That's all!

About

Telegram bot for storing messages using Elasticsearch

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%