Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Commit

Permalink
Use MESSAGE_CONTENT Intent
Browse files Browse the repository at this point in the history
  • Loading branch information
ozraru committed Aug 9, 2022
1 parent f82f8b5 commit 101c97f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/src/main/java/work/raru/spigot/discordchat/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.JDABuilder;
import net.dv8tion.jda.api.requests.GatewayIntent;

public class Main extends JavaPlugin {

Expand Down Expand Up @@ -49,7 +50,9 @@ public void run() {

void startJDA() throws LoginException {
try {
jda = JDABuilder.createDefault(ConfigManager.getToken()).build();
JDABuilder jdaBuilder = JDABuilder.createDefault(ConfigManager.getToken());
jdaBuilder.enableIntents(GatewayIntent.MESSAGE_CONTENT);
jda = jdaBuilder.build();
jda.addEventListener(new DiscordMessage());
} catch (LoginException e) {
getLogger().severe("Discord login failed. Please check token.");
Expand Down

0 comments on commit 101c97f

Please sign in to comment.