Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/labymod/discord-webhook
A lightweight library for Discord™ Webhooks
https://github.com/labymod/discord-webhook
discord php webhook
Last synced: 2 months ago
JSON representation
A lightweight library for Discord™ Webhooks
- Host: GitHub
- URL: https://github.com/labymod/discord-webhook
- Owner: LabyMod
- License: mit
- Created: 2018-11-26T08:30:06.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-04T11:01:22.000Z (over 2 years ago)
- Last Synced: 2024-11-02T11:51:53.218Z (3 months ago)
- Topics: discord, php, webhook
- Language: PHP
- Homepage: https://packagist.org/packages/labymod/discord-webhook
- Size: 175 KB
- Stars: 11
- Watchers: 4
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Discord Webhook
[![Latest Stable Version](https://poser.pugx.org/labymod/discord-webhook/v)](https://packagist.org/packages/labymod/discord-webhook)
[![Latest Unstable Version](https://poser.pugx.org/labymod/discord-webhook/v/unstable)](https://packagist.org/packages/labymod/discord-webhook)
[![Total Downloads](https://poser.pugx.org/labymod/discord-webhook/downloads)](https://packagist.org/packages/labymod/discord-webhook)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/LabyMod/discord-webhook/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/LabyMod/discord-webhook/?branch=master)
[![License](https://poser.pugx.org/labymod/discord-webhook/license)](https://packagist.org/packages/labymod/discord-webhook)Send Discord messages directly from your PHP application. Even with embeds & files!
## Versions & Compatibility
| Release | Supported PHP Versions | Supported Symfony Versions | Release Date | Maintained | Branch |
|---------|------------------------|------------------------------|--------------|------------|--------|
| 3.x | `^8.1` | `^4.4.35`, `^5.3.12`, `^6.0` | 23.01.2022 | Yes | master |
| 2.x | `^8.0` | `^4.4.35`, `^5.3.12`, `^6.0` | 23.01.2022 | Yes | 2.x |
| 1.x | `^7.3`, `^8.0` | `^3.0`, `^4.0`, `^5.0` | 05.01.2020 | No | 1.x |## Installation
**Composer installation**
```bash
composer require labymod/discord-webhook
```## Documentation
Hop into the wonderful world of webhooks with just those few lines:
```php
use DiscordWebhook\Webhook;$wh = new Webhook('https://my.webhook/url');
$wh
->setMessage('Hello world!')
->send();
```### ✨ NEW: Simple Webhooks
> **First** (recommended but optional): Define the `DWH_DEFAULT_URL` as environment variable```php
use DiscordWebhook\SimpleWebhook;// with environment variable defined:
SimpleWebhook::sendMessage('My simple message.');// without environment variable defined (or to override the already set env var):
SimpleWebhook::sendMessage('My simple message.', 'https://discord.com/my/webhook/url');
```For further documentation have a look here:
* [Basics](docs/01_Basics.md)
* [Sending Files](docs/02_SendingFiles.md)
* [Embeds](docs/03_Embeds.md)