onApplicationBootstrap function
The onApplicationBootstrap
is a lifecycle hook in CommandKit that allows you to execute code when the application is fully initialized and ready to run. This is particularly useful for setting up things like commandkit cache providers, message command prefix resolvers, and other application-wide settings.
Basic Usage
import { onApplicationBootstrap } from 'commandkit';
onApplicationBootstrap((commandkit) => {
// This code will run when the application is ready
console.log('CommandKit is ready!');
});
You can register multiple onApplicationBootstrap
hooks, and they will be called in the order they were registered.