B4J Question [JDA] Documentation

Blueforcer

Well-Known Member
Licensed User
Longtime User
Hello,

is there any documentation of the JDA lib?
There are so many functions, but dont know how to use them.
For example how can i response to a message or how can i send pictures etc.

thanks
 

DonManfred

Expert
Licensed User
Longtime User
is there any documentation of the JDA lib?
Not really. You can download the java sources from github or the release build jars

Inside the javadoc is a lot of info. Note that the Docs are for the JAVA Part.
how can i send pictures
B4X:
Dim topin As Message = channel.sendFile5(imagebytes,"Teilnehmer.jpg") ' Channel is a MessageChannel

Snap7.png

For example how can i response to a message
If the bot gets a private message then the Channel in MessageReceived is of Type private.
You just can respond in this channel.
B4X:
Sub JDA_onMessageReceived(event As Object)
    MyLog($"JDA_onMessageReceived(${event})"$)
    Dim ev As MessageReceivedEvent = event
    Dim msg As Message = ev.Message
    Dim ch As MessageChannel = msg.Channel
    work with ch to respond in the same channel
end sub
If the bot reads the message in public then you can for ex answer in the channel you get a message in.
 
Last edited:
Upvote 0
Top