Skip to main content

Python Telegram Bot for Meltingplot 3D Printers.

Project description

This package provides a Telegram Bot for the Meltingplot 3D Printers. The communication is using the Duet HTTP API.

See https://github.com/Duet3D/RepRapFirmware/wiki/HTTP-requests for more details.

Installation

sudo apt-get install ffmpeg
cd /home/ubuntu/
mkdir mp_telegram_bot
cd mp_telegram_bot
python3 -m venv venv
source venv/bin/activate
pip install mp_telegram_bot
mkdir config
# see next section for content of config.json
nano config/config.json
sudo cp /home/ubuntu/mp_telegram_bot/venv/mp_telegram_bot.service /etc/systemd/system
sudo systemctl enable mp_telegram_bot.service
sudo systemctl start mp_telegram_bot.service

Content of config/config.json

{
    "duet_api_address": "10.42.0.3",
    "duet_api_password": "password",
    "webcam_url": "http://10.42.0.3:8082/picture/1/current/",
    "telegram_token": "you get a new token from BotFather https://t.me/botfather"
}

Usage of Telegram Bot

Create a macro on your duet called pair_telegram_bot

The content of that file is:

M291 P"waiting for telegram bot ..." T60 ;indicate the telegram bot that we want to pair a new user

Execute the macro on your mobile to pair your telegram with your newly created bot. Wait for the telegram bot to take over. It will send you a start code to connect your telegram with your bot. After that, the bot creats a challenge code and showing you that challenge code again on your DWC. Press the link in the Messagebox and you are paired with your bot.

The following commands are currently supported:

/webcam - to create a 5 second webcam snippet
/unregister - to remove yourself from the paired user
/register <challenge> - to supply the provided challenge
/start - to start the challenge response auth

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

mp_telegram_bot-0.0.1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file mp_telegram_bot-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: mp_telegram_bot-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

File hashes

Hashes for mp_telegram_bot-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4c1dce00db22c4fb71c71fa37554f5c5997da3942d6df3693f1d9e02164739c5
MD5 d1a43f16ff44a368ee2cc93e1cbd4b96
BLAKE2b-256 6139823c79ba0eddd0df943a902d9095eb62247e0d68b2a129185dadcc977bf1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page