module.exports = d => {
    let inside = d.unpack()
    let code = d.command.code
    let error = d.inside(inside)
    if (error) return d.error(error)
    const options = [g = d.message.guild.id, message = "- Giveaway: {prize} ID: ({message})"] = inside.splits
    const guild = d.client.guilds.cache.get(g)
    if (!guild) return d.error(`\`${d.func}: Invalid guild ID in ${inside}\``)
    const gw = d.client.giveawaysManager.giveaways.filter(i => i.guildID === g && !i.ended);
    const gws = gw.map(a => message.replace('{message}', a.messageID).replace('{end}', a.endAt).replace('{start}', a.startAt).replace('{prize}', a.prize))
    return {
        code: code.replaceLast(`$giveawaysList${inside}`, gws.join('\n'))
    }
} 