fix: Now automatically update last updated date

This commit is contained in:
Siwoo Jeon 2024-10-18 22:39:04 +09:00
parent 9c3f371f0c
commit 2efe702309
Signed by: migan
GPG key ID: 036E9A8C5E8E48DA
2 changed files with 10 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "muffinbot", "name": "muffinbot",
"version": "4.0.0-pudding.p241017a", "version": "4.0.0-pudding.p241018a",
"main": "dist/src/index.js", "main": "dist/src/index.js",
"private": true, "private": true,
"dependencies": { "dependencies": {

View file

@ -11,13 +11,21 @@ const release = version
.slice((semver.coerce(version)?.toString() + '-').length) .slice((semver.coerce(version)?.toString() + '-').length)
.split('.')[1] .split('.')[1]
function getLastUpdated() {
const updated = release.match(/[0-9]/g)!.join('')
const year = updated.slice(0, 2)
const month = updated.slice(2, 4)
const day = updated.slice(4, 6)
return `20${year}-${month}-${day}`
}
container.config = config container.config = config
container.prefix = config.bot.prefix container.prefix = config.bot.prefix
container.version = version container.version = version
container.database = new PrismaClient() container.database = new PrismaClient()
container.dokdoAliases = ['dokdo', 'dok', 'Dokdo', 'Dok', '테스트'] container.dokdoAliases = ['dokdo', 'dok', 'Dokdo', 'Dok', '테스트']
container.chatBot = new ChatBot(container.database) container.chatBot = new ChatBot(container.database)
container.lastUpdated = new Date('2024-10-09') container.lastUpdated = new Date(getLastUpdated())
container.embedColors = { container.embedColors = {
default: 0xaddb87, default: 0xaddb87,
fail: 0xff0000, fail: 0xff0000,