Guilds
Create a guild ban, and optionally delete previous messages sent by the banned user. Requires the BAN_MEMBERS
permission. Returns a 204 empty response on success.
$params = array(
"delete-message-days" => 7, // Default = 0 (0-7)
"reason" => "Unwanted behaviour" // Default = null
);
$discord->guilds->ban("GUILD_ID", "USER_ID", $params);
Returns a ban object for the given user or a 404 not found if the ban cannot be found. Requires the BAN_MEMBERS
permission.
// Example 1 (Get list of banned Users)
$discord->guilds->bans("GUILD_ID");
// Example 2 (Get a banned User)
$discord->guilds->bans("GUILD_ID", "USER_ID");
Returns a list of guild channel objects.
$discord->guilds->channels("GUILD_ID");
Create a new guild. Returns a guild object on success. This endpoint can be used only by bots in less than 10 guilds. Creating channel categories from this endpoint is not supported.
$params = array(
"name" => "Server Name",
"region" => "region.id",
"verification_level" => 1, // Low
"default_message_notifications" => 0 // All messages
"explicit_content_filter" => 1, // Member without roles
);
$discord->guilds->create($params);
- List of Verifications;
- List of Default message notifications;
- List of Explicit content filters;
Create a new channel object for the guild. Requires the MANAGE_CHANNELS
permission. Returns the new channel object on success. All parameters for this endpoint are optional excluding name
$params = array(
"name" => "channel-name",
"type" => "0", // Text Channel
"topic" => "Here is the **channel description**",
"rate_limit_per_user" => 10, // In seconds
"parent_id" => "CATEGORY_ID",
"nsfw" => false // 18+ Filter
);
$discord->guilds->createChannel("GUILD_ID", $params);
- List of Channel types
Create a new role for the guild. Requires the MANAGE_ROLES
permission. Returns the new role object on success. All JSON params are optional.
var_dump($discord->keys["permissions"]) // All available permission snowflakes
$params = array(
"name" => "Role Name",
"permissions" => {
"ADMINISTRATOR" => true
},
"color" => 10913450, // Pink
"hoist" => true, // Whether the role should be displayed separately in the sidebar
"mentionable" => true
);
$discord->guilds->createRole("GUILD_ID", $params);
- List of Permission flags
Delete a guild permanently. User must be owner. Returns 204 No Content on success.
$discord->guilds->delete("GUILD_ID");
Delete a channel, or close a private message. Requires the MANAGE_CHANNELS
permission for the guild. Deleting a category does not delete its child channels; they will have their parent_id removed and a Channel Update Gateway event will fire for each of them. Returns a channel object on success.
$discord->guilds->deleteChannel("CHANNEL_ID");
Delete the given emoji. Requires the MANAGE_EMOJIS
permission. Returns 204 No Content on success.
$discord->guilds->deleteEmoji("GUILD_ID", "EMOJI");
Where EMOJI
parameter must be sent in the following format: name:emoji_id
Delete a guild role. Requires the MANAGE_ROLES
permission. Returns a 204 empty response on success.
$discord->guilds->deleteEmoji("GUILD_ID", "ROLE_ID");
Modify a guild's settings. Requires the MANAGE_GUILD
permission. Returns the updated guild object on success.
$params = array(
"name" => "New Server Name",
"region" => "REGION_ID",
"verification_level" => 1, // Low
"default_message_notifications" => 1 // All messages
"explicit_content_filter" => 0 // No filters
"afk_channel_id" => "CHANNEL_ID",
"afk_timeout" => 120, // In seconds
"system_channel_id" => "CHANNEL_ID" // The id of the channel to which system messages are sent
);
$discord->guilds->edit("GUILD_ID", $params);
- List of Verifications;
- List of Default message notifications;
- List of Explicit content filters;
Update a channels settings. Requires the MANAGE_CHANNELS
permission for the guild. Returns a channel on success, and a 400 BAD REQUEST on invalid parameters.
Modify the given emoji. Requires the MANAGE_EMOJIS permission. Returns the updated emoji object on success.
$params = array( "name" => "new_emoji_name" );
$discord->guilds->editEmoji("GUILD_ID", "EMOJI_ID", $params);
Modify a guild role. Requires the MANAGE_ROLES permission. Returns the updated role on success. All parameters to this endpoint are optional.
var_dump($discord->keys["permissions"]) // All available permission snowflakes
$params = array(
"name" => "New Role Name",
"permissions" => {
"ADMINISTRATOR" => true
},
"color" => 10913450, // Pink
"hoist" => true, // Whether the role should be displayed separately in the sidebar
"mentionable" => false
);
$discord->guilds->editRole("GUILD_ID", "ROLE_ID", $params);
Returns an emoji object for the given guild and emoji IDs.
$discord->guilds->emoji("GUILD_ID", "EMOJI_ID");
Returns a list of emoji objects for the given guild.
$discord->guilds->emojis("GUILD_ID");
Returns the guild object for the given id.
$discord->guilds->get("GUILD_ID");
Returns the guild object for the given id.
$discord->guilds->integrations("GUILD_ID");
Returns a list of invite objects (with invite metadata) for the guild. Requires the MANAGE_GUILD
permission.
$discord->guilds->invites("GUILD_ID");
Remove a member from a guild. Requires KICK_MEMBERS
permission. Returns a 204 empty response on success.
$discord->guilds->kick("GUILD_ID", "USER_ID");
Returns a guild member object for the specified user.
$discord->guilds->member("GUILD_ID", "USER_ID");
Adds a role to a guild member. Requires the MANAGE_ROLES
permission. Returns a 204 empty response on success.
// Example 1
$discord->guilds->memberRole("GUILD_ID", "USER_ID", "ROLE_ID");
// Example 2
$discord->guilds->addMemberRole("GUILD_ID", "USER_ID", "ROLE_ID");
Returns a list of guild member objects that are members of the guild.
$discord->guilds->members("GUILD_ID");
Returns a list of voice region objects for the guild. Unlike the similar /voice route, this returns VIP servers when the guild is VIP-enabled.
$discord->guilds->regions("GUILD_ID");
Removes a role from a guild member. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success.
$discord->guilds->removeMemberRole("GUILD_ID", "USER_ID", "ROLE_ID");
Returns a list of role objects for the guild.
$discord->guilds->roles("GUILD_ID");
Remove the ban for a user. Requires the BAN_MEMBERS
permissions. Returns a 204 empty response on success.
// Example 1
$discord->guilds->unban("GUILD_ID", "USER_ID");
// Example 2
$discord->guilds->removeBan("GUILD_ID", "USER_ID");
// Example 3
$discord->guilds->revokeBan("GUILD_ID", "USER_ID");
// Example 4
$discord->guilds->deleteBan("GUILD_ID", "USER_ID");
Returns a partial invite object for guilds with that feature enabled. Requires the MANAGE_GUILD
permission. code will be null if a vanity url for the guild is not set.
$discord->guilds->vanity("GUILD_ID");
- bulkDelete
- create
- createInvite
- createMessage
- delete
- deleteMessage
- deletePin
- deleteReactions
- edit
- editMessage
- get
- message
- messageReactions
- messages
- pin
- pins
- react
- ban
- bans
- channels
- create
- createChannel
- createEmoji
- createIntegration
- createRole
- delete
- deleteChannel
- deleteEmoji
- deleteIntegration
- deleteRole
- edit
- editChannel
- editEmbed
- editEmoji
- editIntegration
- editRole
- embed
- emoji
- emojis
- get
- integrations
- invite
- invites
- kick
- member
- memberRole
- members
- regions
- removeMemberRole
- roles
- unban
- vanity
- widget
- channel
- create
- delete
- deleteByToken
- edit
- editByToken
- execute (alpha)
- executeGitHub
- executeSlack
- get
- guild