mirror of
https://github.com/danbulant/discord.js
synced 2026-09-20 06:53:53 +00:00
Attempt to fix the create command function
This commit is contained in:
parent
4f5cdf2814
commit
c513df444e
1 changed files with 4 additions and 4 deletions
|
|
@ -76,14 +76,14 @@ class InteractionClient extends BaseClient {
|
||||||
* Create a command.
|
* Create a command.
|
||||||
* @param {Object} command The command description.
|
* @param {Object} command The command description.
|
||||||
* @param {Snowflake?} guildID Optional guild ID.
|
* @param {Snowflake?} guildID Optional guild ID.
|
||||||
* @returns {ApplicationCommand} The created command.
|
* @returns {Promise<ApplicationCommand>} The created command.
|
||||||
*/
|
*/
|
||||||
createCommand(command, guildID) {
|
async createCommand(command, guildID) {
|
||||||
let path = this.client.api.applications('@me');
|
let path = this.client.api.applications(this.client.user.id);
|
||||||
if (guildID) {
|
if (guildID) {
|
||||||
path = path.guilds(guildID);
|
path = path.guilds(guildID);
|
||||||
}
|
}
|
||||||
const c = path.commands.post({
|
const c = await path.commands.post({
|
||||||
data: {
|
data: {
|
||||||
name: command.name,
|
name: command.name,
|
||||||
description: command.description,
|
description: command.description,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue