<commit_before>### Discord OAuth2 Provider

This is a Discord provider for use with the PHP League's OAuth2 client.<commit_msg>Adding description and usage to the README<commit_after>### Discord OAuth2 Provider

This is a Discord provider for use with the PHP League's [OAuth2 client](https://github.com/thephpleague/oauth2-client).

### Installation

To install the provider use Composer:

```
composer require psecio/oauth2-discord
```

### Usage

```
<?php

$provider = new \League\OAuth2\Client\Provider\Discord([
    'clientId'          => 'client-id',
    'clientSecret'      => 'client-secret',
    'redirectUri'       => 'http://yoursite.com/callback'
]);

if (!isset($_GET['code'])) {
    // If we don't have a code yet, we need to make the link
    echo '<a href="'.$provider->getAuthorizationUrl().'">Link to Discord</a>';

} else {
    // If we do have a code, use it to get a token
    $accessToken = $provider->getAccessToken('authorization_code', [
        'code' => $_GET['code']
    ]);

    $user = $provider->getResourceOwner($accessToken);

    /**
     * User object contains:
     * - username
     * - verified
     * - mfa_enabled
     * - id
     * - avatar
     */
}

?>
```
{'fraction_non_alphanumeric': 0.15, 'fraction_numerical': 0.005833333333333334, 'mean_word_length': 3.0437710437710437, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2419549', 'n_tokens_mistral': 390, 'n_tokens_neox': 375, 'n_words': 107}