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:
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.
Jump to solution
10 Replies
Solution
Sawako
Sawako2y ago
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.
Favna
Favna2y ago
this
Np 🌸
Np 🌸2y ago
Umm what's the difference between hot module reloading and just reloading ( like the reloading example that was there in d.js guide )??
Sawako
Sawako2y ago
where does the dj guide say that?
Lioness100
Lioness1002y ago
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
Np 🌸
Np 🌸2y ago
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?
Lioness100
Lioness1002y ago
That might be possible 🤷‍♂️
bomi
bomi2y ago
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.
Himori
Himori2y ago
mind me asking where I find resources about how to use it with esm?
Sawako
Sawako2y ago
the plugin is compatible with esm Just add the module type in your package.json
Want results from more Discord servers?
Add your server