PHP code example of ahmetonurslmz / php-webhook

1. Go to this page and download the library: Download ahmetonurslmz/php-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/ */

    

ahmetonurslmz / php-webhook example snippets




use PhpWebhook\Providers\Discord;

$discordWebhook = new Discord(); // initializes discord instance
$discordWebhook->setMessage('Hello World!');
$discordWebhook->setToken(YOUR_DISCORD_CHANNEL_TOKEN); // Discord token exists in your webhook URL.
$discordWebhook->request();

$discordWebhook->setMessage("Hello world!");

$discordWebhook->setData(array(
  "username" => "Webhook",
  "avatar_url" => "https://i.imgur.com/4M34hi2.png",
  "content" => "Text message. Up to 2000 characters.",
  ));
bash
composer