131 Commits
Author SHA1 Message Date
rich 2d0aeb2a2e Merge branch 'dev' 2026-02-20 18:12:17 -05:00
rich 2476fa9fae adding gitignore 2026-02-20 18:10:39 -05:00
rich bc4854e6f4 updating readme 2026-02-20 18:01:13 -05:00
rich 6362f2558e removing tls_verify option 2026-02-20 17:38:21 -05:00
rich a750628097 adding code to capture ffmpeg errors 2026-02-20 17:35:56 -05:00
rich ce31a2e5df reworking bambu image to get from rtsp stream 2026-02-20 17:27:37 -05:00
rich 570e9d14a6 added option to enable bambu camera retrieval 2026-02-20 16:44:19 -05:00
rich 23fe33e3ad added camera 2026-02-20 16:38:19 -05:00
rich 54c16d81dc fixing the fix for the unconfirmed bug 2026-02-20 16:29:56 -05:00
rich 04d7d5c37f working around unconfirmed bug 2026-02-20 16:27:33 -05:00
rich fbc3ceb3c4 update requirements 2026-02-20 16:23:30 -05:00
rich e1703ae326 adding requirements 2026-02-20 16:19:54 -05:00
rich 65a1fe413d inital commit for adding $bambustat 2026-02-20 16:15:03 -05:00
rich 451938772a more clean up 2026-02-20 15:57:01 -05:00
rich 591d44904e fixing up some issues 2026-02-20 15:48:53 -05:00
rich 84dda24e9d adding discord.py version to $info 2026-02-20 15:00:54 -05:00
rich ebb9865109 reworking 2026-02-20 14:52:12 -05:00
rich e6cf3c6984 fix hanging if octopi is unavailable 2026-02-20 14:47:09 -05:00
rich 01e102af17 clearing voice session before joining channel 2026-02-20 14:42:28 -05:00
rich 790c224dcc using await for 1 second delay 2026-02-20 14:36:51 -05:00
rich 34b80aa274 Merge branch 'master' of https://git.rickelobe.com/rich/r0b3BOT 2026-02-18 19:46:39 -05:00
rich a35be2f669 fixing api woes 2026-02-18 19:43:13 -05:00
rich 06c0f98e25 bringing bot up to date with current discord api 2026-02-18 19:34:03 -05:00
rich 14104b4f39 Discord API now requires INTENTS 2024-03-20 13:29:36 -04:00
rich 1184102860 Added livestream URL to printstat output 2023-02-16 20:13:19 +00:00
rich 4e3d735b1d forgot to replace output variable 2023-02-12 15:47:11 +00:00
rich b074306696 ugh, need ==, not = 2023-02-11 23:13:45 +00:00
rich 0d5fd6c0cf rework time remaining for status 2023-02-11 23:12:34 +00:00
rich 8647451b24 setting to 999 2023-02-11 23:07:41 +00:00
rich c89bfaeff1 retrying leading zero 2023-02-11 19:38:00 +00:00
rich 74f6e0a32c adding leading zero (hopefully) 2023-02-11 19:35:49 +00:00
rich be9173a7ff adding time left to logging output 2023-02-11 19:26:31 +00:00
rich 1666e8fbf9 changeup wording 2023-02-11 19:23:30 +00:00
rich b950886c2d adding time remaining to status 2023-02-11 19:22:10 +00:00
rich 9a627c8a83 remove unused library 2023-02-10 22:51:44 +00:00
rich 9f11775db8 Fix missing paren, add comment explaining need for unknowns 2023-02-10 22:42:44 +00:00
rich d994b9f8fe forgot the f in the f-string 2023-02-10 20:50:50 +00:00
rich a7e5b3bea2 meh, round to tenth place 2023-02-10 20:14:15 +00:00
rich ed2e00ac3c change rounding to whole number 2023-02-10 20:12:53 +00:00
rich 0fd568fd87 minor logging message changes 2023-02-10 20:07:42 +00:00
rich 2801e1559f commenting out few lines that are updating bot status when $printstat is called. No longer need to do this. 2023-02-10 19:56:17 +00:00
rich 3007aa56f5 add message if print job is present but at 100% complete 2023-02-10 19:19:43 +00:00
rich 669333e2c7 dont want to watch print job if it's already at 100% 2023-02-10 19:14:46 +00:00
rich bf88d3d7c1 change location of last_error assignment 2023-02-10 14:48:49 +00:00
rich 3751a29dfb updating logging output 2023-02-10 14:21:23 +00:00
rich 2aae88ed22 forgot await async 2023-02-10 14:19:18 +00:00
rich dc2ea9a7e3 fixing loop 2023-02-10 14:16:43 +00:00
rich 7285c4da85 Adding loop to autodetect 3D printer jobs 2023-02-10 14:09:51 +00:00
rich e0c34659a2 removing references to StatPing and MMR 2023-02-08 23:27:15 +00:00
rich 32bb958ac0 Remove all StatPing and MMR_Checker code 2023-02-08 23:22:36 +00:00
rich 70b721b40f Merge branch 'dev' into 'master'
Merge Dev into Master - minor update

