Downloads
Stars
Version
Note Since v5, only Interactions command is provided. Interactions command is webhook-based, it is easy to use in Laravel. v4 still support Gateway API.
composer require revolution/discord-manager
DISCORD_BOT_TOKEN=
# APPLICATION ID
DISCORD_BOT=
# PUBLIC KEY
DISCORD_PUBLIC_KEY=
# GUILD ID
DISCORD_GUILD=
composer remove revolution/discord-manager
config/discord_interactions.php
app/Discord/
and other files.DISCORD_*
in .env
php artisan vendor:publish --tag=discord-interactions-config
INTERACTIONS ENDPOINT URL
in Discord's developer portal.https://example/discord/webhook
php artisan discord:make:interaction HelloCommand
php artisan discord:interactions:register
php artisan make:listener InteractionsListener
use Revolution\DiscordManager\Events\InteractionsWebhook;
use Revolution\DiscordManager\Facades\DiscordManager;
//
/**
* Handle the event.
*
* @param InteractionsWebhook $event
* @return void
*/
public function handle(InteractionsWebhook $event)
{
DiscordManager::interaction($event->request);
}
(Only Laravel10) Update EventServiceProvider.php
use App\Listeners\InteractionsListener;
use Revolution\DiscordManager\Events\InteractionsWebhook;
//
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
InteractionsWebhook::class => [
InteractionsListener::class,
],
];
app/Discord/
.MIT