team-reflex/discord-php
DiscordPHP is a PHP wrapper for Discord’s REST, gateway, and voice APIs. Build Discord bots that run in CLI with ReactPHP-style async handling. Includes limited docs/class reference and community integrations like Laracord for Laravel.
Requires the Intents::GUILD_INVITES intent and manage_channels permission.
Called with an Invite object when a new invite to a channel is created.
$discord->on(Event::INVITE_CREATE, function (Invite $invite, Discord $discord) {
// ...
});
Called with an object when an invite is created.
$discord->on(Event::INVITE_DELETE, function (object $invite, Discord $discord) {
if ($invite instanceof Invite) {
// $invite was cached
}
// If $invite was not in cache:
else {
// {
// "channel_id": "",
// "guild_id": "",
// "code": "" // the unique invite code
// }
}
});
How can I help you explore Laravel packages today?