How to use the discord-giveaways.edit 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
let messageID = args[1];
            if(!messageID){
                return message.channel.send(message.language.get("GIVEAWAY_ERR_DELETE"));
            }
            giveaways.delete(messageID).then(() => {
                return message.channel.send(message.language.get("GIVEAWAY_DELETED"));
            }).catch((err) => {
                return message.channel.send(message.language.get("GIVEAWAY_ERR_MESSAGE_NOT_FOUND", messageID));
            });
        } else if(status === "end"){
            let messageID = args[1];
            if(!messageID){
                return message.channel.send(message.language.get("GIVEAWAY_ERR_END"));
            }
            try {
                giveaways.edit(messageID, {
                    setEndTimestamp: Date.now()
                });
                return message.channel.send(message.language.get("GIVEAWAY_ENDED"));
            } catch(e){
                return message.channel.send(message.language.get("GIVEAWAY_ERR_MESSAGE_NOT_FOUND", messageID));
            }
        } else {
            return message.channel.send(message.language.get("GIVEAWAY_ERR_STATUS"));
        }

    }

discord-giveaways

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

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis