What is the Best approach to developing a bot and reloading the new changes into it?
I heard that logging in too many times can lead to rate limits. is there a good solution for this issue?
I want to change something, build it run it and test it on discord.
Solution:Jump to solution
npm
@sapphire/plugin-hmr
Plugin for @sapphire/framework for hot module reloading for pieces. Latest version: 2.0.0, last published: 5 months ago. Start using @sapphire/plugin-hmr in your project by running
npm i @sapphire/plugin-hmr
. There are no other projects in the npm registry using @sapphire/plugin-hmr.10 Replies
Solution
npm
@sapphire/plugin-hmr
Plugin for @sapphire/framework for hot module reloading for pieces. Latest version: 2.0.0, last published: 5 months ago. Start using @sapphire/plugin-hmr in your project by running
npm i @sapphire/plugin-hmr
. There are no other projects in the npm registry using @sapphire/plugin-hmr.Umm what's the difference between hot module reloading and just reloading ( like the reloading example that was there in d.js guide )??
where does the dj guide say that?
Hot module reloading is automatic (it will reload whenever you save the file)
I think djs mentions it as a command, which just means you'd have to run a command every time
It was there earlier but they probably removed it
Oh, instead of hot module reloading, can't we just import the command/event file while executing it rather than setting it in a discordjs collection and retrieving it?
That might be possible 🤷♂️
I think you would need to clear the require cache every time then.
It wouldnt be so good for performance, the cache is there for a reason, but maybe fine for development.
Also if you want to reload things that aren't commands, you can also delete require cache for it.
mind me asking where I find resources about how to use it with esm?
the plugin is compatible with esm
Just add the module type in your package.json