All Downloads are FREE. Search and download functionalities are using the official Maven repository.

discord4j.rest.route.Routes Maven / Gradle / Ivy

There is a newer version: 3.3.0-RC2
Show newest version
/*
 * This file is part of Discord4J.
 *
 * Discord4J is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Discord4J is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Discord4J. If not, see .
 */
package discord4j.rest.route;

/**
 * A collection of {@link discord4j.rest.route.Route} object definitions.
 *
 * @since 3.0
 */
public abstract class Routes {

    /**
     * The base URL for all API requests.
     *
     * @see 
     * https://discord.com/developers/docs/reference#base-url
     */
    public static final String BASE_URL = "https://discord.com/api/v9";

    //////////////////////////////////////////////
    ////////////// Gateway Resource //////////////
    //////////////////////////////////////////////

    /**
     * Returns an object with a single valid WSS URL, which the client can use as a basis for Connecting. Clients
     * should cache this value and only call this endpoint to retrieve a new URL if they are unable to properly
     * establish a connection using the cached version of the URL.
     *
     * @see 
     * https://discord.com/developers/docs/topics/gateway#get-gateway
     */
    public static final Route GATEWAY_GET = Route.get("/gateway");

    /**
     * Returns an object with the same information as Get Gateway, plus a shards key, containing the recommended number
     * of shards to connect with (as an integer). Bots that want to dynamically/automatically spawn shard processes
     * should use this endpoint to determine the number of processes to run. This route should be called once when
     * starting up numerous shards, with the response being cached and passed to all sub-shards/processes. Unlike the
     * Get Gateway, this route should not be cached for extended periods of time as the value is not guaranteed to be
     * the same per-call, and changes as the bot joins/leaves guilds.
     *
     * @see 
     * https://discord.com/developers/docs/topics/gateway#get-gateway-bot
     */
    public static final Route GATEWAY_BOT_GET = Route.get("/gateway/bot");

    //////////////////////////////////////////////
    ////////////// Audit Log Resource ////////////
    //////////////////////////////////////////////

    /**
     * Returns an audit log object for the guild. Requires the 'VIEW_AUDIT_LOG' permission.
     *
     * @see 
     * https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log
     */
    public static final Route AUDIT_LOG_GET = Route.get("/guilds/{guild.id}/audit-logs");

    //////////////////////////////////////////////
    ////////////// AutoMod Resource //////////////
    //////////////////////////////////////////////

    /**
     * Get a list of all rules currently configured for guild. Returns a list of auto moderation rule objects for the given guild. Requires the 'MANAGE_GUILD' permission.
     *
     * @see 
     * https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild
     */
    public static final Route AUTO_MOD_RULES_GET = Route.get("/guilds/{guild.id}/auto-moderation/rules");

    /**
     * Get a single rule. Returns an auto moderation rule object. Requires the 'MANAGE_GUILD' permission.
     *
     * @see 
     * https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule
     */
    public static final Route AUTO_MOD_RULE_GET = Route.get("/guilds/{guild.id}/auto-moderation/rules/{auto_moderation_rule.id}");

    /**
     * Create a new rule. Returns an auto moderation rule on success. Requires the 'MANAGE_GUILD' permission.
     *
     * @see 
     * https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
     */
    public static final Route AUTO_MOD_RULE_CREATE = Route.post("/guilds/{guild.id}/auto-moderation/rules");

    /**
     * Modify an existing rule. Returns an auto moderation rule on success. Requires the 'MANAGE_GUILD' permission.
     *
     * @see 
     * https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
     */
    public static final Route AUTO_MOD_RULE_MODIFY = Route.patch("/guilds/{guild.id}/auto-moderation/rules/{auto_moderation_rule.id}");

    /**
     * Delete a rule. Returns a 204 on success. Requires the 'MANAGE_GUILD' permission.
     *
     * @see 
     * https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule
     */
    public static final Route AUTO_MOD_RULE_DELETE = Route.patch("/guilds/{guild.id}/auto-moderation/rules/{auto_moderation_rule.id}");

    //////////////////////////////////////////////
    ////////////// Channel Resource //////////////
    //////////////////////////////////////////////

    /**
     * Get a channel by ID. Returns a guild channel or dm channel object.
     *
     * @see 
     * https://discord.com/developers/docs/resources/channel#get-channel
     */
    public static final Route CHANNEL_GET = Route.get("/channels/{channel.id}");

    /**
     * Update a channels settings. Requires the 'MANAGE_CHANNELS' permission for the guild. Returns a guild channel on
     * success, and a 400 BAD REQUEST on invalid parameters. Fires a Channel Update Gateway event.
     *
     * @see 
     * https://discord.com/developers/docs/resources/channel#modify-channel
     */
    public static final Route CHANNEL_MODIFY = Route.put("/channels/{channel.id}");

    /**
     * Update a channels settings. Requires the 'MANAGE_CHANNELS' permission for the guild. Returns a guild channel on
     * success, and a 400 BAD REQUEST on invalid parameters. Fires a Channel Update Gateway event. All the JSON Params
     * are optional.
     *
     * @see 
     * https://discord.com/developers/docs/resources/channel#modify-channel
     */
    public static final Route CHANNEL_MODIFY_PARTIAL = Route.patch("/channels/{channel.id}");

    /**
     * Delete a guild channel, or close a private message. Requires the 'MANAGE_CHANNELS' permission for the guild.
     * Returns a guild channel or dm channel object on success. Fires a Channel Delete Gateway event.
     *
     * @see 
     * https://discord.com/developers/docs/resources/channel#deleteclose-channel
     */
    public static final Route CHANNEL_DELETE = Route.delete("/channels/{channel.id}");

    /**
     * Returns the messages for a channel. If operating on a guild channel, this endpoint requires the 'READ_MESSAGES'
     * permission to be present on the current user. Returns an array of message objects on success.
     *
     * @see 
     * https://discord.com/developers/docs/resources/channel#get-channel-messages
     */
    public static final Route MESSAGES_GET = Route.get("/channels/{channel.id}/messages");

