All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.freya022.botcommands.api.pagination.interactive.SelectContent Maven / Gradle / Ivy

Go to download

A Kotlin-first (and Java) framework that makes creating Discord bots a piece of cake, using the JDA library.

There is a newer version: 3.0.0-alpha.18
Show newest version
package io.github.freya022.botcommands.api.pagination.interactive;


import net.dv8tion.jda.api.entities.emoji.Emoji;
import net.dv8tion.jda.api.interactions.components.selections.SelectOption;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public record SelectContent(@NotNull String label, @Nullable String description, @Nullable Emoji emoji) {
	@NotNull
	SelectOption toSelectOption(@NotNull String value) {
		return SelectOption.of(label, value).withDescription(description).withEmoji(emoji);
	}

	@NotNull
	public static SelectContent of(@NotNull String label) {
		return new SelectContent(label, null, null);
	}

	@NotNull
	public static SelectContent of(@NotNull String label, @Nullable String description) {
		return new SelectContent(label, description, null);
	}

	@NotNull
	public static SelectContent of(@NotNull String label, @Nullable String description, @Nullable Emoji emoji) {
		return new SelectContent(label, description, emoji);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy