Skip to content

Latest commit

 

History

History
25 lines (14 loc) · 472 Bytes

dependency-injection.md

File metadata and controls

25 lines (14 loc) · 472 Bytes

Dependency Injection

Krobot uses Guice as dependency injection framework. See its doc here.

Registering modules

To register you own modules, provide them to the Krobot#start method :

Krobot.start(MyBot.class, new MyModule(), new MyOtherModule(), ...);

Krobot singletons

Krobot defines singletons to use then with dependency injection :

  • JDA
  • CommandManager
  • ConfigProvider
  • ExceptionHandler