Skip to content
Telegram bot for storing messages using Elasticsearch
JavaScript
Branch: master
Clone or download
Pull request Compare This branch is 1 commit ahead of manuasir:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
controllers
lib
.gitignore
ELK-How-to.md
LICENSE
README.md
bot.js
config.sample.js
package.json

README.md

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!
You can’t perform that action at this time.