1
0
Fork 0
forked from Elijah/AudioBot
AudioBot/src/commands.ts
2024-01-25 22:08:47 -05:00

21 lines
871 B
TypeScript

import { SlashCommandBuilder, APIApplicationCommandOptionChoice, SlashCommandStringOption } from "discord.js";
import IConfig from './config.js';
import { readFileSync } from "fs";
const config : IConfig = JSON.parse(readFileSync('./config.json', 'utf8'));
const Commands = [
new SlashCommandBuilder()
.setName('connect')
.setDescription('Connect the bot to the specified VM')
.addStringOption(option => {
option.setName('vm');
option.setDescription('The QEMU instance to connect to');
option.setRequired(true);
config.VMs.forEach(vm => option.addChoices({name: vm.name, value: vm.name}));
return option;
}).toJSON(),
new SlashCommandBuilder()
.setName('disconnect')
.setDescription('Leave the voice channel'),
];
export default Commands;