awe
awe
SIASapphire - Imagine a framework
Created by awe on 8/28/2023 in #sapphire-support
"There are no more arguments." using args.pick('integer')
In this particular case I am trying to check if there is any argument after the command (while my method does work) I get an error saying "there are no more arguments" on value
let value = await args.pick('integer').catch((err) => console.log('Volume ::', err.message));

if (isNaN(value)) return message.channel.send(`Current volume is **${queue.volume}%**`);
if (Number(value) < 1 || Number(value) > 150) return message.reply(`Please send a valid value ranged between 1 to 150 (%).`);
let value = await args.pick('integer').catch((err) => console.log('Volume ::', err.message));

if (isNaN(value)) return message.channel.send(`Current volume is **${queue.volume}%**`);
if (Number(value) < 1 || Number(value) > 150) return message.reply(`Please send a valid value ranged between 1 to 150 (%).`);
Volume :: There are no more arguments.
Volume :: There are no more arguments.
I am not using args.finished of sapphire.js because that doesn't seem to check the numbers, only characters. Could proceed by simply catching the error and returning null but that seems unprofessional, any ideas?
4 replies