/* * Copyright (C) 2022 jimj316 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package moe.nekojimi.chords.commands; import java.util.Map; import java.util.Map.Entry; import moe.nekojimi.chords.Chords; public class HelpCommand extends Command { public HelpCommand(Chords bot) { super(bot, "help"); } @Override public void call(Invocation invocation) { String help = "Commands available:\n" + "!join - Joins a voice channel\n" + "!leave - Leaves the current voice channel\n" + "!play - Downloads the track at that URL and adds it to the queue.\n" + "!play - Searches for a track and displays a selection menu.\n" + "!queue - Show the tracks currently playing and the current queue.\n" + "!remove - Remove the track at position from the queue.\n" + "!skip - Skip the current track and play the next one.\n" + "!restart - Try playing the current track again in case it goes wrong.\n"; final Map commands = bot.getCommands(); for (Entry e : commands.entrySet()) { help += "!" + e.getKey() + " ".repeat(10 - e.getKey().length()) + "- " + e.getValue().synopsis(); } invocation.respond(help); } }