Skip to content

$isAutoComplete

$isAutoComplete will return either true or false depending on the entered slash command option being auto completed or not. (autoCompleteRespond function)

Usage

$isAutoComplete

Example(s)

This will create a slash command with the “autoComplete” feature:

Please note that you require “events: [“onMessage”, “onInteractionCreate”]” in your main file (also known as, in most cases, index.js)

1
client.command({
2
name: "createSlashCommand",
3
code: `
4
$createApplicationCommand[global;example;Awesome example interaction command with auto-complete!;true;true;slash;[{
5
"name": "option",
6
"description": "test",
7
"required": false,
8
"type": 3,
9
"autocomplete": true
10
}]]`
11
});

Checking if autoComplete equals true if so it will respond with the given respond (addition of the code above):

1
client.command({
2
name: "example",
3
prototype: "slash",
4
$if: "old",
5
code: `
6
$if[$isAutocomplete==true]
7
$autoCompleteRespond[First option;You selected the first option, therefore I'm responding with this!;Second option;You selected the first second, therefore I'm responding with this!]
8
$else
9
$interactionReply[$slashOption[option]]
10
$endif
11
`
12
});

Create the slash-commands with another option:

1
client.command({
2
name: "createSlashCommand",
3
code: `
4
$createApplicationCommand[global;example;Awesome example interaction command with auto-complete!;true;slash;[{
5
"name": "option",
6
"description": "test",
7
"required": false,
8
"type": 3,
9
"autocomplete": true
10
}, {
11
"name": "anotheroption",
12
"description": "test",
13
"required": false,
14
"type": 3
15
}]]`
16
});

Using JSON and checking if autoComplete equals true if so it will respond with the given respond (addition of the code above):

1
client.command({
2
name: "example",
3
prototype: "slash",
4
$if: "old",
5
code: `
6
$if[$isAutocomplete==true]
7
$autoCompleteRespond[[{
8
"name" : "First Option",
9
"value" : "You selected the first option, therefore I\'m responding with this!"
10
}, {
11
"name" : "Second Option",
12
"value" : "You selected the second option, therefore I\'m responding with this!"
13
}]]
14
$else
15
$interactionReply[$slashOption[option]]
16
$endif
17
`
18
});