Androz2091 / discord-giveaways

πŸŽ‰ Complete framework to facilitate the creation of giveaways using discord.js
https://discord-giveaways.js.org
MIT License
333 stars 127 forks source link

.reroll doesnt work. #202

Closed jameslinimk closed 3 years ago

jameslinimk commented 3 years ago

I had a giveaway with 3 reactions when it ended (Mine, the bots, and another user) and then I won. I re-rolled 15 times, and each time I rerolled the winner was me. Doing

message.client.giveawaysManager.giveaways.find(g => !g.ended && g.messageID === '805493149228728360').options

Returned

  options: {
    startAt: 1612114931942,
    endAt: 1612978931942,
    winnerCount: '1',
    winnerIDs: [],
    channelID: '757280403202768996',
    guildID: '712323497380020314',
    ended: false,
    prize: 'gay',
    hostedBy: '<@400029130219061260>',
    messages: {
      giveaway: 'πŸŽ‰πŸŽ‰ **GIVEAWAY** πŸŽ‰πŸŽ‰',
      giveawayEnded: 'πŸŽ‰πŸŽ‰ **GIVEAWAY ENDED** πŸŽ‰πŸŽ‰',
      inviteToParticipate: 'React with πŸŽ‰ to participate!',
      timeRemaining: 'Time remaining: **{duration}**!',
      winMessage: 'Congratulations, {winners}! You won **{prize}**!\n{messageURL}',
      embedFooter: 'Giveaways',
      noWinner: 'Giveaway cancelled, no valid participations.',
      winners: 'winner(s)',
      endedAt: 'Ended at',
      hostedBy: 'Hosted by: {user}',
      units: [Object]
    },
    reaction: 'πŸŽ‰',
    botsCanWin: undefined,
    exemptPermissions: undefined,
    exemptMembers: undefined,
    embedColor: '#EFDEB2',
    embedColorEnd: '#2f3136',
    extraData: undefined
  },

Images: image image

Note: I edited the giveaway before stopping, it and here is my code.

        message.client.giveawaysManager.edit(giveaway.messageID, {
            setEndTimestamp: Date.now() + ms(giveawayDuration),
            newWinnerCount: giveawayNumberWinners,
            newPrize: giveawayPrize,
        })
        .then(() => {
            message.channel.send('Giveaway edited.');
        })
        .catch((e) => {
            if(e.startsWith(`Giveaway with message ID ${giveaway.messageID} is already ended.`)){
                message.channel.send('This giveaway is already ended!');
            } else {
                message.channel.send('An error occured...');
            }
        });
Nico105 commented 3 years ago

image Worked fine for me. Are you using the latest version of the module? And when you create your giveawaysManager do you have set exemptMembers or exemptPermissions there?

jameslinimk commented 3 years ago

image Worked fine for me. Are you using the latest version of the module? And when you create your giveawaysManager do you have set exemptMembers or exemptPermissions there?

Damn. fuck me, exemptPermissions is there. Thanks