BlogProduct7 min

How to auto-reply to Instagram and Facebook comments with Grok Bot

Connect Grok Bot to ViewPrinter with an API key, create a routine that sends one DM with your link and a public “check your DMs” reply, and point ViewPrinter’s comment webhook at it. Three prompts to paste, the one step the Bot cannot do itself, and an add-on that saves the comments worth a post.

Someone comments “LINK” on your post. Shortly after, they have a DM with the link, the comment has a public “Check your DMs” under it, and you have a note in chat saying what was sent. This is the most common thing people use ManyChat for, built with a Grok Bot routine and ViewPrinter instead. Why you might, and what it costs, is in the ManyChat alternative post; this is the setup.

Comments and DMs are switching on platform by platform. Check which platforms support them right now before you start.

How it fits together

  1. A comment or DM arrives on your Instagram or Facebook account.
  2. ViewPrinter sends a webhook to your Grok Bot routine within seconds. It carries ids, never the comment text.
  3. The routine reads the comment through ViewPrinter, decides whether it is asking for the link, and replies: one private DM and one public comment.
  4. The Bot tells you in chat what it did, or why it skipped.

1. Make an API key

In the ViewPrinter dashboard, open API keys and create one. It is shown once, so copy it straight into the next step. Connect the Instagram and Facebook accounts you want covered from the dashboard too, if you have not already.

2. Connect the Bot to ViewPrinter

Paste this into your Grok Bot’s chat, with your key in place of the placeholder. The Bot installs a small bridge, stores the key, and lists your accounts to prove it worked. Note the account ids it gives back; the routine needs them.

Prompt
Add ViewPrinter as a local MCP server on your machine.

1. Install mcp-remote once: npm install -g mcp-remote
2. Save this ViewPrinter API key in a file only you can read, and expose it as the environment variable VIEWPRINTER_API_KEY. Do not write it into any config file or repeat it back to me.
   Key: PASTE_YOUR_API_KEY_HERE
3. Add a local (stdio) MCP server named viewprinter that runs:
   mcp-remote https://viewprinter.tech/api/mcp --header "Authorization: Bearer ${VIEWPRINTER_API_KEY}"
4. Call accounts_list and tell me which accounts you can see, with their ids.

3. Create the routine

Routines are made by asking the Bot. This prompt is the whole rulebook: what counts as asking for the link, the exact DM, the public reply, and what to leave alone. Replace the account ids, the DM and the link with your own. Keep the link on its own last line.

Prompt
Create a routine named "Comment auto-reply" that runs when its webhook is called. Each call's body is one event.

Each event is a ViewPrinter webhook body: JSON with a type, an id, an accountId and the ids to look things up by. It never contains the comment or message text, so always fetch it first.

For every event:
1. If you have already handled this event id, stop. The same event can arrive more than once.
2. If accountId is not one of these, stop: ACCOUNT_IDS_FROM_ACCOUNTS_LIST
3. If type is comment.created, read the comment with ViewPrinter comments_list using data.commentId.
   - If it is asking for the link (for example "LINK", "link?", "where do I get it?"), send one private reply with messages_reply using comment_id, before data.privateReplyUntil. Send exactly this, with the link alone on the last line:
     Hey! Thanks for asking. Here it is:
     https://example.com/app
   - Then reply to the comment publicly with comments_reply: "Check your DMs!". Never put the link in the public reply.
   - Anything else (questions, complaints, jokes, people talking to each other): do nothing.
4. If type is message.received, read the thread with messages_list using data.conversationId. If they are asking for the link again, send it with messages_reply before data.replyUntil. Otherwise leave it for me.
5. After every event, tell me in this chat: the comment or message, exactly what you sent, or why you skipped it.

You have my standing permission to send these two replies without asking me each time. Do nothing else on these accounts from these events.

When the routine exists, tell me, and I will paste you its webhook details.

4. Copy the webhook details back to the Bot

The Bot cannot see its own routine’s webhook address, so this step is yours. Open the routine’s details: the webhook section shows POST to, key and header. Copy POST to and header into this prompt and send it.

Prompt
Here are the webhook details from the Comment auto-reply routine:

POST to: PASTE_THE_POST_TO_ADDRESS
header: PASTE_THE_HEADER

Register them with ViewPrinter: call webhooks_save with
- url: the POST to address
- events: ["comment.created", "message.received"]
- auth_header: the header's value without the "Authorization:" part, so it starts with "Bearer "

Leave product_id and account_id out; the routine already ignores accounts that are not on its list. Then call webhooks_list and confirm the webhook is active. Do not repeat the header back to me.

5. Test it

From a different account, comment “LINK” on one of your recent posts. You should get the DM, a public “Check your DMs” under the comment, and the Bot’s note in chat. If nothing happens, ask the Bot to call webhooks_list: it shows whether deliveries are failing.

Optional: collect content ideas from the comments

Your comments are where people tell you what they argue about, what they doubt and what they wish someone would explain. Since the routine already reads every comment, it can make a second decision on each one: is this a post? A comment it skips for the link can still be your next idea.

Paste this to the Bot to add it to the routine. Ideas go to a running list and to the note it sends you, never to the commenter.

Prompt
Add this to the Comment auto-reply routine. It runs on every comment, after the reply rules, whether or not you replied.

Also decide whether the comment is a content idea: something I could make a post about. Save it when it has at least one of:
1. A specific situation or story from the commenter's own life
2. A doubt or objection about my product that I could answer
3. A myth or common belief worth correcting
4. A question a whole post could answer
5. A disagreement about how something should be counted or judged

Do not save: bare link requests, insults or one-word reactions, rants with nothing specific in them, thank-yous, jokes, or a comment you have already logged.

When you save one, add a line to a running list called "Content ideas":
Content idea (date, platform): one-line hook. Why it would work as a post.

Include the idea, or "Content idea: no", in the note you send me after each event. Never mention content ideas in a DM or a public reply. The list is only for me.

The rules it runs under

One DM per comment. Instagram allows one private reply to a comment, within 7 days of it. More messages only once the person writes back, and within 24 hours of their message. That is why the link goes in the first and only DM.

Events are ids, not text. The webhook says what happened and where. The routine fetches the comment itself, so nothing anyone writes travels in the webhook.

Duplicates happen. A delivery that fails is retried three times over about twenty minutes, so the same event id can arrive twice. The routine’s first rule is to skip ids it has handled. Only comments and DMs from the last day are announced.

Common questions

Then post it

Say it once, post it everywhere

Say what to post and when — it goes out on time to every account, without you opening a tab.

Paste this into your client

Server config
{
  "mcpServers": {
    "viewprinter": {
      "type": "http",
      "url": "https://viewprinter.tech/api/mcp"
    }
  }
}