Second tweak of my telegram bot to remotely turn on my PC
- Dotenv → To use the environment variables.
- Telegraf → To manage the Telegram bot
- Ping → To check the status of the PC.
- WOL → To send a Magic Packet to the PC.
npm i
To set all the appropriate variables I created an .env file where I set these variables:
-
BOT_TOKEN → The Telegram BOT token in order to be able to use its functionality.
-
TELEGRAM_USERNAME → My telegram username.
-
PC_MAC_ADDRESS → The mac address of my PC so i can turn it on.
-
PC_IP_ADDRESS → The local ip address of my PC so i can check its status.
-
USER_CHAT_ID → The ID of my Telegram chat with the BOT to be able to use the commands.
-
LOG_CHAT_ID → The ID of a Telegram channel with the BOT inside to send the actions performed.
BOT_TOKEN=ABCD123
TELEGRAM_USERNAME=abc
PC_MAC_ADDRESS=00:A0:B1:23:C4:56
PC_IP_ADDRESS=192.168.1.2
USER_CHAT_ID=12345
LOG_CHAT_ID=123456789
node index