Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d0aeb2a2e | ||
|
|
2476fa9fae | ||
|
|
bc4854e6f4 | ||
|
|
6362f2558e | ||
|
|
a750628097 | ||
|
|
ce31a2e5df | ||
|
|
570e9d14a6 | ||
|
|
23fe33e3ad | ||
|
|
54c16d81dc | ||
|
|
04d7d5c37f | ||
|
|
fbc3ceb3c4 | ||
|
|
e1703ae326 | ||
|
|
65a1fe413d | ||
|
|
451938772a | ||
|
|
591d44904e | ||
|
|
84dda24e9d | ||
|
|
ebb9865109 | ||
|
|
e6cf3c6984 | ||
|
|
01e102af17 | ||
|
|
790c224dcc | ||
|
|
34b80aa274 | ||
|
|
a35be2f669 | ||
|
|
06c0f98e25 | ||
|
|
14104b4f39 | ||
|
|
1184102860 | ||
|
|
4e3d735b1d | ||
|
|
b074306696 | ||
|
|
0d5fd6c0cf | ||
|
|
8647451b24 | ||
|
|
c89bfaeff1 | ||
|
|
74f6e0a32c | ||
|
|
be9173a7ff | ||
|
|
1666e8fbf9 | ||
|
|
b950886c2d | ||
|
|
9a627c8a83 | ||
|
|
9f11775db8 | ||
|
|
d994b9f8fe | ||
|
|
a7e5b3bea2 | ||
|
|
ed2e00ac3c | ||
|
|
0fd568fd87 | ||
|
|
2801e1559f | ||
|
|
3007aa56f5 | ||
|
|
669333e2c7 | ||
|
|
bf88d3d7c1 | ||
|
|
3751a29dfb | ||
|
|
2aae88ed22 | ||
|
|
dc2ea9a7e3 | ||
|
|
7285c4da85 | ||
|
|
e0c34659a2 | ||
|
|
32bb958ac0 | ||
|
|
70b721b40f | ||
|
|
a80f62f8d4 | ||
|
|
a9efb888bd | ||
|
|
59fdac5803 | ||
|
|
64173df84d | ||
|
|
5859bbdac8 | ||
|
|
5b6555b8da | ||
|
|
0e287c369d | ||
|
|
98f7ced3bf | ||
|
|
dce4303ca1 |
No files matched your search
@@ -1 +1,3 @@
|
||||
.vscode/launch.json
|
||||
__pycache__
|
||||
bot_config.conf
|
||||
@@ -3,26 +3,60 @@
|
||||
[](http://gitlab.rickelobe.com/Bots/r0b3BOT/commits/master)
|
||||
|
||||
# Description
|
||||
This is R0b3's Discord Bot. It's creation was basically a challenge posed a coworker who said "Hey, you can write Discord Bots in Python... Make one to display your 3D printer status!". But as time went on, a few more features were added. Aside from being able to query and monitor your 3D printer, it can also fetch the current status of a service monitroed by your [StatPing](https://github.com/statping/statping) instance. In addition to just fetching the current status of a service, you can subscribe to receive alerts for any StatPing service state change. All subscriptions are persistent and will remain even after the bot is restarted.
|
||||
This is R0b3's Discord Bot. It's creation was basically a challenge posed a coworker who said "Hey, you can write Discord Bots in Python... Make one to display your 3D printer status!".
|
||||
|
||||
# Features
|
||||
* Query & Monitor 3D Printer Status using `$printstat` command(Requires that your printer is connected to [Octoprint](https://octoprint.org/))<br>
|
||||
* Query & Monitor OctoPrint 3D Printer Status using the `$printstat` command (Requires that your printer is connected to [Octoprint](https://octoprint.org/))<br>
|
||||

|
||||
* Query serivces states on StatPing using the `$spstatus`
|
||||
* Use `$spsub` to "Subscribe" to service change alerts for StatPing services. Subscribed alerts are persistent and are not lost on bot restart.<br>
|
||||

|
||||
* Use `$mmrsub` to "Subscribe" to a League of Legends handle's Ranked Average. As with the StatPing feature, the subscriptions are persistent.
|
||||
* Query & Monitor Bambu Lab Printer Status using the `$bambustat` command (Requires a Bambu Lab printer accessible on the local network via MQTT)<br>
|
||||
* Displays print state, progress percentage, time remaining, current layer, bed temp, nozzle temp, and chamber temp
|
||||
* Optionally captures and attaches a camera snapshot from the printer's RTSPS stream (requires [ffmpeg](https://ffmpeg.org/) on the host)
|
||||
* Updates the bot's Discord status to show live Bambu print progress while a print is running
|
||||
* Play a selection of sound clips to voice channel members using the various commands (`$torololo`, `$oops`, `$promoted`, etc)
|
||||
|
||||
# Commands
|
||||

|
||||
|
||||
# Requirements
|
||||
1. discord.py version 1.2.4 or greater<br>
|
||||
<code> pip install discord.py </code>
|
||||
|
||||
Install all Python dependencies using the provided `requirements.txt`:
|
||||
|
||||
```
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
Dependencies:
|
||||
- `discord.py[voice]` >= 2.6.4 — Discord bot framework (voice support included)
|
||||
- `requests` >= 2.32.3 — HTTP client for HomeAssistant REST API calls
|
||||
- `bambu-connect` >= 0.3.1 — Bambu Lab printer integration via local MQTT
|
||||
- `paho-mqtt` >= 2.0 — MQTT client library (required by bambu-connect)
|
||||
|
||||
**Optional: Camera snapshot support**
|
||||
|
||||
To enable camera snapshots with `$bambustat`, [ffmpeg](https://ffmpeg.org/) must be installed on the host running the bot. Set `bambu_camera_enable = true` in `bot_config.conf` once ffmpeg is available.
|
||||
|
||||
# Configuration
|
||||
1. Create a Discord Bot via Developer tools<br>
|
||||
2. Enter configuration parameters in bot_config.conf.example<br>
|
||||
3. Enter OctoPrint config parameters in octoapi.conf.example<br>
|
||||
4. Rename *.example files as *.conf and setup your config<br>
|
||||
1. Create a Discord Bot via the [Discord Developer Portal](https://discord.com/developers/applications)
|
||||
2. Copy `bot_config.conf.example` to `bot_config.conf` and fill in your values (see below)
|
||||
3. Rename `octoapi.conf.example` to `octoapi.conf` and configure OctoPrint settings (if using OctoPrint)
|
||||
|
||||
## bot_config.conf Keys
|
||||
|
||||
| Key | Description |
|
||||
|-----|-------------|
|
||||
| `discord_auth_token` | Bot token from the Discord Developer Console |
|
||||
| `bot_command_prefix` | Command prefix (e.g. `$`, `!`, `/`) |
|
||||
| `hass_url` | URL to your Home Assistant instance |
|
||||
| `hass_token` | Long-lived access token for Home Assistant REST API |
|
||||
| `hass_light` | Entity ID of the light at your printer |
|
||||
| `octoprint_ip_address` | IP address of your OctoPrint/OctoPi host |
|
||||
| `bambu_ip_address` | IP address of your Bambu Lab printer on the local network |
|
||||
| `bambu_access_code` | Access code shown on the printer screen (Settings > WLAN) |
|
||||
| `bambu_serial_number` | Serial number of your Bambu Lab printer |
|
||||
| `bambu_camera_enable` | Set to `true` to capture camera snapshots with `$bambustat` (requires ffmpeg) |
|
||||
| `statping_enable` | Set to `true` to enable StatPing service status integration |
|
||||
| `statping_url` | URL of your StatPing instance |
|
||||
| `statping_api_key` | API key for StatPing |
|
||||
| `mmr_checker_enable` | Set to `true` to enable MMR checker |
|
||||
| `mmr_checker_interval` | Seconds between MMR checks |
|
||||
| `mmr_api_url` | MMR API URL |
|
||||
@@ -0,0 +1,25 @@
|
||||
[bot-config]
|
||||
#
|
||||
# Replace the placeholders with your information. Do not use quotes.
|
||||
#
|
||||
# discord_auth_token - this is the bot token generated via the Discord development console.
|
||||
# bot_command_prefix - The prefix used identify commands for this bot
|
||||
# hass_url - URL to your home assistant instance. This is used to turn on the light by your 3d printer
|
||||
# hass_token - Long Lived Access Token used to authenticate with the REST API for your Home assistant instance
|
||||
# hass_light - Entity name of the light you want to control
|
||||
# octoprint_ip_address - IP Address of you OctoPrint (or OctoPi) host. Used to get 3D printer stats.
|
||||
# statping_url - Server hostname of the StatPing instance we will be querying w/ the REST API
|
||||
# statping_api_key - API Key for Statping to query for service status
|
||||
#
|
||||
discord_auth_token = Njk4NTY1MDM5MzAwNDExNDIy.XpHrZA.QCXjDj_Sk36Ohtu8ryXKSoGKMkc
|
||||
bot_command_prefix = #
|
||||
hass_url = <URL to HomeAssistant>
|
||||
hass_token = <HomeAssistant Long Lived Access Token>
|
||||
hass_light = <Entity_ID of the light @ your printer>
|
||||
octoprint_ip_address = <OctoPrint IP Address>
|
||||
statping_enable = False
|
||||
statping_url = <Statping URL>
|
||||
statping_api_key = <Statping API Key>
|
||||
mmr_checker_enable = True
|
||||
mmr_checker_interval = 600
|
||||
mmr_api_url = https://na.whatismymmr.com/api/v1/summoner?name=
|
||||
+10
-1
@@ -7,7 +7,12 @@
|
||||
# hass_url - URL to your home assistant instance. This is used to turn on the light by your 3d printer
|
||||
# hass_token - Long Lived Access Token used to authenticate with the REST API for your Home assistant instance
|
||||
# hass_light - Entity name of the light you want to control
|
||||
# octoprint_ip_address - IP Address of you OctoPrint (or OctoPi) host. Used to get 3D printer stats.
|
||||
# octoprint_ip_address - IP Address of you OctoPrint (or OctoPi) host. Used to get 3D printer stats.
|
||||
# bambu_ip_address - IP Address of your Bambu Lab printer on the local network
|
||||
# bambu_access_code - Access code displayed on the printer's screen (Settings > WLAN)
|
||||
# bambu_serial_number - Serial number of your Bambu Lab printer
|
||||
# bambu_camera_enable - Set to true to capture a camera snapshot with $bambustat via ffmpeg RTSPS stream.
|
||||
# Requires ffmpeg to be installed on the bot host.
|
||||
# statping_url - Server hostname of the StatPing instance we will be querying w/ the REST API
|
||||
# statping_api_key - API Key for Statping to query for service status
|
||||
#
|
||||
@@ -17,6 +22,10 @@ hass_url = <URL to HomeAssistant>
|
||||
hass_token = <HomeAssistant Long Lived Access Token>
|
||||
hass_light = <Entity_ID of the light @ your printer>
|
||||
octoprint_ip_address = <OctoPrint IP Address>
|
||||
bambu_ip_address = <Bambu Lab Printer IP Address>
|
||||
bambu_access_code = <Bambu Lab Access Code>
|
||||
bambu_serial_number = <Bambu Lab Serial Number>
|
||||
bambu_camera_enable = false
|
||||
statping_enable = <trues/false>
|
||||
statping_url = <Statping URL>
|
||||
statping_api_key = <Statping API Key>
|
||||
|
||||
+369
-729
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,13 @@
|
||||
# r0b3BOT Python dependencies
|
||||
# Install with: pip install -r requirements.txt
|
||||
|
||||
# Discord bot framework — [voice] pulls in PyNaCl for voice channel encryption
|
||||
discord.py[voice]>=2.6.4
|
||||
|
||||
# HTTP client — used for HomeAssistant REST API calls
|
||||
requests>=2.32.3
|
||||
|
||||
# Bambu Lab printer integration via local MQTT
|
||||
# bambu-connect 0.3.1 uses mqtt.CallbackAPIVersion.VERSION1, which requires paho-mqtt 2.x
|
||||
bambu-connect>=0.3.1
|
||||
paho-mqtt>=2.0
|
||||
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user