JDA Discord bot - MessageUpdateEvent not working

Viewed 26

I'm making a bot where I'm using a channel as an application form, and I store every message that the user sends in a string arraylist.

This is working perfectly, the only problem I have is that if the user edits one of their messages, the arraylist still has the old message saved, not the new one, so Im trying to use MessageUpdateEvent to change the String into what I want it to be. After trying a bunch of different code I realised that the MessageUpdateEvent isnt working at all in my code. I have added the EventListeners in the jda, and I am enabling the intents: GUILD_MEMBERS, GUILD_MESSAGES, and DIRECT_MESSAGES. The class is also extending ListenerAdapter of course.

Here is the code I used now to test if the event works:

public void onMessageEdit(MessageUpdateEvent event) {
    Guild guild = event.getGuild();
    TextChannel adminchannel = event.getGuild().getTextChannelById("1019689015437426758");
    adminchannel.sendMessage("the listener works").queue();
}

0 Answers
Related