-
Notifications
You must be signed in to change notification settings - Fork 237
Webhook
SQKo edited this page Sep 20, 2022
·
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
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')->done(function (Webhook $webhook) {
// ...
});
https://discord.com/developers/docs/resources/webhook#get-channel-webhooks
Note: This wiki is currently Work In Progress. Consider reading the docs instead.
- Application Command (Slash based)
Command Client (Message based)
- Activity
- Application
- Guild
- Private Channel
- User
Components
-
ActionRow
- Buttons
- Option (commands)
- SelectMenu
- TextInput
Builders