Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes when cant DM user[BUG] #15

Closed
AdamT20054 opened this issue Oct 23, 2022 · 3 comments
Closed

Crashes when cant DM user[BUG] #15

AdamT20054 opened this issue Oct 23, 2022 · 3 comments
Assignees
Labels
bug Something isn't working Stale

Comments

@AdamT20054
Copy link
Owner

AdamT20054 commented Oct 23, 2022

Describe the bug
Bot crashes when trying to DM a user that it cant

To Reproduce
Steps to reproduce the behavior:

  1. Make the bot DM a user it cant

Expected behavior
It should try the fallback channel if provided, or just not send a captcha

Screenshots

throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
              ^

DiscordAPIError[50007]: Cannot send messages to this user
    at SequentialHandler.runRequest (C:\Users\Elijah\Desktop\bots\vf\node_modules@discordjs\rest\dist\index.js:659:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (C:\Users\Elijah\Desktop\bots\vf\node_modules@discordjs\rest\dist\index.js:458:14)
    at async REST.request (C:\Users\Elijah\Desktop\bots\vf\node_modules@discordjs\rest\dist\index.js:902:22)
    at async DMChannel.send (C:\Users\Elijah\Desktop\bots\vf\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:175:15)
    at async C:\Users\Elijah\Desktop\bots\vf\node_modules\djscaptcha\src\index.cjs:331:25
    at async handleAttempt (C:\Users\Elijah\Desktop\bots\vf\node_modules\djscaptcha\src\index.cjs:311:17)
    at async C:\Users\Elijah\Desktop\bots\vf\node_modules\djscaptcha\src\index.cjs:511:13
    at async Captcha.present (C:\Users\Elijah\Desktop\bots\vf\node_modules\djscaptcha\src\index.cjs:258:9) {
  requestBody: {
    files: [],
    json: {
      content: undefined,
      tts: false,
      nonce: undefined,
      embeds: [
        {
          title: '❌ You failed to solve the Captcha!!',
          description: "» <@741601107310018560>, you've failed to solve the Captcha, we know these can be hard sometimes.\n" +
            'Please rejoin the server if you want to try again!',
          timestamp: '2022-10-23T16:29:11.678Z',
          color: 13047061,
          thumbnail: {
            url: 'https://cdn.discordapp.com/icons/1025748794245132328/745b42c9a7d4a860380109928b799e35.webp'
          }
        }
      ],
      components: undefined,
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: undefined,
      message_reference: undefined,
      attachments: undefined,
      sticker_ids: undefined,
      thread_name: undefined
    }
  },
  rawError: { message: 'Cannot send messages to this user', code: 50007 },
  code: 50007,
  status: 403,
  method: 'POST',
  url: 'https://discord.com/api/v10/channels/1033779135950110750/messages'
}
@AdamT20054 AdamT20054 added the bug Something isn't working label Oct 23, 2022
@AdamT20054 AdamT20054 self-assigned this Oct 23, 2022
@AdamT20054 AdamT20054 pinned this issue Oct 23, 2022
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

1 participant