DiscordRemote is a plugin allowing Octoprint to send notifications to a Discord channel. The plugin connects to a DiscordShim which manages the actual discord interactions.
There is an existing DiscordShim that is already setup, or users may create and use their own DiscordShim instance.
This is forked from https://github.com/bchanudet/OctoPrint-Octorant.
Note, using this plug-in requires either:
License : MIT
Benjamin Chanudet for their initial plugin, which this is based on.
OctopusProteins for their work on the enclosure plugin, file upload capabilities and presence updates.
megasaturnv for their assistance with configuring the access settings.
goscicki for their help testing the /gcode capability.
timothy-b for their help fixing the help command handling.
wchill for the custom embed in notification change.
SgtKiLLx for various typo fixes.
Zinc-OS for adding Raspberry Pi throttling status to the status message.
Stwend for adding split zip support, to get around the 8mb discord limit.
Mary for preventing the bot replying to other bots, and avoiding downloading non-gcode/zip files.
Milo Mirate for adding ETA to status.
jneilliii for Print Scheduler support.
grantrules for fixing presence.
MrFrickinFixit for assisting with debugging the network issues in v5.0
See the release history to get a quick summary of what's new in the latest versions.
Install via the bundled Plugin Manager or manually using this URL:
https://github.com/cameroncros/OctoPrint-DiscordRemote/archive/master.zip
There are currently 2 API's available for interacting with the bot.
These can be used by sending a POST request to [octoprint_url]/api/plugin/discordremote
, with JSON in the body of the request.
This API lets you send a command as if you typed it in discord. The response will be sent to discord. The JSON format is:
{
"command": "executeCommand",
"args": "COMMAND GOES HERE"
}
This API lets you send a message directly to discord. The JSON format is:
{
"command": "sendMessage",
"title": "TITLE GOES HERE",
"description": "DESCRIPTION GOES HERE",
"color": 0x123456,
"image": "BASE64 ENCODED FILE DATA HERE",
"imagename": "IMAGE NAME GOES HERE"
}
To get a list of available commands and arguments, type /help
into the discord channel. The bot will return all available commands.
Commands can also be sent via the web interface, by clicking the button in the top panel that looks like a game controller.
Files can be uploaded to the discord channel directly, and they will be downloaded into OctoPrint automatically. You can use the /unzip
command to manage zip files.
The plugin can be configured in the configuration panel, under the "DiscordRemote" panel.
In order for you to be sure these settings work, every time you change one of them, a test message will be sent to the corresponding Discord Channel. If you don't receive it, something is most likely wrong!
The access settings allow specific commands to be limited to specific users.
If the current command and user combination matches any of the rules, it will be executed. If additional rules are required, manually editing the config will be required.
Here you can customize every message handled by DiscordRemote.
XX
% : specific to the printing progress
message, this settings allows you to change the frequency of the notification :
10%
means you'll receive a message at 10%, 20%, 30%, 40% ... 80%, 90% of the printing process.5%
means you'll receive a message at 5%, 10%, 15%, 20% ... 80%, 85%, 90%, 95% of the printing process.Messages are regular Discord messages, which means you can use :
**markdown**
format (see Discord Documentation):emoji:
shortcuts to display emojis@mentions
to notify someoneSome events also support variables, here is a basic list : Common :
{ipaddr}
: the internal IP address of the OctoPrint server{externaddr}
: the external IP address of the OctoPrint server{timeremaining}
: the time remaining for the print ('Unknown' if the print is not running){timespent}
: the time spent so far on the print{eta}
: the date+time which is {timeremaining}
into the futurePrinting process : started event :
{name}
: file's name that's being printed{path}
: file's path within its origin location{origin}
: the origin storage locationPrinting process : failed event :
{name}
: file's name that's being printed{path}
: file's path within its origin location{origin}
: the origin storage locationPrinting process : done event :
{name}
: file's name that's being printed{path}
: file's path within its origin location{origin}
: the origin storage location{time}
: time needed for the print (in seconds){time_formatted}
: same as {time}
, but in a human-readable format (HH:MM:SS
)Printing process : failed event :
{name}
: file's name that's being printed{path}
: file's path within its origin location{origin}
: the origin storage location{position}
: position of the hotendPrinting process : paused event :
{name}
: file's name that's being printed{path}
: file's path within its origin location{origin}
: the origin storage location{position}
: position of the hotendPrinting process : resumed event :
{name}
: file's name that's being printed{path}
: file's path within its origin location{origin}
: the origin storage location{position}
: position of the hotendPrinting progress event :
{progress}
: progress in % of the print.Printer state : error
{error}
: The error receivedFor more reference, you can go to the Octoprint documentation on Events
If you encounter any trouble don't hesitate to open an issue. I'll gladly do my best to help you setup this plugin.