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

add errorresponse 50178 The user account must first be verified #2650

Closed GitMilchi closed 4 months ago

GitMilchi commented 4 months ago

General Troubleshooting

Version of JDA

5.0.0-beta.17

Expected Behaviour

I want to handle the error response 50178 The user account must first be verified. This error response is not existing in net.dv8tion.jda.api.requests.ErrorResponse so I create this issue. Please add it and give me feedback.

image

Code Example for Reproduction Steps

event.getGuild().addMember("Access Token", user).queue(null, new ErrorHandler()
.ignore(ErrorResponse.MAX_GUILDS)
.ignore(ErrorResponse.USER_BANNED_FROM_GUILD)
.ignore(ErrorResponse.MAX_MEMBERS)
.ignore(ErrorResponse.INVALID_OAUTH_ACCESS_TOKEN)
.ignore(ErrorResponse.UNKNOWN_USER)
.ignore(ErrorResponse.NOT_VERIFIED)
);

Code for JDABuilder or DefaultShardManagerBuilder used

JDABuilder jdaBuilder;
        if (!devMode) {
            jdaBuilder = JDABuilder.createDefault(Config.getInstance().bottoken);
        } else {
            jdaBuilder = JDABuilder.createDefault("DEV BOT TOKEN");
        }
        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

[ForkJoinPool.commonPool-worker-3] ERROR RestAction - RestAction queue returned failure: [ErrorResponseException] 50178: The user account must first be verified
net.dv8tion.jda.api.exceptions.ContextException
        at net.dv8tion.jda.api.exceptions.ContextException.here(ContextException.java:54)
        at net.dv8tion.jda.api.requests.Request.<init>(Request.java:77)
        at net.dv8tion.jda.internal.requests.RestActionImpl.queue(RestActionImpl.java:197)
        at work.cloudservice.commands.RecoverCommand.lambda$null$1(RecoverCommand.java:158)
        at net.dv8tion.jda.api.requests.Request.lambda$onSuccess$0(Request.java:121)
        at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(Unknown Source)
        at java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source)
        at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
        at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
MCausc78 commented 4 months ago

the PR was merged, can that issue be closed?

GitMilchi commented 4 months ago

the PR was merged, can that issue be closed?

Ye, you can close it