Telegram Bot for metal-archives.com written in NodeJS.
-
Make sure you have nodejs, mongodb, redis and git installed.
-
Run the API: See instructions
-
Clone the repo:
git clone https://github.com/amiralies/metalarchives-telegram-bot.git
- Install dependencies :
cd metalarchives-telegram-bot
npm install
- 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
- Start the bot :
npm start
#or if you prefer pm2
pm2 start process.json
- Done.
- Make sure you have docker and docker-compose installed.
- Make a directoy where you want to put your api and bot files (We go with
MetalArchives
here.
mkdir MetalArchives
cd MetalArchives
- Clone metalarchivlses-api and this repo (bot).
git clone https://github.com/amiralies/metalarchives-api
git clone https://github.com/amiralies/metalarchives-telegram-bot
- 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
- 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
- Done! (you dont need to install dependencies manually , easy huh?)