Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if giveaway is due in sqlite, not ts #24

Open
filip326 opened this issue Mar 27, 2023 · 1 comment
Open

Check if giveaway is due in sqlite, not ts #24

filip326 opened this issue Mar 27, 2023 · 1 comment
Assignees

Comments

@filip326
Copy link
Collaborator

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.

@filip326 filip326 self-assigned this Mar 27, 2023
@EinsKatze
Copy link
Collaborator

in sqlite you can get the current utc timestampt with unixepoch() and could therefore get the due dates with WHERE timestamp < unixepoch() ig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants