#The better discord bot library.

1 messages ยท Page 1 of 1 (latest)

naive frost
#

What is it?

JDA?
Javacord?
Discord4j?

arctic chasmBOT
#

<@&987246399047479336> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question ๐Ÿค–. Maybe it helps! In any case, a human is on the way ๐Ÿ‘. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#
TJ-Bot
What is it? JDA? Javacord? Discord4j?

JDA, Javacord, and Discord4j are all popular Java libraries for creating Discord bots.

JDA (Java Discord API) is a fully-featured library that is widely used and supported by the community. It provides a high-level interface for interacting with the Discord API.

Javacord is another popular option that offers a more user-friendly and easy-to-use API. It has a simpler design compared to JDA, making it a good choice for beginners.

Discord4j is a reactive library that leverages the power of Project Reactor to handle asynchronous events in a more efficient manner. It offers a modern approach to building Discord bots using reactive programming principles.

Overall, the best library will depend on your specific needs and preferences. It's recommended to try out each one and see which one suits your project best.

Useful links:

hollow bear
arctic chasmBOT
#

Changed the category to Frameworks.

#

<@&987246452180930620> please have a look, thanks.

naive frost
hollow bear
#

depends a lot id say

#

refer to this

#

generally, JDA is the most commonly used

#

has widest support

#

supports almost any discord feature

#

the other options are generally more modern/comfortable to code with, but lack support

#

our @arctic chasm uses JDA

#

btw, javacord is dead

#

it was closed

naive frost
#

ok

hollow bear
#

discord4j uses reactor as foundation (Mono and Flow). so that needs a paradigm change in ur thinking

#

especially bc reactor isnt super common anymore

#

(in particular after virtual threads have arrived in java)

#

JDA is essentially a future api. so if ur used to javas CompletableFuture, ull feel right at home with JDAs RestAction class

#

in terms of thinking patterns

#

discord.jar is interesting but id mostly call it a WIP project by mostly a solo contributor

#

while JDA is maintained by a lot of people and very actively

#

(5 contributors vs 163)

naive frost
#

Do you know of a ressource that explain how to divide discord feature in class?

#

For JDA

hollow bear
#

sorry, what?

naive frost
#

Is there a better way to configure a bot than using ListenerAdapter?

hollow bear
#

better in what sense

#

have u checked out @arctic chasm?

naive frost
#

No

#

got the link?

hollow bear
#

ur entry point will be a global ListenerAdapater

#

i.e. it receives any event from any guild from any command from anything

#

and then u do the routing urself

#

so u need to setup a receiver-registry urself

#

for slashcommands etc u can do it based on the name

fluid elbow
hollow bear
#

for channels perhaps have a channel subscription setup

#

u can see all of that in tj-bot BotCore

#

it routes all events to the corresponding classes

naive frost
#

I see.

hollow bear
#

but yeah, thats what i mean with "modern/convenient". JDA has everything but u need to do this kind of stuff urself

#

no automatic routing

#

other libs mostly differ in that aspect by giving more convenience for those things

#

but it lacks in terms of support and everything. so only good for small stuff

naive frost
#

I will do some kind of wrapper api for the feature I want to use then.

hollow bear
#

discordkt is based on coroutines so u have all the routing totally out of the box

#
commands("foo") {
  slash("send") {
    execute {
      respond("okay")
      repeat(10) {
        channel.createMessage("test $it")
      }
    }
  }
}
#

no futures, no async coding, ...

#

super convenient

naive frost
#

The style hide too much of what it does.

hollow bear
#

up to u. but i found coroutines an extremely nice fit for sth like discord

#

anyways. for routing events urself u can take inspiration from TJ-Bot

hollow bear
#

yes

#

its the global entry point and will route each event to the corresponding class

#

u can add multiple listeners but whats the point. they will still all receive all events from any guild, any user, any slash command, any message, any channel

#

what u actually want is that everyone only gets the events they are interested in

#

and for that u need to do routine or filtering urself at some point

#

like, jda doesnt provide filtering. u make a /ban slash command and its onSlashCommand method will be triggered when someone uses /ping as well

#

so u need to do filtering or routing