Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

fuma-nama/B-JDA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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