Skip to content

Commit d8fcba9

Browse files
authored
update JDA and other dependencies to fix discord connection
1 parent 0a31300 commit d8fcba9

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/main/java/com/jagrosh/jmusicbot/JMusicBot.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
public class JMusicBot
4848
{
4949
public final static Logger LOG = LoggerFactory.getLogger(JMusicBot.class);
50-
public final static Permission[] RECOMMENDED_PERMS = {Permission.MESSAGE_READ, Permission.MESSAGE_WRITE, Permission.MESSAGE_HISTORY, Permission.MESSAGE_ADD_REACTION,
50+
public final static Permission[] RECOMMENDED_PERMS = {Permission.VIEW_CHANNEL, Permission.MESSAGE_SEND, Permission.MESSAGE_HISTORY, Permission.MESSAGE_ADD_REACTION,
5151
Permission.MESSAGE_EMBED_LINKS, Permission.MESSAGE_ATTACH_FILES, Permission.MESSAGE_MANAGE, Permission.MESSAGE_EXT_EMOJI,
5252
Permission.VOICE_CONNECT, Permission.VOICE_SPEAK, Permission.NICKNAME_CHANGE};
53-
public final static GatewayIntent[] INTENTS = {GatewayIntent.DIRECT_MESSAGES, GatewayIntent.GUILD_MESSAGES, GatewayIntent.GUILD_MESSAGE_REACTIONS, GatewayIntent.GUILD_VOICE_STATES};
53+
public final static GatewayIntent[] INTENTS = {GatewayIntent.MESSAGE_CONTENT, GatewayIntent.DIRECT_MESSAGES, GatewayIntent.GUILD_MESSAGES, GatewayIntent.GUILD_MESSAGE_REACTIONS, GatewayIntent.GUILD_VOICE_STATES};
5454

5555
/**
5656
* @param args the command line arguments
@@ -118,7 +118,7 @@ private static void startBot()
118118
{
119119
JDA jda = JDABuilder.create(config.getToken(), Arrays.asList(INTENTS))
120120
.enableCache(CacheFlag.MEMBER_OVERRIDES, CacheFlag.VOICE_STATE)
121-
.disableCache(CacheFlag.ACTIVITY, CacheFlag.CLIENT_STATUS, CacheFlag.EMOTE, CacheFlag.ONLINE_STATUS)
121+
.disableCache(CacheFlag.ACTIVITY, CacheFlag.CLIENT_STATUS, CacheFlag.EMOJI, CacheFlag.ONLINE_STATUS, CacheFlag.STICKER, CacheFlag.SCHEDULED_EVENTS)
122122
.setActivity(config.isGameNone() ? null : Activity.playing("loading..."))
123123
.setStatus(config.getStatus()==OnlineStatus.INVISIBLE || config.getStatus()==OnlineStatus.OFFLINE
124124
? OnlineStatus.INVISIBLE : OnlineStatus.DO_NOT_DISTURB)
@@ -147,13 +147,13 @@ private static void startBot()
147147
+ "on https://discord.com/developers/applications/" + jda.getSelfUser().getId() + "/bot");
148148
}
149149
}
150-
catch (LoginException ex)
151-
{
152-
prompt.alert(Prompt.Level.ERROR, "JMusicBot", ex + "\nPlease make sure you are "
153-
+ "editing the correct config.txt file, and that you have used the "
154-
+ "correct token (not the 'secret'!)\nConfig Location: " + config.getConfigLocation());
155-
System.exit(1);
156-
}
150+
// catch (LoginException ex)
151+
// {
152+
// prompt.alert(Prompt.Level.ERROR, "JMusicBot", ex + "\nPlease make sure you are "
153+
// + "editing the correct config.txt file, and that you have used the "
154+
// + "correct token (not the 'secret'!)\nConfig Location: " + config.getConfigLocation());
155+
// System.exit(1);
156+
// }
157157
catch(IllegalArgumentException ex)
158158
{
159159
prompt.alert(Prompt.Level.ERROR, "JMusicBot", "Some aspect of the configuration is "

0 commit comments

Comments
 (0)