discord-jda / JDA

Java wrapper for the popular chat & VOIP service: Discord https://discord.com
Apache License 2.0
4.26k stars 730 forks source link

ErrorResponse USER_MUST_BE_VERIFIED Error #2664

Closed GitMilchi closed 4 months ago

GitMilchi commented 4 months ago

General Troubleshooting

Version of JDA

5.0.0-beta.22_6062ea4

Expected Behaviour

add member to guild and catch ErrorResponse.USER_MUST_BE_VERIFIED

Code Example for Reproduction Steps

event.getGuild().addMember(String.valueOf(userData.get("access_token")), user).queue(null, new ErrorHandler()
                                                                .ignore(ErrorResponse.MAX_GUILDS)
                                                                .ignore(ErrorResponse.USER_BANNED_FROM_GUILD)
                                                                .ignore(ErrorResponse.MAX_MEMBERS)
                                                                .ignore(ErrorResponse.UNKNOWN_USER)
                                                                .ignore(ErrorResponse.NOT_VERIFIED)
                                                                .ignore(ErrorResponse.USER_MUST_BE_VERIFIED)

Code for JDABuilder or DefaultShardManagerBuilder used

JDABuilder jdaBuilder;
        if (!devMode) {
            jdaBuilder = JDABuilder.createDefault(Config.getInstance().bottoken);
        } else {
            jdaBuilder = JDABuilder.createDefault("");
        }
        jdaBuilder.enableIntents(GatewayIntent.GUILD_MEMBERS, GatewayIntent.GUILD_MESSAGE_REACTIONS, GatewayIntent.DIRECT_MESSAGE_REACTIONS, GatewayIntent.DIRECT_MESSAGES, GatewayIntent.MESSAGE_CONTENT);
        jdaBuilder.setChunkingFilter(ChunkingFilter.ALL);
        jdaBuilder.setMemberCachePolicy(MemberCachePolicy.ALL);
        jdaBuilder.setStatus(OnlineStatus.ONLINE);
        jda = jdaBuilder.build();

Exception or Error

java.lang.NoSuchFieldError: USER_MUST_BE_VERIFIED
MinnDevelopment commented 4 months ago

This seems like an issue on your end, you need to recompile your project and run it with the right version of JDA.

GitMilchi commented 4 months ago

I use the jitbranch lib. I got my JDA version from JDAInfo.VERSION. Is it possible to use a stable lib?

MinnDevelopment commented 4 months ago

I don't know what "jitbranch lib" is. The current latest version is 5.0.0-beta.23, which added this enum constant. I recommend you update to that version.