How to use the discord-giveaways.start function in discord-giveaways

To help you get started, we’ve selected a few discord-giveaways examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Androz2091 / AtlantaBot / commands / Moderation / giveaway.js View on Github external
}
            if(ms(time) > ms("15d")){
                return message.channel.send(message.language.get("GIVEAWAY_ERR_15_DAYS"))
            }
            let winnersCount = args[2];
            if(!winnersCount){
                return message.channel.send(message.language.get("GIVEAWAY_ERR_CREATE", data.settings.prefix));
            }
            if(isNaN(winnersCount) || winnersCount > 10 || winnersCount < 1){
                return message.channel.send(message.language.get("ERR_INVALID_NUMBER_MM", 1, 10));
            }
            let prize = args.slice(3).join(" ");
            if(!prize){
                return message.channel.send(message.language.get("GIVEAWAY_ERR_CREATE", data.settings.prefix)); 
            }
            giveaways.start(message.channel, {
                time: ms(time),
                prize: prize,
                winnersCount: parseInt(winnersCount, 10),
                messages: message.language.get("GIVEAWAY_CREATE_MESSAGES")
            }).then(() => {
                message.channel.send(message.language.get("GIVEAWAY_CREATED", message.channel));
            });
        } else if(status === "reroll"){
            let messageID = args[1];
            if(!messageID){
                return message.channel.send(message.language.get("GIVEAWAY_ERR_REROLL"));
            }
            giveaways.reroll(messageID, message.language.get("GIVEAWAY_REROLL_MESSAGES")).then(() => {
                return message.channel.send(message.language.get("GIVEAWAY_REROLLED"));
            }).catch((err) => {
                return message.channel.send(message.language.get("GIVEAWAY_ERR_REROLL_MSG_ENDED", messageID));

discord-giveaways

A complete framework to facilitate the creation of giveaways using discord.js

MIT
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis