ApplicationCommandRegistry save new Command registered to DB
I want to save the idHints automatically in a Database, where can i intercept all new registered Commands with their respective idHint. I did try intercepting all events inside my Client with:
emit(event, ...args) { // save all events to a file fs.appendFile('events.log', event + ' ' + JSON.stringify(args) + ' ' + new Date().toString() + ' ', (err) => { if (err) throw err; }); super.emit(event, ...args);}
emit(event, ...args) { // save all events to a file fs.appendFile('events.log', event + ' ' + JSON.stringify(args) + ' ' + new Date().toString() + ' ', (err) => { if (err) throw err; }); super.emit(event, ...args);}
But i didnt find the Command Id in the file.
Solution
I asked a similar question a little while ago (archived in No Access). The solution I ended up with was to pull all the IDs from the commands store and then upload them to my DB about two minutes after the client is constructed. I also pulled them in from the DB before creating the client so that I could be sure they would be cached in a container property I setup before the commands themselves would be created.