Skip to content

feat(instagram): add comment-to-DM automation for Instagram Login - #809

Closed
AlanSyue wants to merge 2 commits into
ChatbotXIO:mainfrom
AlanSyue:feat/instagram-comment-to-dm
Closed

AlanSyue wants to merge 2 commits into
ChatbotXIO:mainfrom
AlanSyue:feat/instagram-comment-to-dm

Conversation

@AlanSyue

Copy link
Copy Markdown
Contributor

What

Adds Instagram (Instagram Login) support to the existing Facebook Comment Automation feature. A comment containing a configured keyword on a selected Instagram post can now trigger a public comment reply and/or a private DM to the commenter.

This was previously Messenger-only — the Instagram private DM path was left as // out of scope MVP (no private_replies API) in executePrivateReply. This PR fills that gap using the Instagram Login me/messages endpoint (private replies addressed by comment id).

Changes

  • Instagram Login APIs (integrations/instagram):
    • sendPrivateReply — private DM via me/messages with recipient.comment_id.
    • listInstagramMedia — list the connected account's own media (me/media) for post targeting.
  • Worker (comment-automation): add the Instagram branch to executePrivateReply, alongside the existing Messenger branch (text private reply).
  • Builder UI (fb-comments): platform selector (Facebook / Instagram) in the automation form, an Instagram post picker, and Instagram-specific gating (liking comments is not supported on Instagram).
  • API: instagramPostsAPI endpoint to list Instagram posts for targeting.
  • Fix (integrations/instagram connect): accept MEDIA_CREATOR as a valid account type. Meta renamed the Creator account type, so Creator accounts were being rejected on connect.
  • i18n (en / vi) for the new UI strings.

No database migration — the type column (messenger / instagram) already exists on FBCommentAutomation.

Verification

  • check-types (integration-instagram, business, builder, worker), lint, and unit tests pass.
  • Verified end-to-end against a real Instagram Business/Creator account: the me/messages (DM) and me/media (post list) APIs, webhook comment parsing, public comment reply, and the full keyword → public reply + DM flow.

Out of scope (intentionally, to keep this focused)

  • Instagram-via-Facebook login variant (integrations/instagram-facebook).
  • No change to the existing dedup / idempotency mechanism.

AlanSyue and others added 2 commits July 24, 2026 02:44
Extend the existing fb-comments comment automation so an Instagram Login
channel can reply to matching comments with a public reply plus a private
DM. Adds the me/messages private reply and me/media listing on
graph.instagram.com, an Instagram post picker in the builder, a platform
selector with Instagram gating (no comment likes), and the worker text-DM
branch. No database migration is required as the type column already exists.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01JVD52t9bnQFDPemU5HEwAC
@sung17

sung17 commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Hey @AlanSyue , thanks a lot for taking the time to put this together!
We're going to build on the idea here and take it further — planning to keep working on top of your PR to flesh the feature out more fully. Really appreciate the contribution!

@realcodesiman realcodesiman added the feature New feature or request label Jul 30, 2026
@AlanSyue AlanSyue closed this Jul 31, 2026

This branch was previously deployed

1 inactive deployment
dev — b23b045e Deployed Jul 29, 2026 by AlanSyue via Build mcp-server #2174
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants