xernerx 2.7.0 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,7 +49,7 @@ class InteractionCommand {
49
49
  }
50
50
 
51
51
  else if (options?.groups?.length > 0) {
52
- this.addSubcommandGroups(options.groups)
52
+ this.addSubcommandGroups(options.groups);
53
53
  }
54
54
 
55
55
  this.id = id;
@@ -116,62 +116,59 @@ module.exports = new class Functions {
116
116
  for (const commands of Object.values(interaction.client.commands)) {
117
117
  let commandInfo = {};
118
118
 
119
- if (commands.has(cmd)) {
120
- const command = commands.get(cmd);
119
+ const command = commands.find(command => command?.data?.name === cmd.toLowerCase() || command?.name === cmd.toLowerCase() || command?.id == cmd.toLowerCase());
121
120
 
121
+ if (command) {
122
122
  if (command?.data?.options?.length > 0) {
123
123
  command?.data?.options?.map(option => {
124
124
  if (!option?.type) {
125
125
  if (option?.options?.length > 0) {
126
126
  option?.options?.map(opt => {
127
127
  if (!opt.type) {
128
- commandInfo = {
128
+ cmds.push(commandInfo = {
129
129
  name: command?.data?.name + " " + option?.name + " " + opt?.name,
130
130
  description: opt.description,
131
131
  category: command.category
132
- }
132
+ })
133
133
  }
134
134
 
135
135
  else {
136
- commandInfo = {
136
+ cmds.push(commandInfo = {
137
137
  name: command?.data?.name + " " + option?.name,
138
138
  description: option?.description,
139
139
  category: command.category
140
- }
140
+ })
141
141
  }
142
142
  })
143
143
  }
144
144
 
145
145
  else {
146
- commandInfo = {
146
+ cmds.push(commandInfo = {
147
147
  name: command?.data?.name + " " + option?.name,
148
148
  description: option?.description,
149
149
  category: command.category
150
- }
150
+ })
151
151
  }
152
152
  }
153
153
 
154
154
  else {
155
- commandInfo = {
155
+ cmds.push(commandInfo = {
156
156
  name: command?.data?.name || command?.name || command?.id,
157
157
  description: command?.data?.description || command?.description,
158
158
  category: command.category
159
- }
159
+ })
160
160
  }
161
161
  })
162
162
  }
163
163
 
164
164
  else {
165
- commandInfo = {
165
+ cmds.push(commandInfo = {
166
166
  name: command?.data?.name || command?.name || command?.id,
167
167
  description: command?.data?.description || command?.description,
168
168
  category: command.category
169
- }
169
+ })
170
170
  }
171
-
172
- cmds.push(commandInfo);
173
171
  }
174
-
175
172
  }
176
173
  return cmds;
177
174
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xernerx",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "description": "A bot framework for discord.js. [BETA]",
5
5
  "main": "main.js",
6
6
  "scripts": {