mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 12:21:00 -05:00
Compare commits
4 Commits
79da90cab8
...
3a06ea3953
Author | SHA1 | Date | |
---|---|---|---|
|
3a06ea3953 | ||
|
5a479fd36d | ||
|
da89a71128 | ||
|
1011c39642 |
22
.pnp.cjs
generated
22
.pnp.cjs
generated
@ -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"]\
|
||||
|
@ -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",
|
||||
|
175
src/config.json
175
src/config.json
@ -1,85 +1,90 @@
|
||||
{
|
||||
"configName": "Daggerbot",
|
||||
"embedColor": "#ffffff",
|
||||
"embedColorBackup": "#0052cf",
|
||||
"embedColorGreen": "#57f287",
|
||||
"embedColorYellow": "#ffea00",
|
||||
"embedColorRed": "#e62c3b",
|
||||
"embedColorInvis": "#2f3136",
|
||||
"embedColorBCA": "#ff69b4",
|
||||
"embedColorXmas": "#ffffff",
|
||||
"LRSstart": 1661236321433,
|
||||
"whitelistedServers": [
|
||||
"929807948748832798", "468835415093411861"
|
||||
],
|
||||
"botSwitches": {
|
||||
"dailyMsgsBackup": true,
|
||||
"registerCommands": false,
|
||||
"commands": true,
|
||||
"logs": true,
|
||||
"mpSys": true,
|
||||
"buttonRoles": true,
|
||||
"automod": true,
|
||||
"autores": true
|
||||
},
|
||||
"botPresence": {
|
||||
"activities": [
|
||||
{"name": "Today is January!", "url": "https://www.youtube.com/watch?v=UPSSUSLlwjY", "type": 1}
|
||||
],
|
||||
"status": "online"
|
||||
},
|
||||
"whitelist": [
|
||||
"190407856527376384",
|
||||
"215497515934416896",
|
||||
"141304507249197057",
|
||||
"309373272594579456",
|
||||
"301350210926280704"
|
||||
],
|
||||
"contribList": [
|
||||
"190407856527376384",
|
||||
"633345781780185099",
|
||||
"215497515934416896",
|
||||
"141304507249197057",
|
||||
"178941218510602240",
|
||||
"700641965787709520"
|
||||
],
|
||||
"dcServer": {
|
||||
"id": "468835415093411861",
|
||||
"staffRoles": [
|
||||
"admin",
|
||||
"dcmod",
|
||||
"mpmanager",
|
||||
"mpmod",
|
||||
"vtcmanager",
|
||||
"vtcstaff",
|
||||
"ytmod"
|
||||
],
|
||||
"roles": {
|
||||
"admin": "468842789053136897",
|
||||
"bottech": "1011341005389307925",
|
||||
"dcmod": "468841295150972929",
|
||||
"mpmanager": "1028735939813585029",
|
||||
"mpmod": "572151330710487041",
|
||||
"vtcmanager": "1028735871370940490",
|
||||
"vtcstaff": "801945627268481046",
|
||||
"ytmod": "734888335851388958",
|
||||
"mphelper": "1034453973412884500",
|
||||
"mpplayer": "798285830669598762",
|
||||
"vtcmember": "802282391652663338"
|
||||
},
|
||||
"channels": {
|
||||
"errors": "1009754872188506192",
|
||||
"thismeanswar": "1091300529696673792",
|
||||
"bot_suggestions": "1040018521746325586",
|
||||
"bot_status": "1009753780188884992",
|
||||
"logs": "548032776830582794",
|
||||
"welcome": "621134751897616406",
|
||||
"botcommands": "468888722210029588",
|
||||
"bankick_log": "1048341961901363352",
|
||||
"punishment_log": "1102751034754998302",
|
||||
"dcmod_chat": "742324777934520350",
|
||||
"mpmod_chat": "516344221452599306",
|
||||
"multifarm_chat": "1149238561934151690"
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
"configName": "Daggerbot",
|
||||
"embedColor": "#0052cf",
|
||||
"embedColorBackup": "#0052cf",
|
||||
"embedColorGreen": "#57f287",
|
||||
"embedColorYellow": "#ffea00",
|
||||
"embedColorRed": "#e62c3b",
|
||||
"embedColorInvis": "#2f3136",
|
||||
"embedColorBCA": "#ff69b4",
|
||||
"embedColorXmas": "#ffffff",
|
||||
"LRSstart": 1704067200631,
|
||||
"whitelistedServers": [
|
||||
"929807948748832798",
|
||||
"468835415093411861"
|
||||
],
|
||||
"botSwitches": {
|
||||
"dailyMsgsBackup": true,
|
||||
"registerCommands": false,
|
||||
"commands": true,
|
||||
"logs": true,
|
||||
"mpSys": true,
|
||||
"buttonRoles": true,
|
||||
"automod": true,
|
||||
"autores": true
|
||||
},
|
||||
"botPresence": {
|
||||
"activities": [
|
||||
{
|
||||
"name": "Today is January!",
|
||||
"url": "https://www.youtube.com/watch?v=UPSSUSLlwjY",
|
||||
"type": 1
|
||||
}
|
||||
],
|
||||
"status": "online"
|
||||
},
|
||||
"whitelist": [
|
||||
"190407856527376384",
|
||||
"215497515934416896",
|
||||
"141304507249197057",
|
||||
"309373272594579456",
|
||||
"301350210926280704"
|
||||
],
|
||||
"contribList": [
|
||||
"190407856527376384",
|
||||
"633345781780185099",
|
||||
"215497515934416896",
|
||||
"141304507249197057",
|
||||
"178941218510602240",
|
||||
"700641965787709520"
|
||||
],
|
||||
"dcServer": {
|
||||
"id": "468835415093411861",
|
||||
"staffRoles": [
|
||||
"admin",
|
||||
"dcmod",
|
||||
"mpmanager",
|
||||
"mpmod",
|
||||
"vtcmanager",
|
||||
"vtcstaff",
|
||||
"ytmod"
|
||||
],
|
||||
"roles": {
|
||||
"admin": "468842789053136897",
|
||||
"bottech": "1011341005389307925",
|
||||
"dcmod": "468841295150972929",
|
||||
"mpmanager": "1028735939813585029",
|
||||
"mpmod": "572151330710487041",
|
||||
"vtcmanager": "1028735871370940490",
|
||||
"vtcstaff": "801945627268481046",
|
||||
"ytmod": "734888335851388958",
|
||||
"mphelper": "1034453973412884500",
|
||||
"mpplayer": "798285830669598762",
|
||||
"vtcmember": "802282391652663338"
|
||||
},
|
||||
"channels": {
|
||||
"errors": "1009754872188506192",
|
||||
"thismeanswar": "1091300529696673792",
|
||||
"bot_suggestions": "1040018521746325586",
|
||||
"bot_status": "1009753780188884992",
|
||||
"logs": "548032776830582794",
|
||||
"welcome": "621134751897616406",
|
||||
"botcommands": "468888722210029588",
|
||||
"bankick_log": "1048341961901363352",
|
||||
"punishment_log": "1102751034754998302",
|
||||
"dcmod_chat": "742324777934520350",
|
||||
"mpmod_chat": "516344221452599306",
|
||||
"multifarm_chat": "1149238561934151690"
|
||||
}
|
||||
}
|
||||
}
|
@ -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}});
|
||||
|
@ -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});
|
||||
|
@ -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.
|
||||
}
|
||||
|
23
yarn.lock
23
yarn.lock
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user