Skip to content

Invites

Marco Cusano edited this page May 7, 2019 · 1 revision

create external-link

Create a new invite object for the channel. Only usable for guild channels. Requires the CREATE_INSTANT_INVITE permission. All JSON parameters for this route are optional, however the request body is not. If you are not sending any fields, you still have to send an empty JSON object ({}). Returns an invite object.

$params = array(
    "max_age" => 0,
    "unique" => true
);
$discord->channels->createInvite("CHANNEL_ID", $params);

get external-link

Returns an invite object for the given code.

$discord->invites->get("INVITATION_CODE");

INVITATION_CODE param must be in the following format: 123AbcD - VanityURL


delete external-link

Delete an invite. Requires the MANAGE_CHANNELS permission on the channel this invite belongs to, or MANAGE_GUILD to remove any invite across the guild. Returns an invite object on success.

$discord->invites->delete("INVITATION_CODE");

INVITATION_CODE param must be in the following format: 123AbcD