Skip to content

Commit

Permalink
Bug fixes and final v3.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
f2reninj5 committed Oct 18, 2021
1 parent 1446e26 commit 3861662
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ tokens.json
transactionLogs.txt
jobs/available/available.json
commands/money/lottery/winners.json
.vscode/launch.json
2 changes: 1 addition & 1 deletion commands/money/lottery/subcommands/information.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "s3.0",
"version": "v3.0",

"guildIds": {

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// oggbot s3.0 by f2reninj5
// oggbot v3.0 by f2reninj5

// imports
const oggbot = require('./oggbot')
Expand Down
8 changes: 4 additions & 4 deletions jobs/birthday.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {

Expand All @@ -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)
}

Expand All @@ -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' })
Expand Down

0 comments on commit 3861662

Please sign in to comment.