From 2b8a6294afb6bab758ba200af1d8c4381805ddcf Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Fri, 11 Dec 2020 15:10:12 -0600 Subject: [PATCH] fixes --- src/client/InteractionClient.js | 4 +-- ...actionCommand.js => ApplicationCommand.js} | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) rename src/structures/{InteractionCommand.js => ApplicationCommand.js} (77%) diff --git a/src/client/InteractionClient.js b/src/client/InteractionClient.js index 3a709d08..c7d05302 100644 --- a/src/client/InteractionClient.js +++ b/src/client/InteractionClient.js @@ -1,8 +1,8 @@ 'use strict'; const BaseClient = require('./BaseClient'); +const ApplicationCommand = require('../structures/ApplicationCommand'); const Interaction = require('../structures/Interaction'); -const ApplicationCommand = require('../structures/InteractionCommand'); const { ApplicationCommandOptionType, InteractionType, InteractionResponseType } = require('../util/Constants'); let sodium; @@ -50,7 +50,7 @@ class InteractionClient extends BaseClient { /** * Get registered slash commands. * @param {Snowflake?} guildID Optional guild ID. - * @returns {[Command]} + * @returns {Command[]} */ async getCommands(guildID) { let path = this.client.api.applications('@me'); diff --git a/src/structures/InteractionCommand.js b/src/structures/ApplicationCommand.js similarity index 77% rename from src/structures/InteractionCommand.js rename to src/structures/ApplicationCommand.js index b4d23c7e..c646ff7e 100644 --- a/src/structures/InteractionCommand.js +++ b/src/structures/ApplicationCommand.js @@ -23,14 +23,39 @@ class ApplicationCommand extends Base { } _patch(data) { + /** + * The ID of this command. + * @type {Snowflake} + * @readonly + */ this.id = data.id; + /** + * The ID of the application which owns this command. + * @type {Snowflake} + * @readonly + */ this.appplicationID = data.application_id; + /** + * The name of this command. + * @type {string} + * @readonly + */ this.name = data.name; + /** + * The description of this command. + * @type {string} + * @readonly + */ this.description = data.description; + /** + * The options of this command. + * @type {Object[]} + * @readonly + */ this.options = data.options.map(function m(o) { return { type: ApplicationCommandOptionType[o.type],