Autocomplete nwrplay

This commit is contained in:
Christopher Cookman 2024-06-11 22:01:15 -06:00
parent e5d9a687d4
commit 081b4ef261
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -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",
"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 () => {
try {
//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 })
} catch (error) {
console.error(error);