See merge request Bots/r0b3BOT!65
2022-12-10 00:32:04 +00:00
rich a80f62f8d4 fixing some minor bugs 2022-12-10 00:22:15 +00:00
rich a9efb888bd some cleanup and re-org of help command 2022-12-10 00:15:27 +00:00
rich 59fdac5803 added $nice 2022-05-14 00:33:09 +00:00
rich 64173df84d Adding We butter the bread with butter - N!CE 2022-05-14 00:30:00 +00:00
rich 5859bbdac8 updating emote 2022-03-25 01:50:52 +00:00
rich 5b6555b8da adding ascii emote 2022-03-25 01:48:48 +00:00
rich 0e287c369d Added $breee command 2022-03-25 01:36:00 +00:00
rich 98f7ced3bf Adding BREEEEEEEEEEEE 2022-03-25 01:33:06 +00:00
rich dce4303ca1 Merge branch 'testing' into 'dev'
Fixing some stuff & things

See merge request Bots/r0b3BOT!64
2021-04-27 22:36:37 +00:00
rich 1153d1919c fixing indents 2021-04-04 15:01:48 -04:00
rich 499d86459b Merge branch 'testing' of https://gitlab.rickelobe.com/Bots/r0b3BOT into testing 2021-04-04 14:54:55 -04:00
rich c053b58733 not properly handling non jason response 2021-04-04 14:54:38 -04:00
rich e018cfa05b Merge branch 'master' of https://gitlab.rickelobe.com/Bots/r0b3BOT into testing 2021-03-23 19:11:00 -04:00
rich 9f58177559 Merge branch 'dev' into 'master'
Bring in fix for displaying correct version number

See merge request Bots/r0b3BOT!63
2021-03-22 14:40:18 +00:00
rich 58e1781397 correctly fixing the version now (wish the documentation was better) 2021-03-22 00:10:35 +00:00
rich f08eb06db4 Fixing the version information displayed for the info command 2021-03-22 00:06:43 +00:00
rich 807bf17f61 Merge branch 'dev' into 'master'
Merge MMR checker into master for release

See merge request Bots/r0b3BOT!62
2021-03-21 23:42:04 +00:00
rich 3e354d3655 Merge MMR checker into master for release 2021-03-21 23:42:04 +00:00
rich fa38734869 Merge branch 'testing' into 'dev'
Merge MMR Checker into Dev

See merge request Bots/r0b3BOT!61
2021-03-21 23:29:08 +00:00
rich 66ed4fd4d1 Merge MMR Checker into Dev 2021-03-21 23:29:07 +00:00
rich c528e0f638 Added new feature 2021-03-21 17:19:27 +00:00
rich 41b1c73ff3 adding back bot.remove_command entry 2021-03-21 13:10:16 -04:00
rich b1d1a7b1cc Cleanup of code 2021-03-21 13:07:25 -04:00
rich 8bb132be24 Organizing 2021-03-21 12:44:49 -04:00
rich 15d0a01dcb typo 2021-03-21 12:37:56 -04:00
rich ad05b2f427 updating help command details 2021-03-21 12:37:20 -04:00
rich 2cbaef99c0 working on mmrstatus 2021-03-21 12:26:25 -04:00
rich a53cab8343 working on mmrstatus 2021-03-21 12:24:03 -04:00
rich e00da20870 Cleaning up output text 2021-03-21 12:17:00 -04:00
rich 45d8d5702c found typo 2021-03-21 12:11:24 -04:00
rich 86e7944837 editing output for clarity 2021-03-21 12:05:31 -04:00
rich e9a2165f78 found some issues 2021-03-21 11:41:45 -04:00
rich 9421b22cff was using wrong varibale... missed ong 2021-03-21 07:54:10 -04:00
rich 5767d2d606 was using wrong varibale 2021-03-21 07:53:06 -04:00
rich 3b5ecf4b6b more debug 2021-03-21 07:46:56 -04:00
rich d961698d40 typo 2021-03-21 07:45:15 -04:00
rich 37e9512d82 troubleshooting -list command 2021-03-21 07:44:27 -04:00
rich 5e1164d98c typo 2021-03-20 19:25:50 -04:00
rich 1e64e992dd let's try it this way 2021-03-20 19:25:05 -04:00
rich 667126c916 dunno 2021-03-20 19:18:31 -04:00
rich 5ada6cfb36 troubleshooting response check: welp, had that backwards 2021-03-20 19:13:08 -04:00
rich b6d5ce6836 troubleshooting response check: fixing syntax 2021-03-20 19:11:16 -04:00
rich 0077f1a80b troubleshooting response check 2021-03-20 19:09:34 -04:00
rich dfa82dbe96 correcting variable being used 2021-03-20 19:06:59 -04:00
rich ba014f4c98 fixing... 2021-03-20 19:05:27 -04:00
rich 6823161897 fixing... 2021-03-20 19:03:52 -04:00
rich fcb0051c87 fixing 2021-03-20 19:03:15 -04:00
rich 403aa9a362 check if handle was actually found 2021-03-20 19:00:42 -04:00
rich 8d91336b43 Added mmrstatus command 2021-03-20 18:31:41 -04:00
rich 25abfb2a59 updating info command 2021-03-20 18:23:30 -04:00
rich 3f9a976742 clarifying alert text 2021-03-20 17:17:49 -04:00
rich 8f41991a3d fixing assignment again... hopefully for the last time, again 2021-03-20 16:31:09 -04:00
rich 1785162cea fixing assignment again... hopefully for the last time 2021-03-20 16:30:15 -04:00
rich 0207424d32 fixing assignment again 2021-03-20 16:28:50 -04:00
rich ab7009e43f fixing assignment 2021-03-20 16:25:36 -04:00
rich 5c0e61d466 adding newlines 2021-03-20 12:51:43 -04:00
rich 2cabbbf6f1 more tweaks to output 2021-03-20 12:49:19 -04:00
rich 803e8d552d more tweaks to output 2021-03-20 12:48:19 -04:00
rich 0950092f6d more tweaks to output 2021-03-20 12:46:47 -04:00
rich f6e15d9c35 output formatting 2021-03-20 12:38:21 -04:00
rich 5b917e032f fixing minor typo 2021-03-20 12:16:36 -04:00
rich 7628f8d1ae setting variable to int 2021-03-20 12:14:52 -04:00
rich 1e496efbee added interval option for mmr checker, cleaned up some output 2021-03-20 12:11:30 -04:00
rich 0cf348570b tweaks 2021-03-20 11:39:17 -04:00
rich 55419dbafb correcting syntax error 2021-03-20 10:03:45 -04:00
rich cf3757ce11 added enable/disable check before starting mmr checker and statping monitor 2021-03-20 10:02:08 -04:00
rich 4cf45b2684 added enable/disable options for mmr checker and statping monitor 2021-03-20 10:01:34 -04:00
rich 544f7b5833 I think all of the necessary changes have been made to add the mmr checker... needs to test now? 2021-03-19 22:43:02 -04:00
rich fa2a34c951 adding mmr api variable 2021-03-19 22:24:04 -04:00
rich affbf366a1 adding base code for mmr_checker 2021-02-14 21:37:17 -05:00
rich 4056f60cd8 duplicated statping functions for mmr monitor 2021-01-20 21:55:42 -05:00
rich a7a36f123c Merge branch 'dev' of https://gitlab.rickelobe.com/Bots/r0b3BOT into mmr_checker 2021-01-20 21:27:43 -05:00
rich 6865041707 Added missing playtime value for rs command 2020-09-02 09:47:06 -04:00
rich 520758e2f2 Added Wiz Khalifa clip $big 2020-07-01 09:10:58 -04:00
rich cd74624747 added iran sound clip 2020-07-01 08:58:15 -04:00
rich 525f13b3e8 Merge branch 'dev' into 'master'
changing play delay to check if file is still being played

See merge request Bots/r0b3BOT!60
2020-06-22 11:36:18 -04:00
rich c82dc32ca2 changing play delay to check if file is still being played 2020-06-19 11:42:37 -04:00
rich ccb260c3f9 Merge branch 'master' into 'testing'
Make testing master again!

See merge request Bots/r0b3BOT!59
2020-04-15 15:27:09 -04:00
rich fa9fb6b27d Merge branch 'dev' into 'master'
Version 0.3

See merge request Bots/r0b3BOT!58
2020-04-15 15:09:06 -04:00
rich a8e62c5ce9 Merge branch 'dev' into 'master'
Version 0.2

See merge request Bots/r0b3BOT!47
2020-03-29 18:20:14 -04:00
10 changed files with 517 additions and 485 deletions

No files matched your search

+2
View File
@@ -1 +1,3 @@
.vscode/launch.json
__pycache__
bot_config.conf
+46 -11
View File
@@ -3,25 +3,60 @@
[![pipeline status](http://gitlab.rickelobe.com/Bots/r0b3BOT/badges/master/pipeline.svg)](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>
![](images/Discord_Printstat_Command.png)
* 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>
![Example service alert](images/Service_alert.png)
* 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
![Screenshot of $help](images/command_list.png)
# 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<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 |
+25
View File
@@ -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=
+15 -2
View File
@@ -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,5 +22,13 @@ 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>
statping_api_key = <Statping API Key>
mmr_checker_enable = <true/false>
mmr_checker_interval = <number of seconds between checks>
mmr_api_url = <MMR API URL>
+416 -472
View File
File diff suppressed because it is too large. Load diff
+13
View File
@@ -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
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.