mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-05-09 05:35:30 +02:00
[PR #350] [MERGED] Add camera image embeds to Discord notifications #1006
Labels
No labels
A1
automated
automated
bug
bug
Closed due to inactivity
contrib
dependencies
dependencies
duplicate
enhancement
feedback
hold
invalid
Notes
P1S
pull-request
security
security
ThumbsUp
user-report
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/bambuddy#1006
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/maziggy/bambuddy/pull/350
Author: @sbcrumb
Created: 2/12/2026
Status: ✅ Merged
Merged: 2/13/2026
Merged by: @maziggy
Base:
0.2.0b← Head:feature/discord-image-embeds📝 Commits (2)
a942fb5Add camera image embeds to Discord notifications7fd1218Merge branch '0.2.0b' into feature/discord-image-embeds📊 Changes
1 file changed (+20 additions, -11 deletions)
View changed files
📝
backend/app/services/notification_service.py(+20 -11)📄 Description
Add camera image embeds to Discord webhook notifications. When a camera snapshot is available, it is attached to the Discord webhook via multipart form-data and referenced in the embed's image field. This applies to print start, print complete/failed/stopped, progress milestones (25%, 50%, 75%), and printer error notifications. When no image is available, notifications continue to send as text-only.
Related Issue
Fixes #306
Type of Change
Bug fix (non-breaking change that fixes an issue)
New feature (non-breaking change that adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
Documentation update
Code refactoring
Performance improvement
Test addition or update
Changes Made

Added image_data parameter to _send_discord() in notification_service.py
When image data is present, send as multipart form-data with payload_json for the embed and files[0] for the JPEG attachment, using Discord's attachment://photo.jpg URL reference in the embed image field
Pass image_data through to Discord in _send_to_provider(), matching existing Pushover behavior
When no image is available, behavior is unchanged (text-only embed via JSON POST)
Screenshots
Testing
I have tested this on my local machine
I have tested with my printer model: H2S
Checklist
My code follows the project's coding style
I have commented my code where necessary
I have updated the documentation (if needed)
My changes generate no new warnings
I have tested my changes thoroughly
Additional Notes
This builds on the existing camera snapshot infrastructure already in the codebase. The image capture logic (external camera, buffered stream frame, or fresh capture via chamber image/RTSP) is shared across all providers that support attachments. Discord uses the attachment:// URI scheme to reference uploaded files within embeds, which is the recommended approach from Discord's API documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.