Skip to content
SQKo edited this page Dec 9, 2023 · 3 revisions

Webhooks are part of Channel.

use Discord\Parts\Channel\Webhook;

Webhooks are a low-effort way to post messages to channels in Discord. They do not require a bot user or authentication to use.

Requires GUILD_WEBHOOKS intent

WEBHOOKS_UPDATE


Get a Specific Webhook

Retrieving a webhook requires manage_webhooks permission

You must first get the Channel object to use the code below. Change 123123123123123123 below with the Webhook ID you want to retrieve

Cached, synchronous (i.e retrieveBans option is true):

$webhook = $channel->webhooks->get('id', '123123123123123123');

If the code above returns null, you may need to fetch it first (Promise, asynchronous):

$channel->webhooks->fetch('123123123123123123')->then(function (Webhook $webhook) {
    // ...
})->done();

https://discord.com/developers/docs/resources/webhook#get-channel-webhooks

Clone this wiki locally