marioparaschiv / nitro-sniper

🔫 A lightweight, fast and efficient discord nitro sniper, giveaway sniper & invite sniper.
819 stars 3.25k forks source link

[Bug] [major, successfully reproduced] sniper crash while checking for invite #397

Closed mte0 closed 2 years ago

mte0 commented 2 years ago

Describe the bug

sniper crashes after running for 10m or so apears to happen when it checks a message for an invite.

sniper connects etc but crashes after a bit

To Reproduce

run sniper send a message in a channel the sniper can see? im not sure

Expected behavior

kept running/joined the invite it found

Please provide your snipers settings.

got rid of most the tokens

settings="{
    tokens: {
       // Main Token (ex: Nz...)
       main: 'ODczMDU2XXXXXXXXXXXXXXXXXXXXXXXXXX',
       // Alt Tokens (ex: Nz...)
      alts: [
         'mfa.S2QNPVCY08nQ5XXXXXXXXXXXXXX',
   "mfa.S2QNPVCY08nXXXXXXXXXXX",
      ],
    },
    // The mode to run the sniper in. Options: main (only main account), alts (only alts), both
    mode: 'both',
    /*
       The status the accounts should be on.
       Options: online, dnd, idle, offline, default
       default means the status will not be modified.
    */
    status: {
       // The status the main account will have IF it's logged in
       main: 'default',
       // The status the logged in alts will have
       alts: 'default'
    },
    nitro: {
       // The amount of nitros needed to be sniped for the cooldown to activate
       max: 15,
       // Cooldown to activate after max nitro has been hit (in hours)
       cooldown: 3,
       dm: {
          /*
           * How long to wait before attempting to claim the nitro in DMs (in seconds)
           * This is to avoid suspicion when winning giveaways by slowing down the sniper from instantly sniping it.
           */
          delay: 13
       },
       // A list of channel IDs to ignore when sniping nitro
       blacklistedChannels: [
          '',
       ]
    },
    giveaway: {
       // Wether or not to activate the giveaway sniper (true/false)
       enabled: true,
       // Delay to react to the giveaway (in seconds)
       delay: 49,
       // DM the hoster on giveaway win (true/false)
       dm: true,
       // Messages to DM the host
       dmMessages: [
          'Hey, i won the giveaway.',
          'yo bro i won the giveaway can u drop the code here?',
          'can i get my nitro here plz!'
       ],
       // How long to wait to DM (in seconds)
       dmDelay: 32,
       // How long to wait between messages (in seconds)
       messageDelay: 2,
       // Blacklisted words for giveaway prizes
       blacklistedWords: [
          'bot',
          'test',
          'ban',
          'kick',
          'react',
          'autoreact',
          'auto react',
          'sniper',
          'selfbot',
          'self bot'
       ],
       // Only react to whitelisted giveaway prizes (true/false)
       whitelistOnly: true,
       // Whitelisted words for giveaway prizes
       whitelistedWords: [
          'nitro'
       ],
       // Blacklisted Server IDs to not snipe giveaways on
       blacklistedServers: [
         'x',
         'x',
         'x',
         'x',
         'x',
         'x'
       ],
       // Only snipe giveaways on whitelisted servers (true/false)
       whitelistServersOnly: false,
       whitelistedServers: [
         ''
       ],
       prizeLength: {
          // The minimum character length of the prize (null = infinite)
          min: 4,
          // The maximum character length of the prize (null = infinite)
          max: null
       }
    },
    invite: {
       // Wether or not to activate the invite sniper (true/false)
       enabled: true,
       delay: {
          // Minimum delay to join the server (in seconds)
          min: 3000,
          // Maximum delay to join the server (in seconds)
          max: 99999
       },
       members: {
          // The minimum member count the server should have
          min: 8000,
          // The maximum member count the server should have
          max: 60000
       },
       // The amount of joined invites needed for the cooldown to activate
       max: 2,
       // Cooldown to activate after max joined invites has been hit (in hours)
       cooldown: 7,
       // Whether to accept an invite on any other alt/account (depends on 'mode') if the current alt has max servers (true/false)
       queue: true,
       // Whether to allow the main token to snipe invites ONLY if sniper mode is set to 'both' (true/false)
       onlyAlts: true
    },
    webhook: {
       // URL to fire webhook to for notifications (ex: https://discord.com/api/webhooks/.../...)
       url: 'https://discord.com/api/webhooks/x/x',
       enabled: {
          // Fire webhook on invalid code (true/false)
          codeInvalid: false,
          // Fire webhook on already redeemed code (true/false)
          codeAlreadyRedeemed: true,
          // Fire webhook on sniped code (true/false)
          codeSuccess: true,
          // Fire webhook on giveaway enter (true/false)
          giveawayEntered: true,
          // Fire webhook on giveaway win (true/false)
          giveawayWin: true,
          // Fire webhook on invite join (true/false)
          inviteJoin: false,
          // Fire webhook on failure of sniping invite (true/false)
          inviteFail: true
       },
       mentionEveryone: {
          // Mention on invalid code (true/false)
          codeInvalid: false,
          // Mention on already redeemed code (true/false)
          codeAlreadyRedeemed: false,
          // Mention on sniped code (true/false)
          codeSuccess: true,
          // Mention on giveaway enter (true/false)
          giveawayEntered: false,
          // Mention on giveaway win (true/false)
          giveawayWin: true,
          // Mention on invite join (true/false)
          inviteJoin: false,
          // Mention on failure of sniping invite (true/false)
          inviteFail: false
       }
    },
    // Whether to log all console messages to file (true/false)
    log: true
 }"

