mirror of
https://github.com/JonasunderscoreJones/ZtereoMUSIC.git
synced 2025-10-25 13:39:19 +02:00
parent
333b8b9715
commit
aee6735e39
7 changed files with 86 additions and 16 deletions
|
|
@ -1,9 +1,10 @@
|
|||
package codes.ztereohype.ztereomusic.command;
|
||||
|
||||
import codes.ztereohype.ztereomusic.command.permissions.VoiceChecks;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Getter @Builder
|
||||
public class CommandMeta {
|
||||
private final String name;
|
||||
private final String description;
|
||||
|
|
@ -11,13 +12,4 @@ public class CommandMeta {
|
|||
private final boolean isNsfw;
|
||||
private final boolean isHidden;
|
||||
private final VoiceChecks[] checks;
|
||||
|
||||
public CommandMeta(String name, String description, String[] aliases, boolean isNsfw, boolean isHidden, VoiceChecks[] checks) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.aliases = aliases;
|
||||
this.isNsfw = isNsfw;
|
||||
this.isHidden = isHidden;
|
||||
this.checks = checks;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,20 @@ import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
|||
import net.dv8tion.jda.api.managers.AudioManager;
|
||||
|
||||
public class Disconnect implements Command {
|
||||
CommandMeta meta = new CommandMeta("disconnect", "A command to kick the bot from the vc.", new String[]{"fuckoff", "bye"}, false, false, new VoiceChecks[]{ VoiceChecks.BOT_CONNECTED, VoiceChecks.USER_CONNECTED, VoiceChecks.SAME_VC_IF_CONNECTED });
|
||||
private final CommandMeta meta;
|
||||
|
||||
public Disconnect() {
|
||||
this.meta = CommandMeta.builder()
|
||||
.name("disconnect")
|
||||
.description("A command to kick the bot from the vc.")
|
||||
.aliases(new String[] { "fuckoff", "bye" })
|
||||
.isNsfw(false)
|
||||
.isHidden(false)
|
||||
.checks(new VoiceChecks[] { VoiceChecks.BOT_CONNECTED,
|
||||
VoiceChecks.USER_CONNECTED,
|
||||
VoiceChecks.SAME_VC_IF_CONNECTED })
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandMeta getMeta() {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,21 @@ import net.dv8tion.jda.api.entities.Guild;
|
|||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
public class Pause implements Command {
|
||||
CommandMeta meta = new CommandMeta("pause", "Pause the playing music", new String[]{"resume"}, false, false, new VoiceChecks[]{ VoiceChecks.BOT_CONNECTED, VoiceChecks.BOT_PLAYING, VoiceChecks.USER_CONNECTED, VoiceChecks.SAME_VC_IF_CONNECTED });
|
||||
private final CommandMeta meta;
|
||||
|
||||
public Pause() {
|
||||
this.meta = CommandMeta.builder()
|
||||
.name("pause")
|
||||
.description("Pause the playing music")
|
||||
.aliases(new String[] { "resume" })
|
||||
.isNsfw(false)
|
||||
.isHidden(false)
|
||||
.checks(new VoiceChecks[] { VoiceChecks.BOT_CONNECTED,
|
||||
VoiceChecks.BOT_PLAYING,
|
||||
VoiceChecks.USER_CONNECTED,
|
||||
VoiceChecks.SAME_VC_IF_CONNECTED })
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandMeta getMeta() {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,18 @@ import codes.ztereohype.ztereomusic.command.permissions.VoiceChecks;
|
|||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
public class Ping implements Command {
|
||||
CommandMeta meta = new CommandMeta("ping", "A command to get pinged", new String[]{"pong", "pog"}, false, false, new VoiceChecks[]{});
|
||||
private final CommandMeta meta;
|
||||
|
||||
public Ping() {
|
||||
this.meta = CommandMeta.builder()
|
||||
.name("ping")
|
||||
.description("A command to get pinged")
|
||||
.aliases(new String[] { "pong", "pog" })
|
||||
.isNsfw(false)
|
||||
.isHidden(false)
|
||||
.checks(new VoiceChecks[0])
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandMeta getMeta() {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,20 @@ import java.util.regex.Pattern;
|
|||
|
||||
public class Play implements Command {
|
||||
private static final Pattern URL_PATTERN = Pattern.compile("^(http|https)://([a-z]+\\.[a-z]+)+/\\S+$", Pattern.CASE_INSENSITIVE);
|
||||
CommandMeta meta = new CommandMeta("play", "Play music!", new String[]{"p"}, false, false, new VoiceChecks[]{ VoiceChecks.USER_CONNECTED, VoiceChecks.SAME_VC_IF_CONNECTED });
|
||||
|
||||
private final CommandMeta meta;
|
||||
|
||||
public Play() {
|
||||
this.meta = CommandMeta.builder()
|
||||
.name("play")
|
||||
.description("Play music!")
|
||||
.aliases(new String[] { "p" })
|
||||
.isNsfw(false)
|
||||
.isHidden(false)
|
||||
.checks(new VoiceChecks[] { VoiceChecks.USER_CONNECTED,
|
||||
VoiceChecks.SAME_VC_IF_CONNECTED })
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandMeta getMeta() {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,20 @@ import java.util.List;
|
|||
import java.util.Objects;
|
||||
|
||||
public class Queue implements Command {
|
||||
CommandMeta meta = new CommandMeta("queue", "See the queue", new String[]{"q"}, false, false, new VoiceChecks[]{ VoiceChecks.BOT_CONNECTED, VoiceChecks.USER_CONNECTED, VoiceChecks.SAME_VC_IF_CONNECTED });
|
||||
private final CommandMeta meta;
|
||||
|
||||
public Queue() {
|
||||
this.meta = CommandMeta.builder()
|
||||
.name("queue")
|
||||
.description("See the queue")
|
||||
.aliases(new String[] { "q" })
|
||||
.isNsfw(false)
|
||||
.isHidden(false)
|
||||
.checks(new VoiceChecks[] { VoiceChecks.BOT_CONNECTED,
|
||||
VoiceChecks.USER_CONNECTED,
|
||||
VoiceChecks.SAME_VC_IF_CONNECTED })
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandMeta getMeta() {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,21 @@ import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
|||
import net.dv8tion.jda.api.managers.AudioManager;
|
||||
|
||||
public class Skip implements Command {
|
||||
CommandMeta meta = new CommandMeta("skip", "Skip the current track!", new String[]{"next"}, false, false, new VoiceChecks[]{ VoiceChecks.BOT_CONNECTED, VoiceChecks.BOT_PLAYING, VoiceChecks.USER_CONNECTED, VoiceChecks.SAME_VC_IF_CONNECTED });
|
||||
private final CommandMeta meta;
|
||||
|
||||
public Skip() {
|
||||
this.meta = CommandMeta.builder()
|
||||
.name("skip")
|
||||
.description("Skip the current track!")
|
||||
.aliases(new String[] { "next" })
|
||||
.isNsfw(false)
|
||||
.isHidden(false)
|
||||
.checks(new VoiceChecks[] { VoiceChecks.BOT_CONNECTED,
|
||||
VoiceChecks.BOT_PLAYING,
|
||||
VoiceChecks.USER_CONNECTED,
|
||||
VoiceChecks.SAME_VC_IF_CONNECTED })
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandMeta getMeta() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue