Collector bot
Description
This bot will store every message sent in a group and in private mode.
How to use
- You need to create a bot with @botfather, then you'll got a TOKEN.
- Clone the repository, then move into the root directory of the project.
- Install the latest Node.js version.
- Install all the dependencies. Do not use
sudo
orroot
.
npm install
- Configure your token copying the sample configuration and replacing its value with your own value.
cp config.sample.js config.js
- Integrate it with the Elastic stack, see ELK-How-to for details.
Creating a system service
- Install PM2.
sudo npm install -g pm2
- Start the server. Do not use
sudo
orroot
.
cd bot-dir/
pm2 start bot.js
- Create system service. Do not use
sudo
orroot
, 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>
- Copy the command
pm2 startup
gave you, and execute it. - Save your services. Do not use
sudo
orroot
.
pm2 save
How to contribute?
- Follow the "How to use" steps.
- Test your changes.
- Create a pull request.
- Wait for a review.
- That's all!