fix: range and q size check

This commit is contained in:
DrunkenToast 2021-11-20 21:19:34 +01:00 committed by Max Isom
parent 5a74115beb
commit fe233cb98c
No known key found for this signature in database
GPG key ID: 25C9B1A7F6798880

View file

@ -48,8 +48,13 @@ export default class implements Command {
return; return;
} }
if (range[1] > player.queueSize()) {
await res.stop(errorMsg('queue isn\'t THAT big'));
return;
}
if (range[0] < range[1]) { if (range[0] < range[1]) {
player.removeFromQueue(range[0], range[0] - range[1]); player.removeFromQueue(range[0], range[1] - range[0] + 1);
} else { } else {
await res.stop(errorMsg('range is backwards, just like you')); await res.stop(errorMsg('range is backwards, just like you'));
return; return;