import { Interaction } from 'discord.js';

const helpChoices = [
	{
		name: "play",
		value: "play"
	}
];

const helpResponse = {
	content: `/help: displays this message\n/play: plays a song`,
	ephemeral: true
}

const playResponse = {
	content: `/play: Add a song or playlist to the queue and starts the music if it's not already playing
		**Parameters:**
		url: A URL or video ID of the song or playlist to play`,
	ephemeral: true
}

export const helpCommand = {
	name: "help",
	description: "Lists the bot's commands and describes how to use them",
	options: [
		{
			type: 'STRING' as const,
			name: "command",
			description: "Displays additional info about a particular command",
			choices: helpChoices,
			required: false
		},
	]
};

export async function help(interaction: Interaction) {
	if(!interaction.guildId) return;
	if(!interaction.data) return;

	if(interaction.data.options) {
		switch(interaction.data.options[0].value) {
			case "play": {
				await interaction.reply(playResponse);
				break;
			}
		}
	} else {
		await interaction.reply(helpResponse);
	}
}
