mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-12-26 11:45:37 -05:00
Compare commits
4 Commits
aafdc3571b
...
dba415862f
Author | SHA1 | Date | |
---|---|---|---|
|
dba415862f | ||
|
f078129f43 | ||
|
d2100aafb9 | ||
|
fd4948917b |
@ -1,5 +1,5 @@
|
|||||||
FROM node:22.7-alpine3.20
|
FROM node:22.7-alpine3.20
|
||||||
ENV YARN_VERSION="4.5.0"
|
ENV YARN_VERSION="4.5.1"
|
||||||
ENV TZ="Australia/Sydney"
|
ENV TZ="Australia/Sydney"
|
||||||
ENV NODE_COMPILE_CACHE="/Daggerbot/build_cache"
|
ENV NODE_COMPILE_CACHE="/Daggerbot/build_cache"
|
||||||
RUN yarn policies set-version $YARN_VERSION
|
RUN yarn policies set-version $YARN_VERSION
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
"npm": "NPM isn't supported, please use Yarn instead."
|
"npm": "NPM isn't supported, please use Yarn instead."
|
||||||
},
|
},
|
||||||
"engineStrict": true,
|
"engineStrict": true,
|
||||||
"packageManager": "yarn@4.5.0+sha512.837566d24eec14ec0f5f1411adb544e892b3454255e61fdef8fd05f3429480102806bac7446bc9daff3896b01ae4b62d00096c7e989f1596f2af10b927532f39",
|
"packageManager": "yarn@4.5.1+sha512.341db9396b6e289fecc30cd7ab3af65060e05ebff4b3b47547b278b9e67b08f485ecd8c79006b405446262142c7a38154445ef7f17c1d5d1de7d90bf9ce7054d",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@napi-rs/canvas": "0.1.59",
|
"@napi-rs/canvas": "0.1.59",
|
||||||
"@octokit/rest": "21.0.2",
|
"@octokit/rest": "21.0.2",
|
||||||
@ -46,7 +46,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/ms": "0.7.34",
|
"@types/ms": "0.7.34",
|
||||||
"@types/node": "22.8.1",
|
"@types/node": "22.8.4",
|
||||||
"@types/node-cron": "3.0.11",
|
"@types/node-cron": "3.0.11",
|
||||||
"typescript": "5.5.4"
|
"typescript": "5.5.4"
|
||||||
}
|
}
|
||||||
|
@ -14,11 +14,11 @@
|
|||||||
"468835415093411861"
|
"468835415093411861"
|
||||||
],
|
],
|
||||||
"botSwitches": {
|
"botSwitches": {
|
||||||
"dailyMsgsBackup": true,
|
|
||||||
"registerCommands": false,
|
"registerCommands": false,
|
||||||
"commands": true,
|
"commands": true,
|
||||||
"logs": true,
|
"logs": false,
|
||||||
"mpSys": true,
|
"mpSys": false,
|
||||||
|
"dailyMsgs": true,
|
||||||
"buttonRoles": true,
|
"buttonRoles": true,
|
||||||
"automod": true,
|
"automod": true,
|
||||||
"autores": true
|
"autores": true
|
||||||
|
@ -63,7 +63,7 @@ setInterval(async()=>{
|
|||||||
|
|
||||||
const formattedDate = Math.floor((now - client.config.LRSstart)/1000/60/60/24);
|
const formattedDate = Math.floor((now - client.config.LRSstart)/1000/60/60/24);
|
||||||
const dailyMsgs = await client.dailyMsgs.fetchDays();
|
const dailyMsgs = await client.dailyMsgs.fetchDays();
|
||||||
if (client.config.botSwitches.dailyMsgsBackup && !dailyMsgs.some(x=>x[0] === formattedDate)) {
|
if (client.config.botSwitches.dailyMsgs && !dailyMsgs.some(x=>x[0] === formattedDate)) {
|
||||||
if (!dailyMsgs.find(x=>x.dataValues.day === formattedDate)) {
|
if (!dailyMsgs.find(x=>x.dataValues.day === formattedDate)) {
|
||||||
let total = (await client.userLevels.fetchEveryone()).reduce((a,b)=>a + b.messages, 0); // Sum of all users
|
let total = (await client.userLevels.fetchEveryone()).reduce((a,b)=>a + b.messages, 0); // Sum of all users
|
||||||
const yesterday = dailyMsgs.find(x=>x.day === formattedDate - 1)
|
const yesterday = dailyMsgs.find(x=>x.day === formattedDate - 1)
|
||||||
@ -90,11 +90,11 @@ setInterval(async()=>{
|
|||||||
}
|
}
|
||||||
}, 5000)
|
}, 5000)
|
||||||
|
|
||||||
if (client.config.botSwitches.dailyMsgsBackup) {
|
// Cronjob tasks
|
||||||
|
if (client.config.botSwitches.dailyMsgs) {
|
||||||
client.userLevels.initSelfdestruct();
|
client.userLevels.initSelfdestruct();
|
||||||
client.userLevels.dataSweeper();
|
client.userLevels.dataSweeper();
|
||||||
}
|
}
|
||||||
// Cronjob tasks
|
|
||||||
|
|
||||||
// Raw gateway event receivers
|
// Raw gateway event receivers
|
||||||
export let rawSwitches = {
|
export let rawSwitches = {
|
||||||
|
2
src/interfaces.d.ts
vendored
2
src/interfaces.d.ts
vendored
@ -68,11 +68,11 @@ export interface Config {
|
|||||||
LRSstart: number,
|
LRSstart: number,
|
||||||
whitelistedServers: string[],
|
whitelistedServers: string[],
|
||||||
botSwitches: {
|
botSwitches: {
|
||||||
dailyMsgsBackup: boolean,
|
|
||||||
registerCommands: boolean,
|
registerCommands: boolean,
|
||||||
commands: boolean,
|
commands: boolean,
|
||||||
logs: boolean,
|
logs: boolean,
|
||||||
mpSys: boolean,
|
mpSys: boolean,
|
||||||
|
dailyMsgs: boolean,
|
||||||
buttonRoles: boolean,
|
buttonRoles: boolean,
|
||||||
automod: boolean,
|
automod: boolean,
|
||||||
autores: boolean
|
autores: boolean
|
||||||
|
51
yarn.lock
51
yarn.lock
@ -6,11 +6,11 @@ __metadata:
|
|||||||
cacheKey: 10
|
cacheKey: 10
|
||||||
|
|
||||||
"@babel/runtime@npm:^7.25.6":
|
"@babel/runtime@npm:^7.25.6":
|
||||||
version: 7.25.7
|
version: 7.26.0
|
||||||
resolution: "@babel/runtime@npm:7.25.7"
|
resolution: "@babel/runtime@npm:7.26.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
regenerator-runtime: "npm:^0.14.0"
|
regenerator-runtime: "npm:^0.14.0"
|
||||||
checksum: 10/73411fe0f1bff3a962586cef05b30f49e554b6563767e6d84f7d79d605b2c20e7fc3df291a3aebef69043181a8f893afdab9e6672557a5c2d08b9377d6f678cd
|
checksum: 10/9f4ea1c1d566c497c052d505587554e782e021e6ccd302c2ad7ae8291c8e16e3f19d4a7726fb64469e057779ea2081c28b7dbefec6d813a22f08a35712c0f699
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -511,9 +511,9 @@ __metadata:
|
|||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@types/lodash@npm:^4.17.0":
|
"@types/lodash@npm:^4.17.0":
|
||||||
version: 4.17.10
|
version: 4.17.13
|
||||||
resolution: "@types/lodash@npm:4.17.10"
|
resolution: "@types/lodash@npm:4.17.13"
|
||||||
checksum: 10/10fe24a93adc6048cb23e4135c1ed1d52cc39033682e6513f4f51b74a9af6d7a24fbea92203c22dc4e01e35f1ab3aa0fd0a2b487e8a4a2bbdf1fc05970094066
|
checksum: 10/ddb34e20810c71be2d9445bcc4b64ec25b83976738454de709854b79c7f655b03704b76235445699956d65012987720e0e429a35489de65495cdb5420202d905
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -531,21 +531,12 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@types/node@npm:*":
|
"@types/node@npm:*, @types/node@npm:22.8.4":
|
||||||
version: 22.7.5
|
version: 22.8.4
|
||||||
resolution: "@types/node@npm:22.7.5"
|
resolution: "@types/node@npm:22.8.4"
|
||||||
dependencies:
|
|
||||||
undici-types: "npm:~6.19.2"
|
|
||||||
checksum: 10/e8ba102f8c1aa7623787d625389be68d64e54fcbb76d41f6c2c64e8cf4c9f4a2370e7ef5e5f1732f3c57529d3d26afdcb2edc0101c5e413a79081449825c57ac
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"@types/node@npm:22.8.1":
|
|
||||||
version: 22.8.1
|
|
||||||
resolution: "@types/node@npm:22.8.1"
|
|
||||||
dependencies:
|
dependencies:
|
||||||
undici-types: "npm:~6.19.8"
|
undici-types: "npm:~6.19.8"
|
||||||
checksum: 10/ae969e3d956dead1422c35d568ea5d48dd124a38a1a337cbd120fec6e13cc92b45c7308f91f1139fcd2337a67d4704d5614d6a2c444b1fb268f85e9f1d24c713
|
checksum: 10/ee6b6b66c290a74bb37487f5ec533b7333c25e1b2f45016af4cd870408c4366f6fca75de5b8bb7a6e5836ab0536d2ef1910a89a2f797ae33a80344d0e81de03e
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -628,9 +619,9 @@ __metadata:
|
|||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"complex.js@npm:^2.1.1":
|
"complex.js@npm:^2.1.1":
|
||||||
version: 2.3.0
|
version: 2.4.0
|
||||||
resolution: "complex.js@npm:2.3.0"
|
resolution: "complex.js@npm:2.4.0"
|
||||||
checksum: 10/e11898404570a2a10154cc3d21ddb66ef208d1a9d3aa13e76a7c3e73b9f7e36a42435659b13d34dc1990d7276e1c32beb59274e3870e4d4324365b335500bfff
|
checksum: 10/7377be0136085b5818488894c7e391974f64edb4ddb983216fecb542be24b3b75f232482bc930917722b0b4fef0191e57a224ce7d6a48a5398700142cd55b120
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -644,7 +635,7 @@ __metadata:
|
|||||||
"@sequelize/postgres": "npm:7.0.0-alpha.43"
|
"@sequelize/postgres": "npm:7.0.0-alpha.43"
|
||||||
"@toast/tokenservice-client": "npm:1.3.1"
|
"@toast/tokenservice-client": "npm:1.3.1"
|
||||||
"@types/ms": "npm:0.7.34"
|
"@types/ms": "npm:0.7.34"
|
||||||
"@types/node": "npm:22.8.1"
|
"@types/node": "npm:22.8.4"
|
||||||
"@types/node-cron": "npm:3.0.11"
|
"@types/node-cron": "npm:3.0.11"
|
||||||
ansi-colors: "npm:4.1.3"
|
ansi-colors: "npm:4.1.3"
|
||||||
dayjs: "npm:1.11.13"
|
dayjs: "npm:1.11.13"
|
||||||
@ -1013,8 +1004,8 @@ __metadata:
|
|||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"pg@npm:^8.11.3":
|
"pg@npm:^8.11.3":
|
||||||
version: 8.13.0
|
version: 8.13.1
|
||||||
resolution: "pg@npm:8.13.0"
|
resolution: "pg@npm:8.13.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
pg-cloudflare: "npm:^1.1.1"
|
pg-cloudflare: "npm:^1.1.1"
|
||||||
pg-connection-string: "npm:^2.7.0"
|
pg-connection-string: "npm:^2.7.0"
|
||||||
@ -1030,7 +1021,7 @@ __metadata:
|
|||||||
peerDependenciesMeta:
|
peerDependenciesMeta:
|
||||||
pg-native:
|
pg-native:
|
||||||
optional: true
|
optional: true
|
||||||
checksum: 10/6defa3254b121317014c6de0ce4c21a9a1ec9b7ef24651164596b813d951d6545542faab964131f11e81c64c5c166b14051f6808e0247af928e1773a9fd7e0af
|
checksum: 10/542aa49fcb37657cf5f779b4a31fe6eb336e683445ecca38e267eeb0ca85d873ffe51f04794f9f9e184187e9f74bf7895e932a0fa9507132ac0dfc76c7c73451
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -1257,9 +1248,9 @@ __metadata:
|
|||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"tslib@npm:^2.6.2, tslib@npm:^2.6.3":
|
"tslib@npm:^2.6.2, tslib@npm:^2.6.3":
|
||||||
version: 2.7.0
|
version: 2.8.0
|
||||||
resolution: "tslib@npm:2.7.0"
|
resolution: "tslib@npm:2.8.0"
|
||||||
checksum: 10/9a5b47ddac65874fa011c20ff76db69f97cf90c78cff5934799ab8894a5342db2d17b4e7613a087046bc1d133d21547ddff87ac558abeec31ffa929c88b7fce6
|
checksum: 10/1bc7c43937477059b4d26f2dbde7e49ef0fb4f38f3014e0603eaea76d6a885742c8b1762af45949145e5e7408a736d20ded949da99dabc8ccba1fc5531d2d927
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -1304,7 +1295,7 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"undici-types@npm:~6.19.2, undici-types@npm:~6.19.8":
|
"undici-types@npm:~6.19.8":
|
||||||
version: 6.19.8
|
version: 6.19.8
|
||||||
resolution: "undici-types@npm:6.19.8"
|
resolution: "undici-types@npm:6.19.8"
|
||||||
checksum: 10/cf0b48ed4fc99baf56584afa91aaffa5010c268b8842f62e02f752df209e3dea138b372a60a963b3b2576ed932f32329ce7ddb9cb5f27a6c83040d8cd74b7a70
|
checksum: 10/cf0b48ed4fc99baf56584afa91aaffa5010c268b8842f62e02f752df209e3dea138b372a60a963b3b2576ed932f32329ce7ddb9cb5f27a6c83040d8cd74b7a70
|
||||||
|
Loading…
Reference in New Issue
Block a user