Zue
Zue
SIASapphire - Imagine a framework
Created by Zue on 2/22/2025 in #sapphire-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
Okay so I created a handler named unregisterer.js I'm calling it in another handler named bootstrap.js bootstrap.js is then imported into index.js then called as such await handlers() on ready event I use a custom structure named SlashCommand imported in every command file (to replace Command of @sapphire/framework): this only serves to prevent spamming registerApplicationCommands in every single command file meanwhile Command is already called within the structure itself to serve it's purpose The expected behavior is to first unregister all the Global commands, afterwards register them once again, acts as a reload for the existing commands There's 3 types of different behaviors when booting up the bot in a row, I've embedded a video
350 replies
SIASapphire - Imagine a framework
Created by Zue 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