aiko-chan-ai / discord.js-selfbot-v13

An unofficial discord.js fork for creating selfbots

Home Page:https://discordjs-self-v13.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error 40003 - You are opening direct messages too fast

ignshifts opened this issue · comments

Which package has the bugs?

The core library

Issue description

Sending direct messages to users from a server, how can I prevent this error or work around it? Do I just add a delay, I've never seen this error before

Code sample

member.createDM(true).then((dm) => {
  dm.send(Message)
    .then(() => {
      console.log(
        `${chalk.green(`[✓]`)} (${client.token}) - Sent message to: ${member.user.tag} with delay: ${randomDelay} seconds`,
      );
      successfulDMCount++;
    })
    .catch((err) => {
      console.log(
        `${chalk.red(`[✕]`)} (${client.token}) - Failed to send message to: ${member.user.tag} - Delay: ${randomDelay} seconds - Error code: ${err.code}`,
      );
      failedDMCount++;
      console.log(err);
    });
});

Package version

"discord.js-selfbot-v13": "^3.1.3",

Node.js version

v18.16.1

Operating system

Windows 11

Priority this issue should have

Low (slightly annoying)

Checklist

  • I have searched the open issues for duplicates.
  • I have shared the entire traceback.
  • I am using a user token (and it isn't visible in the code).

Additional Information

No response

commented

await client.sleep(Number)

That seemed to work thanks!