Getting DM errors on servers

I’m making a simple timeout bot, the code in question is the following:

    mentioned.roles.add(role);
    mentioned.voice.setMute(true, `Time-out for ${duration}`);
    msg.channel.send(`Timed-out <@${mentioned.id}> for ${duration}`);
    console.log("Timed-out", mentioned.displayName, "for", duration);

    scheduler.schedule(mentioned.id, parsedDuration, () => {
      mentioned.roles.remove(role);
      mentioned.voice.setMute(false, "Time-out ended");
      msg.channel.send(`Time-out ended for <@${mentioned.id}>`);
      console.log("Time-out ended for", mentioned.displayName);
    });
  }

This works fine, but after being timed-out some members are telling me they’re getting an error when sending messages that links them to this support page.

You’re only supposed to get this error on DMs, and they’re consistently getting it after being timed out.
Why is this happening?

Get them to send a screenshot of the error.

Sure, it’s in Spanish tho

. Keep in mind this is in a server, not a DM

That is not your bot… and that cannot be in a server. Can you prove that it is actually in a server, and not a DM.

Yeah, the issue is that they are suddenly getting this error (by the Clyde bot) after being timed-out

Highly unlikely.

I has consistently happened, and the error doesn’t even make sense. It’s supposed to be for DMs, but this is a server

Has this error occurred for you, yourself?

I haven’t experienced the issue myself because as I’m server owner I can’t timeout myself, it seems have something to do with removing people’s ability to type in a certain channel and then restoring it.
Here’s another screenshot where you can see it’s in a server:

its because they cannot send messages, its a discord error, if they reload discord, should be fine. Nothing you can do.

We have tried to reload Discord and that doesn’t fix it. In our experimentation, the only way to fix it is for them to leave and re-join the server, or for an admin to manually add and remove the timeout role again. It seems to be that when removing the role via the API (using discord.js), it isn’t registered correctly and the member doesn’t have the rights to write in the channel even though they can, so Discord shows the unrelated DM error.

Not all users have DMs turned on so anyone can DM you. They might have it set so only a friend can DM them, instead of anyone being allowed to DM them or anyone in a common server can DM them

1 Like

Example is like this:
Screen_Shot_2021-03-26_at_9.59.16_AM
This will happend if “that” member/user can only add friend by himself.