mirror of
https://github.com/danbulant/discord.js
synced 2026-07-06 11:40:41 +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';
|
'use strict';
|
||||||
|
|
||||||
const BaseClient = require('./BaseClient');
|
const BaseClient = require('./BaseClient');
|
||||||
|
const ApplicationCommand = require('../structures/ApplicationCommand');
|
||||||
const Interaction = require('../structures/Interaction');
|
const Interaction = require('../structures/Interaction');
|
||||||
const ApplicationCommand = require('../structures/InteractionCommand');
|
|
||||||
const { ApplicationCommandOptionType, InteractionType, InteractionResponseType } = require('../util/Constants');
|
const { ApplicationCommandOptionType, InteractionType, InteractionResponseType } = require('../util/Constants');
|
||||||
|
|
||||||
let sodium;
|
let sodium;
|
||||||
|
|
@ -50,7 +50,7 @@ class InteractionClient extends BaseClient {
|
||||||
/**
|
/**
|
||||||
* Get registered slash commands.
|
* Get registered slash commands.
|
||||||
* @param {Snowflake?} guildID Optional guild ID.
|
* @param {Snowflake?} guildID Optional guild ID.
|
||||||
* @returns {[Command]}
|
* @returns {Command[]}
|
||||||
*/
|
*/
|
||||||
async getCommands(guildID) {
|
async getCommands(guildID) {
|
||||||
let path = this.client.api.applications('@me');
|
let path = this.client.api.applications('@me');
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,39 @@ class ApplicationCommand extends Base {
|
||||||
}
|
}
|
||||||
|
|
||||||
_patch(data) {
|
_patch(data) {
|
||||||
|
/**
|
||||||
|
* The ID of this command.
|
||||||
|
* @type {Snowflake}
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
this.id = data.id;
|
this.id = data.id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The ID of the application which owns this command.
|
||||||
|
* @type {Snowflake}
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
this.appplicationID = data.application_id;
|
this.appplicationID = data.application_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of this command.
|
||||||
|
* @type {string}
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
this.name = data.name;
|
this.name = data.name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The description of this command.
|
||||||
|
* @type {string}
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
this.description = data.description;
|
this.description = data.description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The options of this command.
|
||||||
|
* @type {Object[]}
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
this.options = data.options.map(function m(o) {
|
this.options = data.options.map(function m(o) {
|
||||||
return {
|
return {
|
||||||
type: ApplicationCommandOptionType[o.type],
|
type: ApplicationCommandOptionType[o.type],
|
||||||
Loading…
Reference in a new issue