1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 12:21:00 -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"],\
["@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/node", "npm:20.10.5"],\
["@types/node", "npm:20.10.6"],\
["@types/node-cron", "npm:3.0.11"],\
["@types/pg", "npm:8.10.9"],\
["@types/sequelize", "npm:4.28.19"],\
@ -45,7 +45,7 @@ const RAW_RUNTIME_STATE =
["pg-hstore", "npm:2.3.4"],\
["redis", "npm:4.6.12"],\
["sequelize", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.35.2"],\
["simple-git", "npm:3.21.0"],\
["simple-git", "npm:3.22.0"],\
["systeminformation", "npm:5.21.22"],\
["typescript", "patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>::version=5.3.3&hash=e012d7"],\
["undici", "npm:6.2.1"]\
@ -644,6 +644,14 @@ const RAW_RUNTIME_STATE =
["undici-types", "npm:5.26.5"]\
],\
"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", [\
@ -995,7 +1003,7 @@ const RAW_RUNTIME_STATE =
["@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"],\
["@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/pg", "npm:8.10.9"],\
["@types/sequelize", "npm:4.28.19"],\
@ -1010,7 +1018,7 @@ const RAW_RUNTIME_STATE =
["pg-hstore", "npm:2.3.4"],\
["redis", "npm:4.6.12"],\
["sequelize", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.35.2"],\
["simple-git", "npm:3.21.0"],\
["simple-git", "npm:3.22.0"],\
["systeminformation", "npm:5.21.22"],\
["typescript", "patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>::version=5.3.3&hash=e012d7"],\
["undici", "npm:6.2.1"]\
@ -2398,10 +2406,10 @@ const RAW_RUNTIME_STATE =
}]\
]],\
["simple-git", [\
["npm:3.21.0", {\
"packageLocation": "./.yarn/cache/simple-git-npm-3.21.0-692f82a4a3-6b644151a4.zip/node_modules/simple-git/",\
["npm:3.22.0", {\
"packageLocation": "./.yarn/cache/simple-git-npm-3.22.0-42ea3caec2-309e7f0b73.zip/node_modules/simple-git/",\
"packageDependencies": [\
["simple-git", "npm:3.21.0"],\
["simple-git", "npm:3.22.0"],\
["@kwsites/file-exists", "npm:1.1.1"],\
["@kwsites/promise-deferred", "npm:1.1.1"],\
["debug", "virtual:428f325a939c2653ad822eb3d75efb02ac311523dd0d4f9645afc39ea00bd86eceac35a9d59c9b6977d76b670a4ef0ae057ea572338a44729aa592711a8c05a3#npm:4.3.4"]\

View File

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

View File

@ -1,6 +1,6 @@
{
"configName": "Daggerbot",
"embedColor": "#ffffff",
"embedColor": "#0052cf",
"embedColorBackup": "#0052cf",
"embedColorGreen": "#57f287",
"embedColorYellow": "#ffea00",
@ -8,9 +8,10 @@
"embedColorInvis": "#2f3136",
"embedColorBCA": "#ff69b4",
"embedColorXmas": "#ffffff",
"LRSstart": 1661236321433,
"LRSstart": 1704067200631,
"whitelistedServers": [
"929807948748832798", "468835415093411861"
"929807948748832798",
"468835415093411861"
],
"botSwitches": {
"dailyMsgsBackup": true,
@ -24,7 +25,11 @@
},
"botPresence": {
"activities": [
{"name": "Today is January!", "url": "https://www.youtube.com/watch?v=UPSSUSLlwjY", "type": 1}
{
"name": "Today is January!",
"url": "https://www.youtube.com/watch?v=UPSSUSLlwjY",
"type": 1
}
],
"status": "online"
},

View File

@ -7,7 +7,6 @@ import {Model, DataTypes} from 'sequelize';
import CacheServer from '../components/CacheServer.js';
import MessageTool from '../helpers/MessageTool.js';
import Formatters from '../helpers/Formatters.js';
import {readFileSync, existsSync} from 'node:fs';
class punishments extends Model {
declare public case_id: number;
@ -79,23 +78,6 @@ export class PunishmentsSvc {
});
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) {
const findCase = this.findCase(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 DatabaseServer from '../components/DatabaseServer.js';
import {Model, DataTypes} from 'sequelize';
import {readFileSync, existsSync} from 'node:fs';
import {ChatInputCommandInteraction, Snowflake} from 'discord.js';
class tagsystem extends Model {
@ -51,17 +50,6 @@ export class TagSystemSvc {
});
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) {
CacheServer.delete('tags');
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 DatabaseServer from '../components/DatabaseServer.js';
import {Model, DataTypes} from 'sequelize';
import {writeFileSync, readFileSync, existsSync} from 'node:fs';
import {writeFileSync} from 'node:fs';
import cron from 'node-cron';
import Logger from '../helpers/Logger.js';
@ -108,17 +108,5 @@ export class UserLevelsSvc {
}
algorithm = (level:number)=>level*level*15;
// Algorithm for determining levels. If adjusting, recommended to only change the integer at the end of equation.
// 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
})));
}
// Requires rank data to be reset if changed as it causes unexpected results.
}

View File

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