8000 GitHub - Xirado/JDUI: Kotlin library for effortlessly creating stateful and interactive messages in Discord with 0 boilerplate
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ JDUI Public

Kotlin library for effortlessly creating stateful and interactive messages in Discord with 0 boilerplate

Notifications You must be signed in to change notification settings

Xirado/JDUI

Repository files navigation

maven-central jitpack

JDUI

A Kotlin library for effortlessly creating stateful and interactive messages in Discord with 0 boilerplate

fun counterView() = view {
    var counter: Int by state(0)

    compose {
        +text("## Counter: $counter")
        +row {
            +button(ButtonStyle.SECONDARY, "Increment") {
                counter += 1
                println("Button was pressed")
            }
        }
    }
}

Warning

This library is a work in progress. API breakage may (and probably will) happen!

Features

  • Easily create isolated message "views" (as we will call them from now on) and make them interactive with 0 boilerplate
  • Store a Base65536 encoded and encrypted representation of the state of your views inside the custom_id field of components, or optionally in a database. The library does it for you
  • Makes use of Discords "Components V2", an improved way to creating structured messages with even more options for bot developers
  • Dependency injection using global and per-view context

Installation

maven-central jitpack

Gradle

repositories {
    mavenCentral()
}

dependencies {
    implementation("dev.xirado:jdui-core:0.1.1")
}

Maven

<dependency>
    <groupId>dev.xirado</groupId>
    <artifactId>jdui-core</artifactId>
    <version>0.1.1</version>
</dependency>

About

Kotlin library for effortlessly creating stateful and interactive messages in Discord with 0 boilerplate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages

0