Skip and Stop Command

This commit is contained in:
GregTCLTK 2019-12-28 15:11:24 +01:00
parent 25b88c1005
commit 1eb970fca4
No known key found for this signature in database
GPG key ID: A91BADE5C070FF67
4 changed files with 39 additions and 32 deletions

View file

@ -136,14 +136,6 @@ public class AudioManager {
return getTrackManager(member.getGuild()).getTrackInfo(getPlayer(member.getGuild()).getPlayingTrack()).getAuthor().equals(member); return getTrackManager(member.getGuild()).getTrackInfo(getPlayer(member.getGuild()).getPlayingTrack()).getAuthor().equals(member);
} }
public boolean isIdle(CommandEvent event) {
if (!hasPlayer(event.getGuild()) || getPlayer(event.getGuild()).getPlayingTrack() == null) {
event.getTextChannel().sendMessage(" Idle no song lul :D").queue();
return true;
}
return false;
}
public void forceSkipTrack(CommandEvent event) { public void forceSkipTrack(CommandEvent event) {
getPlayer(event.getGuild()).stopTrack(); getPlayer(event.getGuild()).stopTrack();
event.getTextChannel().sendMessage("Skipped boyy :D").queue(); event.getTextChannel().sendMessage("Skipped boyy :D").queue();

View file

@ -2,6 +2,7 @@ package com.bbn.hadder.commands.music;
import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.Command;
import com.bbn.hadder.commands.CommandEvent; import com.bbn.hadder.commands.CommandEvent;
import com.bbn.hadder.utils.MessageEditor;
/** /**
* @author Skidder / GregTCLTK * @author Skidder / GregTCLTK
@ -11,7 +12,16 @@ public class SkipCommand implements Command {
@Override @Override
public void executed(String[] args, CommandEvent event) { public void executed(String[] args, CommandEvent event) {
event.getAudioManager().forceSkipTrack(event); if (!event.getAudioManager().hasPlayer(event.getGuild()) || event.getAudioManager().getPlayer(event.getGuild()).getPlayingTrack() == null) {
event.getAudioManager().forceSkipTrack(event);
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
"commands.music.skip.success.title",
"commands.music.skip.success.description").build()).queue();
} else {
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
"commands.music.info.error.title",
"commands.music.info.error.description").build()).queue();
}
} }
@Override @Override
@ -21,7 +31,7 @@ public class SkipCommand implements Command {
@Override @Override
public String description() { public String description() {
return "Skips the song"; return "commands.music.skip.help.description";
} }
@Override @Override

View file

@ -12,7 +12,7 @@ public class StopCommand implements Command {
@Override @Override
public void executed(String[] args, CommandEvent event) { public void executed(String[] args, CommandEvent event) {
if (event.getAudioManager().hasPlayer(event.getGuild())) { if (event.getAudioManager().hasPlayer(event.getGuild()) && event.getAudioManager().getPlayer(event.getGuild()).getPlayingTrack() == null) {
event.getAudioManager().players.remove(event.getGuild().getId()); event.getAudioManager().players.remove(event.getGuild().getId());
event.getAudioManager().getPlayer(event.getGuild()).destroy(); event.getAudioManager().getPlayer(event.getGuild()).destroy();
event.getAudioManager().getTrackManager(event.getGuild()).purgeQueue(); event.getAudioManager().getTrackManager(event.getGuild()).purgeQueue();
@ -21,7 +21,9 @@ public class StopCommand implements Command {
"commands.music.stop.success.title", "commands.music.stop.success.title",
"commands.music.stop.success.description").build()).queue(); "commands.music.stop.success.description").build()).queue();
} else { } else {
event.getTextChannel().sendMessage("I love you <3").queue(); event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
"commands.music.info.error.title",
"commands.music.info.error.description").build()).queue();
} }
} }

View file

@ -179,9 +179,9 @@ commands.moderation.editrules.help.description = Edits the rules message.
commands.music.join.success.title = Successfully connected commands.music.join.success.title = Successfully connected
commands.music.join.success.description = I successfully connected to %extra%. commands.music.join.success.description = I successfully connected to %extra%.
commands.music.join.error.connecting.already.title = Already connected commands.music.join.error.connecting.already.title = Already connected
commands.music.join.error.connecting.already.description = I am already connected to your voice channel. commands.music.join.error.connecting.already.description = I am already connected to your voice channel
commands.music.join.error.connecting.trying.title = Already trying to connect commands.music.join.error.connecting.trying.title = Already trying to connect
commands.music.join.error.connecting.trying.description = Hadder is already trying to connect. Please wait a moment. commands.music.join.error.connecting.trying.description = Hadder is already trying to connect. Please wait a moment
commands.music.join.error.channel.title = No Voice Channel commands.music.join.error.channel.title = No Voice Channel
commands.music.join.error.channel.description = You aren't in a Voice Channel. commands.music.join.error.channel.description = You aren't in a Voice Channel.
commands.music.join.help.description = Joins your voice channel commands.music.join.help.description = Joins your voice channel
@ -198,9 +198,9 @@ commands.music.play.success.author = Author
commands.music.play.success.length = Length commands.music.play.success.length = Length
commands.music.play.success.tracks = Tracks commands.music.play.success.tracks = Tracks
commands.music.play.error.load.title = %extra% Load failed %extra% commands.music.play.error.load.title = %extra% Load failed %extra%
commands.music.play.error.load.description = Unfortunately I can not load the given song. commands.music.play.error.load.description = Unfortunately I can not load the given song
commands.music.play.error.match.title = %extra% No matches %extra% commands.music.play.error.match.title = %extra% No matches %extra%
commands.music.play.error.match.description = I can not find a song named this on YouTube. commands.music.play.error.match.description = I can not find a song named this on YouTube
commands.music.play.help.description = Plays a song commands.music.play.help.description = Plays a song
commands.music.stop.success.title = Successfully stopped commands.music.stop.success.title = Successfully stopped
commands.music.stop.success.description = I successfully stopped the song. commands.music.stop.success.description = I successfully stopped the song.
@ -213,25 +213,28 @@ commands.music.queue.error.title = No queue
commands.music.queue.error.description = There are no queued songs at the moment commands.music.queue.error.description = There are no queued songs at the moment
commands.music.queue.success.title = Queue commands.music.queue.success.title = Queue
commands.music.queue.success.description = This is the queue\: \n %extra% commands.music.queue.success.description = This is the queue\: \n %extra%
commands.music.queue.help.description = Shows the music queue. commands.music.queue.help.description = Shows the music queue
commands.music.skip.success.title = Successfully skipped
commands.music.skip.success.description = I successfully skipped to the next song
commands.music.skip.help.description = Skips the currently playing song
commands.nsfw.gif.error.title = GIF not showing? Click here commands.nsfw.gif.error.title = GIF not showing? Click here
commands.nsfw.img.error.title = Image not showing? Click here commands.nsfw.img.error.title = Image not showing? Click here
commands.nsfw.anal.help.description = Shows a random anal gif. commands.nsfw.anal.help.description = Shows a random anal gif
commands.nsfw.bdsm.help.description = Shows a random BDSM picture. commands.nsfw.bdsm.help.description = Shows a random BDSM picture
commands.nsfw.blowjob.help.description = Shows a random Blowjob picture. commands.nsfw.blowjob.help.description = Shows a random Blowjob picture
commands.nsfw.boobs.help.description = Shows a random boob gif. commands.nsfw.boobs.help.description = Shows a random boob gif
commands.nsfw.cum.help.description = Shows a random cum gif. commands.nsfw.cum.help.description = Shows a random cum gif
commands.nsfw.erotic.help.description = Shows a random erotic picture. commands.nsfw.erotic.help.description = Shows a random erotic picture
commands.nsfw.feet.help.description = Shows a random feet gif. commands.nsfw.feet.help.description = Shows a random feet gif
commands.nsfw.fingering.help.description = Shows a random fingering gif. commands.nsfw.fingering.help.description = Shows a random fingering gif
commands.nsfw.linking.help.description = Shows a random licking gif. commands.nsfw.linking.help.description = Shows a random licking gif
commands.nsfw.porn.help.description = Shows a random porn gif. commands.nsfw.porn.help.description = Shows a random porn gif
commands.nsfw.pussy.help.description = Shows a random pussy gif. commands.nsfw.pussy.help.description = Shows a random pussy gif
commands.nsfw.randomporn.help.description = Shows a completely random porn gif. commands.nsfw.randomporn.help.description = Shows a completely random porn gif
commands.nsfw.solo.help.description = Shows a random solo gif. commands.nsfw.solo.help.description = Shows a random solo gif
commands.nsfw.spank.help.description = Shows a random spank gif. commands.nsfw.spank.help.description = Shows a random spank gif
commands.nsfw.trans.help.description = Shows a random trans picture. commands.nsfw.trans.help.description = Shows a random trans picture
commands.owner.eval.success.title = Eval Command commands.owner.eval.success.title = Eval Command
commands.owner.eval.success.input = Input commands.owner.eval.success.input = Input