mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 22:51:32 +00:00
fixes
This commit is contained in:
parent
8c65961a07
commit
2b8a6294af
2 changed files with 27 additions and 2 deletions
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
Loading…
Reference in a new issue