> For the complete documentation index, see [llms.txt](https://neiizun.gitbook.io/lightdrop/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://neiizun.gitbook.io/lightdrop/usage/automapping.md).

# AutoMapping

AutoMapping is a way to map classes of commands and ExeptionHandlers without having to specify it manually.

You should put the @AutoMapping annotation to your class in order to enable automapping for this class.

```java
@AutoMapping
public class MyCommand {
    @Command(name = "test")
    public void test(CommandContext context) {
        ...
    }
}
```

You must specify that you enable AutoMapping in your LightDrop instance.

```java
JDA jda = JDABuilder.createDefault("your token").build();
        
new LightDrop().hook(jda)
    .enableAutoMapping("your.package"); //Enable auto-mapping for package your.package and all childs
```

Note that @AutoMapping annotated classes must have a no-args constructor.
