How to receive webhook update gateway events?

Hello, I'm trying to receive webhook events through the code below:

import { Client, Events, GatewayIntentBits } from 'discord.js'

const client = new Client({
  intents: [GatewayIntentBits.GuildWebhooks],
})

client.once(Events.ClientReady, (c) => {
  console.log('Ready as ', c.user?.tag)
})

client.on(Events.WebhooksUpdate, (c) => {
  console.log('webhook update', c)
})

client.login(process.env.BOT_TOKEN)


I tried

  • changing a webhook's name
  • adding/moving a webhook
but the only log I get is the initial ready log. The bot has Administrator permission.

Is there something wrong with the code snippet above? Version's 14.13.0
Was this page helpful?