Giter VIP home page Giter VIP logo

b-jda's Introduction

Warning

BJDA had been replaced by JDAK and Discord-UI
You should use them instead

banner

BJDA - Better Java Discord API

GitHub Maven Central Sonatype Nexus (Releases) GitHub Repo stars

A Discord Bot Framework based on JDA written in Kotlin
With many utilities to speed up you development.

Installation

Install the Core

<dependency>
  <groupId>io.github.sonmoosans</groupId>
  <artifactId>bjda-core</artifactId>
  <version>6.0.1</version>
</dependency>

Why BJDA

Modularized

Keep it Light, Only Import all Needed Modules for your application

Commands Utilities

Create Slash Commands, Text Commands with few lines of code

command(name = "hello", description = "Say Hello") {
  
  val size = int("size", "Size of example") {
    optional { 6 }
  }
  
  execute {
    event.reply("size: ${size()}").queue()
  }
}

Application Command is also supported

val UserHelloCommand = userCommand(name = "hello") {
  execute { event ->
    event.reply("Hello").queue()
  }
}

Message Component UI Framework

We highly recommend using DUI instead of BJDUI.
BJDUI is already outdated, and stopped maintain

Install BJDUI for UI Module

<dependency>
    <groupId>io.github.sonmoosans</groupId>
    <artifactId>bjdui</artifactId>
    <version>BJDA_VERSION</version>
</dependency>

Create an interactive UI easily in few lines of code
And Update UI with component state

Beautiful, Readable, Flexible

example-2

Full Demo of above example

Built-in Components

val app = UI {
    pager {
        embed {
            title = "Page 1"
        }
        embed {
            title = "Page 2"
        }
    }
}

app.reply(event)

Getting Started

You can see the documentation here

Demo

  • Full Demo of a Todo App: Todo Bot
  • Demo for production: Dishub is a great example with high performance.

Creating a Slash Command

val TestCommand = command(name = "test", description = "Example Command") {
    val size = int("size", "Size of Text")
        .optional()
        .map({"${it}px"}) {
            choices {
                choice("sm", 1)
                choice("md", 2)
                choice("lg", 5)
            }

            default { 0 }
        }

    execute {
        event.reply(size.value).queue()
    }
}

diagram

Coming soon

We will move to Kord which is a discord api written in kotlin

b-jda's People

Contributors

fuma-nama avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

uncle0918

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.