Autocomplete nwrplay
This commit is contained in:
parent
e5d9a687d4
commit
081b4ef261
36
index.js
36
index.js
|
@ -643,19 +643,6 @@ discord.on('ready', async () => {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "nwrplay",
|
|
||||||
"description": "Nwr stream",
|
|
||||||
"type": 1,
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"name": "callsign",
|
|
||||||
"description": "The URL of the stream to play",
|
|
||||||
"type": 3,
|
|
||||||
"required": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "pause",
|
"name": "pause",
|
||||||
"description": "Pause/Unpause the current stream",
|
"description": "Pause/Unpause the current stream",
|
||||||
|
@ -674,10 +661,33 @@ discord.on('ready', async () => {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
nwrplayCommand = {
|
||||||
|
"name": "nwrplay",
|
||||||
|
"description": "Nwr stream",
|
||||||
|
"type": 1,
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"name": "callsign",
|
||||||
|
"description": "The URL of the stream to play",
|
||||||
|
"type": 3,
|
||||||
|
"required": true,
|
||||||
|
"choices": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
for (const key in nwrstreams.callsigns) {
|
||||||
|
nwrplayCommand.options[0].choices.push({
|
||||||
|
"name": key,
|
||||||
|
"value": key
|
||||||
|
});
|
||||||
|
}
|
||||||
|
commands.push(nwrplayCommand);
|
||||||
}
|
}
|
||||||
await (async () => {
|
await (async () => {
|
||||||
try {
|
try {
|
||||||
//Global
|
//Global
|
||||||
|
if(config.debug >= 1) console.log(`${colors.magenta("[DEBUG]")} Registering global commands: ${JSON.stringify(commands, null, 2)}`);
|
||||||
await rest.put(Routes.applicationCommands(discord.user.id), { body: commands })
|
await rest.put(Routes.applicationCommands(discord.user.id), { body: commands })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
Loading…
Reference in a new issue