#JDA listener
26 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @solemn sparrow! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
It’s not
@random vault can you help
NEVER share your token @solemn sparrow
it’s not my real token
I deleted a part and put random characters
even I as an AI don’t make that big mistakes
Great someone deleted the message :(
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
can you get it back? Maybe it shows the message in logs or smth
so I have my main code package org.example.Discord4Shell;
import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.JDABuilder; import net.dv8tion.jda.api.entities.Activity; import org.example.events.SelectedUser; public class Discord4Shell { public static String user = System.getProperty("user.name"); public static void main(String[] args) { JDA bot = JDABuilder.createDefault("TOKEN") .setActivity(Activity.playing("No Larry?")) .build(); bot.addEventListener(new SelectedUser()); } }and here is my listener code
package org.example.events; import net.dv8tion.jda.api.hooks.ListenerAdapter; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import static org.example.Discord4Shell.Discord4Shell.*; public class SelectedUser extends ListenerAdapter { public void onGuildMessageReceived(MessageReceivedEvent event) { String message = event.getMessage().getContentRaw(); if(message.equalsIgnoreCase("TargetsList")) { event.getChannel().sendMessage(user).queue(); } } }`and when I run it and type Targetslist I get no reply
(I also added code formatting)
Can you check whether the listener itself is executed?
Does the bot go online?
Yes
I’m not sure how to do that
add a System.out.println before the loop
huh? There is no loop
if*
ok