1
0
Fork
You've already forked rctl-bot
0
No description
  • Python 100%
2026年07月01日 20:33:48 +03:00
docs refactor: migrate documentation to harness-based structure 2026年06月19日 09:53:24 +03:00
rctl_bot feat: notify admins on bot startup 2026年07月01日 20:33:48 +03:00
tests feat: notify admins on bot startup 2026年07月01日 20:33:48 +03:00
.env.example init: add raspberry pi control bot project structure 2026年05月28日 07:24:11 +03:00
.gitignore init: add raspberry pi control bot project structure 2026年05月28日 07:24:11 +03:00
.python-version init: add raspberry pi control bot project structure 2026年05月28日 07:24:11 +03:00
.worktreeinclude feat: implement startup volume initialization 2026年06月18日 12:03:35 +03:00
AGENTS.md refactor: migrate documentation to harness-based structure 2026年06月19日 09:53:24 +03:00
main.py init: add raspberry pi control bot project structure 2026年05月28日 07:24:11 +03:00
pyproject.toml init: add raspberry pi control bot project structure 2026年05月28日 07:24:11 +03:00
README.md fix: run power actions non-interactively 2026年05月28日 07:52:42 +03:00
requirements.txt feat: add project dependencies to requirements.txt 2026年05月28日 07:29:55 +03:00
uv.lock init: add raspberry pi control bot project structure 2026年05月28日 07:24:11 +03:00

Raspberry Pi control bot

Telegram bot for controlling a Raspberry Pi from a private admin chat.

Configuration

Create .env from .env.example:

BOT_TOKEN=123456:replace-me
ADMIN_TELEGRAM_IDS=100000001,100000002

Only users listed in ADMIN_TELEGRAM_IDS can use the bot. Handlers also require a private chat.

Actions

  • Volume up -> wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
  • Volume down -> wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
  • Mute -> wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
  • Poweroff -> sudo -n /usr/bin/systemctl poweroff
  • Reboot -> sudo -n /usr/bin/systemctl reboot

The bot registers slash commands for private chats and shows a two-row reply keyboard:

  • Volume up, Volume down, Mute
  • Poweroff, Reboot

Run

uv run python main.py

Raspberry Pi permissions

Power actions require non-interactive root privileges. Add a sudoers rule for the user that runs the bot:

botuser ALL=(root) NOPASSWD: /usr/bin/systemctl poweroff, /usr/bin/systemctl reboot

Replace botuser with the actual service user. The bot uses sudo -n, so it will fail fast instead of waiting for a password prompt.