Skip to content

Commit

Permalink
Merge pull request #84 from taichanNE30/develop
Browse files Browse the repository at this point in the history
Prod 2023-07-31
  • Loading branch information
tai-cha authored Jul 30, 2023
2 parents 19e42cd + 9ec00a5 commit 1b9fdae
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/post_remind.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import YAMAG from '@/utils/misskey'
import { recordTime, remindPostText } from '@/utils/config'

let now = new Date()
const getTimeDiff = ():number => recordTime.getTime() - new Date().getTime();
const getTimeDiff = ():number => {
let target = recordTime

if (target.getTime() < new Date().getTime()) {
target.setDate(target.getDate() + 1)
}

return recordTime.getTime() - new Date().getTime();
}

async function main() {
console.log("Remind Post Script Launched")
Expand All @@ -12,7 +19,7 @@ async function main() {
await new Promise(resolve => setTimeout(resolve, 50))
}
console.log(new Date())
YAMAG.Misskey.postNote(`${remindPostText}(${now.toLocaleDateString('ja-JP')})`)
YAMAG.Misskey.postNote(`${remindPostText}(${recordTime.toLocaleDateString('ja-JP')})`)
}
}

Expand Down

0 comments on commit 1b9fdae

Please sign in to comment.