From 294aa28849d06d1e58afdf0d1578be09aaebe1fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 26 Aug 2021 21:50:15 +0300 Subject: [PATCH] Fix commands.js --- src/client/commands.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/client/commands.js b/src/client/commands.js index 464ab91..078a8ee 100644 --- a/src/client/commands.js +++ b/src/client/commands.js @@ -15,8 +15,16 @@ module.exports = { command.data = new SlashCommandBuilder() .setName(command.name) .setDescription(command.description); - if(command.options) command.data.options = command.options; - commands.push(command.data.toJSON()); + + command.data = command.data.toJSON(); + if(command.options) { + command.options.forEach(function(option) { + if(option.type == "STRING") option.type = 3; + command.data.options.push(option); + }); + } + + commands.push(command.data); } const rest = new REST({ version: '9' }).setToken(token);