    /**
     * Returns a specific message in the channel. If operating on a guild channel, this endpoints requires the
     * 'READ_MESSAGE_HISTORY' permission to be present on the current user. Returns a message object on success.
     *
     * @see 
     * https://discord.com/developers/docs/resources/channel#get-channel-message
     */
    public static final Route MESSAGE_GET = Route.get("/channels/{channel.id}/messages/{message.id}");

    /**
     * Post a message to a guild text or DM channel. If operating on a guild channel, this endpoint requires the
     * 'SEND_MESSAGES' permission to be present on the current user. Returns a message object. Fires a Message Create
     * Gateway event. See message formatting for more information on how to properly format messages.
     * 

* This endpoint supports both JSON and form data bodies. It does require multipart/form-data requests instead * of the normal JSON request type when uploading files. Make sure you set your Content-Type to multipart/form-data * if you're doing that. Note that in that case, the embed field cannot be used, but you can pass an url-encoded * JSON body as a form value for payload_json. * * @see * https://discord.com/developers/docs/resources/channel#create-message */ public static final Route MESSAGE_CREATE = Route.post("/channels/{channel.id}/messages"); /** * Create a reaction for the message. This endpoint requires the 'READ_MESSAGE_HISTORY' permission to be present on * the current user. Additionally, if nobody else has reacted to the message using this emoji, this endpoint * requires the 'ADD_REACTIONS' permission to be present on the current user. Returns a 204 empty response on * success. * * @see * https://discord.com/developers/docs/resources/channel#create-reaction */ public static final Route REACTION_CREATE = Route.put("/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me"); /** * Delete a reaction the current user has made for the message. Returns a 204 empty response on success. * * @see * https://discord.com/developers/docs/resources/channel#delete-own-reaction */ public static final Route REACTION_DELETE_OWN = Route.delete("/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me"); /** * Deletes another user's reaction. This endpoint requires the 'MANAGE_MESSAGES' permission to be present on the * current user. Returns a 204 empty response on success. * * @see * https://discord.com/developers/docs/resources/channel#delete-user-reaction */ public static final Route REACTION_DELETE_USER = Route.delete("/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id}"); /** * Deletes all the reactions for a given emoji on a message. This endpoint requires the 'MANAGE_MESSAGES' permission * to be present on the current user. * * @see * https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji */ public static final Route REACTION_DELETE = Route.delete("/channels/{channel.id}/messages/{message.id}/reactions/{emoji}"); /** * Get a list of users that reacted with this emoji. Returns an array of user objects on success. * * @see * https://discord.com/developers/docs/resources/channel#get-reactions */ public static final Route REACTIONS_GET = Route.get("/channels/{channel.id}/messages/{message.id}/reactions/{emoji}"); /** * Deletes all reactions on a message. This endpoint requires the 'MANAGE_MESSAGES' permission to be present on the * current user. * * @see * https://discord.com/developers/docs/resources/channel#delete-all-reactions */ public static final Route REACTIONS_DELETE_ALL = Route.delete("/channels/{channel.id}/messages/{message.id}/reactions"); /** * Edit a previously sent message. You can only edit messages that have been sent by the current user. Returns a * message object. Fires a Message Update Gateway event. * * @see * https://discord.com/developers/docs/resources/channel#edit-message */ public static final Route MESSAGE_EDIT = Route.patch("/channels/{channel.id}/messages/{message.id}"); /** * Delete a message. If operating on a guild channel and trying to delete a message that was not sent by the * current user, this endpoint requires the 'MANAGE_MESSAGES' permission. Returns a 204 empty response on success. * Fires a Message Delete Gateway event. * * @see * https://discord.com/developers/docs/resources/channel#delete-message */ public static final Route MESSAGE_DELETE = Route.delete("/channels/{channel.id}/messages/{message.id}"); /** * Delete multiple messages in a single request. This endpoint can only be used on guild channels and requires the * 'MANAGE_MESSAGES' permission. Returns a 204 empty response on success. Fires multiple Message Delete Gateway * events. *

* The gateway will ignore any individual messages that do not exist or do not belong to this channel, but these * will count towards the minimum and maximum message count. Duplicate snowflakes will only be counted once for * these limits. *

* This endpoint will not delete messages older than 2 weeks, and will fail if any message provided is older than * that. An endpoint will be added in the future to prune messages older than 2 weeks from a channel. * * @see * https://discord.com/developers/docs/resources/channel#bulk-delete-messages */ public static final Route MESSAGE_DELETE_BULK = Route.post("/channels/{channel.id}/messages/bulk-delete"); /** * Crosspost a Message into all guilds what follow the news channel indicated. This endpoint requires the * 'DISCOVERY' feature to be present for the guild and requires the 'SEND_MESSAGES' permission, if the current user * sent the message, or additionally the 'MANAGE_MESSAGES' permission, for all other messages, to be present for * the current user. *

* Returns a 204 empty response on success. * * @see * https://discord.com/developers/docs/resources/channel#crosspost-message */ public static final Route CROSSPOST_MESSAGE = Route.post("/channels/{channel.id}/messages/{message.id}/crosspost"); /** * Edit the channel permission overwrites for a user or role in a channel. Only usable for guild channels. Requires * the 'MANAGE_ROLES' permission. Returns a 204 empty response on success. For more information about permissions, * see permissions. * * @see * https://discord.com/developers/docs/resources/channel#edit-channel-permissions */ public static final Route CHANNEL_PERMISSIONS_EDIT = Route.put("/channels/{channel.id}/permissions/{overwrite.id}"); /** * Returns a list of invite objects (with invite metadata) for the channel. Only usable for guild channels. * Requires the 'MANAGE_CHANNELS' permission. * * @see * https://discord.com/developers/docs/resources/channel#get-channel-invites */ public static final Route CHANNEL_INVITES_GET = Route.get("/channels/{channel.id}/invites"); /** * 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. * * @see * https://discord.com/developers/docs/resources/channel#create-channel-invite */ public static final Route CHANNEL_INVITE_CREATE = Route.post("/channels/{channel.id}/invites"); /** * Delete a channel permission overwrite for a user or role in a channel. Only usable for guild channels. Requires * the 'MANAGE_ROLES' permission. Returns a 204 empty response on success. For more information about permissions, * see permissions. * * @see * https://discord.com/developers/docs/resources/channel#delete-channel-permission */ public static final Route CHANNEL_PERMISSION_DELETE = Route.delete("/channels/{channel.id}/permissions/{overwrite.id}"); /** * Follow a News Channel to send messages to a target channel. Requires the `MANAGE_WEBHOOKS` permission in the * target channel. Returns a followed channel object. * * @see * https://discord.com/developers/docs/resources/channel#follow-news-channel */ public static final Route FOLLOW_NEWS_CHANNEL = Route.post("/channels/{channel.id}/followers"); /** * Post a typing indicator for the specified channel. Generally bots should not implement this route. However, if a * bot is responding to a command and expects the computation to take a few seconds, this endpoint may be called to * let the user know that the bot is processing their message. Returns a 204 empty response on success. Fires a * Typing Start Gateway event. * * @see * https://discord.com/developers/docs/resources/channel#trigger-typing-indicator */ public static final Route TYPING_INDICATOR_TRIGGER = Route.post("/channels/{channel.id}/typing"); /** * Returns all pinned messages in the channel as an array of message objects. * * @see * https://discord.com/developers/docs/resources/channel#get-pinned-messages */ public static final Route MESSAGES_PINNED_GET = Route.get("/channels/{channel.id}/pins"); /** * Pin a message in a channel. Requires the 'MANAGE_MESSAGES' permission. Returns a 204 empty response on success. * * @see * https://discord.com/developers/docs/resources/channel#add-pinned-channel-message */ public static final Route MESSAGES_PINNED_ADD = Route.put("/channels/{channel.id}/pins/{message.id}"); /** * Delete a pinned message in a channel. Requires the 'MANAGE_MESSAGES' permission. Returns a 204 empty response on * success. * * @see * https://discord.com/developers/docs/resources/channel#delete-pinned-channel-message */ public static final Route MESSAGES_PINNED_DELETE = Route.delete("/channels/{channel.id}/pins/{message.id}"); /** * Adds a recipient to a Group DM using their access token. * * @see * https://discord.com/developers/docs/resources/channel#group-dm-add-recipient */ public static final Route GROUP_DM_RECIPIENT_ADD = Route.put("/channels/{channel.id}/recipients/{user.id}"); /** * Removes a recipient from a Group DM. * * @see * https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient */ public static final Route GROUP_DM_RECIPIENT_DELETE = Route.delete("/channels/{channel.id}/recipients/{user.id}"); public static final Route START_THREAD_WITH_MESSAGE = Route.post("/channels/{channel.id}/messages/{message.id}/threads"); public static final Route START_THREAD_WITHOUT_MESSAGE = Route.post("/channels/{channel.id}/threads"); public static final Route START_THREAD_IN_FORUM_CHANNEL_MESSAGE = Route.post("/channels/{channel.id}/threads"); public static final Route JOIN_THREAD = Route.put("/channels/{channel.id}/thread-members/@me"); public static final Route ADD_THREAD_MEMBER = Route.put("/channels/{channel.id}/thread-members/{user.id}"); public static final Route LEAVE_THREAD = Route.delete("/channels/{channel.id}/thread-members/@me"); public static final Route REMOVE_THREAD_MEMBER = Route.delete("/channels/{channel.id}/thread-members/{user.id}"); public static final Route GET_THREAD_MEMBER = Route.get("/channels/{channel.id}/thread-members/{user.id}"); public static final Route LIST_THREAD_MEMBERS = Route.get("/channels/{channel.id}/thread-members"); public static final Route LIST_PUBLIC_ARCHIVED_THREADS = Route.get("/channels/{channel.id}/threads/archived/public"); public static final Route LIST_PRIVATE_ARCHIVED_THREADS = Route.get("/channels/{channel.id}/threads/archived/private"); public static final Route LIST_JOINED_PRIVATE_ARCHIVED_THREADS = Route.get("/channels/{channel.id}/users/@me/threads/archived/private"); //////////////////////////////////////////// ////////////// Sticker Resource ////////////// //////////////////////////////////////////// /** * Returns a sticker object for the given sticker ID. * * @see * https://discord.com/developers/docs/resources/sticker#get-sticker */ public static final Route STICKER_GET = Route.get("/stickers/{sticker.id}"); /** * Returns the list of sticker packs available to Nitro subscribers. * * @see * https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs */ public static final Route NITRO_STICKER_PACKS_GET = Route.get("/sticker-packs"); /** * Returns an array of sticker objects for the given guild. Includes user fields if the bot has the MANAGE_EMOJIS_AND_STICKERS permission. * * @see * https://discord.com/developers/docs/resources/sticker#list-guild-stickers */ public static final Route GUILD_STICKERS_GET = Route.get("/guilds/{guild.id}/stickers"); /** * Returns a sticker object for the given guild and sticker IDs. Includes the user field if the bot has the MANAGE_EMOJIS_AND_STICKERS permission. * * @see * https://discord.com/developers/docs/resources/sticker#get-guild-sticker */ public static final Route GUILD_STICKER_GET = Route.get("/guilds/{guild.id}/stickers/{sticker.id}"); /** * Create a new sticker for the guild. Send a multipart/form-data body. Requires the MANAGE_EMOJIS_AND_STICKERS permission. Returns the new sticker object on success. * * @see * https://discord.com/developers/docs/resources/sticker#create-guild-sticker */ public static final Route GUILD_STICKER_CREATE = Route.post("/guilds/{guild.id}/stickers"); /** * Modify the given sticker. Requires the MANAGE_EMOJIS_AND_STICKERS permission. Returns the updated sticker object on success. * * @see * https://discord.com/developers/docs/resources/sticker#modify-guild-sticker */ public static final Route GUILD_STICKER_MODIFY = Route.patch("/guilds/{guild.id}/stickers/{sticker.id}"); /** * Delete the given sticker. Requires the MANAGE_EMOJIS_AND_STICKERS permission. Returns 204 No Content on success. * * @see * https://discord.com/developers/docs/resources/sticker#delete-guild-sticker */ public static final Route GUILD_STICKER_DELETE = Route.delete("/guilds/{guild.id}/stickers/{sticker.id}"); //////////////////////////////////////////// ////////////// Emoji Resource ////////////// //////////////////////////////////////////// /** * Returns a list of emoji objects for the given guild. * * @see * https://discord.com/developers/docs/resources/emoji#list-guild-emojis */ public static final Route GUILD_EMOJIS_GET = Route.get("/guilds/{guild.id}/emojis"); /** * Returns an emoji object for the given guild and emoji IDs. * * @see * https://discord.com/developers/docs/resources/emoji#get-guild-emoji */ public static final Route GUILD_EMOJI_GET = Route.get("/guilds/{guild.id}/emojis/{emoji.id}"); /** * Create a new emoji for the guild. Returns the new emoji object on success. Fires a Guild Emojis Update Gateway * event. * * @see * https://discord.com/developers/docs/resources/emoji#create-guild-emoji */ public static final Route GUILD_EMOJI_CREATE = Route.post("/guilds/{guild.id}/emojis"); /** * Modify the given emoji. Returns the updated emoji object on success. Fires a Guild Emojis Update Gateway event. * * @see * https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */ public static final Route GUILD_EMOJI_MODIFY = Route.patch("/guilds/{guild.id}/emojis/{emoji.id}"); /** * Delete the given emoji. Returns 204 No Content on success. Fires a Guild Emojis Update Gateway event. * * @see * https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */ public static final Route GUILD_EMOJI_DELETE = Route.delete("/guilds/{guild.id}/emojis/{emoji.id}"); //////////////////////////////////////////// ////////////// Guild Resource ////////////// //////////////////////////////////////////// /** * Create a new guild. Returns a guild object on success. Fires a Guild Create Gateway event. *

* By default this endpoint is limited to 10 active guilds. These limits are raised for whitelisted GameBridge * applications. * * @see * https://discord.com/developers/docs/resources/guild#create-guild */ public static final Route GUILD_CREATE = Route.post("/guilds"); /** * Returns the guild object for the given id. * * @see * https://discord.com/developers/docs/resources/guild#get-guild */ public static final Route GUILD_GET = Route.get("/guilds/{guild.id}"); /** * Modify a guild's settings. Returns the updated guild object on success. Fires a Guild Update Gateway event. * * @see * https://discord.com/developers/docs/resources/guild#modify-guild */ public static final Route GUILD_MODIFY = Route.patch("/guilds/{guild.id}"); /** * Delete a guild permanently. User must be owner. Returns 204 No Content on success. Fires a Guild Delete Gateway * event. * * @see * https://discord.com/developers/docs/resources/guild#delete-guild */ public static final Route GUILD_DELETE = Route.delete("/guilds/{guild.id}"); /** * Returns a list of guild channel objects. * * @see * https://discord.com/developers/docs/resources/guild#get-guild-channels */ public static final Route GUILD_CHANNELS_GET = Route.get("/guilds/{guild.id}/channels"); /** * Create a new channel object for the guild. Requires the 'MANAGE_CHANNELS' permission. Returns the new channel * object on success. Fires a Channel Create Gateway event. * * @see * https://discord.com/developers/docs/resources/guild#create-guild-channel */ public static final Route GUILD_CHANNEL_CREATE = Route.post("/guilds/{guild.id}/channels"); /** * Modify the positions of a set of role objects for the guild. Requires the 'MANAGE_ROLES' permission. Returns a * list of all of the guild's role objects on success. Fires multiple Guild Role Update Gateway events. * * @see * https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions */ public static final Route GUILD_CHANNEL_POSITIONS_MODIFY = Route.patch("/guilds/{guild.id}/channels"); /** * Returns a guild member object for the specified user. * * @see * https://discord.com/developers/docs/resources/guild#get-guild-member */ public static final Route GUILD_MEMBER_GET = Route.get("/guilds/{guild.id}/members/{user.id}"); /** * Returns a list of guild member objects that are members of the guild. * * @see * https://discord.com/developers/docs/resources/guild#list-guild-members */ public static final Route GUILD_MEMBERS_LIST = Route.get("/guilds/{guild.id}/members"); /** * Returns a list of guild member objects whose username or nickname starts with a provided string. * * @see * https://discord.com/developers/docs/resources/guild#search-guild-members */ public static final Route SEARCH_GUILD_MEMBERS_GET = Route.get("/guilds/{guild.id}/members/search"); /** * Adds a user to the guild, provided you have a valid oauth2 access token for the user with the guilds.join scope. * Returns a 201 Created with the guild member as the body. Fires a Guild Member Add Gateway event. Requires the * bot to have the CREATE_INSTANT_INVITE permission. * * @see * https://discord.com/developers/docs/resources/guild#add-guild-member */ public static final Route GUILD_MEMBER_ADD = Route.put("/guilds/{guild.id}/members/{user.id}"); /** * Modify attributes of a guild member. Returns a 200 OK with the guild member on success. Fires a Guild Member * Update Gateway event. * * @see * https://discord.com/developers/docs/resources/guild#modify-guild-member */ public static final Route GUILD_MEMBER_MODIFY = Route.patch("/guilds/{guild.id}/members/{user.id}"); /** * Modifies the current member in a guild. Returns a 200 with the updated member on success. Fires a Guild * Member Update Gateway event. * * @see Discord */ public static final Route CURRENT_MEMBER_MODIFY = Route.patch("/guilds/{guild.id}/members/@me"); /** * Adds a role to a guild member. Requires the 'MANAGE_ROLES' permission. Returns a 204 empty response on success. * Fires a Guild Member Update Gateway event. * * @see * https://discord.com/developers/docs/resources/guild#add-guild-member-role */ public static final Route GUILD_MEMBER_ROLE_ADD = Route.put("/guilds/{guild.id}/members/{user.id}/roles/{role.id}"); /** * Removes a role from a guild member. Requires the 'MANAGE_ROLES' permission. Returns a 204 empty response on * success. Fires a Guild Member Update Gateway event. * * @see * https://discord.com/developers/docs/resources/guild#remove-guild-member-role */ public static final Route GUILD_MEMBER_ROLE_REMOVE = Route.delete("/guilds/{guild.id}/members/{user.id}/roles/{role.id}"); /** * Remove a member from a guild. Requires 'KICK_MEMBERS' permission. Returns a 204 empty response on success. Fires * a Guild Member Remove Gateway event. * * @see * https://discord.com/developers/docs/resources/guild#remove-guild-member */ public static final Route GUILD_MEMBER_REMOVE = Route.delete("/guilds/{guild.id}/members/{user.id}"); /** * Returns a list of ban objects for the users banned from this guild. Requires the 'BAN_MEMBERS' permission. * * @see * https://discord.com/developers/docs/resources/guild#get-guild-bans */ public static final Route GUILD_BANS_GET = Route.get("/guilds/{guild.id}/bans"); /** * Returns a ban object for the given user or a 404 not found if the ban cannot be found. Requires the 'BAN_MEMBERS' * permission. * * @see * https://discord.com/developers/docs/resources/guild#get-guild-ban */ public static final Route GUILD_BAN_GET = Route.get("/guilds/{guild.id}/bans/{user.id}"); /** * 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. Fires a Guild Ban Add Gateway event. * * @see * https://discord.com/developers/docs/resources/guild#create-guild-ban */ public static final Route GUILD_BAN_CREATE = Route.put("/guilds/{guild.id}/bans/{user.id}"); /** * Remove the ban for a user. Requires the 'BAN_MEMBERS' permissions. Returns a 204 empty response on success. * Fires a Guild Ban Remove Gateway event. * * @see * https://discord.com/developers/docs/resources/guild#remove-guild-ban */ public static final Route GUILD_BAN_REMOVE = Route.delete("/guilds/{guild.id}/bans/{user.id}"); /** * Returns a list of role objects for the guild. Requires the 'MANAGE_ROLES' permission. * * @see * https://discord.com/developers/docs/resources/guild#get-guild-roles */ public static final Route GUILD_ROLES_GET = Route.get("/guilds/{guild.id}/roles"); /** * Create a new role for the guild. Requires the 'MANAGE_ROLES' permission. Returns the new role object on success. * Fires a Guild Role Create Gateway event. All JSON params are optional. * * @see * https://discord.com/developers/docs/resources/guild#create-guild-role */ public static final Route GUILD_ROLE_CREATE = Route.post("/guilds/{guild.id}/roles"); /** * Modify the positions of a set of role objects for the guild. Requires the 'MANAGE_ROLES' permission. Returns a * list of all of the guild's role objects on success. Fires multiple Guild Role Update Gateway events. * * @see * https://discord.com/developers/docs/resources/guild#modify-guild-role-positions */ public static final Route GUILD_ROLE_POSITIONS_MODIFY = Route.patch("/guilds/{guild.id}/roles"); /** * Modify a guild role. Requires the 'MANAGE_ROLES' permission. Returns the updated role on success. Fires a Guild * Role Update Gateway event. * * @see * https://discord.com/developers/docs/resources/guild#modify-guild-role */ public static final Route GUILD_ROLE_MODIFY = Route.patch("/guilds/{guild.id}/roles/{role.id}"); /** * Delete a guild role. Requires the 'MANAGE_ROLES' permission. Returns a 204 empty response on success. Fires a * Guild Role Delete Gateway event. * * @see * https://discord.com/developers/docs/resources/guild#delete-guild-role */ public static final Route GUILD_ROLE_DELETE = Route.delete("/guilds/{guild.id}/roles/{role.id}"); /** * Returns an object with one 'pruned' key indicating the number of members that would be removed in a prune * operation. Requires the 'KICK_MEMBERS' permission. * * @see * https://discord.com/developers/docs/resources/guild#get-guild-prune-count */ public static final Route GUILD_PRUNE_COUNT_GET = Route.get("/guilds/{guild.id}/prune"); /** * Begin a prune operation. Requires the 'KICK_MEMBERS' permission. Returns an object with one 'pruned' key * indicating the number of members that were removed in the prune operation. Fires multiple Guild Member Remove * Gateway events. * * @see * https://discord.com/developers/docs/resources/guild#begin-guild-prune */ public static final Route GUILD_PRUNE_BEGIN = Route.post("/guilds/{guild.id}/prune"); /** * 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. * * @see * https://discord.com/developers/docs/resources/guild#get-guild-voice-regions */ public static final Route GUILD_VOICE_REGIONS_GET = Route.get("/guilds/{guild.id}/regions"); /** * Returns a list of invite objects (with invite metadata) for the guild. Requires the 'MANAGE_GUILD' permission. * * @see * https://discord.com/developers/docs/resources/guild#get-guild-invites */ public static final Route GUILD_INVITES_GET = Route.get("/guilds/{guild.id}/invites"); /** * Returns a list of integration objects for the guild. Requires the 'MANAGE_GUILD' permission. * * @see * https://discord.com/developers/docs/resources/guild#get-guild-integrations */ public static final Route GUILD_INTEGRATIONS_GET = Route.get("/guilds/{guild.id}/integrations"); /** * Attach an integration object from the current user to the guild. Requires the 'MANAGE_GUILD' permission. Returns * a 204 empty response on success. Fires a Guild Integrations Update Gateway event. * * @see * https://discord.com/developers/docs/resources/guild#create-guild-integration */ public static final Route GUILD_INTEGRATION_CREATE = Route.post("/guilds/{guild.id}/integrations"); /** * Modify the behavior and settings of a integration object for the guild. Requires the 'MANAGE_GUILD' permission. * Returns a 204 empty response on success. Fires a Guild Integrations Update Gateway event. * * @see * https://discord.com/developers/docs/resources/guild#modify-guild-integration */ public static final Route GUILD_INTEGRATION_MODIFY = Route.patch("/guilds/{guild.id}/integrations/{integration.id}"); /** * Delete the attached integration object for the guild. Requires the 'MANAGE_GUILD' permission. Returns a 204 * empty response on success. Fires a Guild Integrations Update Gateway event. * * @see * https://discord.com/developers/docs/resources/guild#delete-guild-integration */ public static final Route GUILD_INTEGRATION_DELETE = Route.delete("/guilds/{guild.id}/integrations/{integration.id}"); /** * Sync an integration. Requires the 'MANAGE_GUILD' permission. Returns a 204 empty response on success. * * @see * https://discord.com/developers/docs/resources/guild#sync-guild-integration */ public static final Route GUILD_INTEGRATION_SYNC = Route.post("/guilds/{guild.id}/integrations/{integration.id}/sync"); /** * Returns the guild widget object. Requires the 'MANAGE_GUILD' permission. * * @see * https://discord.com/developers/docs/resources/guild#get-guild-widget */ public static final Route GUILD_WIDGET_GET = Route.get("/guilds/{guild.id}/widget"); /** * Modify a guild widget object for the guild. All attributes may be passed in with JSON and modified. Requires the * 'MANAGE_GUILD' permission. Returns the updated guild widget object. * * @see * https://discord.com/developers/docs/resources/guild#modify-guild-widget */ public static final Route GUILD_WIDGET_MODIFY = Route.patch("/guilds/{guild.id}/widget"); /** * Returns the guild preview object. If the user is not in the guild, then the guild must be Discoverable. * * @see * https://discord.com/developers/docs/resources/guild#get-guild-preview */ public static final Route GUILD_PREVIEW_GET = Route.get("/guilds/{guild.id}/preview"); /** * Updates the current user's voice state. * * @see * https://discord.com/developers/docs/resources/guild#update-self-voice-state */ public static final Route SELF_VOICE_STATE_MODIFY = Route.patch("/guilds/{guild.id}/voice-states/@me"); /** * Updates another user's voice state. * * @see * https://discord.com/developers/docs/resources/guild#update-others-voice-state */ public static final Route OTHERS_VOICE_STATE_MODIFY = Route.patch("/guilds/{guild.id}/voice-states/{user.id}"); public static final Route LIST_ACTIVE_GUILD_THREADS = Route.get("/guilds/{guild.id}/threads/active"); ///////////////////////////////////////////// ////////////// Invite Resource ////////////// ///////////////////////////////////////////// /** * Returns an invite object for the given code. * * @see * https://discord.com/developers/docs/resources/invite#get-invite */ public static final Route INVITE_GET = Route.get("/invites/{invite.code}"); /** * Delete an invite. Requires the MANAGE_CHANNELS permission. Returns an invite object on success. * * @see * https://discord.com/developers/docs/resources/invite#delete-invite */ public static final Route INVITE_DELETE = Route.delete("/invites/{invite.code}"); /** * Accept an invite. This requires the guilds.join OAuth2 scope to be able to accept invites on behalf of normal * users (via an OAuth2 Bearer token). Bot users are disallowed. Returns an invite object on success. * * @see * https://discord.com/developers/docs/resources/invite#accept-invite */ public static final Route INVITE_ACCEPT = Route.post("/invites/{invite.code}"); ///////////////////////////////////////////// ////////////// Template Resource //////////// ///////////////////////////////////////////// /** * Get a template. Returns a template object for the given code on success. * * @see * https://discord.com/developers/docs/resources/template#get-template */ public static final Route GUILD_TEMPLATE_GET = Route.get("/guilds/templates/{template.code}"); /** * Create a new guild from template. Returns a guild object on success. Fires a Guild Create Gateway event. * * By default this endpoint can be used only by bots in less than 10 guilds. * * @see * https://discord.com/developers/docs/resources/template#create-guild-from-template */ public static final Route TEMPLATE_GUILD_CREATE = Route.post("/guilds/templates/{template.code}"); /** * Returns an array of template objects. Requires the MANAGE_GUILD permission. Returns an array of template objects. * * @see * https://discord.com/developers/docs/resources/template#get-guild-templates */ public static final Route GUILD_TEMPLATE_LIST_GET = Route.get("/guilds/{guild.id}/templates"); /** * Creates a template for the guild. Requires the MANAGE_GUILD permission. Returns the created template object on success. * * @see * https://discord.com/developers/docs/resources/template#create-guild-template */ public static final Route GUILD_TEMPLATE_CREATE = Route.post("/guilds/{guild.id}/templates"); /** * Syncs the template to the guild's current state. Requires the MANAGE_GUILD permission. Returns the template object on success. * * @see * https://discord.com/developers/docs/resources/template#sync-guild-template */ public static final Route GUILD_TEMPLATE_SYNC = Route.put("/guilds/{guild.id}/templates/{template.code}"); /** * Modifies the template's metadata. Requires the MANAGE_GUILD permission. Returns the template object on success. * * @see * https://discord.com/developers/docs/resources/template#modify-guild-template */ public static final Route GUILD_TEMPLATE_MODIFY = Route.patch("/guilds/{guild.id}/templates/{template.code}"); /** * Deletes the template. Requires the MANAGE_GUILD permission. Returns the deleted template object on success. * * @see * https://discord.com/developers/docs/resources/template#delete-guild-template */ public static final Route GUILD_TEMPLATE_DELETE = Route.delete("/guilds/{guild.id}/templates/{template.code}"); /////////////////////////////////////////// ////////////// User Resource ////////////// /////////////////////////////////////////// /** * Returns the user object of the requester's account. For OAuth2, this requires the identify scope, which will * return the object without an email, and optionally the email scope, which returns the object with an email. * * @see * https://discord.com/developers/docs/resources/user#get-current-user */ public static final Route CURRENT_USER_GET = Route.get("/users/@me"); /** * Returns a user object for a given user ID. * * @see * https://discord.com/developers/docs/resources/user#get-user */ public static final Route USER_GET = Route.get("/users/{user.id}"); /** * Modify the requester's user account settings. Returns a user object on success. * * @see * https://discord.com/developers/docs/resources/user#modify-current-user */ public static final Route CURRENT_USER_MODIFY = Route.patch("/users/@me"); /** * Returns a list of partial guild objects the current user is a member of. Requires the guilds OAuth2 scope. * * @see * https://discord.com/developers/docs/resources/user#get-current-user-guilds */ public static final Route CURRENT_USER_GUILDS_GET = Route.get("/users/@me/guilds"); /** * Returns a guild member object for the current user. Requires the guilds.members.read OAuth2 scope. * * @see Discord */ public static final Route CURRENT_USER_GUILD_MEMBER_GET = Route.get("/users/@me/guilds/{guild.id}/member"); /** * Leave a guild. Returns a 204 empty response on success. * * @see * https://discord.com/developers/docs/resources/user#leave-guild */ public static final Route GUILD_LEAVE = Route.delete("/users/@me/guilds/{guild.id}"); /** * Create a new DM channel with a user. Returns a DM channel object. * * @see * https://discord.com/developers/docs/resources/user#create-dm */ public static final Route USER_DM_CREATE = Route.post("/users/@me/channels"); /** * Create a new group DM channel with multiple users. Returns a DM channel object. * * @see * https://discord.com/developers/docs/resources/user#create-group-dm */ public static final Route GROUP_DM_CREATE = Route.post("/users/@me/channels"); /** * Returns a list of connection objects. Requires the connections OAuth2 scope. * * @see * https://discord.com/developers/docs/resources/user#get-user-connections */ public static final Route USER_CONNECTIONS_GET = Route.get("/users/@me/connections"); //////////////////////////////////////////// ////////////// Voice Resource ////////////// //////////////////////////////////////////// /** * Returns an array of voice region objects that can be used when creating servers. * * @see * https://discord.com/developers/docs/resources/voice#list-voice-regions */ public static final Route VOICE_REGION_LIST = Route.get("/voice/regions"); ////////////////////////////////////////////// ////////////// Webhook Resource ////////////// ////////////////////////////////////////////// /** * Create a new webhook. Returns a webhook object on success. * * @see * https://discord.com/developers/docs/resources/webhook#create-webhook */ public static final Route CHANNEL_WEBHOOK_CREATE = Route.post("/channels/{channel.id}/webhooks"); /** * Returns a list of channel webhook objects. * * @see * https://discord.com/developers/docs/resources/webhook#get-channel-webhooks */ public static final Route CHANNEL_WEBHOOKS_GET = Route.get("/channels/{channel.id}/webhooks"); /** * Returns a list of guild webhook objects. * * @see * https://discord.com/developers/docs/resources/webhook#get-guild-webhooks */ public static final Route GUILD_WEBHOOKS_GET = Route.get("/guilds/{guild.id}/webhooks"); /** * Returns the new webhook object for the given id. * * @see * https://discord.com/developers/docs/resources/webhook#get-webhook */ public static final Route WEBHOOK_GET = Route.get("/webhooks/{webhook.id}"); /** * Same as {@link #WEBHOOK_GET}, except this call does not require authentication and returns no user in the * webhook object. * * @see https://discord.com/developers/docs/resources/webhook#get-webhook-with-token */ public static final Route WEBHOOK_TOKEN_GET = Route.get("/webhooks/{webhook.id}/{webhook.token}"); /** * Modify a webhook. Returns the updated webhook object on success. All parameters to this endpoint are optional. * * @see * https://discord.com/developers/docs/resources/webhook#modify-webhook */ public static final Route WEBHOOK_MODIFY = Route.patch("/webhooks/{webhook.id}"); /** * Same as {@link #WEBHOOK_MODIFY}, except this call does not require authentication and returns no user in the * webhook object. * * @see * https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */ public static final Route WEBHOOK_TOKEN_MODIFY = Route.patch("/webhooks/{webhook.id}/{webhook.token}"); /** * Delete a webhook permanently. User must be owner. Returns a 204 NO CONTENT response on success. * * @see * https://discord.com/developers/docs/resources/webhook#delete-webhook */ public static final Route WEBHOOK_DELETE = Route.delete("/webhooks/{webhook.id}"); /** * Same as above, except this call does not require authentication. * * @see * https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token */ public static final Route WEBHOOK_TOKEN_DELETE = Route.delete("/webhooks/{webhook.id}/{webhook.token}"); /** * This endpoint supports both JSON and form data bodies. It does require multipart/form-data requests instead of * the normal JSON request type when uploading files. Make sure you set your Content-Type to multipart/form-data if * you're doing that. Note that in that case, the embeds field cannot be used, but you can pass an url-encoded JSON * body as a form value for payload_json. * * @see * https://discord.com/developers/docs/resources/webhook#execute-webhook */ public static final Route WEBHOOK_EXECUTE = Route.post("/webhooks/{webhook.id}/{webhook.token}"); /** * @see * https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook */ public static final Route WEBHOOK_EXECUTE_SLACK = Route.post("/webhooks/{webhook.id}/{webhook.token}/slack"); /** * @see * https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook */ public static final Route WEBHOOK_EXECUTE_GITHUB = Route.post("/webhooks/{webhook.id}/{webhook.token}/github"); /** * @see * https://discord.com/developers/docs/resources/webhook#get-webhook-message */ public static final Route WEBHOOK_MESSAGE_GET = Route.get("/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}"); /** * @see * https://discord.com/developers/docs/resources/webhook#edit-webhook-message */ public static final Route WEBHOOK_MESSAGE_EDIT = Route.patch("/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}"); /** * @see * https://discord.com/developers/docs/resources/webhook#delete-webhook-message */ public static final Route WEBHOOK_MESSAGE_DELETE = Route.delete("/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}"); /////////////////////////////////////////// ////////// Application Resource /////////// /////////////////////////////////////////// /** * Returns the bot's OAuth2 application info. * * @see * https://discord.com/developers/docs/topics/oauth2#get-current-application-information */ public static final Route APPLICATION_INFO_GET = Route.get("/oauth2/applications/@me"); public static final Route GLOBAL_APPLICATION_COMMANDS_GET = Route.get("/applications/{application.id}/commands"); public static final Route GLOBAL_APPLICATION_COMMANDS_CREATE = Route.post("/applications/{application.id}/commands"); public static final Route GLOBAL_APPLICATION_COMMANDS_BULK_OVERWRITE = Route.put("/applications/{application.id}/commands"); public static final Route GLOBAL_APPLICATION_COMMAND_GET = Route.get("/applications/{application.id}/commands/{command.id}"); public static final Route GLOBAL_APPLICATION_COMMAND_MODIFY = Route.patch("/applications/{application.id}/commands/{command.id}"); public static final Route GLOBAL_APPLICATION_COMMAND_DELETE = Route.delete("/applications/{application.id}/commands/{command.id}"); public static final Route GUILD_APPLICATION_COMMANDS_GET = Route.get("/applications/{application.id}/guilds/{guild.id}/commands"); public static final Route GUILD_APPLICATION_COMMANDS_CREATE = Route.post("/applications/{application.id}/guilds/{guild.id}/commands"); public static final Route GUILD_APPLICATION_COMMANDS_BULK_OVERWRITE = Route.put("/applications/{application.id}/guilds/{guild.id}/commands"); public static final Route GUILD_APPLICATION_COMMAND_GET = Route.get("/applications/{application.id}/guilds/{guild.id}/commands/{command.id}"); public static final Route GUILD_APPLICATION_COMMAND_MODIFY = Route.patch("/applications/{application.id}/guilds/{guild.id}/commands/{command.id}"); public static final Route GUILD_APPLICATION_COMMAND_DELETE = Route.delete("/applications/{application.id}/guilds/{guild.id}/commands/{command.id}"); public static final Route GUILD_APPLICATION_COMMAND_PERMISSIONS_GET = Route.get("/applications/{application.id}/guilds/{guild.id}/commands/permissions"); public static final Route APPLICATION_COMMAND_PERMISSIONS_GET = Route.get("/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions"); public static final Route APPLICATION_COMMAND_PERMISSIONS_MODIFY = Route.put("/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions"); public static final Route APPLICATION_COMMAND_PERMISSIONS_BULK_MODIFY = Route.put("/applications/{application.id}/guilds/{guild.id}/commands/permissions"); /////////////////////////////////////////// ////////// Interaction Resource /////////// /////////////////////////////////////////// public static final Route INTERACTION_RESPONSE_CREATE = Route.post("/interactions/{interaction.id}/{interaction.token}/callback"); /////////////////////////////////////////// //////// Stage Instance Resource ///////// /////////////////////////////////////////// public static final Route CREATE_STAGE_INSTANCE = Route.post("/stage-instances"); public static final Route GET_STAGE_INSTANCE = Route.get("/stage-instances/{channel.id}"); public static final Route MODIFY_STAGE_INSTANCE = Route.patch("/stage-instances/{channel.id}"); public static final Route DELETE_STAGE_INSTANCE = Route.delete("/stage-instances/{channel.id}"); ///////////////////////////////////////////////////// ////////// Guild Scheduled Event Resource /////////// ///////////////////////////////////////////////////// /** * Returns a list of all scheduled events for a guild. * * @see * https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild */ public static final Route GUILD_SCHEDULED_EVENTS_GET = Route.get("/guilds/{guild.id}/scheduled-events"); /** * Creates a guild scheduled event for the given guild. Returns a scheduled event object on success. * * @see * ttps://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event */ public static final Route GUILD_SCHEDULED_EVENT_CREATE = Route.post("/guilds/{guild.id}/scheduled-events"); /** * Returns a scheduled event for the given guild. * * @see * https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event */ public static final Route GUILD_SCHEDULED_EVENT_GET = Route.get("/guilds/{guild.id}/scheduled-events/{event.id}"); /** * Modifies a scheduled event for the given guild. Returns the modified scheduled event object on success. * * @see * https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event */ public static final Route GUILD_SCHEDULED_EVENT_MODIFY = Route.patch("/guilds/{guild.id}/scheduled-events/{event.id}"); /** * Deletes a scheduled event for the given guild. Returns a 204 empty response on success. * * @see * https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event */ public static final Route GUILD_SCHEDULED_EVENT_DELETE = Route.delete("/guilds/{guild.id}/scheduled-events/{event.id}"); /** * Returns a list of users RSVP'd to the scheduled event for the given guild. Returns a list of user objects on * success with an optional `guild_member` property for each user if `with_member` query param is passed. * * @see * https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users */ public static final Route GUILD_SCHEDULED_EVENT_USERS_GET = Route.get("/guilds/{guild.id}/scheduled-events/{event.id}/users"); /////////////////////////////////////////// ///////////// OAuth2 Resource ///////////// /////////////////////////////////////////// public static final Route TOKEN = Route.post("/oauth2/token"); public static final Route TOKEN_REVOKE = Route.post("/oauth2/token/revoke"); public static final Route AUTHORIZATION_INFO_GET = Route.get("/oauth2/@me"); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy