Jda: Private Messaging

Created on 12 Jan 2020  路  2Comments  路  Source: DV8FromTheWorld/JDA

General Troubleshooting

  • [x] I have checked for similar issues.
  • [x] I have updated to the [latest JDA version][download].
  • [x] I have checked the branches or the maintainers' PRs for upcoming bug fixes.

Bug Report

I am unable to send a private message no matter how I code it. I get the same error. Iv tried different ways of coding it. Iv tried complete(). I'm out of ideas now. I cannot get the bot to send a private message. If it helps, I can't even message the bot myself to even try opening the private conversation. I get Your message could not be delivered because you don't share a server with the recipient or you disabled direct messages on your shared server, recipient is only accepting direct messages from friends, or you were blocked by the recipient.

Expected Behavior

Expecting it to send a private message

Code Example or Reproduction Steps

    @Override
    public void onMessageReceived(MessageReceivedEvent e) {
        if (e.getMessage().getContentRaw().equalsIgnoreCase("!help")) {
            if (!e.getChannelType().equals(ChannelType.PRIVATE)) {
                e.getChannel().sendMessage("Ok " + e.getAuthor().getAsMention() + ", " +
                        "I sent you a list of commands you can use.").queue();
                e.getAuthor().openPrivateChannel().queue((channel) ->
                {
                   channel.sendMessage("test").queue();
                });
            } else {
                e.getChannel().sendMessage(helpList).queue();
            }
        }
    }

Exception or Error

16:36:33 [SEVERE] [ForkJoinPool.commonPool-worker-1] ERROR RestAction - RestAction queue returned failure: [ErrorResponseException] 50007: Cannot send messages to this user
intended behavior

Most helpful comment

My stupid ass had messages disabled from server members

All 2 comments

My stupid ass had messages disabled from server members

For the next time also join the Discord as the issue tracker is reserved for bug reports and feature requests.

https://discord.gg/0hMr4ce0tIk3pSjp

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Frederikam picture Frederikam  路  4Comments

napstr picture napstr  路  3Comments

ExpDev07 picture ExpDev07  路  6Comments

YukioKeno picture YukioKeno  路  6Comments

StijnSimons picture StijnSimons  路  3Comments