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

An unofficial discord.js fork for creating selfbots
https://discordjs-self-v13.netlify.app
GNU General Public License v3.0
774 stars 164 forks source link

Error 40003 - You are opening direct messages too fast #1149

Closed ignshifts closed 5 months ago

ignshifts commented 5 months ago

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

Additional Information

No response

ignshifts commented 5 months ago

new

xvyx commented 5 months ago

await client.sleep(Number)

ignshifts commented 5 months ago

That seemed to work thanks!