Skip to content

Commit

Permalink
feat: add links to each routes documentation (#8898)
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidx committed Dec 7, 2022
1 parent 3dede75 commit 73300c7
Show file tree
Hide file tree
Showing 10 changed files with 161 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/core/src/api/applicationCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class ApplicationCommandsAPI {
/**
* Fetches all global commands for a application
*
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands}
* @param applicationId - The application id to fetch commands for
* @param options - The options to use when fetching commands
*/
Expand All @@ -36,6 +37,7 @@ export class ApplicationCommandsAPI {
/**
* Creates a new global command
*
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
* @param applicationId - The application id to create the command for
* @param data - The data to use when creating the command
*/
Expand All @@ -48,6 +50,7 @@ export class ApplicationCommandsAPI {
/**
* Fetches a global command
*
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-command}
* @param applicationId - The application id to fetch the command from
* @param commandId - The command id to fetch
*/
Expand All @@ -60,6 +63,7 @@ export class ApplicationCommandsAPI {
/**
* Edits a global command
*
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command}
* @param applicationId - The application id of the command
* @param commandId - The id of the command to edit
* @param data - The data to use when editing the command
Expand All @@ -77,6 +81,7 @@ export class ApplicationCommandsAPI {
/**
* Deletes a global command
*
* @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command}
* @param applicationId - The application id of the command
* @param commandId - The id of the command to delete
*/
Expand All @@ -87,6 +92,7 @@ export class ApplicationCommandsAPI {
/**
* Overwrites global commands
*
* @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands}
* @param applicationId - The application id to overwrite commands for
* @param data - The data to use when overwriting commands
*/
Expand All @@ -99,6 +105,7 @@ export class ApplicationCommandsAPI {
/**
* Fetches all commands for a guild
*
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands}
* @param applicationId - The application id to fetch commands for
* @param guildId - The guild id to fetch commands for
* @param data - The data to use when fetching commands
Expand All @@ -116,6 +123,7 @@ export class ApplicationCommandsAPI {
/**
* Creates a new command for a guild
*
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command}
* @param applicationId - The application id to create the command for
* @param guildId - The guild id to create the command for
* @param data - The data to use when creating the command
Expand All @@ -133,6 +141,7 @@ export class ApplicationCommandsAPI {
/**
* Fetches a guild command
*
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command}
* @param applicationId - The application id to fetch the command from
* @param guildId - The guild id to fetch the command from
* @param commandId - The command id to fetch
Expand All @@ -146,6 +155,7 @@ export class ApplicationCommandsAPI {
/**
* Edits a guild command
*
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
* @param applicationId - The application id of the command
* @param guildId - The guild id of the command
* @param commandId - The command id to edit
Expand All @@ -165,6 +175,7 @@ export class ApplicationCommandsAPI {
/**
* Deletes a guild command
*
* @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command}
* @param applicationId - The application id of the command
* @param guildId - The guild id of the command
* @param commandId - The id of the command to delete
Expand All @@ -176,6 +187,7 @@ export class ApplicationCommandsAPI {
/**
* Bulk overwrites guild commands
*
* @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands}
* @param applicationId - The application id to overwrite commands for
* @param guildId - The guild id to overwrite commands for
* @param data - The data to use when overwriting commands
Expand All @@ -193,6 +205,7 @@ export class ApplicationCommandsAPI {
/**
* Fetches the permissions for a guild command
*
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions}
* @param applicationId - The application id to get the permissions for
* @param guildId - The guild id of the command
* @param commandId - The command id to get the permissions for
Expand All @@ -206,6 +219,7 @@ export class ApplicationCommandsAPI {
/**
* Fetches all permissions for all commands in a guild
*
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions}
* @param applicationId - The application id to get the permissions for
* @param guildId - The guild id to get the permissions for
*/
Expand All @@ -218,6 +232,7 @@ export class ApplicationCommandsAPI {
/**
* Edits the permissions for a guild command
*
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions}
* @param userToken - The token of the user to edit permissions on behalf of
* @param applicationId - The application id to edit the permissions for
* @param guildId - The guild id to edit the permissions for
Expand Down
26 changes: 26 additions & 0 deletions packages/core/src/api/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class ChannelsAPI {
/**
* Sends a message in a channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#create-message}
* @param channelId - The id of the channel to send the message in
* @param data - The data to use when sending the message
*/
Expand All @@ -46,6 +47,7 @@ export class ChannelsAPI {
/**
* Edits a message
*
* @see {@link https://discord.com/developers/docs/resources/channel#edit-message}
* @param channelId - The id of the channel the message is in
* @param messageId - The id of the message to edit
* @param data - The data to use when editing the message
Expand All @@ -64,6 +66,7 @@ export class ChannelsAPI {
/**
* Fetches the reactions for a message
*
* @see {@link https://discord.com/developers/docs/resources/channel#get-reactions}
* @param channelId - The id of the channel the message is in
* @param messageId - The id of the message to get the reactions for
* @param emoji - The emoji to get the reactions for
Expand All @@ -83,6 +86,7 @@ export class ChannelsAPI {
/**
* Deletes a reaction for the current user
*
* @see {@link https://discord.com/developers/docs/resources/channel#delete-own-reaction}
* @param channelId - The id of the channel the message is in
* @param messageId - The id of the message to delete the reaction for
* @param emoji - The emoji to delete the reaction for
Expand All @@ -94,6 +98,7 @@ export class ChannelsAPI {
/**
* Deletes a reaction for a user
*
* @see {@link https://discord.com/developers/docs/resources/channel#delete-user-reaction}
* @param channelId - The id of the channel the message is in
* @param messageId - The id of the message to delete the reaction for
* @param emoji - The emoji to delete the reaction for
Expand All @@ -106,6 +111,7 @@ export class ChannelsAPI {
/**
* Deletes all reactions for a message
*
* @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions}
* @param channelId - The id of the channel the message is in
* @param messageId - The id of the message to delete the reactions for
*/
Expand All @@ -116,6 +122,7 @@ export class ChannelsAPI {
/**
* Deletes all reactions of an emoji for a message
*
* @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji}
* @param channelId - The id of the channel the message is in
* @param messageId - The id of the message to delete the reactions for
* @param emoji - The emoji to delete the reactions for
Expand All @@ -127,6 +134,7 @@ export class ChannelsAPI {
/**
* Adds a reaction to a message
*
* @see {@link https://discord.com/developers/docs/resources/channel#create-reaction}
* @param channelId - The id of the channel the message is in
* @param messageId - The id of the message to add the reaction to
* @param emoji - The emoji to add the reaction with
Expand All @@ -138,6 +146,7 @@ export class ChannelsAPI {
/**
* Fetches a channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel}
* @param channelId - The id of the channel
*/
public async get(channelId: Snowflake) {
Expand All @@ -147,6 +156,7 @@ export class ChannelsAPI {
/**
* Edits a channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#modify-channel}
* @param channelId - The id of the channel to edit
* @param data - The new channel data
*/
Expand All @@ -157,6 +167,7 @@ export class ChannelsAPI {
/**
* Deletes a channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#deleteclose-channel}
* @param channelId - The id of the channel to delete
*/
public async delete(channelId: Snowflake) {
Expand All @@ -166,6 +177,7 @@ export class ChannelsAPI {
/**
* Fetches the messages of a channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel-messages}
* @param channelId - The id of the channel to fetch messages from
* @param options - The options to use when fetching messages
*/
Expand All @@ -178,6 +190,7 @@ export class ChannelsAPI {
/**
* Shows a typing indicator in a channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#trigger-typing-indicator}
* @param channelId - The id of the channel to show the typing indicator in
*/
public async showTyping(channelId: Snowflake) {
Expand All @@ -187,6 +200,7 @@ export class ChannelsAPI {
/**
* Fetches the pinned messages of a channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#get-pinned-messages}
* @param channelId - The id of the channel to fetch pinned messages from
*/
public async getPins(channelId: Snowflake) {
Expand All @@ -196,6 +210,7 @@ export class ChannelsAPI {
/**
* Pins a message in a channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#pin-message}
* @param channelId - The id of the channel to pin the message in
* @param messageId - The id of the message to pin
* @param reason - The reason for pinning the message
Expand All @@ -207,6 +222,7 @@ export class ChannelsAPI {
/**
* Deletes a message
*
* @see {@link https://discord.com/developers/docs/resources/channel#delete-message}
* @param channelId - The id of the channel the message is in
* @param messageId - The id of the message to delete
* @param reason - The reason for deleting the message
Expand All @@ -218,6 +234,7 @@ export class ChannelsAPI {
/**
* Bulk deletes messages
*
* @see {@link https://discord.com/developers/docs/resources/channel#bulk-delete-messages}
* @param channelId - The id of the channel the messages are in
* @param messageIds - The ids of the messages to delete
*/
Expand All @@ -228,6 +245,7 @@ export class ChannelsAPI {
/**
* Fetches a message
*
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel-message}
* @param channelId - The id of the channel the message is in
* @param messageId - The id of the message to fetch
*/
Expand All @@ -238,6 +256,7 @@ export class ChannelsAPI {
/**
* Crossposts a message
*
* @see {@link https://discord.com/developers/docs/resources/channel#crosspost-message}
* @param channelId - The id of the channel the message is in
* @param messageId - The id of the message to crosspost
*/
Expand All @@ -250,6 +269,7 @@ export class ChannelsAPI {
/**
* Unpins a message in a channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#unpin-message}
* @param channelId - The id of the channel to unpin the message in
* @param messageId - The id of the message to unpin
* @param reason - The reason for unpinning the message
Expand All @@ -261,6 +281,7 @@ export class ChannelsAPI {
/**
* Follows an announcement channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#follow-announcement-channel}
* @param channelId - The id of the announcement channel to follow
* @param webhookChannelId - The id of the webhook channel to follow the announcements in
*/
Expand All @@ -273,6 +294,7 @@ export class ChannelsAPI {
/**
* Creates a new invite for a channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#create-channel-invite}
* @param channelId - The id of the channel to create an invite for
* @param data - The data to use when creating the invite
*/
Expand All @@ -286,6 +308,7 @@ export class ChannelsAPI {
/**
* Fetches the invites of a channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel-invites}
* @param channelId - The id of the channel to fetch invites from
*/
public async getInvites(channelId: Snowflake) {
Expand All @@ -295,6 +318,8 @@ export class ChannelsAPI {
/**
* Fetches the archived threads of a channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#list-public-archived-threads}
* @see {@link https://discord.com/developers/docs/resources/channel#list-private-archived-threads}
* @param channelId - The id of the channel to fetch archived threads from
* @param archivedStatus - The archived status of the threads to fetch
* @param options - The options to use when fetching archived threads
Expand All @@ -312,6 +337,7 @@ export class ChannelsAPI {
/**
* Fetches the private joined archived threads of a channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
* @param channelId - The id of the channel to fetch joined archived threads from
* @param options - The options to use when fetching joined archived threads
*/
Expand Down

0 comments on commit 73300c7

Please sign in to comment.