PHPackages                             routmoute/routmoute-discord-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. routmoute/routmoute-discord-bundle

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

routmoute/routmoute-discord-bundle
==================================

This bundle is simple access to discord OAuth &amp; API for Symfony 5

1.1.0(5y ago)05841MITPHPPHP &gt;=7.2.5

Since Feb 12Pushed 4y ago1 watchersCompare

[ Source](https://github.com/routmoute/routmoute-discord-bundle)[ Packagist](https://packagist.org/packages/routmoute/routmoute-discord-bundle)[ Docs](https://github.com/routmoute/RoutmouteDiscordBundle)[ RSS](/packages/routmoute-routmoute-discord-bundle/feed)WikiDiscussions main Synced yesterday

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

RoutmouteDiscordBundle
======================

[](#routmoutediscordbundle)

Manual Installation
-------------------

[](#manual-installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

### Step 1: Create configuration file

[](#step-1-create-configuration-file)

Create configuration file `config/packages/routmoute_discord.yaml` and modify scopes if you want

```
// config/packages/routmoute_discord.yaml

routmoute_discord:
    oauth:
        client_id: '%env(ROUTMOUTE_DISCORD_CLIENT_ID)%'
        client_secret: '%env(ROUTMOUTE_DISCORD_CLIENT_SECRET)%'
        scope:
            - identify
            - email
    api:
        bot_token: '%env(ROUTMOUTE_DISCORD_BOT_TOKEN)%'
```

### Step 2: Download the Bundle

[](#step-2-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
composer require routmoute/routmoute-discord-bundle
```

Configuration
-------------

[](#configuration)

### Step 1: Create your Discord Application

[](#step-1-create-your-discord-application)

- Go to
- Create a New Application
- Copy `CLIENT ID` and `CLIENT SECRET` for next step
- Go to `OAuth2` Tab
- Add Redirect `https://yourDomain.domain/receiveDiscord`
- Go to Bot Tab and copy `TOKEN` for next step

### Step 2: Create your env variables

[](#step-2-create-your-env-variables)

Add this environments vars in your `.env` file.

```
ROUTMOUTE_DISCORD_CLIENT_ID=YourClientId
ROUTMOUTE_DISCORD_CLIENT_SECRET=YourClientSecret
ROUTMOUTE_DISCORD_BOT_TOKEN=YourBotToken

```

Usage (for Symfony 5)
---------------------

[](#usage-for-symfony-5)

### Discord OAuth

[](#discord-oauth)

#### Step 1: Create Controller in your App

[](#step-1-create-controller-in-your-app)

Create Controller, for exemple `src/Controller/DiscordOAuthController.php`

```
// src/Controller/DiscordOAuthController.php
