Update parsing and validation logic for playlist-limit config

This commit is contained in:
Thongrapee Panyapatiphan 2021-10-01 23:59:33 +07:00
parent 847c578b5d
commit 33b0ffa244
No known key found for this signature in database
GPG key ID: 4B08AEC7F50F1967

View file

@ -76,8 +76,8 @@ export default class implements Command {
}
case 'playlist-limit': {
const playlistLimit = Number(args[1]);
if (!playlistLimit || playlistLimit <= 0) {
const playlistLimit = parseInt(args[1], 10);
if (playlistLimit <= 0) {
await msg.channel.send(errorMsg('please enter a valid number'));
return;
}