cameroncros / octoprint-discordremote Goto Github PK
View Code? Open in Web Editor NEWDiscord plugin for OctoPrint
License: MIT License
Discord plugin for OctoPrint
License: MIT License
I have my bot token and channel ID in the plugin. For the base URL I used the local IP as the pi is not port forwarded. The gamepad icon is green and my bot says online in my discord channel but nothing is sent or received from either direction.
Is there any special permissions when setting the bot up so it can read/write in the channel
disregard the top commands that is the google assistant bot I was testing out.
Is it possible to have the printer name post in discord? I have 2 printers posting to same channel but doesnt say which is which etc
It would be great if there was a command for "how long its currently been printing" and "eta till print is finished"
Then this "📢 Printing is at {progress}%"
could be changed to
📢 Printing is at {progress}%
So far i've been printing for 2 hours.
Current ETA is 1 hour 65 minutes.
etc
time formatted in mins and hours have no ideal what it is in like /status https://puu.sh/AE1Rn/ff2d678ae4.png
I am probably missing something obvious, but I can't get the bot to respond to commands in discord. Everything else is working. I can see the bot on the channel, I can send commands from octoprint which shows up in Discord, but not send commands from discord itself.
Any ideas?
I see there have been issues raised on this in the past, but I couldn't find a solution there.
Hello !
Could you please also update the setup.py version to match you release's one when you push new releases so after we update in octopi it stops notify us there is an update availble ?
Thx !
Basically in discord the bot does not respond to the commands
however if i send the commands through the web interface it spits out the information in discord
Get the printer and if possible, the print status.
Info:
Hi, can you please list the commands that can be sent to the bot through Discord? I've used the Telegram bot so I know to try /files and /print, but beyond that I'm lost. Thanks!
after doing /files the Estimated time printing is Extimated time.
Currently, the bot listens to anyone who is not the bot itself. This is a mild security problem, but is solvable by locking down the channel.
Change this so the printer owner can specify specific users who the bot will listen to.
formatting on mobile is bad the status one is fine on mobile https://cdn.discordapp.com/attachments/423501252618485770/459528563129843722/image.png if you can get it to look like this it would be amazing https://puu.sh/AJHG3/17fbe588d6.png
Frequent 10% intermediate updates are not always helpful when printing smaller jobs. Proposing the addition of a "minimum update interval" configuration option. The system would then update on the X% if the interval between the current and last update were > the "minimum update interval". The start and end notification should be exempt from this configuration.
Having too many notifications potentially has the implication of users simply tuning out the update. By making this a configurable parameter, users are able to select the interval that works best for them.
Personally I use this reminder to periodically check on my prints.
Thanks.
Hi, i'm having some issues getting the bot to even show up on my channel.
i've made sure that the token id and channel id are correct.
as well I seem to be getting some errors in regards to the discord remote plugin, please see https://pastebin.com/e6GTnH1Q
Thanks!
It seems since the latest update, the Print Process: done message is not being triggered.
Add a free CI service
Hi, I just installed the plugins and everything was working fine until I started a print. I was waiting on my 10% notification and when came back a while later, the bot had disconnected from discord, I wasn’t able to send commands and the print was at 18%.
Any ideas? Thanks!
Will it ever be possible to upload a .gcode file to the discord channel with /upload and have it load into octoprint?
This would be amazing!
ip get set back to on when it updated to a new version when it sends this message I just woke up! What are we gonna print today?
Local IP: 172.17.62.26 External IP:xxx.xxx.xxx.xxx when i have it set to just local ip and /status keeps it state before the update
Hi, the part about creating a new discordbot and giving it the right rights to write something in the channel is poorly covered. I have added my bot to my discord channel and everything looks green and ok. It joins my discord channel but I am unable to get it to write anything in the channel. I have doublechecked all the channel settings and tried giving the bot all kinds of different bot permisions. Even tried admin =8, but it still doesnt want to write anything in the channel. Any tips to checking what could have gone wrong?
Here is the octopi error log
https://pastebin.com/EUJTBPbT
(for the record i have changed my discord bot token after pasting this log
Hi,
I installed this plugin but didn't get around to configuring it yet, so it's been sat idle for a few weeks, I guess. Today I checked out the usage graphs for my ISP and noticed that since around midday (BST) on Saturday, we've been using a huge amount of upstream bandwidth - on the order of 50 GiB/day.
I tracked it down to my Octoprint Pi, down to Octoprint itself, and after running a packet sniffer on my router, which returned packets referencing discordapp.com
, I traced it to this plugin. Restarting Octoprint saw the data spam continue, albeit at a much lower rate (judging by the graphs for my ISP, the data stream gradually increases over the course of 60-90 minutes). When I disabled this plugin and restarted Octoprint, the data spam ceased entirely, with just a couple of kbps background traffic remaining.
Graph from Saturday, the red line is our uploads, showing around 5 Mbps, but note that we have two bonded VDSL lines, so seeing 5 Mbps on one line means that there's also 5 Mbps on the other line for a total of 10 Mbps:
Graph from Sunday (Monday, Tuesday and Wednesday look much the same):
The traffic was all going to a Cloudflare IP address, 104.16.59.5
.
Upon checking my Octoprint logs folder I found that my octoprint.log
file was 36 MiB, but previous days' logs were more than 200 MiB.
The most recent octoprint.log
almost entirely consists of these lines repeated forever:
2018-06-27 12:24:02,508 - octoprint.plugins.discordremote - INFO - Message queued 2
2018-06-27 12:24:04,162 - octoprint.plugins.discordremote - ERROR - <Response [404]>: {"code": 0, "message": "404: Not Found"} - {'Expect-CT': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', 'Content-Length': '40', 'Via': '1.1 google', 'Set-Cookie': '__cfduid=dc0ac58b2ced576345210d7d85df498be1530098643; expires=Thu, 27-Jun-19 11:24:03 GMT; path=/; domain=.discordapp.com; HttpOnly', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains', 'Server': 'cloudflare', 'Connection': 'keep-alive', 'Date': 'Wed, 27 Jun 2018 11:24:04 GMT', 'CF-RAY': '43178b876ae36b55-LHR', 'Alt-Svc': 'clear', 'Content-Type': 'application/json'}
However the older log files (Saturday and earlier) also include some HTML alongside the report-uri
line:
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>discordapp.com | 502: Bad gateway</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]-->
<style type="text/css">body{margin:0;padding:0}</style>
</head>
<body>
<div id="cf-wrapper">
<div id="cf-error-details" class="cf-error-details-wrapper">
<div class="cf-wrapper cf-error-overview">
<h1>
<span class="cf-error-type">Error</span>
<span class="cf-error-code">502</span>
<small class="heading-ray-id">Ray ID: 42e1069a3c146ba3 • 2018-06-20 20:36:07 UTC</small>
</h1>
<h2 class="cf-subheadline">Bad gateway</h2>
</div><!-- /.error-overview -->
<div class="cf-section cf-highlight cf-status-display">
<div class="cf-wrapper">
<div class="cf-columns cols-3">
<div id="cf-browser-status" class="cf-column cf-status-item cf-browser-status ">
<div class="cf-icon-error-container">
<i class="cf-icon cf-icon-browser"></i>
<i class="cf-icon-status cf-icon-ok"></i>
</div>
<span class="cf-status-desc">You</span>
<h3 class="cf-status-name">Browser</h3>
<span class="cf-status-label">Working</span>
</div>
<div id="cf-cloudflare-status" class="cf-column cf-status-item cf-cloudflare-status ">
<div class="cf-icon-error-container">
<i class="cf-icon cf-icon-cloud"></i>
<i class="cf-icon-status cf-icon-ok"></i>
</div>
<span class="cf-status-desc">London</span>
<h3 class="cf-status-name">Cloudflare</h3>
<span class="cf-status-label">Working</span>
</div>
<div id="cf-host-status" class="cf-column cf-status-item cf-host-status cf-error-source">
<div class="cf-icon-error-container">
<i class="cf-icon cf-icon-server"></i>
<i class="cf-icon-status cf-icon-error"></i>
</div>
<span class="cf-status-desc">discordapp.com</span>
<h3 class="cf-status-name">Host</h3>
<span class="cf-status-label">Error</span>
</div>
</div>
</div>
</div><!-- /.status-display -->
<div class="cf-section cf-wrapper">
<div class="cf-columns two">
<div class="cf-column">
<h2>What happened?</h2>
<p>The web server reported a bad gateway error.</p>
</div>
<div class="cf-column">
<h2>What can I do?</h2>
<p>Please try again in a few minutes.</p>
</div>
</div>
</div><!-- /.section -->
<div class="cf-error-footer cf-wrapper">
<p>
<span class="cf-footer-item">Cloudflare Ray ID: <strong>42e1069a3c146ba3</strong></span>
<span class="cf-footer-separator">•</span>
<span class="cf-footer-item"><span>Your IP</span>: 90.155.91.100</span>
<span class="cf-footer-separator">•</span>
<span class="cf-footer-item"><span>Performance & security by</span> <a href="https://www.cloudflare.com/5xx-error-landing?utm_source=error_footer" id="brand_link" target="_blank">Cloudflare</a></span>
</p>
</div><!-- /.error-footer -->
</div><!-- /#cf-error-details -->
</div><!-- /#cf-wrapper -->
</body>
</html>
- {'Expect-CT': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', 'Content-Length': '4093', 'Set-Cookie': '__cfduid=d86c5c4d1c8933a36c592d26952c5991e1529526967; expires=Thu, 20-Jun-19 20:36:07 GMT; path=/; domain=.discordapp.com; HttpOnly, cf_use_ob=0; expires=Wed, 20-Jun-18 20:36:37 GMT; path=/', 'Expires': 'Thu, 01 Jan 1970 00:00:01 GMT', 'Server': 'cloudflare', 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'Date': 'Wed, 20 Jun 2018 20:36:07 GMT', 'X-Frame-Options': 'SAMEORIGIN', 'Content-Type': 'text/html; charset=UTF-8', 'CF-RAY': '42e1069a3c146ba3-LHR'}
My guess is that this plugin was attempting to do something, accidentally ended up being very spammy to someone (possibly the Report-URI service), and then that person blocked my Pi's IP address at Saturday lunchtime (the guy who runs Report-URI lives in the UK, so that's a perfectly reasonable time for him to be dealing with things like that), and then this plugin wasn't expecting the Report URI requests to 404 and just started spamming those requests, somehow doing so at increasing frequency - every 1-2 seconds judging by this octoprint.log
!
But I suspect that the main issue will be that there is no logic to keep the plugin in "idle"/standby mode if it's not configured :)
I'm happy to share my log files privately, along with the packet dumps I collected, if that helps.
And hopefully this hasn't resulted in my entire IP address range being blocked by Report-URI, as that was a service I was planning to use at some point. It won't matter too much if only the Raspberry Pi's IP address was blocked, but if the block extends to my whole IP range I won't be happy =/
Thanks :)
If available, use:
https://github.com/kantlivelong/OctoPrint-PSUControl/wiki/API
To turn on and off the PSU. Use getPSUState API to detect if plugin exists, and only register if true.
Is there a way to exclude the 100% message, but still get the incremental messages? I like having the "Print complete" message, but when getting status updates every X% as well as having the complete message, I get double pinged upon completion.
Haven't been printing with octoprint lately because I was having some errors with it, but started it up again earlier this evening. I noticed that discordremote's reporting % complete wasn't lining up with octoprint's % complete shown (example i got the 70% message while octoprint was showing 87%)
running octoprint on puppy linux 14.04 thar. Everything appears to be set up correctly both on octoprint and discord text channel, all commands work apart from /status, tried from discord and from octoprint page.
It would appear that ipgetter
is gone from the the pip repository and installations are now failing -- or is this just me?
https://pypi.org/search/?q=ipgetter
There really should be a better way of doing this than pulling this package in. A simple GET request to http://checkip.amazonaws.com/ will return this without all these extraneous dependencies.
Can we have a way to wait for x seconds before taking a snapshot? This I think would mostly be for the "done" photo. My photos are being taken immediately after the 100% is hit, which means my extruder may be blocking part of the print and so I can't see a good snapshot of the part. Just a thought. Thanks!
Here's another enhancement idea:
Let the user change what character they want in front of the command. So they could change to
.help, or even ./help
@cameroncros If you want this setting, I have the code already and I'll make a PR.
hey i was wondering if there is an option to get the ip of the net from the discord channel.
can we have the bot send the message at a determined time interval? like, i dont want 10 snapshots of a 20min job, but i dont want 2 of a 20h job
so using it by time (for example, every 30 mins) so it sends a message after the specified interval has passed
it would be amazing to get a notification every 30mins (or whatever you set it to) on discord, i monitor my prints while away with it and its very useful, Amazing plugin btw!!
it dose not post or listen to the channel i did give it permissions
Could you add the possibility to turn of the bot with a simple button. so it doesn't spam you when you are for exampe at Home were you don,t really need it. It would be good if you can toggle this even mid print
/gettimelapse [filename] to get the bot to upload a timelapse
This would be an excellent feature to add. For example, one could add a custom command "/light" and use their RPI to toggle a lamp. I would be willing to help add this, I just need to know what this would entail with regards to how the plugin is set up. Maybe the command could trigger a python script, etc.
I have tried restarting and rebooting but I cannot get the plugin to install.
Installation gets to "Running setup.py install for Pillow: started" and then freezes. After a little while I get this error message: Error!
Could not install plugin, unknown error, please consult octoprint.log for details
I have attached my log.
plugin_pluginmanager_console (1).log
octoprint (3).log
Thanks for the help. I am trying to get my printer to work with google assistant. With IFTTT I can post to a discord channel so when I get this up and running I should be able to control my printer with my google home and phone
a box to say show ext ip or don't show it and same for local ip
Hi, was wondering it is possible to run customs commands that would send a bash command for raspberry Pi users to shut off the printer or what ever relays they have?
Would it be possible to add someone that can only use snapshot and status but cannot upload and start prints?
Thanks!
a button to ping the discord bot so i dont have to remove one charter to reload the bots connection
I haven't been getting progress report messages for the past couple days. The 100% and complete messages are coming through, just not the incremental steps. this very well could be because i'm using a RC build, but wanted to bring it to your attention.
In Octorant (that this plugin is based on/inspired by), whenever you get a notification (including those with snapshots) the notification actually displays the message of the notification, such as the percentage of progress the printer has made. However with this plugin whenever the message includes an image the notification (on the Discord iOS app anyway) just says “snapshot.png”, not the actual text of the status message.
I know a while back in issue #51 you changed it so that it would send multiple messages, one with just the status update, and one with the picture. Would it be possible to have an option that you could toggle between having the old way and the current way? I personally preferred getting one message over two, and the current fix always has the picture second, so my notification still shows "snapshot.png" instead of the status.
/getfile file.gcode
Get the file from server
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.