Skip to content

amiralies/metalarchives-telegram-bot

Repository files navigation

MetalArchives Telegram Bot

Telegram Bot for metal-archives.com written in NodeJS.

How to run

  1. Make sure you have nodejs, mongodb, redis and git installed.

  2. Run the API: See instructions

  3. Clone the repo:

git clone https://github.com/amiralies/metalarchives-telegram-bot.git
  1. Install dependencies :
cd metalarchives-telegram-bot
npm install
  1. Set env vars (do changes if necessary) :
export BOT_TOKEN=<bot_token>
export BOT_USERNAME=<bot_username>
export API_URL=http://localhost:3000

export MONGO_URL=mongodb://mongodb:27017/metalarchives-bot

export REDIS_URL=redis://localhost:6379
#if you prefer local session
export LOCAL_SESSION=true
  1. Start the bot :
npm start
#or if you prefer pm2
pm2 start process.json
  1. Done.

Docker (Recommended)

  1. Make sure you have docker and docker-compose installed.
  2. Make a directoy where you want to put your api and bot files (We go with MetalArchives here.
mkdir MetalArchives
cd MetalArchives
  1. Clone metalarchivlses-api and this repo (bot).
git clone https://github.com/amiralies/metalarchives-api
git clone https://github.com/amiralies/metalarchives-telegram-bot
  1. Copy docker-compose.yml from metalarchives-telegram-bot dir to its parent (MetalArchives) and put your bot token inside that:
cp metalarchives-telegram-bot/docker-compose.yml docker-compose.yml 
#edit the file docker-compose.yml with your desired editor.
#find the line which has BOT_TOKEN=<bot token goes here> and put your bot token 
#save the file
  1. Run with docker compose:
docker-compose up
#note if you want to dont run catchDB script of metalarchives-api on start try with
DB_CATCH=false docker-compose up
  1. Done! (you dont need to install dependencies manually , easy huh?)