marioparaschiv / nitro-sniper

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

[Bug] Giveaway Timer Broken #122

Closed Imploded closed 3 years ago

Imploded commented 3 years ago

Describe the bug The time waited before joining the giveaway is significantly lower than what is entered.

To Reproduce Steps to reproduce the behavior:

  1. Set delay to at least 60 seconds (probably works with shorter times as well)
  2. Wait for a giveaway to show up
  3. Observe the giveaway delay

Expected behavior Join a giveaway after the set delay

Additional context This happened even after I increased the delay. My delay is set to 130 seconds but it joins the giveaways after waiting less than 10 seconds.

InimicalPart commented 3 years ago

Is it possible for you to show us the .env file? NOTE: Don't forget to remove the tokens before posting!

Imploded commented 3 years ago

I deployed to heroku but here is the configuration file:

{
  "tokens": {
    "main": "",
    "alts": [
 "",
""
    ]
  },
  "mode": "alts",
  "nitro": {
    "max": 2,
    "cooldown": 24
  },
  "giveaway": {
    "enabled": true,
    "delay": 130,
    "dm": true,
    "dmMessage": "did i win something???",
    "dmDelay": 190,
    "blacklistedWords": [
      "bot",
      "test",
      "ban",
      "fake",
      "timer"
    ],
    "whitelistOnly": false,
    "whitelistedWords": [
      "nitro"
    ],
    "blacklistedServers": [
      ""
    ]
  },
  "invite": {
    "enabled": false,
    "delay": {
      "min": 10,
      "max": 20
    },
    "members": {
      "min": 1500,
      "max": 50000
    },
    "max": 10,
    "cooldown": 6
  },
  "webhook": {
    "url": "",
    "enabled": {
      "codeInvalid": false,
      "codeAlreadyRedeemed": false,
      "codeSuccess": true,
      "giveawayEntered": true,
      "giveawayWin": true,
      "inviteJoin": false
    },
    "mentionEveryone": {
      "codeInvalid": false,
      "codeAlreadyRedeemed": false,
      "codeSuccess": true,
      "giveawayEntered": false,
      "giveawayWin": true,
      "inviteJoin": false
    }
  }
}
InimicalPart commented 3 years ago

Hi! I've analyzed a bit and I can confirm this is in fact a bug, to fix this. what you need to do is open the nitro-sniper directory in explorer and navigate to src/modules image Then, open Giveaway.js in your favorite text editor (Notepad/Visual Studio Code/Sublime Text, etc.) and find the line that looks like this (Should be line 129): image and change it to look like this: image And now you're done! NOTE: This will not fix the DM feature! To fix the DM feature then you should find the same line at line number 180 and change it to the same thing as the image above.

When you're done just save the file and restart your sniper and it should work!

NOTE: The code automatically gives some randomness to the delay, meaning that it won't always be i.e 130 seconds in delay, it will be in a range from 130 to 195 (1.5 times the delay amount)

Tested on node v16.3.0