diff --git a/apps/backend/src/routes/post.ts b/apps/backend/src/routes/post.ts index 6bbb086..20168b0 100644 --- a/apps/backend/src/routes/post.ts +++ b/apps/backend/src/routes/post.ts @@ -545,6 +545,17 @@ export default new Elysia({ prefix: "/post" }) } console.log(`Saved ${savedCount} Pixiv media records to MongoDB. Failed: ${failedCount}`); + + if (savedCount > 0) { + await sendDiscordNotification({ + title: pixivData.title || "Pixiv Artwork", + url: pixivData.url, + author: body.author ? body.author : (pixivData.author_name || "unknown"), + tags: normalizedTags, + imageUrl: mediaUrls[0], + }); + } + await createAuditLog({ actor: { userId: requester.userId, @@ -670,6 +681,18 @@ export default new Elysia({ prefix: "/post" }) } console.log(`Saved ${savedCount} media records to MongoDB. Failed: ${failedCount}`); + + if (savedCount > 0) { + const firstMedia = media[0]; + await sendDiscordNotification({ + title: tweetData.tweet.text?.substring(0, 100) || "Twitter Post", + url: body.url, + author: body.author ? body.author : tweetData.tweet.author.name, + tags: normalizeTags(body.tag || ["미분류"]), + imageUrl: firstMedia.url, + }); + } + await createAuditLog({ actor: { userId: requester.userId,