Skip to content

$autoCompleteRespond

$autoCompleteRespond is used to auto-complete slash options.

Usage

$autoCompleteRespond[object]
$autoCompleteRespond[OptionName;OptionReply;...]

Parameters

FieldTypeDescriptionRequired
OptionNamestringName of the auto-complete option that will be displayed to the user.true
OptionReplystringThe reply that will be sent if the auto-complete option was selected, (not visible to the user).true

Example(s)

Create the slash-commands: (please note that you require the events: ["onMessage", "onInteractionCreate"] event in your main file)

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
`
12
});

Interaction Command:

1
client.command({
2
name: "test",
3
prototype: "slash",
4
code: `
5
$if[$isAutocomplete==true]
6
$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!]
7
$else
8
$interactionReply[$slashOption[option]]
9
$endif
10
`
11
});

Advanced Example

Create the slash-commands: (please note that you require the events: ["onMessage", "onInteractionCreate"] event in your main file)

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
"name": "anotheroption",
12
"description": "test",
13
"required": false,
14
"type": 3
15
}]
16
`
17
});

Interaction Command:

1
client.command({
2
name: "test",
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
});