|
const giveawayArr = await db.allAsync(`SELECT message_id, prize, timestamp, status, organizer_id, channel_id FROM giveaways WHERE status = 0 and channel_id is not null`, []) |
Here all open giveaways are fetched from the sqlite db and checked if due afterwards. It should be possible to fetch only the due giveaways.