docs(*): add links to Discord's API objects & data (#5862)

This commit is contained in:
Rodry
2021-06-24 09:55:44 +01:00
committed by GitHub
parent 6d3d00b445
commit e0efcc6ab0
35 changed files with 175 additions and 63 deletions

View File

@@ -206,13 +206,13 @@ class ApplicationCommand extends Base {
* Transforms an {@link ApplicationCommandOptionData} object into something that can be used with the API.
* @param {ApplicationCommandOptionData} option The option to transform
* @param {boolean} [received] Whether this option has been received from Discord
* @returns {Object}
* @returns {APIApplicationCommandOption}
* @private
*/
static transformOption(option, received) {
const stringType = typeof option.type === 'string' ? option.type : ApplicationCommandOptionTypes[option.type];
return {
type: typeof option.type === 'number' && !received ? option.type : ApplicationCommandOptionTypes[option.type],
type: typeof option.type === 'number' && !received ? option.type : stringType,
name: option.name,
description: option.description,
required:
@@ -224,3 +224,13 @@ class ApplicationCommand extends Base {
}
module.exports = ApplicationCommand;
/**
* @external APIApplicationCommand
* @see {@link https://discord.com/developers/docs/interactions/slash-commands#applicationcommand}
*/
/**
* @external APIApplicationCommandOption
* @see {@link https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoption}
*/