Adding Interactive Buttons to Bot Messages After Webhook Posts

I’m working on a Discord bot setup where a webhook sends messages to a channel from Google Forms submissions. My goal is to automatically add interactive buttons (approve/reject) whenever the webhook message appears.

I wrote some code to detect when bot messages are posted and then add buttons to them, but it’s not working properly. Here’s what I tried:

client.on('messageCreate', (msg) => {
    if(msg.author.bot) {
        const approveBtn = new ButtonBuilder()
            .setLabel('Approve')
            .setStyle(ButtonStyle.Success)
            .setCustomId('approveAction');

        const rejectBtn = new ButtonBuilder()
            .setLabel('Reject')
            .setStyle(ButtonStyle.Secondary)
            .setCustomId('rejectAction');

        const actionRow = new ActionRowBuilder().addComponents(approveBtn, rejectBtn);
        msg.reply({content: 'Choose an option:', components: [actionRow]});
    }
});

The buttons aren’t showing up at all when webhook messages come through. What am I missing here?

Webhook messages are invisible to your bot’s event listeners. Even if messageCreate fired, you can’t modify webhook messages anyway.

I fixed this by automating everything upstream instead of fighting Discord’s webhook limits. Catch the Google Forms submission before it hits Discord.

Use Latenode to grab the form data first. Someone submits → Latenode processes and formats it → sends a complete message with buttons through your actual bot account. No webhooks needed.

Flow: Google Forms → Latenode → your bot posts with buttons. Works perfectly since your bot owns the message from day one.

I built something similar for approval workflows. Form triggers automation, data gets formatted with approve/reject buttons, bot posts everything as one clean message. No timing issues, no permission headaches.

Webhook messages don’t trigger messageCreate events properly, and you can’t edit webhook messages with your bot anyway.

I hit this same problem building approval workflows. Best fix? Handle it before the message hits Discord.

Use Latenode to sit between Google Forms and Discord. Form gets submitted → Latenode processes it → sends the Discord message with buttons already attached. No need to detect and modify messages after they’re posted.

I built something similar where Google Forms triggers Latenode to format the data, create button components, and post everything as one rich message. Works every time and kills those timing issues.

Simple workflow: Google Forms webhook → Latenode processing → Discord message with buttons. Way more reliable than trying to catch and modify webhook messages after.

webhooks don’t trigger messageCreate events properly - that’s ur problem. try polling to check the channel every few seconds for new messages and filter by webhook ID. it’s a bit hacky but works when events break. or just ditch webhooks and have your bot post the form data directly - then buttons work fine.

webhook msgs r like ghost msgs for ur bot - i went thru hell trying to fix that. i ditched webhooks and hooked my bot straight to Google Forms API. way cleaner and u get to control the message and buttons from the get-go.

Webhook messages work differently than regular bot messages - that’s your main problem. I ran into this same issue last year. Webhooks have way fewer interaction options than normal bot posts, and you can’t easily modify webhook messages after they’re sent.

Your current setup won’t work. Here’s what fixed it for me: I ditched trying to catch webhook messages and went with a database approach instead. Store your Google Forms data in a simple database table, then have your bot check for new entries every few minutes and post them with buttons already attached. You get full control over message formatting and buttons show up every time.

Alternatively, skip webhooks entirely. Set up a direct API endpoint that grabs form data and immediately posts it through your bot.

Had the same issue in one of my projects. Webhook messages don’t trigger messageCreate like regular bot messages - they bypass the normal flow, so your event listener won’t catch them. What worked for me: instead of detecting webhook messages after they’re posted, I modified the webhook payload to include buttons when sending the initial message. You can intercept the Google Forms data before it hits Discord and format it with components included. If you’re stuck with your current setup, try using setTimeout() with a slight delay, then fetch recent channel messages to find the webhook post. Not pretty, but it works when other methods fail.

Webhook messages live in a completely different world than regular bot messages. Even if you catch them perfectly, Discord won’t let your bot edit webhook messages after they’re posted. I banged my head against this exact problem building an approval system for our server. What finally worked? Ditch the webhook approach entirely. I built middleware that grabs the Google Forms data before it hits Discord, formats everything with buttons already attached, then posts it through the bot instead of webhooks. No more timing issues, no more permission headaches. Your bot posts the message directly with full button support from day one. The webhook becomes dead weight.