labymod / discord-webhook
A lightweight library for Discord™ Webhooks
Installs: 13 870
Dependents: 1
Suggesters: 0
Security: 0
Stars: 11
Watchers: 4
Forks: 6
Open Issues: 3
Requires
- php: ^8.1
- doctrine/collections: ^1.6
- guzzlehttp/guzzle: >=7.2
- symfony/property-access: ^4.0 || ^5.0 || ^6.0
- symfony/serializer: ^4.4.35 || ^5.3.12 || ^6.0
- symfony/yaml: ^4.0 || ^5.0 || ^6.0
Requires (Dev)
- symfony/var-dumper: ^5.0
README
Send Discord messages directly from your PHP application. Even with embeds & files!
Versions & Compatibility
Installation
Composer installation
composer require labymod/discord-webhook
Documentation
Hop into the wonderful world of webhooks with just those few lines:
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
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: