PHP code example of netodomenico / php-discord-git-notifications

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

    

netodomenico / php-discord-git-notifications example snippets


use ArsDigitalia\Repository;

$repository = new Repository();

$repository->addWebhooks([
    // Example for GitHub
    '{github_hook_uuid}' => 'https://discord.com/api/webhooks/{channel_id}/{webhook_id}',
    // Example for Bitbucket
    '{bitbucket_webhook_uuid}' => 'https://discord.com/api/webhooks/{channel_id}/{webhook_id}',
    // Example for Gitlab
    '{gitlab_project_id}' => 'https://discord.com/api/webhooks/{channel_id}/{webhook_id}',
]);

$repository->config->set('{configuration_key}', '{configuration_value}');

$repository = $repository->parseRequest();
$repository->sendMessage();