MacOS / Windows remote control Telegram bot

List of controls:

  • Play previous song
  • Play/Pause
  • Play next song
  • Volume down
  • Mute
  • Volume up
  • Disable screen
  • Mac: Display brightness down, Win: Set brightness to 10%
  • Mac: Display brightness up, Win: Set brightness to 100%
  • Mac: Sleep, Win: Hibernate
  • Reboot
  • Shutdown

Windows install steps:

  1. Install Python
  2. Start powershell as administrator and run py -m pip install telepot psutil
  3. Create your Telegram bot
  4. Clone this repository to your user dir C:\Users\<username>\RemoteControlBot
  5. Run cmd (Win+R) and enter shell:common startup. In the folder that opens, create a RemoteControlBot.bat file with content:
powershell pythonw {DIR}\run.py '{TOKEN}}' '{CHAT_ID}}'
  1. If you are using Windows 10, then you need to start the powershell in administrator mode and run the command Set-ExecutionPolicy unrestricted
  2. Double click RemoteControlBot.bat to start script
  3. Send message /start to your bot

MacOS install steps:

  1. Install Python and BetterTouchTool brew install python && brew install --cask bettertouchtool && brew install python && pip3 install telepot
  2. Clone this repository to your user dir ~/RemoteControlBot
  3. Open BetterTouchTool and import preset "scripts/mac/RemoteControlBot.bttpreset"
  4. Start Automator.app
  5. Select Application
  6. Click Show library in the toolbar (if hidden)
  7. Add Run shell script (from the Actions/Utilities)
  8. Copy & paste script into the window:
source .zprofile
python3 ~/RemoteControlBot/run.py '{TOKEN}}' '{CHAT_ID}}''{TOKEN}}' '{CHAT_ID}}'
  1. Save somewhere (for example in your HOME) as RemoteControlBot.app
  2. Go to System Preferences -> GeneralGeneral -> Login items and add this app
  3. Reboot
  4. Send message /start to your bot

Where:

  • {DIR} - folder with RemoteControlBot files
  • {TOKEN} - your bot token
  • {CHAT_ID} - your Telegram account chat_id (optional param to secure your connection)