UNPKG

giftcord

Version:

Giveaway discord.js Package

45 lines (31 loc) 1.08 kB
const GiveawayModel = require('../models/Giveaway'); class Giveaway { constructor(options) { this.prize = options.prize; this.endsOn = options.endsOn; this.guildId = options.guildId; this.channelId = options.channelId; this.hostedBy = options.hostedBy; this.messageId = options.messageId; this.startsOn = options.startsOn; this.winners = options.winners; this.emoji = options.emoji; this.hasEnded = 'False'; this.duration = options.duration; const newGiveaway = new GiveawayModel({ prize: this.prize, emoji: this.emoji, endsOn: this.endsOn, guildId: this.guildId, channelId: this.channelId, hostedBy: this.hostedBy, messageId: this.messageId, startsOn: this.startsOn, winners: this.winners, hasEnded: this.hasEnded, duration: this.duration }); newGiveaway.save(); } } module.exports = Giveaway;