Skip to content

Type Adapter

Kaktushose edited this page Jun 14, 2022 · 2 revisions

Type Adapter System

The default argument parser of this framework supports all primitive data types, the JDA entities Member, User, TextChannel and Role. However, you can define additional type adapters:

@Component
public class FooAdapter implements TypeAdapter<Foo> {

    @Override
    public Optional<Foo> parse(@NotNull String raw, @NotNull CommandContext context) {
        return Optional.of(new Foo(raw));
    }
}

Important

This wiki is the documentation for V3 (text commands)! If you're using V4 (interactions) please refer to the new documentation

Home

Getting Started

Writing Commands

Advanced Configuration

Util

Clone this wiki locally