PHP code example of labymod / discord-webhook-bundle

1. Go to this page and download the library: Download labymod/discord-webhook-bundle 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-bundle example snippets


    return [
        // ...
        \DiscordWebhookBundle\DiscordWebhookBundle::class => ['all' => true],
    ]
    

use DiscordWebhookBundle\DiscordWebhook;

class MyController
{
   public function myAction(DiscordWebhook $announcementsClient) // <-- Thanks to an ArgumentValueResolver, name the parameter after your client, and it will be resolved automatically
   {
      // OR, resolve it from the container:
      $webhook = $this->container->get('announcements.client');
   }
}