picamera_telegrambot.py
is very simple script,
which just sends a photo to a Telegram group from attached PiCamera.
Of course the script must be run in a Raspberry Pi.
Read Raspberry Pi's documentation how to install and configure PiCamera.
Read Telegram's bot documentation how to create a bot and find its access token.
Create a Python3 virtuanenv, activate it and install required modules:
pip install -r requirements.txt -U
You can add token as an --token
argument or in
CAMBOT_TOKEN
environment variable:
python picamera_telegrambot.py --token 123456789:asdfghjjklqwertyuiop123456
or
CAMBOT_TOKEN='123456789:asdfghjjklqwertyuiop123456' python picamera_telegrambot.py
You can test the script without Raspberry Pi and PiCamera if you install Pillow module.