> 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/create-a-command.md).

# Create a command

You can annotate a method with @Command to specify this method as a command.

```java
public class MyCommand {
    @Command(name = "mycommand")
    public void myCommand(CommandContext context) {
        context.getChannel().sendMessage("Hello " + context.getAuthor().getName()).complete();
    }
}
```

You can now map your class to register all commands.

```java
JDA jda = JDABuilder.createDefault("your token").build();
        
new LightDrop().hook(jda)
    .map(new MyCommand());
```

![Result of command](/files/-MfubKb2JchiyuZ-CIc6)

Likewise, you can also add permission and permission message to the command.

```java
public class MyCommand {
    @Command(name = "mycommand", permission="BAN_MEMBERS", permissionMessage="Sorry but you must have `{permission}`")
    public void myCommand(CommandContext context) {
        context.getChannel().sendMessage("Hello " + context.getAuthor().getName()).complete();
    }
}
```
