Adjusted error messages and their deletion delays.
This commit is contained in:
@@ -58,26 +58,26 @@ public final class TrackLoadHandler implements AudioLoadResultHandler {
|
|||||||
|
|
||||||
final AudioTrackInfo info = track.getInfo();
|
final AudioTrackInfo info = track.getInfo();
|
||||||
if (info.isStream) {
|
if (info.isStream) {
|
||||||
response = new CommandResponse("no_entry_sign",
|
response = new CommandResponse("x",
|
||||||
"Sorry " + this.requester.getAsMention() + ", but streams cannot be added to the queue.")
|
"Sorry " + this.requester.getAsMention() + ", but streams cannot be added to the queue.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
response.sendResponse(this.channel);
|
response.sendResponse(this.channel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(info.length >= 60000 && info.length <= 900000) && !PermissionManager.isWhitelisted(this.requester)) {
|
if (!(info.length >= 60000 && info.length <= 900000) && !PermissionManager.isWhitelisted(this.requester)) {
|
||||||
response = new CommandResponse("no_entry_sign",
|
response = new CommandResponse("x",
|
||||||
"Sorry " + this.requester.getAsMention()
|
"Sorry " + this.requester.getAsMention()
|
||||||
+ ", but you can only add tracks between 1 and 15 minutes in length.").setDeletionDelay(10,
|
+ ", but you can only add tracks between 1 and 15 minutes in length to the queue.")
|
||||||
TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
response.sendResponse(this.channel);
|
response.sendResponse(this.channel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scheduler.isQueued(track)) {
|
if (scheduler.isQueued(track)) {
|
||||||
response = new CommandResponse("no_entry_sign",
|
response = new CommandResponse("x",
|
||||||
"Sorry " + this.requester.getAsMention() + ", but that track is already queued.")
|
"Sorry " + this.requester.getAsMention() + ", but that track is already in the queue.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
response.sendResponse(this.channel);
|
response.sendResponse(this.channel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -109,18 +109,18 @@ public final class TrackLoadHandler implements AudioLoadResultHandler {
|
|||||||
|
|
||||||
if (track != null) {
|
if (track != null) {
|
||||||
if (scheduler.isQueued(track)) {
|
if (scheduler.isQueued(track)) {
|
||||||
response = new CommandResponse("no_entry_sign",
|
response = new CommandResponse("x",
|
||||||
"Sorry " + this.requester.getAsMention() + ", but that track is already queued.")
|
"Sorry " + this.requester.getAsMention() + ", but that track is already in the queue.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
response.sendResponse(this.channel);
|
response.sendResponse(this.channel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final AudioTrackInfo info = track.getInfo();
|
final AudioTrackInfo info = track.getInfo();
|
||||||
if (info.isStream) {
|
if (info.isStream) {
|
||||||
response = new CommandResponse("no_entry_sign",
|
response = new CommandResponse("x",
|
||||||
"Sorry " + this.requester.getAsMention() + ", but streams cannot be added to the queue.")
|
"Sorry " + this.requester.getAsMention() + ", but streams cannot be added to the queue.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
response.sendResponse(this.channel);
|
response.sendResponse(this.channel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -133,9 +133,10 @@ public final class TrackLoadHandler implements AudioLoadResultHandler {
|
|||||||
response.attachEmbed(TrackUtil.trackInfoEmbed(requestedTrack));
|
response.attachEmbed(TrackUtil.trackInfoEmbed(requestedTrack));
|
||||||
response.sendResponse(this.channel);
|
response.sendResponse(this.channel);
|
||||||
} else {
|
} else {
|
||||||
response = new CommandResponse("no_entry_sign", "Sorry " + this.requester.getAsMention()
|
response = new CommandResponse("x",
|
||||||
+ ", but you are not allowed to add tracks less than 1 minute or greater than 15 minutes in length.")
|
"Sorry " + this.requester.getAsMention()
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
+ ", but you can only request tracks between 1 and 15 minutes in length.")
|
||||||
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
response.sendResponse(this.channel);
|
response.sendResponse(this.channel);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -154,21 +155,21 @@ public final class TrackLoadHandler implements AudioLoadResultHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (addedTracks.size() == 0) {
|
if (addedTracks.size() == 0) {
|
||||||
response = new CommandResponse("no_entry_sign",
|
response = new CommandResponse("x",
|
||||||
"Sorry " + this.requester.getAsMention()
|
"Sorry " + this.requester.getAsMention()
|
||||||
+ ", but none of the tracks in that playlist could be added.").setDeletionDelay(10,
|
+ ", but none of the tracks in that playlist could be added to the queue.")
|
||||||
TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
response.sendResponse(this.channel);
|
response.sendResponse(this.channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
response = new CommandResponse("notes",
|
response = new CommandResponse("notes",
|
||||||
this.requester.getAsMention() + " added the following tracks to the queue:");
|
this.requester.getAsMention() + " added the following tracks from a playlist to the queue:");
|
||||||
response.attachEmbed(TrackUtil.trackListInfoEmbed(addedTracks, false));
|
response.attachEmbed(TrackUtil.trackListInfoEmbed(addedTracks, false));
|
||||||
response.sendResponse(this.channel);
|
response.sendResponse(this.channel);
|
||||||
} else {
|
} else {
|
||||||
response = new CommandResponse("no_entry_sign",
|
response = new CommandResponse("x",
|
||||||
"Sorry " + this.requester.getAsMention()
|
"Sorry " + this.requester.getAsMention()
|
||||||
+ ", but you are not allowed to add playlists to the queue.").setDeletionDelay(10,
|
+ ", but you are not allowed to add playlists to the queue.").setDeletionDelay(30,
|
||||||
TimeUnit.SECONDS);
|
TimeUnit.SECONDS);
|
||||||
response.sendResponse(this.channel);
|
response.sendResponse(this.channel);
|
||||||
}
|
}
|
||||||
@@ -177,9 +178,9 @@ public final class TrackLoadHandler implements AudioLoadResultHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void noMatches() {
|
public final void noMatches() {
|
||||||
final CommandResponse response = new CommandResponse("map",
|
final CommandResponse response = new CommandResponse("x",
|
||||||
"Sorry " + this.requester.getAsMention() + ", but I was not able to find that track.")
|
"Sorry " + this.requester.getAsMention() + ", but I was not able to find that track.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
response.sendResponse(this.channel);
|
response.sendResponse(this.channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,12 +191,12 @@ public final class TrackLoadHandler implements AudioLoadResultHandler {
|
|||||||
final CommandResponse response;
|
final CommandResponse response;
|
||||||
final String message = exception.getMessage();
|
final String message = exception.getMessage();
|
||||||
if (message.equals("Unknown file format.")) {
|
if (message.equals("Unknown file format.")) {
|
||||||
response = new CommandResponse("question",
|
response = new CommandResponse("x",
|
||||||
"Sorry " + this.requester.getAsMention() + ", but I do not recognize the format of that track.")
|
"Sorry " + this.requester.getAsMention() + ", but I do not recognize the format of that track.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
} else if (message.equals("The playlist is private.")) {
|
} else if (message.equals("The playlist is private.")) {
|
||||||
response = new CommandResponse("no_entry_sign",
|
response = new CommandResponse("x",
|
||||||
"Sorry " + this.requester.getAsMention() + ", but that playlist is private.").setDeletionDelay(10,
|
"Sorry " + this.requester.getAsMention() + ", but that playlist is private.").setDeletionDelay(30,
|
||||||
TimeUnit.SECONDS);
|
TimeUnit.SECONDS);
|
||||||
} else {
|
} else {
|
||||||
final Guild guild = this.channel.getGuild();
|
final Guild guild = this.channel.getGuild();
|
||||||
@@ -203,7 +204,7 @@ public final class TrackLoadHandler implements AudioLoadResultHandler {
|
|||||||
+ ") while trying to load a track!", exception);
|
+ ") while trying to load a track!", exception);
|
||||||
response = new CommandResponse("sos",
|
response = new CommandResponse("sos",
|
||||||
"Sorry " + this.requester.getAsMention()
|
"Sorry " + this.requester.getAsMention()
|
||||||
+ ", but an error occurred while trying to get that track!").setDeletionDelay(10,
|
+ ", but an error occurred while trying to get that track!").setDeletionDelay(30,
|
||||||
TimeUnit.SECONDS);
|
TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
response.sendResponse(this.channel);
|
response.sendResponse(this.channel);
|
||||||
|
|||||||
@@ -70,9 +70,9 @@ public final class Settings implements Command {
|
|||||||
} else {
|
} else {
|
||||||
final char[] input = arguments[1].replaceAll("\n", "").toCharArray();
|
final char[] input = arguments[1].replaceAll("\n", "").toCharArray();
|
||||||
if (input.length > 1) {
|
if (input.length > 1) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention()
|
"Sorry " + executor.getAsMention()
|
||||||
+ ", but the command character must be a single character.").setDeletionDelay(10,
|
+ ", but the command character must be a single character.").setDeletionDelay(30,
|
||||||
TimeUnit.SECONDS);
|
TimeUnit.SECONDS);
|
||||||
} else if (input.length == 0) {
|
} else if (input.length == 0) {
|
||||||
DataManager.deleteGuildKey(guild, "commandCharacter");
|
DataManager.deleteGuildKey(guild, "commandCharacter");
|
||||||
@@ -97,9 +97,9 @@ public final class Settings implements Command {
|
|||||||
try {
|
try {
|
||||||
volume = Integer.parseInt(arguments[1]);
|
volume = Integer.parseInt(arguments[1]);
|
||||||
} catch (final NumberFormatException exception) {
|
} catch (final NumberFormatException exception) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but the default volume must be an integer.")
|
"Sorry " + executor.getAsMention() + ", but the default volume must be an integer.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (volume == 10) {
|
if (volume == 10) {
|
||||||
@@ -116,9 +116,9 @@ public final class Settings implements Command {
|
|||||||
return new CommandResponse("white_check_mark",
|
return new CommandResponse("white_check_mark",
|
||||||
executor.getAsMention() + ", the default volume has been set to `" + volume + "%`.");
|
executor.getAsMention() + ", the default volume has been set to `" + volume + "%`.");
|
||||||
} else {
|
} else {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention()
|
"Sorry " + executor.getAsMention()
|
||||||
+ ", but the default volume must be between 1% and 150%.").setDeletionDelay(10,
|
+ ", but the default volume must be between 1% and 150%.").setDeletionDelay(30,
|
||||||
TimeUnit.SECONDS);
|
TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -127,10 +127,10 @@ public final class Settings implements Command {
|
|||||||
try {
|
try {
|
||||||
maxSlots = Integer.parseInt(arguments[1]);
|
maxSlots = Integer.parseInt(arguments[1]);
|
||||||
} catch (final NumberFormatException exception) {
|
} catch (final NumberFormatException exception) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention()
|
"Sorry " + executor.getAsMention()
|
||||||
+ ", but the maximum amount of queue slots per user must be an integer.")
|
+ ", but the maximum amount of queue slots per user must be an integer.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxSlots == 0) {
|
if (maxSlots == 0) {
|
||||||
@@ -144,15 +144,14 @@ public final class Settings implements Command {
|
|||||||
return new CommandResponse("white_check_mark", executor.getAsMention()
|
return new CommandResponse("white_check_mark", executor.getAsMention()
|
||||||
+ ", the maximum amount of queue slots per user has been set to `" + maxSlots + "`.");
|
+ ", the maximum amount of queue slots per user has been set to `" + maxSlots + "`.");
|
||||||
} else {
|
} else {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention()
|
"Sorry " + executor.getAsMention()
|
||||||
+ ", but the maximum amount of queue slots per user must be between 1 and 249.")
|
+ ", but the maximum amount of queue slots per user must be between 1 and 249.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x", "Sorry " + executor.getAsMention() + ", but that setting is unknown.")
|
||||||
"Sorry " + executor.getAsMention() + ", but I do not know what that setting is.")
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,44 +29,43 @@ public final class Whitelist implements Command {
|
|||||||
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
||||||
final Guild guild = channel.getGuild();
|
final Guild guild = channel.getGuild();
|
||||||
if (!executor.hasPermission(Permission.ADMINISTRATOR)) {
|
if (!executor.hasPermission(Permission.ADMINISTRATOR)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but you are not allowed to use this command.")
|
"Sorry " + executor.getAsMention() + ", but you are not allowed to use this command.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.length == 0) {
|
if (arguments.length == 0) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention()
|
"Sorry " + executor.getAsMention()
|
||||||
+ ", but you need to specify a user to add or remove from the whitelist.")
|
+ ", but you need to specify a user to add or remove from the whitelist.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
final String userID = arguments[0].replaceFirst("<@[!]?([0-9]*)>", "$1");
|
final String userID = arguments[0].replaceFirst("<@[!]?([0-9]*)>", "$1");
|
||||||
final Member member;
|
final Member member;
|
||||||
try {
|
try {
|
||||||
member = guild.getMemberById(userID);
|
member = guild.getMemberById(userID);
|
||||||
} catch (final Throwable exception) {
|
} catch (final NumberFormatException exception) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but that doesn't appear to be a valid user.")
|
"Sorry " + executor.getAsMention() + ", but that doesn't appear to be a valid user.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (member == null) {
|
if (member == null) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but that doesn't appear to be a valid user.")
|
"Sorry " + executor.getAsMention() + ", but that doesn't appear to be a valid user.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (member.hasPermission(Permission.ADMINISTRATOR)) {
|
if (member.hasPermission(Permission.ADMINISTRATOR)) {
|
||||||
return new CommandResponse("no_entry_sign", "Sorry " + executor.getAsMention()
|
return new CommandResponse("x", "Sorry " + executor.getAsMention()
|
||||||
+ ", but you cannot remove that user from the whitelist due to them being a guild administrator.")
|
+ ", but you cannot remove that user from the whitelist because they are a guild administrator.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (member.getUser().isBot()) {
|
if (member.getUser().isBot()) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x", "Sorry " + executor.getAsMention() + ", but you cannot whitelist bots.")
|
||||||
"Sorry " + executor.getAsMention() + ", but you cannot whitelist bots.").setDeletionDelay(10,
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
TimeUnit.SECONDS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PermissionManager.isWhitelisted(member)) {
|
if (PermissionManager.isWhitelisted(member)) {
|
||||||
|
|||||||
@@ -31,17 +31,16 @@ public final class ForceSkip implements Command {
|
|||||||
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
||||||
final Guild guild = channel.getGuild();
|
final Guild guild = channel.getGuild();
|
||||||
if (!AudioUtil.isTrackLoaded(guild)) {
|
if (!AudioUtil.isTrackLoaded(guild)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention()
|
"Sorry " + executor.getAsMention()
|
||||||
+ ", but there must be a track playing in order to force skip it.").setDeletionDelay(10,
|
+ ", but there must be a track playing in order to force skip it.").setDeletionDelay(30,
|
||||||
TimeUnit.SECONDS);
|
TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
if (!VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x", "Sorry " + executor.getAsMention() + ", but you must be in voice channel `"
|
||||||
"Sorry " + executor.getAsMention() + ", but you must be in voice channel `"
|
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName() + "` in order to force skip tracks.")
|
||||||
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName()
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
+ "` in order to force skip tracks.").setDeletionDelay(10, TimeUnit.SECONDS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final RequestedTrack skippedTrack = AudioUtil.getLoadedTrack(guild);
|
final RequestedTrack skippedTrack = AudioUtil.getLoadedTrack(guild);
|
||||||
|
|||||||
@@ -30,17 +30,16 @@ public final class Lock implements Command {
|
|||||||
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
||||||
final Guild guild = channel.getGuild();
|
final Guild guild = channel.getGuild();
|
||||||
if (!AudioUtil.isTrackLoaded(guild)) {
|
if (!AudioUtil.isTrackLoaded(guild)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention()
|
"Sorry " + executor.getAsMention()
|
||||||
+ ", but there must be a track playing in order to lock or unlock the queue.")
|
+ ", but there must be a track playing in order to lock or unlock the queue.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
if (!VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x", "Sorry " + executor.getAsMention() + ", but you must be in voice channel `"
|
||||||
"Sorry " + executor.getAsMention() + ", but you must be in voice channel `"
|
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName() + "` in order to lock or unlock the queue.")
|
||||||
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName()
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
+ "` in order to lock or unlock the queue.").setDeletionDelay(10, TimeUnit.SECONDS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final TrackScheduler scheduler = AudioUtil.getTrackScheduler(guild);
|
final TrackScheduler scheduler = AudioUtil.getTrackScheduler(guild);
|
||||||
|
|||||||
@@ -29,17 +29,17 @@ public final class Pause implements Command {
|
|||||||
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
||||||
final Guild guild = channel.getGuild();
|
final Guild guild = channel.getGuild();
|
||||||
if (!AudioUtil.isTrackLoaded(guild)) {
|
if (!AudioUtil.isTrackLoaded(guild)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention()
|
"Sorry " + executor.getAsMention()
|
||||||
+ ", but there must be a track playing in order to pause or resume the track player.")
|
+ ", but there must be a track playing in order to pause or resume the track player.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
if (!VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but you must be in voice channel `"
|
"Sorry " + executor.getAsMention() + ", but you must be in voice channel `"
|
||||||
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName()
|
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName()
|
||||||
+ "` in order to pause or resume the track player.").setDeletionDelay(10, TimeUnit.SECONDS);
|
+ "` in order to pause or resume the track player.").setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AudioUtil.isPlayerPaused(guild)) {
|
if (AudioUtil.isPlayerPaused(guild)) {
|
||||||
|
|||||||
@@ -36,54 +36,53 @@ public final class Play implements Command {
|
|||||||
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
||||||
final Guild guild = channel.getGuild();
|
final Guild guild = channel.getGuild();
|
||||||
if (AudioUtil.isTrackLoaded(guild) && !VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
if (AudioUtil.isTrackLoaded(guild) && !VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but you need to be in voice channel `"
|
"Sorry " + executor.getAsMention() + ", but you need to be in voice channel `"
|
||||||
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName()
|
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName()
|
||||||
+ "` in order to add songs to the queue.").setDeletionDelay(10, TimeUnit.SECONDS);
|
+ "` in order to add songs to the queue.").setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
final VoiceChannel targetChannel = VoiceChannelUtil.getVoiceChannelMemberIsConnectedTo(executor);
|
final VoiceChannel targetChannel = VoiceChannelUtil.getVoiceChannelMemberIsConnectedTo(executor);
|
||||||
if (targetChannel == null) {
|
if (targetChannel == null) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention()
|
"Sorry " + executor.getAsMention()
|
||||||
+ ", but you need to be in a voice channel in order to add songs to the queue.")
|
+ ", but you need to be in a voice channel in order to add songs to the queue.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
final Member selfMember = guild.getSelfMember();
|
final Member selfMember = guild.getSelfMember();
|
||||||
if (!selfMember.hasPermission(targetChannel, Permission.VOICE_CONNECT)
|
if (!selfMember.hasPermission(targetChannel, Permission.VOICE_CONNECT)
|
||||||
|| !selfMember.hasPermission(targetChannel, Permission.VOICE_SPEAK)) {
|
|| !selfMember.hasPermission(targetChannel, Permission.VOICE_SPEAK)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention()
|
"Sorry " + executor.getAsMention()
|
||||||
+ ", but I do not have the required permissions to use your current voice channel.")
|
+ ", but I do not have the required permissions to use your current voice channel.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.length == 0) {
|
if (arguments.length == 0) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention()
|
"Sorry " + executor.getAsMention()
|
||||||
+ ", but you need to provide a search query or a link to a specific track or playlist.")
|
+ ", but you need to provide a search query or a link to a specific track or playlist.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
final TrackScheduler scheduler = AudioUtil.getTrackScheduler(guild);
|
final TrackScheduler scheduler = AudioUtil.getTrackScheduler(guild);
|
||||||
if (scheduler.isQueueLocked() && !PermissionManager.isWhitelisted(executor)) {
|
if (scheduler.isQueueLocked() && !PermissionManager.isWhitelisted(executor)) {
|
||||||
return new CommandResponse("lock", "Sorry " + executor.getAsMention() + ", but the queue is locked.")
|
return new CommandResponse("x", "Sorry " + executor.getAsMention() + ", but the queue is locked.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scheduler.isQueueFull()) {
|
if (scheduler.isQueueFull()) {
|
||||||
return new CommandResponse("card_box", "Sorry " + executor.getAsMention() + ", but the queue is full.")
|
return new CommandResponse("x", "Sorry " + executor.getAsMention() + ", but the queue is full.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final int maxSlots = Integer.parseInt(DataManager.getGuildValue(guild, "maximumSlots"));
|
final int maxSlots = Integer.parseInt(DataManager.getGuildValue(guild, "maximumSlots"));
|
||||||
|
|
||||||
if ((scheduler.occupiedSlotCount(executor) >= maxSlots) && !PermissionManager.isWhitelisted(executor)) {
|
if ((scheduler.occupiedSlotCount(executor) >= maxSlots) && !PermissionManager.isWhitelisted(executor)) {
|
||||||
return new CommandResponse("no_entry_sign", "Sorry " + executor.getAsMention()
|
return new CommandResponse("x", "Sorry " + executor.getAsMention() + ", you cannot request more than "
|
||||||
+ ", you cannot request more than " + maxSlots + " tracks at the same time.")
|
+ maxSlots + " tracks at the same time.").setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
|
||||||
}
|
}
|
||||||
} catch (final NumberFormatException exception) {
|
} catch (final NumberFormatException exception) {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ public final class Queue implements Command {
|
|||||||
try {
|
try {
|
||||||
page = Integer.parseInt(arguments[0]);
|
page = Integer.parseInt(arguments[0]);
|
||||||
} catch (final NumberFormatException exception) {
|
} catch (final NumberFormatException exception) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but the page number must be an integer.")
|
"Sorry " + executor.getAsMention() + ", but the page number must be an integer.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ public final class Queue implements Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
response.setReactionCallbackTarget(executor);
|
response.setReactionCallbackTarget(executor);
|
||||||
response.setReactionCallbackExpireDelay(15, TimeUnit.SECONDS);
|
response.setReactionCallbackExpireDelay(1, TimeUnit.MINUTES);
|
||||||
response.attachEmbed(TrackUtil.pagedTrackListInfoEmbed(queue, page));
|
response.attachEmbed(TrackUtil.pagedTrackListInfoEmbed(queue, page));
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,24 +36,24 @@ public final class Remove implements Command {
|
|||||||
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
||||||
final TrackScheduler scheduler = AudioUtil.getTrackScheduler(channel.getGuild());
|
final TrackScheduler scheduler = AudioUtil.getTrackScheduler(channel.getGuild());
|
||||||
if (scheduler.isQueueEmpty()) {
|
if (scheduler.isQueueEmpty()) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but there are no tracks in the queue.").setDeletionDelay(10,
|
"Sorry " + executor.getAsMention() + ", but there are no tracks in the queue to remove.")
|
||||||
TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
final Guild guild = channel.getGuild();
|
final Guild guild = channel.getGuild();
|
||||||
if (AudioUtil.isTrackLoaded(guild) && !VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
if (AudioUtil.isTrackLoaded(guild) && !VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but you need to be in voice channel `"
|
"Sorry " + executor.getAsMention() + ", but you need to be in voice channel `"
|
||||||
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName()
|
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName()
|
||||||
+ "` in order to remove tracks from the queue.").setDeletionDelay(10, TimeUnit.SECONDS);
|
+ "` in order to remove tracks from the queue.").setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.length == 0) {
|
if (arguments.length == 0) {
|
||||||
if (!guild.getSelfMember().hasPermission(channel, Permission.MESSAGE_ADD_REACTION)) {
|
if (!guild.getSelfMember().hasPermission(channel, Permission.MESSAGE_ADD_REACTION)) {
|
||||||
return new CommandResponse("no_entry_sign", "Sorry " + executor.getAsMention()
|
return new CommandResponse("x", "Sorry " + executor.getAsMention()
|
||||||
+ ", but I do not have the required permissions to create a reaction selection dialog in this text channel.")
|
+ ", but I do not have the required permissions to create a reaction selection dialog in this text channel.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
final CommandResponse response = new CommandResponse("question",
|
final CommandResponse response = new CommandResponse("question",
|
||||||
@@ -74,7 +74,7 @@ public final class Remove implements Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
response.setReactionCallbackTarget(executor);
|
response.setReactionCallbackTarget(executor);
|
||||||
response.setDeletionDelay(30, TimeUnit.SECONDS);
|
response.setDeletionDelay(1, TimeUnit.MINUTES);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,9 +82,8 @@ public final class Remove implements Command {
|
|||||||
try {
|
try {
|
||||||
index = Integer.parseInt(arguments[0]);
|
index = Integer.parseInt(arguments[0]);
|
||||||
} catch (final NumberFormatException exception) {
|
} catch (final NumberFormatException exception) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x", "Sorry " + executor.getAsMention() + ", but the index must be an integer.")
|
||||||
"Sorry " + executor.getAsMention() + ", but the index must be an integer.").setDeletionDelay(10,
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
TimeUnit.SECONDS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -96,9 +95,9 @@ public final class Remove implements Command {
|
|||||||
response.attachEmbed(TrackUtil.trackInfoEmbed(removedTrack));
|
response.attachEmbed(TrackUtil.trackInfoEmbed(removedTrack));
|
||||||
return response;
|
return response;
|
||||||
} catch (final IndexOutOfBoundsException exception) {
|
} catch (final IndexOutOfBoundsException exception) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but that index is outside the bounds of the queue.")
|
"Sorry " + executor.getAsMention() + ", but that index is outside the bounds of the queue.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,10 +29,10 @@ public final class Reset implements Command {
|
|||||||
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
||||||
final Guild guild = channel.getGuild();
|
final Guild guild = channel.getGuild();
|
||||||
if (AudioUtil.isTrackLoaded(guild) && !VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
if (AudioUtil.isTrackLoaded(guild) && !VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but you need to be in voice channel `"
|
"Sorry " + executor.getAsMention() + ", but you need to be in voice channel `"
|
||||||
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName()
|
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName()
|
||||||
+ "` in order to reset the audio player.").setDeletionDelay(10, TimeUnit.SECONDS);
|
+ "` in order to reset the audio player.").setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioUtil.getTrackScheduler(guild).clearQueue();
|
AudioUtil.getTrackScheduler(guild).clearQueue();
|
||||||
|
|||||||
@@ -31,16 +31,16 @@ public final class Shuffle implements Command {
|
|||||||
final Guild guild = channel.getGuild();
|
final Guild guild = channel.getGuild();
|
||||||
final TrackScheduler scheduler = AudioUtil.getTrackScheduler(guild);
|
final TrackScheduler scheduler = AudioUtil.getTrackScheduler(guild);
|
||||||
if (scheduler.isQueueEmpty()) {
|
if (scheduler.isQueueEmpty()) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but there are no tracks in the queue.").setDeletionDelay(10,
|
"Sorry " + executor.getAsMention() + ", but there are no tracks in the queue to shuffle.")
|
||||||
TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AudioUtil.isTrackLoaded(guild) && !VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
if (AudioUtil.isTrackLoaded(guild) && !VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but you need to be in voice channel `"
|
"Sorry " + executor.getAsMention() + ", but you need to be in voice channel `"
|
||||||
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName()
|
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName()
|
||||||
+ "` in order to shuffle the queue.").setDeletionDelay(10, TimeUnit.SECONDS);
|
+ "` in order to shuffle the queue.").setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
scheduler.shuffleQueue();
|
scheduler.shuffleQueue();
|
||||||
|
|||||||
@@ -32,23 +32,23 @@ public final class Skip implements Command {
|
|||||||
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
||||||
final Guild guild = channel.getGuild();
|
final Guild guild = channel.getGuild();
|
||||||
if (!AudioUtil.isTrackLoaded(guild)) {
|
if (!AudioUtil.isTrackLoaded(guild)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention()
|
"Sorry " + executor.getAsMention()
|
||||||
+ ", but there must be a track playing in order to vote to skip it.").setDeletionDelay(10,
|
+ ", but there must be a track playing in order to vote to skip it.").setDeletionDelay(30,
|
||||||
TimeUnit.SECONDS);
|
TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
if (!VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but you must be in voice channel `"
|
"Sorry " + executor.getAsMention() + ", but you must be in voice channel `"
|
||||||
+ AudioUtil.getVoiceChannelConnectedTo(channel.getGuild()).getName()
|
+ AudioUtil.getVoiceChannelConnectedTo(channel.getGuild()).getName()
|
||||||
+ "` in order to vote to skip the current track.").setDeletionDelay(10, TimeUnit.SECONDS);
|
+ "` in order to vote to skip the current track.").setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SkipTracker.hasVoted(executor)) {
|
if (SkipTracker.hasVoted(executor)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"You have already voted to skip the current track " + executor.getAsMention() + ".")
|
"You have already voted to skip the current track " + executor.getAsMention() + ".")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
SkipTracker.registerVote(executor);
|
SkipTracker.registerVote(executor);
|
||||||
@@ -61,10 +61,12 @@ public final class Skip implements Command {
|
|||||||
return response;
|
return response;
|
||||||
} else {
|
} else {
|
||||||
if (SkipTracker.getRemainingRequired(guild) == 1) {
|
if (SkipTracker.getRemainingRequired(guild) == 1) {
|
||||||
return new CommandResponse("x", executor.getAsMention() + " has voted to skip the current track. "
|
return new CommandResponse("exclamation",
|
||||||
|
executor.getAsMention() + " has voted to skip the current track. "
|
||||||
+ SkipTracker.getRemainingRequired(guild) + " more vote is needed.");
|
+ SkipTracker.getRemainingRequired(guild) + " more vote is needed.");
|
||||||
} else {
|
} else {
|
||||||
return new CommandResponse("x", executor.getAsMention() + " has voted to skip the current track. "
|
return new CommandResponse("exclamation",
|
||||||
|
executor.getAsMention() + " has voted to skip the current track. "
|
||||||
+ SkipTracker.getRemainingRequired(guild) + " more votes are needed.");
|
+ SkipTracker.getRemainingRequired(guild) + " more votes are needed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,17 +29,17 @@ public final class Volume implements Command {
|
|||||||
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
||||||
final Guild guild = channel.getGuild();
|
final Guild guild = channel.getGuild();
|
||||||
if (!AudioUtil.isTrackLoaded(guild)) {
|
if (!AudioUtil.isTrackLoaded(guild)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention()
|
"Sorry " + executor.getAsMention()
|
||||||
+ ", but there must be a track playing in order to change the volume of the track player.")
|
+ ", but there must be a track playing in order to change the volume of the track player.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
if (!VoiceChannelUtil.isInCurrentVoiceChannel(executor)) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but you must be in voice channel `"
|
"Sorry " + executor.getAsMention() + ", but you must be in voice channel `"
|
||||||
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName()
|
+ AudioUtil.getVoiceChannelConnectedTo(guild).getName()
|
||||||
+ "` in order to change the volume of the track player.").setDeletionDelay(10,
|
+ "` in order to change the volume of the track player.").setDeletionDelay(30,
|
||||||
TimeUnit.SECONDS);
|
TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,9 +57,8 @@ public final class Volume implements Command {
|
|||||||
try {
|
try {
|
||||||
volume = Integer.parseInt(arguments[0]);
|
volume = Integer.parseInt(arguments[0]);
|
||||||
} catch (final NumberFormatException exception) {
|
} catch (final NumberFormatException exception) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x", "Sorry " + executor.getAsMention() + ", but the volume must be an integer.")
|
||||||
"Sorry " + executor.getAsMention() + ", but the volume must be an integer.").setDeletionDelay(10,
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
TimeUnit.SECONDS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (volume <= 150 && volume >= 1) {
|
if (volume <= 150 && volume >= 1) {
|
||||||
@@ -73,9 +72,9 @@ public final class Volume implements Command {
|
|||||||
executor.getAsMention() + " set the volume from `" + oldVolume + "%` to `" + volume + "%`.");
|
executor.getAsMention() + " set the volume from `" + oldVolume + "%` to `" + volume + "%`.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but the volume must be between 1% and 150%.")
|
"Sorry " + executor.getAsMention() + ", but the volume must be between 1% and 150%.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -58,9 +58,9 @@ public final class EightBall implements Command {
|
|||||||
@Override
|
@Override
|
||||||
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
public final CommandResponse execute(final String[] arguments, final Member executor, final TextChannel channel) {
|
||||||
if (arguments.length == 0) {
|
if (arguments.length == 0) {
|
||||||
return new CommandResponse("no_entry_sign",
|
return new CommandResponse("x",
|
||||||
"Sorry, " + executor.getAsMention() + ", but you need to supply a question for the Magic 8 Ball.")
|
"Sorry, " + executor.getAsMention() + ", but you need to supply a question for the Magic 8 Ball.")
|
||||||
.setDeletionDelay(10, TimeUnit.SECONDS);
|
.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
final String question = StringUtil.sanitizeCodeBlock(String.join(" ", arguments));
|
final String question = StringUtil.sanitizeCodeBlock(String.join(" ", arguments));
|
||||||
|
|||||||
@@ -58,9 +58,8 @@ public final class CommandManager {
|
|||||||
+ commandName + "' with arguments '" + String.join(" ", arguments) + "' in " + guild.getName() + " ("
|
+ commandName + "' with arguments '" + String.join(" ", arguments) + "' in " + guild.getName() + " ("
|
||||||
+ guild.getId() + ").");
|
+ guild.getId() + ").");
|
||||||
if (!commandMap.containsKey(commandName)) {
|
if (!commandMap.containsKey(commandName)) {
|
||||||
response = new CommandResponse("question",
|
response = new CommandResponse("x", "Sorry " + executor.getAsMention() + ", but that command is unknown.");
|
||||||
"Sorry " + executor.getAsMention() + ", but I do not know what that command is.");
|
response.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
response.setDeletionDelay(10, TimeUnit.SECONDS);
|
|
||||||
response.sendResponse(channel);
|
response.sendResponse(channel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -69,9 +68,9 @@ public final class CommandManager {
|
|||||||
logger.info(executor.getEffectiveName() + " (" + executor.getUser().getId()
|
logger.info(executor.getEffectiveName() + " (" + executor.getUser().getId()
|
||||||
+ ") was denied access to a command due to not being whitelisted in " + guild.getName() + " ("
|
+ ") was denied access to a command due to not being whitelisted in " + guild.getName() + " ("
|
||||||
+ guild.getId() + ").");
|
+ guild.getId() + ").");
|
||||||
response = new CommandResponse("no_entry_sign",
|
response = new CommandResponse("x",
|
||||||
"Sorry " + executor.getAsMention() + ", but you are not allowed to use this command.");
|
"Sorry " + executor.getAsMention() + ", but you are not allowed to use that command.");
|
||||||
response.setDeletionDelay(10, TimeUnit.SECONDS);
|
response.setDeletionDelay(30, TimeUnit.SECONDS);
|
||||||
response.sendResponse(channel);
|
response.sendResponse(channel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -84,10 +83,7 @@ public final class CommandManager {
|
|||||||
+ executor.getUser().getId() + ") in " + guild.getName() + " (" + guild.getId() + ").",
|
+ executor.getUser().getId() + ") in " + guild.getName() + " (" + guild.getId() + ").",
|
||||||
exception);
|
exception);
|
||||||
response = new CommandResponse("sos",
|
response = new CommandResponse("sos",
|
||||||
"Sorry " + executor.getAsMention() + ", but an error occurred while executing your command!!");
|
"Sorry " + executor.getAsMention() + ", but an error occurred while executing your command.");
|
||||||
response.setDeletionDelay(10, TimeUnit.SECONDS);
|
|
||||||
response.sendResponse(channel);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
package dev.logal.logalbot.utils;
|
package dev.logal.logalbot.utils;
|
||||||
|
|
||||||
import com.vdurmont.emoji.Emoji;
|
|
||||||
import com.vdurmont.emoji.EmojiManager;
|
|
||||||
|
|
||||||
// Copyright 2019 Logan Fick
|
// Copyright 2019 Logan Fick
|
||||||
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@@ -17,6 +14,9 @@ import com.vdurmont.emoji.EmojiManager;
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
|
import com.vdurmont.emoji.Emoji;
|
||||||
|
import com.vdurmont.emoji.EmojiManager;
|
||||||
|
|
||||||
import net.dv8tion.jda.core.utils.Checks;
|
import net.dv8tion.jda.core.utils.Checks;
|
||||||
|
|
||||||
public final class StringUtil {
|
public final class StringUtil {
|
||||||
|
|||||||
Reference in New Issue
Block a user