#The better discord bot library.
1 messages ยท Page 1 of 1 (latest)
<@&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>.
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:
are u asking which of them is the better lib to do discord stuff with java?
Changed the category to Frameworks.
<@&987246452180930620> please have a look, thanks.
Yes, which one is better to code in long term? Is there another?
depends a lot id say
refer to this
Compares Discord libraries and their support of new API features
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
ok
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)
Do you know of a ressource that explain how to divide discord feature in class?
For JDA
sorry, what?
Is there a better way to configure a bot than using ListenerAdapter?
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
jda ofc, it is the most feature complete and has the best community
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
I see.
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
if ur just doing a small project and know what features u need and are okay with kotlin, my personal favorite in terms of fun and convenience is
https://github.com/DiscordKt/DiscordKt
but it lacks in terms of support and everything. so only good for small stuff
I will do some kind of wrapper api for the feature I want to use then.
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
I really do not like kotlin out of configuration.
The style hide too much of what it does.
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
Thanks
Wait, it only use 1 event listener?
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