diff --git a/.gitignore b/.gitignore index a061035..848b5b1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ tokens.json transactionLogs.txt jobs/available/available.json commands/money/lottery/winners.json +.vscode/launch.json diff --git a/commands/money/lottery/subcommands/information.js b/commands/money/lottery/subcommands/information.js index 89579ad..c89983c 100644 --- a/commands/money/lottery/subcommands/information.js +++ b/commands/money/lottery/subcommands/information.js @@ -15,7 +15,7 @@ module.exports = { function createNextDrawDate() { let targetDay = 6 // saturday - let now = new Date(1633791600000) + let now = new Date() let nextDrawDate = new Date(now) if (now.getHours() < 16) { diff --git a/config.json b/config.json index bbc832a..50b08d3 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { - "version": "s3.0", + "version": "v3.0", "guildIds": { diff --git a/index.js b/index.js index 3e57db7..62bbf96 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ -// oggbot s3.0 by f2reninj5 +// oggbot v3.0 by f2reninj5 // imports const oggbot = require('./oggbot') diff --git a/jobs/birthday.js b/jobs/birthday.js index db2560d..8bd117c 100644 --- a/jobs/birthday.js +++ b/jobs/birthday.js @@ -16,7 +16,7 @@ module.exports = { }, async execute() { - const announce = new cron.CronJob('0 0 12 * * *', async () => { + const announce = new cron.CronJob('0 0 16 * * *', async () => { async function getBirthdayUsers() { @@ -30,7 +30,7 @@ module.exports = { for (id of rows.map(row => row.id)) { - let user = oggbot.fetchUser(id) + let user = await oggbot.fetchUser(id) users.push(user) } @@ -46,11 +46,11 @@ module.exports = { let guild = await client.guilds.fetch('745569983542853643') let channels = await guild.channels.fetch() - let channel = channels.filter(channel => channel.name == 'announcements') + let channel = channels.filter(channel => channel.name == 'announcements').first() for (user of users) { - channel.send({ content: `HAPPY BIRTHDAY ${user.username}!` }) + channel.send({ content: `HAPPY BIRTHDAY! ${user.username} is now ${user.age}!` }) } }, { timeZone: 'Europe/London' })