Fixed a NumberFormatException bug
This commit is contained in:
1 parent
e997bc52c9
commit
51c470a9bc
1 file changed
+7
-2
@@ -54,9 +54,14 @@ public class VolumeCommand extends AbstractCommand {
|
||||
|
||||
if (player.isConnected()) {
|
||||
if (player.isConnectedTo(vChannel)) {
|
||||
int volume;
|
||||
volume = Integer.parseInt(args.split(" ")[0]);
|
||||
|
||||
try {
|
||||
int volume = Integer.parseInt(args.split(" ")[0]);
|
||||
player.setVolume(volume);
|
||||
} catch (NumberFormatException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else
|
||||
event.getTextChannel().sendMessage("Not in your voice channel").queue();
|
||||
} else
|
||||
|
||||
Reference in new issue
Block a user