I am hosting my discord.js bot on my raspberry pi 4. Everything works fine but obviously on a electrical outage I want my bot to start up again by itself.
What I tried:
pm2 start index.js --watch --ignore-watch="node_modules" --name MeguBot
pm2 startup
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi
pm2 save
now when I reboot my rpi it and do the pm2 list
command I get this: this (it shows my bot is started and running)
but the bot still stays offline on Discord
EDIT:
This is what I am getting in the error logs:
Error: getaddrinfo EAI_AGAIN discordapp.com discordapp.com:443
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
node index.js
)? – Chris Satchellnode index.js
command – pai_7ce