PHPackages                             marcio1002/discord-webhook-sdk-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. marcio1002/discord-webhook-sdk-php

ActivePackage[Utility &amp; Helpers](/categories/utility)

marcio1002/discord-webhook-sdk-php
==================================

This sdk provides a simple way to send messages by hooks in discord

v2.0.0(3y ago)31.7k1GPL-3.0-onlyPHPPHP &gt;=7.4.0

Since Jun 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/marcio1002/discord-webhook-sdk-php)[ Packagist](https://packagist.org/packages/marcio1002/discord-webhook-sdk-php)[ RSS](/packages/marcio1002-discord-webhook-sdk-php/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

Discord Webhook PHP
===================

[](#discord-webhook-php)

 [![Message sent in Discord by webhook](./assets/send-message.png)](./assets/send-message.png)

---

installation
------------

[](#installation)

```
composer require marcio1002/discord-webhook-sdk-php

```

Constructor parameter options
-----------------------------

[](#constructor-parameter-options)

Pass an array of options to the constructor, note that the webhook url is required.

paramtypedescriptionRequiredwebhook\_idstringThe webhook IDYestokenstringThe webhook tokenYesttsbooleanIf true read message to channel membersNothread\_idstringName of thread to create (requires the webhook channel to be a forum channel)NoSending simple message
----------------------

[](#sending-simple-message)

```
use Marcio1002\DiscordWebhook\DiscordWebhook;

$webhook = new DiscordWebhook([
    'webhook_id' => '12345686',
    'token' => 'dghjt4fw3tk7865edfgt67iykmdw45g$Gdeg4C_VGHT43RW',
]);

//Synchronous envio
$webhook->sendMessage('This is a message', true);

//Asynchronous envio
$webhook->sendMessage('This is a message');
```

Changing the webhook
--------------------

[](#changing-the-webhook)

With the Message class you can change the name, url, define the content and create embeds

```
use Marcio1002\DiscordWebhook\DiscordWebhook;
use Marcio1002\DiscordWebhook\Message;

$message = new Message();
    ->setUsername('DC Notification')
    ->setAvatar('URL');
    ->setContent('Alert message');

$webhook
    ->sendMessage($message)
    ->then(
        fn() => print_r('Success!'),
        fn(\Throwable $err) => print_r($err->getMessage())
    )
```

Sending embed
-------------

[](#sending-embed)

```
use Marcio1002\DiscordWebhook\DiscordWebhook;
use Marcio1002\DiscordWebhook\MessageEmbed;

$message_embed = new MessageEmbed();

$message_embed
    ->setTitle('Title')
    ->setDescription('Description');
    ->setThumbnail('URL')

$discord->sendMessage($message_embed);

$embeds = range(0, 9); // limit 10 embeds

$embeds = array_map(
    fn ($n) => (new MessageEmbed)
        ->setTitle("Title $n"),
        ->setColor(MessageEmbed::randomColor())
    $embeds
);

$webhook->sendMessage($embeds);
```

Sending facades class
---------------------

[](#sending-facades-class)

```
use Marcio1002\DiscordWebhook\Facades\DiscordWebhook;

DiscordWebhook::configure([
    'webhook_id' => '12345686',
    'token' => 'dghjt4fw3tk7865edfgt67iykmdw45g$Gdeg4C_VGHT43RW',
]);

DiscordWebhook::sendMessage('Message');
```

Edit, get and delete message
----------------------------

[](#edit-get-and-delete-message)

When editing the message you can pass the same parameter that is passed in the **sendMessage** method

```
DiscordWebhook::configure([
    'webhook_id' => '12345686',
    'token' => 'dghjt4fw3tk7865edfgt67iykmdw45g$Gdeg4C_VGHT43RW',
]);

DiscordWebhook::editMessage('ID', 'message', true);

DiscordWebhook::getMessage('ID')->then(fn($message) => print_r($message));

DiscordWebhook::deleteMessage('ID', true);
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Total

3

Last Release

1398d ago

Major Versions

v1.1 → v2.0.02022-07-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/20f3839682b5477d63b29b935ef91ccd885c81e11c964627da86cc056c260ca7?d=identicon)[marcio1002](/maintainers/marcio1002)

---

Top Contributors

[![marcio1002](https://avatars.githubusercontent.com/u/50804131?v=4)](https://github.com/marcio1002 "marcio1002 (18 commits)")

---

Tags

discorddiscord-phpwebhooks

### Embed Badge

![Health badge](/badges/marcio1002-discord-webhook-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/marcio1002-discord-webhook-sdk-php/health.svg)](https://phpackages.com/packages/marcio1002-discord-webhook-sdk-php)
```

###  Alternatives

[react/react

ReactPHP: Event-driven, non-blocking I/O with PHP.

9.1k3.6M63](/packages/react-react)[sculpin/sculpin

Static Site Generator

1.5k102.8k12](/packages/sculpin-sculpin)[jclg/php-slack-bot

Slack bot user written in PHP

16825.5k1](/packages/jclg-php-slack-bot)[llm/mcp-server

PHP SDK for building MCP servers

431.1k](/packages/llm-mcp-server)[runtime/react

ReactPHP runtime

185.3k1](/packages/runtime-react)[octopoda/octopus

PHP Sitemap crawler

114.8k](/packages/octopoda-octopus)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
