1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 16:30:58 -05:00

Compare commits

..

4 Commits

Author SHA1 Message Date
dependabot[bot]
3a06ea3953
Bump @types/node from 20.10.5 to 20.10.6 (#76)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.10.5 to 20.10.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-01 13:17:21 +11:00
dependabot[bot]
5a479fd36d
Bump simple-git from 3.21.0 to 3.22.0 (#77)
Bumps [simple-git](https://github.com/steveukx/git-js/tree/HEAD/simple-git) from 3.21.0 to 3.22.0.
- [Release notes](https://github.com/steveukx/git-js/releases)
- [Changelog](https://github.com/steveukx/git-js/blob/main/simple-git/CHANGELOG.md)
- [Commits](https://github.com/steveukx/git-js/commits/simple-git@3.22.0/simple-git)

---
updated-dependencies:
- dependency-name: simple-git
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-01 13:17:07 +11:00
AnxietyisReal
da89a71128 Remove migrations as MongoDB is no longer used 2024-01-01 11:14:17 +11:00
AnxietyisReal
1011c39642 Yearly rank data reset 2024-01-01 11:01:15 +11:00
7 changed files with 125 additions and 145 deletions

22
.pnp.cjs generated
View File

@ -30,7 +30,7 @@ const RAW_RUNTIME_STATE =
["@octokit/rest", "npm:20.0.2"],\ ["@octokit/rest", "npm:20.0.2"],\
["@toast/tokenservice-client", "npm:1.0.6::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.6%2Ftokenservice-client-1.0.6.tgz"],\ ["@toast/tokenservice-client", "npm:1.0.6::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.6%2Ftokenservice-client-1.0.6.tgz"],\
["@types/ms", "npm:0.7.34"],\ ["@types/ms", "npm:0.7.34"],\
["@types/node", "npm:20.10.5"],\ ["@types/node", "npm:20.10.6"],\
["@types/node-cron", "npm:3.0.11"],\ ["@types/node-cron", "npm:3.0.11"],\
["@types/pg", "npm:8.10.9"],\ ["@types/pg", "npm:8.10.9"],\
["@types/sequelize", "npm:4.28.19"],\ ["@types/sequelize", "npm:4.28.19"],\
@ -45,7 +45,7 @@ const RAW_RUNTIME_STATE =
["pg-hstore", "npm:2.3.4"],\ ["pg-hstore", "npm:2.3.4"],\
["redis", "npm:4.6.12"],\ ["redis", "npm:4.6.12"],\
["sequelize", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.35.2"],\ ["sequelize", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.35.2"],\
["simple-git", "npm:3.21.0"],\ ["simple-git", "npm:3.22.0"],\
["systeminformation", "npm:5.21.22"],\ ["systeminformation", "npm:5.21.22"],\
["typescript", "patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>::version=5.3.3&hash=e012d7"],\ ["typescript", "patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>::version=5.3.3&hash=e012d7"],\
["undici", "npm:6.2.1"]\ ["undici", "npm:6.2.1"]\
@ -644,6 +644,14 @@ const RAW_RUNTIME_STATE =
["undici-types", "npm:5.26.5"]\ ["undici-types", "npm:5.26.5"]\
],\ ],\
"linkType": "HARD"\ "linkType": "HARD"\
}],\
["npm:20.10.6", {\
"packageLocation": "./.yarn/cache/@types-node-npm-20.10.6-59a7d708ba-08471220d3.zip/node_modules/@types/node/",\
"packageDependencies": [\
["@types/node", "npm:20.10.6"],\
["undici-types", "npm:5.26.5"]\
],\
"linkType": "HARD"\
}]\ }]\
]],\ ]],\
["@types/node-cron", [\ ["@types/node-cron", [\
@ -995,7 +1003,7 @@ const RAW_RUNTIME_STATE =
["@octokit/rest", "npm:20.0.2"],\ ["@octokit/rest", "npm:20.0.2"],\
["@toast/tokenservice-client", "npm:1.0.6::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.6%2Ftokenservice-client-1.0.6.tgz"],\ ["@toast/tokenservice-client", "npm:1.0.6::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.6%2Ftokenservice-client-1.0.6.tgz"],\
["@types/ms", "npm:0.7.34"],\ ["@types/ms", "npm:0.7.34"],\
["@types/node", "npm:20.10.5"],\ ["@types/node", "npm:20.10.6"],\
["@types/node-cron", "npm:3.0.11"],\ ["@types/node-cron", "npm:3.0.11"],\
["@types/pg", "npm:8.10.9"],\ ["@types/pg", "npm:8.10.9"],\
["@types/sequelize", "npm:4.28.19"],\ ["@types/sequelize", "npm:4.28.19"],\
@ -1010,7 +1018,7 @@ const RAW_RUNTIME_STATE =
["pg-hstore", "npm:2.3.4"],\ ["pg-hstore", "npm:2.3.4"],\
["redis", "npm:4.6.12"],\ ["redis", "npm:4.6.12"],\
["sequelize", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.35.2"],\ ["sequelize", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.35.2"],\
["simple-git", "npm:3.21.0"],\ ["simple-git", "npm:3.22.0"],\
["systeminformation", "npm:5.21.22"],\ ["systeminformation", "npm:5.21.22"],\
["typescript", "patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>::version=5.3.3&hash=e012d7"],\ ["typescript", "patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>::version=5.3.3&hash=e012d7"],\
["undici", "npm:6.2.1"]\ ["undici", "npm:6.2.1"]\
@ -2398,10 +2406,10 @@ const RAW_RUNTIME_STATE =
}]\ }]\
]],\ ]],\
["simple-git", [\ ["simple-git", [\
["npm:3.21.0", {\ ["npm:3.22.0", {\
"packageLocation": "./.yarn/cache/simple-git-npm-3.21.0-692f82a4a3-6b644151a4.zip/node_modules/simple-git/",\ "packageLocation": "./.yarn/cache/simple-git-npm-3.22.0-42ea3caec2-309e7f0b73.zip/node_modules/simple-git/",\
"packageDependencies": [\ "packageDependencies": [\
["simple-git", "npm:3.21.0"],\ ["simple-git", "npm:3.22.0"],\
["@kwsites/file-exists", "npm:1.1.1"],\ ["@kwsites/file-exists", "npm:1.1.1"],\
["@kwsites/promise-deferred", "npm:1.1.1"],\ ["@kwsites/promise-deferred", "npm:1.1.1"],\
["debug", "virtual:428f325a939c2653ad822eb3d75efb02ac311523dd0d4f9645afc39ea00bd86eceac35a9d59c9b6977d76b670a4ef0ae057ea572338a44729aa592711a8c05a3#npm:4.3.4"]\ ["debug", "virtual:428f325a939c2653ad822eb3d75efb02ac311523dd0d4f9645afc39ea00bd86eceac35a9d59c9b6977d76b670a4ef0ae057ea572338a44729aa592711a8c05a3#npm:4.3.4"]\

View File

@ -46,13 +46,13 @@
"pg-hstore": "2.3.4", "pg-hstore": "2.3.4",
"redis": "4.6.12", "redis": "4.6.12",
"sequelize": "6.35.2", "sequelize": "6.35.2",
"simple-git": "3.21.0", "simple-git": "3.22.0",
"systeminformation": "5.21.22", "systeminformation": "5.21.22",
"undici": "6.2.1" "undici": "6.2.1"
}, },
"devDependencies": { "devDependencies": {
"@types/ms": "0.7.34", "@types/ms": "0.7.34",
"@types/node": "20.10.5", "@types/node": "20.10.6",
"@types/node-cron": "3.0.11", "@types/node-cron": "3.0.11",
"@types/pg": "8.10.9", "@types/pg": "8.10.9",
"@types/sequelize": "4.28.19", "@types/sequelize": "4.28.19",

View File

@ -1,85 +1,90 @@
{ {
"configName": "Daggerbot", "configName": "Daggerbot",
"embedColor": "#ffffff", "embedColor": "#0052cf",
"embedColorBackup": "#0052cf", "embedColorBackup": "#0052cf",
"embedColorGreen": "#57f287", "embedColorGreen": "#57f287",
"embedColorYellow": "#ffea00", "embedColorYellow": "#ffea00",
"embedColorRed": "#e62c3b", "embedColorRed": "#e62c3b",
"embedColorInvis": "#2f3136", "embedColorInvis": "#2f3136",
"embedColorBCA": "#ff69b4", "embedColorBCA": "#ff69b4",
"embedColorXmas": "#ffffff", "embedColorXmas": "#ffffff",
"LRSstart": 1661236321433, "LRSstart": 1704067200631,
"whitelistedServers": [ "whitelistedServers": [
"929807948748832798", "468835415093411861" "929807948748832798",
], "468835415093411861"
"botSwitches": { ],
"dailyMsgsBackup": true, "botSwitches": {
"registerCommands": false, "dailyMsgsBackup": true,
"commands": true, "registerCommands": false,
"logs": true, "commands": true,
"mpSys": true, "logs": true,
"buttonRoles": true, "mpSys": true,
"automod": true, "buttonRoles": true,
"autores": true "automod": true,
}, "autores": true
"botPresence": { },
"activities": [ "botPresence": {
{"name": "Today is January!", "url": "https://www.youtube.com/watch?v=UPSSUSLlwjY", "type": 1} "activities": [
], {
"status": "online" "name": "Today is January!",
}, "url": "https://www.youtube.com/watch?v=UPSSUSLlwjY",
"whitelist": [ "type": 1
"190407856527376384", }
"215497515934416896", ],
"141304507249197057", "status": "online"
"309373272594579456", },
"301350210926280704" "whitelist": [
], "190407856527376384",
"contribList": [ "215497515934416896",
"190407856527376384", "141304507249197057",
"633345781780185099", "309373272594579456",
"215497515934416896", "301350210926280704"
"141304507249197057", ],
"178941218510602240", "contribList": [
"700641965787709520" "190407856527376384",
], "633345781780185099",
"dcServer": { "215497515934416896",
"id": "468835415093411861", "141304507249197057",
"staffRoles": [ "178941218510602240",
"admin", "700641965787709520"
"dcmod", ],
"mpmanager", "dcServer": {
"mpmod", "id": "468835415093411861",
"vtcmanager", "staffRoles": [
"vtcstaff", "admin",
"ytmod" "dcmod",
], "mpmanager",
"roles": { "mpmod",
"admin": "468842789053136897", "vtcmanager",
"bottech": "1011341005389307925", "vtcstaff",
"dcmod": "468841295150972929", "ytmod"
"mpmanager": "1028735939813585029", ],
"mpmod": "572151330710487041", "roles": {
"vtcmanager": "1028735871370940490", "admin": "468842789053136897",
"vtcstaff": "801945627268481046", "bottech": "1011341005389307925",
"ytmod": "734888335851388958", "dcmod": "468841295150972929",
"mphelper": "1034453973412884500", "mpmanager": "1028735939813585029",
"mpplayer": "798285830669598762", "mpmod": "572151330710487041",
"vtcmember": "802282391652663338" "vtcmanager": "1028735871370940490",
}, "vtcstaff": "801945627268481046",
"channels": { "ytmod": "734888335851388958",
"errors": "1009754872188506192", "mphelper": "1034453973412884500",
"thismeanswar": "1091300529696673792", "mpplayer": "798285830669598762",
"bot_suggestions": "1040018521746325586", "vtcmember": "802282391652663338"
"bot_status": "1009753780188884992", },
"logs": "548032776830582794", "channels": {
"welcome": "621134751897616406", "errors": "1009754872188506192",
"botcommands": "468888722210029588", "thismeanswar": "1091300529696673792",
"bankick_log": "1048341961901363352", "bot_suggestions": "1040018521746325586",
"punishment_log": "1102751034754998302", "bot_status": "1009753780188884992",
"dcmod_chat": "742324777934520350", "logs": "548032776830582794",
"mpmod_chat": "516344221452599306", "welcome": "621134751897616406",
"multifarm_chat": "1149238561934151690" "botcommands": "468888722210029588",
} "bankick_log": "1048341961901363352",
} "punishment_log": "1102751034754998302",
} "dcmod_chat": "742324777934520350",
"mpmod_chat": "516344221452599306",
"multifarm_chat": "1149238561934151690"
}
}
}

View File

@ -7,7 +7,6 @@ import {Model, DataTypes} from 'sequelize';
import CacheServer from '../components/CacheServer.js'; import CacheServer from '../components/CacheServer.js';
import MessageTool from '../helpers/MessageTool.js'; import MessageTool from '../helpers/MessageTool.js';
import Formatters from '../helpers/Formatters.js'; import Formatters from '../helpers/Formatters.js';
import {readFileSync, existsSync} from 'node:fs';
class punishments extends Model { class punishments extends Model {
declare public case_id: number; declare public case_id: number;
@ -79,23 +78,6 @@ export class PunishmentsSvc {
}); });
this.model.sync(); this.model.sync();
} }
async migrate() {
let file:string = 'src/punishments.json';
if (!existsSync(file)) return Error(`File not found, have you tried checking if it exists? (${file})`);
await this.model.bulkCreate(JSON.parse(readFileSync(file, 'utf8')).map(x=>({
case_id: x._id,
type: x.type,
member: x.member,
moderator: x.moderator,
expired: x.expired,
time: x.time ? Number(x.time.$numberLong) : undefined,
reason: x.reason,
endTime: x.endTime ? Number(x.endTime.$numberLong) : undefined,
cancels: x.cancels,
duration: x.duration ? (typeof x.duration === 'object' ? Number(x.duration.$numberLong) : x.duration) : undefined
})));
}
async updateReason(caseId:number, reason:string) { async updateReason(caseId:number, reason:string) {
const findCase = this.findCase(caseId); const findCase = this.findCase(caseId);
if (findCase) return this.model.update({reason: reason}, {where: {case_id: caseId}}); if (findCase) return this.model.update({reason: reason}, {where: {case_id: caseId}});

View File

@ -3,7 +3,6 @@ import MessageTool from '../helpers/MessageTool.js';
import CacheServer from '../components/CacheServer.js'; import CacheServer from '../components/CacheServer.js';
import DatabaseServer from '../components/DatabaseServer.js'; import DatabaseServer from '../components/DatabaseServer.js';
import {Model, DataTypes} from 'sequelize'; import {Model, DataTypes} from 'sequelize';
import {readFileSync, existsSync} from 'node:fs';
import {ChatInputCommandInteraction, Snowflake} from 'discord.js'; import {ChatInputCommandInteraction, Snowflake} from 'discord.js';
class tagsystem extends Model { class tagsystem extends Model {
@ -51,17 +50,6 @@ export class TagSystemSvc {
}); });
this.model.sync(); this.model.sync();
} }
async migrate() {
let file:string = 'src/tags.json';
if (!existsSync(file)) return Error(`File not found, have you tried checking if it exists? (${file})`);
await this.model.bulkCreate(JSON.parse(readFileSync(file, 'utf8')).map(x=>({
tagname: x._id,
message: x.message,
embedFlag: x.embedBool,
userid: x.user._id
})));
}
async createTag(userid:string, tagName:string, message:string, embedFlag:boolean) { async createTag(userid:string, tagName:string, message:string, embedFlag:boolean) {
CacheServer.delete('tags'); CacheServer.delete('tags');
return await this.model.create({userid: userid, tagname: tagName, message: message.replace(/\\n/g, '\n'), embedFlag: embedFlag}); return await this.model.create({userid: userid, tagname: tagName, message: message.replace(/\\n/g, '\n'), embedFlag: embedFlag});

View File

@ -3,7 +3,7 @@ import TClient from '../client.js';
import MessageTool from '../helpers/MessageTool.js'; import MessageTool from '../helpers/MessageTool.js';
import DatabaseServer from '../components/DatabaseServer.js'; import DatabaseServer from '../components/DatabaseServer.js';
import {Model, DataTypes} from 'sequelize'; import {Model, DataTypes} from 'sequelize';
import {writeFileSync, readFileSync, existsSync} from 'node:fs'; import {writeFileSync} from 'node:fs';
import cron from 'node-cron'; import cron from 'node-cron';
import Logger from '../helpers/Logger.js'; import Logger from '../helpers/Logger.js';
@ -108,17 +108,5 @@ export class UserLevelsSvc {
} }
algorithm = (level:number)=>level*level*15; algorithm = (level:number)=>level*level*15;
// Algorithm for determining levels. If adjusting, recommended to only change the integer at the end of equation. // Algorithm for determining levels. If adjusting, recommended to only change the integer at the end of equation.
// Requires rank data to be reset if changed as it causes unexpected results.
// Deadge on 1.6k users in database...
async migrate() {
let file:string = 'src/userLevels.json';
if (!existsSync(file)) return Error(`File not found, have you tried checking if it exists? (${file})`);
await this.model.bulkCreate(JSON.parse(readFileSync(file, 'utf8')).map(x=>({
id: x._id,
messages: x.messages,
level: x.level,
pingToggle: x.notificationPing
})));
}
} }

View File

@ -441,7 +441,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/node@npm:*, @types/node@npm:20.10.5": "@types/node@npm:*":
version: 20.10.5 version: 20.10.5
resolution: "@types/node@npm:20.10.5" resolution: "@types/node@npm:20.10.5"
dependencies: dependencies:
@ -450,6 +450,15 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/node@npm:20.10.6":
version: 20.10.6
resolution: "@types/node@npm:20.10.6"
dependencies:
undici-types: "npm:~5.26.4"
checksum: 08471220d3cbbb6669835c4b78541edf5eface8f2c2e36c550cfa4ff73da73071c90e200a06359fac25d6564127597c23e178128058fb676824ec23d5178a017
languageName: node
linkType: hard
"@types/pg@npm:8.10.9": "@types/pg@npm:8.10.9":
version: 8.10.9 version: 8.10.9
resolution: "@types/pg@npm:8.10.9" resolution: "@types/pg@npm:8.10.9"
@ -748,7 +757,7 @@ __metadata:
"@octokit/rest": "npm:20.0.2" "@octokit/rest": "npm:20.0.2"
"@toast/tokenservice-client": "npm:1.0.6" "@toast/tokenservice-client": "npm:1.0.6"
"@types/ms": "npm:0.7.34" "@types/ms": "npm:0.7.34"
"@types/node": "npm:20.10.5" "@types/node": "npm:20.10.6"
"@types/node-cron": "npm:3.0.11" "@types/node-cron": "npm:3.0.11"
"@types/pg": "npm:8.10.9" "@types/pg": "npm:8.10.9"
"@types/sequelize": "npm:4.28.19" "@types/sequelize": "npm:4.28.19"
@ -763,7 +772,7 @@ __metadata:
pg-hstore: "npm:2.3.4" pg-hstore: "npm:2.3.4"
redis: "npm:4.6.12" redis: "npm:4.6.12"
sequelize: "npm:6.35.2" sequelize: "npm:6.35.2"
simple-git: "npm:3.21.0" simple-git: "npm:3.22.0"
systeminformation: "npm:5.21.22" systeminformation: "npm:5.21.22"
typescript: "npm:5.3.3" typescript: "npm:5.3.3"
undici: "npm:6.2.1" undici: "npm:6.2.1"
@ -1954,14 +1963,14 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"simple-git@npm:3.21.0": "simple-git@npm:3.22.0":
version: 3.21.0 version: 3.22.0
resolution: "simple-git@npm:3.21.0" resolution: "simple-git@npm:3.22.0"
dependencies: dependencies:
"@kwsites/file-exists": "npm:^1.1.1" "@kwsites/file-exists": "npm:^1.1.1"
"@kwsites/promise-deferred": "npm:^1.1.1" "@kwsites/promise-deferred": "npm:^1.1.1"
debug: "npm:^4.3.4" debug: "npm:^4.3.4"
checksum: 6b644151a41facdafdb6ef97f52125cfcfa61e1aa4bed1f25249d4ae71f9ddaffd371919f9dd0cc3fdb16db248d98b389f80ae4f2a416d924f23e6cee3b2f813 checksum: 309e7f0b73550f99949c0c6cfd4b4799ec0452fc4835dc440f89ec9351fe553c979c4e2bf7a772308e608697d3a27512281fbc64df0328a73607641f389b0aaf
languageName: node languageName: node
linkType: hard linkType: hard