use of net.kodehawa.mantarobot.commands.music.TrackScheduler in project MantaroBot by Mantaro.
the class MusicCmds method forceskip.
@Command
public static void forceskip(CommandRegistry cr) {
cr.register("forceskip", new SimpleCommand(Category.MUSIC, CommandPermission.ADMIN) {
@Override
protected void call(GuildMessageReceivedEvent event, String content, String[] args) {
if (!event.getMember().getVoiceState().inVoiceChannel() || !event.getMember().getVoiceState().getChannel().equals(event.getGuild().getAudioManager().getConnectedChannel())) {
event.getChannel().sendMessage(EmoteReference.ERROR + "You aren't connected to the voice channel I'm in!").queue();
return;
}
TrackScheduler scheduler = MantaroBot.getInstance().getAudioManager().getMusicManager(event.getGuild()).getTrackScheduler();
event.getChannel().sendMessage(EmoteReference.CORRECT + "An admin decided to skip the current song.").queue();
scheduler.next(true);
}
@Override
public MessageEmbed help(GuildMessageReceivedEvent event) {
return helpEmbed(event, "Force skip").setDescription("Well, administrators should be able to forceskip, shouldn't they?").build();
}
});
cr.registerAlias("forceskip", "fs");
}
Aggregations