feat: add live Discord sharing functionality with dynamic habit progress images
- Implemented live card image generation for user habits using canvas. - Created API endpoints for starting and managing live Discord sharing sessions. - Added tests for live Discord sharing to ensure functionality and reliability. - Introduced CSS styles for the live Discord sharing interface. - Enhanced error handling and state management for Discord message updates.
This commit is contained in:
@@ -14,7 +14,7 @@ let sharedImage: Blob | null = null;
|
||||
let reminderMessage: string | null = null;
|
||||
const previewDiscord: DiscordFetch = async (url, init) => {
|
||||
if (url.endsWith("/users/@me/channels")) return Response.json({ id: "523456789012345678" });
|
||||
if (init?.method === "POST") {
|
||||
if (init?.method === "POST" || init?.method === "PATCH") {
|
||||
if (init.body instanceof FormData) sharedImage = init.body.get("files[0]") as Blob;
|
||||
else reminderMessage = JSON.parse(String(init.body)).content;
|
||||
return Response.json({ id: "423456789012345678" });
|
||||
|
||||
Reference in New Issue
Block a user