npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

duet-telegram

v0.3.0

Published

Telegram bot to control duet wifi controller

Downloads

16

Readme

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.