What platform are you seeing the problem on?

Local Computer

Relevant log output if applicable.

[2022-05-14 08:28:53] Sniper is running with 22 accounts and 581 servers.
C:\Users\Administrator\Desktop\snip\nitro-sniper\src\modules\Invite.js:30
      const invites = msg.content.match(this.regex.invite);
                          ^

TypeError: Cannot read properties of undefined (reading 'content')
    at Invite.handleInvite (C:\Users\Administrator\Desktop\snip\nitro-sniper\src\modules\Invite.js:30:27)
    at Sniper.emit (node:events:538:35)
    at Object.PacketHandlers.MESSAGE_CREATE (C:\Users\Administrator\Desktop\snip\nitro-sniper\node_modules\discord.js-light\handlers.js:186:9)
    at WebSocketManager.client.ws.handlePacket (C:\Users\Administrator\Desktop\snip\nitro-sniper\node_modules\discord.js-light\actions.js:38:34)
    at WebSocketShard.onPacket (C:\Users\Administrator\Desktop\snip\nitro-sniper\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\Administrator\Desktop\snip\nitro-sniper\node_modules\discord.js\src\client\websocket\WebSocketShard.js:300:10)
    at WebSocket.onMessage (C:\Users\Administrator\Desktop\snip\nitro-sniper\node_modules\ws\lib\event-target.js:132:16)
    at WebSocket.emit (node:events:526:28)
    at Receiver.receiverOnMessage (C:\Users\Administrator\Desktop\snip\nitro-sniper\node_modules\ws\lib\websocket.js:1
047:20)
    at Receiver.emit (node:events:526:28)
mte0 commented 2 years ago

fresh clone of the repo, nothing modified apart from config btw

Craftzman7 commented 2 years ago

@localip just tested, was able to reproduce.

mte0 commented 2 years ago

bump @localip

mte0 commented 2 years ago

@localip ik u saw this why u ignoring?

marioparaschiv commented 2 years ago

@localip ik u saw this why u ignoring?

You know you're not entitled to anything right? The more you beg me the less I will care.

mte0 commented 2 years ago

mb bro 😭, just lmk if u have any ideas on whats casuing it/if you could fix it

Craftzman7 commented 2 years ago

mb bro 😭, just lmk if u have any ideas on whats casuing it/if you could fix it

He could fix it, I could fix it, anyone that knows how to open a pull request could fix it. We just have better things to do.