Skip to content

Second tweak of my telegram bot to remotely turn on my PC

Notifications You must be signed in to change notification settings

GentilOfficial/Wake-on-LAN-bot-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wake-on-LAN-bot-v2

Second tweak of my telegram bot to remotely turn on my PC

🔎 What I Used?

  • 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.

🚀 Getting Started!

Install dependencies

  npm i

Environment Variables

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.

Example

  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

Start bot

  node index