spacecommands 3.0.2 → 3.0.3
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.
package/dist/CommandHandler.js
CHANGED
|
@@ -158,7 +158,7 @@ class CommandHandler {
|
|
|
158
158
|
if (configuration.default && Object.keys(configuration).length === 1) {
|
|
159
159
|
configuration = configuration.default;
|
|
160
160
|
}
|
|
161
|
-
const { name = fileName, category, commands, aliases, init, callback, run, execute, error, description, requiredPermissions, permissions, slash, expectedArgs, expectedArgsTypes, minArgs, options = [], } = configuration;
|
|
161
|
+
const { name = fileName, category, commands, aliases, init, callback, run, execute, error, description, requiredPermissions, permissions, slash, expectedArgs, expectedArgsTypes, minArgs, options = [], autocomplete, } = configuration;
|
|
162
162
|
const { testOnly } = configuration;
|
|
163
163
|
if (run || execute) {
|
|
164
164
|
throw new Error(`Command located at "${file}" has either a "run" or "execute" function. Please rename that function to "callback".`);
|
|
@@ -250,6 +250,10 @@ class CommandHandler {
|
|
|
250
250
|
else {
|
|
251
251
|
await slashCommands.create(names[0], description, options);
|
|
252
252
|
}
|
|
253
|
+
if (autocomplete) {
|
|
254
|
+
const slashCommands = instance.slashCommands;
|
|
255
|
+
slashCommands.registerAutocomplete(names[0], autocomplete);
|
|
256
|
+
}
|
|
253
257
|
}
|
|
254
258
|
if (callback) {
|
|
255
259
|
if (init) {
|
|
@@ -17,13 +17,13 @@ module.exports = {
|
|
|
17
17
|
{
|
|
18
18
|
name: 'command',
|
|
19
19
|
description: 'The command name',
|
|
20
|
-
type:
|
|
20
|
+
type: 3,
|
|
21
21
|
required: true,
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
name: 'channel',
|
|
25
25
|
description: 'The tag of the channel',
|
|
26
|
-
type:
|
|
26
|
+
type: 7,
|
|
27
27
|
required: false,
|
|
28
28
|
},
|
|
29
29
|
],
|
package/dist/commands/command.js
CHANGED
|
@@ -18,7 +18,7 @@ module.exports = {
|
|
|
18
18
|
name: 'action',
|
|
19
19
|
description: 'Either "enable" or "disable"',
|
|
20
20
|
required: true,
|
|
21
|
-
type:
|
|
21
|
+
type: 3,
|
|
22
22
|
choices: [
|
|
23
23
|
{
|
|
24
24
|
name: 'Enable',
|
|
@@ -31,7 +31,7 @@ module.exports = {
|
|
|
31
31
|
name: 'command',
|
|
32
32
|
description: 'The name of the command',
|
|
33
33
|
required: true,
|
|
34
|
-
type:
|
|
34
|
+
type: 3,
|
|
35
35
|
},
|
|
36
36
|
],
|
|
37
37
|
callback: async (options) => {
|