PHP code example of labymod / discord-webhook
1. Go to this page and download the library: Download labymod/discord-webhook library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
labymod / discord-webhook example snippets
use DiscordWebhook\Webhook;
$wh = new Webhook('https://my.webhook/url');
$wh
->setMessage('Hello world!')
->send();
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');