From 69bc495e817d6f904bacd54b609fbe2122b74796 Mon Sep 17 00:00:00 2001 From: March 7th <71698422+aiko-chan-ai@users.noreply.github.com> Date: Thu, 31 Mar 2022 20:51:43 +0700 Subject: [PATCH] Mistake oh no --- package.json | 2 +- src/structures/ApplicationCommand.js | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index cb09887..ec4b062 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord.js-selfbot-v13", - "version": "1.2.2", + "version": "1.2.3", "description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]", "main": "./src/index.js", "types": "./typings/index.d.ts", diff --git a/src/structures/ApplicationCommand.js b/src/structures/ApplicationCommand.js index b7ee645..71f9264 100644 --- a/src/structures/ApplicationCommand.js +++ b/src/structures/ApplicationCommand.js @@ -486,7 +486,7 @@ class ApplicationCommand extends Base { ); } if (!subCommandCheck && !this?.options[i]) continue; - if (subCommandCheck && subCommand && !subCommand?.options[i]) continue; + if (subCommandCheck && subCommand?.options && !subCommand?.options[i]) continue; if (!subCommandCheck) { // Check value is invalid let choice; @@ -515,6 +515,7 @@ class ApplicationCommand extends Base { // Check value is invalid let choice; if ( + subCommand?.options && subCommand.options[i].choices && subCommand.options[i].choices.length > 0 ) { @@ -546,7 +547,11 @@ class ApplicationCommand extends Base { } if (!subCommandCheck && this.options[i]?.required) throw new Error('Value required missing'); - if (subCommandCheck && subCommand?.options[i-1]?.required) + if ( + subCommandCheck && + subCommand?.options && + subCommand?.options[i - 1]?.required + ) throw new Error('Value required missing'); await this.client.api.interactions.post({ body: {