Closed ghost closed 5 years ago
Hello,
I just published an update of the module that fixes this bug, so you need to update it with npm install discord-giveaways
for it to work properly.
Have a good day!
Thx
Hello, I installed the giveaway bot module as well as the code that goes with and at the end of the giveaway even if there are more than 10 people "Giveaway canceled, no valid participations." can someone help me?
@Justin2528 open a new issue
const Discord = require("discord.js"); const giveaways = require("discord-giveaways"); const ms = require("ms");
module.exports.run = async (bot, message, args) => { message.delete() if (!message.member.roles.some(role => role.name === 'giveaway')) return message.channel.send("Hey! you need the
giveaway
role!") if(!args[0])return message.reply("Time plz! (example: 1d (1 day)/1 m (1 minute)/ 1 h (1 hour) / 1s (1s))");if(!args[1])return message.channel.send("Wrong! How many winners? d>help giveaway for more") if(isNaN(args[1]))return message.channel.send("What? Idk, not a number? The winner is not a number") if(!args[2])return message.channel.send("What's the prize?")
giveaways.start(message.channel, { time: ms(args[0]), prize: args.slice(2).join(" "), winnersCount: parseInt(args[1]), messages: { giveaway: "ππ GIVEAWAY ππ", giveawayEnded: "ππ GIVEAWAY ENDED ππ", timeRemaining: "Time remaining: {duration}!", inviteToParticipate: "React with π to participate!", winMessage: "Congratulations, {winners}! You won {prize}!", embedFooter: "DerpBot Giveaways", noWinner: "Giveaway cancelled, no valid participations.", winners: "winner(s)", endedAt: "Ended at", units: { seconds: "seconds", minutes: "minutes", hours: "hours", days: "days" } } });
}
module.exports.config = { name: "giveaway", aliases: ["gift"], description: "Giveaway :D", usage: "d>giveaway
ready events giveaways.launch(bot, { updateCountdownEvery: 3000, botsCanWin: false, ignoreIfHasPermission: [
Join this to test it