GithubHelp home page GithubHelp logo

cybersardinha / duet-telegram Goto Github PK

View Code? Open in Web Editor NEW

This project forked from martinj/duet-telegram

0.0 1.0 0.0 125 KB

Telegram bot for duet wifi electronics board

JavaScript 99.64% Dockerfile 0.36%

duet-telegram's Introduction

Duet Telegram Bot

Telegram bot for controlling and receiving notifications from a Duet electronics board.

This bot is inspired by Octoprint-Telegram

Installation

  1. Install NodeJS - Raspberry PI instructions

  2. Install duet-telegram

     sudo npm i -g duet-telegram
    
  3. Create Telegram Bot

  4. Start the bot by typing the command duetbot.

The first time you start it won't find any configuration, you will prompted to create an example configuration file.

Edit the configuration file (you can ignore authorizedUsers unless you know your telegram user id, see next step) and start the bot again.

First time authorization

Start a conversation with your bot in telegram and hit the start button, this will issue the command /start.

If you didn't know your telegram user id, this will now be logged in the console output for `duetbot.

Stop the bot and add your telegram user id in the confiuration file authorizedUsers and restart the bot.

You are now all set to start using the bot.

Install NodeJS on Raspberry

sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

Create Telegram Bot

  1. Open a chat with @botfather in Telegram Messenger.

  2. Send /newbot to @botfather and follow the instructions.

  3. The botfather gives you a token, which you will need to use in the configuration for this software later on.

  4. Send the available commands to botfather to enable auto-complete in the bot. Send /setcommands to botfather and select your created bot. Paste the commands in the box below (one message with multiple lines).

     status - Display current print status.
     upload - Upload gcode file.
     files - Browse gcode files.
     print - Alias for files.
     macros - Browse macros.
     togglepause - Pause/resume print.
     notifications - Show/Change your notification settings.
     cancel - Cancel paused print.
     gcode - Send gcode to printer.
     emergencystop - A confirmation is required.
     shutup - Disables all automatic notifications.
     dontshutup - Enables all automatic notifications.
     help - Show this help message.
    

Changing notification settings

All chats notification settings are available in the file <HOME DIR>/.duetbotdb.json, you can modify this file to change your settings. You will need to restart the bot for the configuration to be in effect.

There is plans on adding configuration support through the bot for this. See TODO

TODO

  • Add support for password protected duet
  • Support paginated file listing responses
  • Respect sessionTimeout from rr_connect
  • Test pause / resume with print interval notifications
  • use telgram.sendChatAction for commands that takes time to process

Limitations

Some console / response message may be lost. Apparently the data returned by rr_reply are flushed from duet, which means if duet web control is running it might fetch them before the bot does or vice versa.

Response from gcode commands requires console notifications enabled to see them.

duet-telegram's People

Contributors

martinj avatar cybersardinha avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.