mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-12-25 23:15:38 -05:00
Riverstream of updates
This commit is contained in:
parent
9e9be53760
commit
d5476fb9c3
142
.pnp.cjs
generated
142
.pnp.cjs
generated
@ -33,17 +33,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
["@octokit/auth-token", "npm:4.0.0"],\
|
||||
["@octokit/rest", "npm:20.0.1"],\
|
||||
["@types/ms", "npm:0.7.31"],\
|
||||
["@types/node", "npm:20.5.1"],\
|
||||
["axios", "npm:1.4.0"],\
|
||||
["@types/node", "npm:20.5.4"],\
|
||||
["canvas", "npm:2.11.2"],\
|
||||
["discord-player", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.6.2"],\
|
||||
["discord.js", "npm:14.13.0"],\
|
||||
["libsodium-wrappers", "npm:0.7.11"],\
|
||||
["moment", "npm:2.29.4"],\
|
||||
["mongoose", "npm:7.4.3"],\
|
||||
["mongoose", "npm:7.4.4"],\
|
||||
["ms", "npm:2.1.3"],\
|
||||
["prism-media", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:1.3.5"],\
|
||||
["systeminformation", "npm:5.18.15"],\
|
||||
["systeminformation", "npm:5.19.1"],\
|
||||
["typescript", "patch:typescript@npm%3A5.1.6#~builtin<compat/typescript>::version=5.1.6&hash=5da071"],\
|
||||
["xml-js", "npm:1.6.11"],\
|
||||
["youtube-sr", "npm:4.3.4"],\
|
||||
@ -527,10 +526,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}],\
|
||||
["npm:20.5.1", {\
|
||||
"packageLocation": "./.yarn/cache/@types-node-npm-20.5.1-d4e9ac5c26-3dbe611cd6.zip/node_modules/@types/node/",\
|
||||
["npm:20.5.4", {\
|
||||
"packageLocation": "./.yarn/cache/@types-node-npm-20.5.4-6106d4385a-18de76c990.zip/node_modules/@types/node/",\
|
||||
"packageDependencies": [\
|
||||
["@types/node", "npm:20.5.1"]\
|
||||
["@types/node", "npm:20.5.4"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
@ -678,27 +677,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["asynckit", [\
|
||||
["npm:0.4.0", {\
|
||||
"packageLocation": "./.yarn/cache/asynckit-npm-0.4.0-c718858525-7b78c451df.zip/node_modules/asynckit/",\
|
||||
"packageDependencies": [\
|
||||
["asynckit", "npm:0.4.0"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["axios", [\
|
||||
["npm:1.4.0", {\
|
||||
"packageLocation": "./.yarn/cache/axios-npm-1.4.0-4d7ce8ca3e-7fb6a4313b.zip/node_modules/axios/",\
|
||||
"packageDependencies": [\
|
||||
["axios", "npm:1.4.0"],\
|
||||
["follow-redirects", "virtual:4d7ce8ca3e1e44d82523fba2ad95e1be18c4e9f8dec6d551377587540da3ed75bd8bd3e812280309a3b90cfdb0560f076f3552a20839f7f15665207a4fbd588a#npm:1.15.2"],\
|
||||
["form-data", "npm:4.0.0"],\
|
||||
["proxy-from-env", "npm:1.1.0"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["balanced-match", [\
|
||||
["npm:1.0.2", {\
|
||||
"packageLocation": "./.yarn/cache/balanced-match-npm-1.0.2-a53c126459-9706c088a2.zip/node_modules/balanced-match/",\
|
||||
@ -875,16 +853,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["combined-stream", [\
|
||||
["npm:1.0.8", {\
|
||||
"packageLocation": "./.yarn/cache/combined-stream-npm-1.0.8-dc14d4a63a-49fa4aeb49.zip/node_modules/combined-stream/",\
|
||||
"packageDependencies": [\
|
||||
["combined-stream", "npm:1.0.8"],\
|
||||
["delayed-stream", "npm:1.0.0"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["concat-map", [\
|
||||
["npm:0.0.1", {\
|
||||
"packageLocation": "./.yarn/cache/concat-map-npm-0.0.1-85a921b7ee-902a9f5d89.zip/node_modules/concat-map/",\
|
||||
@ -948,17 +916,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
["@octokit/auth-token", "npm:4.0.0"],\
|
||||
["@octokit/rest", "npm:20.0.1"],\
|
||||
["@types/ms", "npm:0.7.31"],\
|
||||
["@types/node", "npm:20.5.1"],\
|
||||
["axios", "npm:1.4.0"],\
|
||||
["@types/node", "npm:20.5.4"],\
|
||||
["canvas", "npm:2.11.2"],\
|
||||
["discord-player", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.6.2"],\
|
||||
["discord.js", "npm:14.13.0"],\
|
||||
["libsodium-wrappers", "npm:0.7.11"],\
|
||||
["moment", "npm:2.29.4"],\
|
||||
["mongoose", "npm:7.4.3"],\
|
||||
["mongoose", "npm:7.4.4"],\
|
||||
["ms", "npm:2.1.3"],\
|
||||
["prism-media", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:1.3.5"],\
|
||||
["systeminformation", "npm:5.18.15"],\
|
||||
["systeminformation", "npm:5.19.1"],\
|
||||
["typescript", "patch:typescript@npm%3A5.1.6#~builtin<compat/typescript>::version=5.1.6&hash=5da071"],\
|
||||
["xml-js", "npm:1.6.11"],\
|
||||
["youtube-sr", "npm:4.3.4"],\
|
||||
@ -1009,15 +976,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["delayed-stream", [\
|
||||
["npm:1.0.0", {\
|
||||
"packageLocation": "./.yarn/cache/delayed-stream-npm-1.0.0-c5a4c4cc02-46fe6e83e2.zip/node_modules/delayed-stream/",\
|
||||
"packageDependencies": [\
|
||||
["delayed-stream", "npm:1.0.0"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["delegates", [\
|
||||
["npm:1.0.0", {\
|
||||
"packageLocation": "./.yarn/cache/delegates-npm-1.0.0-9b1942d75f-a51744d9b5.zip/node_modules/delegates/",\
|
||||
@ -1274,28 +1232,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["follow-redirects", [\
|
||||
["npm:1.15.2", {\
|
||||
"packageLocation": "./.yarn/cache/follow-redirects-npm-1.15.2-1ec1dd82be-faa66059b6.zip/node_modules/follow-redirects/",\
|
||||
"packageDependencies": [\
|
||||
["follow-redirects", "npm:1.15.2"]\
|
||||
],\
|
||||
"linkType": "SOFT"\
|
||||
}],\
|
||||
["virtual:4d7ce8ca3e1e44d82523fba2ad95e1be18c4e9f8dec6d551377587540da3ed75bd8bd3e812280309a3b90cfdb0560f076f3552a20839f7f15665207a4fbd588a#npm:1.15.2", {\
|
||||
"packageLocation": "./.yarn/__virtual__/follow-redirects-virtual-359bc4c55c/0/cache/follow-redirects-npm-1.15.2-1ec1dd82be-faa66059b6.zip/node_modules/follow-redirects/",\
|
||||
"packageDependencies": [\
|
||||
["follow-redirects", "virtual:4d7ce8ca3e1e44d82523fba2ad95e1be18c4e9f8dec6d551377587540da3ed75bd8bd3e812280309a3b90cfdb0560f076f3552a20839f7f15665207a4fbd588a#npm:1.15.2"],\
|
||||
["@types/debug", null],\
|
||||
["debug", null]\
|
||||
],\
|
||||
"packagePeers": [\
|
||||
"@types/debug",\
|
||||
"debug"\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["foreground-child", [\
|
||||
["npm:3.1.1", {\
|
||||
"packageLocation": "./.yarn/cache/foreground-child-npm-3.1.1-77e78ed774-139d270bc8.zip/node_modules/foreground-child/",\
|
||||
@ -1307,18 +1243,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["form-data", [\
|
||||
["npm:4.0.0", {\
|
||||
"packageLocation": "./.yarn/cache/form-data-npm-4.0.0-916facec2d-01135bf867.zip/node_modules/form-data/",\
|
||||
"packageDependencies": [\
|
||||
["form-data", "npm:4.0.0"],\
|
||||
["asynckit", "npm:0.4.0"],\
|
||||
["combined-stream", "npm:1.0.8"],\
|
||||
["mime-types", "npm:2.1.35"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["formdata-polyfill", [\
|
||||
["npm:4.0.10", {\
|
||||
"packageLocation": "./.yarn/cache/formdata-polyfill-npm-4.0.10-e03013c013-82a34df292.zip/node_modules/formdata-polyfill/",\
|
||||
@ -1775,25 +1699,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["mime-db", [\
|
||||
["npm:1.52.0", {\
|
||||
"packageLocation": "./.yarn/cache/mime-db-npm-1.52.0-b5371d6fd2-0d99a03585.zip/node_modules/mime-db/",\
|
||||
"packageDependencies": [\
|
||||
["mime-db", "npm:1.52.0"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["mime-types", [\
|
||||
["npm:2.1.35", {\
|
||||
"packageLocation": "./.yarn/cache/mime-types-npm-2.1.35-dd9ea9f3e2-89a5b7f1de.zip/node_modules/mime-types/",\
|
||||
"packageDependencies": [\
|
||||
["mime-types", "npm:2.1.35"],\
|
||||
["mime-db", "npm:1.52.0"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["mimic-response", [\
|
||||
["npm:2.1.0", {\
|
||||
"packageLocation": "./.yarn/cache/mimic-response-npm-2.1.0-037463e454-014fad6ab9.zip/node_modules/mimic-response/",\
|
||||
@ -1944,10 +1849,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
],\
|
||||
"linkType": "SOFT"\
|
||||
}],\
|
||||
["virtual:de9b2a4bee48b47472569f051556d00472ad2cae24f303eab2885fcb163b9304e49630ec473487f25346e199b727589de8b538c4c4621c9a5e46486fe0dda3c9#npm:5.7.0", {\
|
||||
"packageLocation": "./.yarn/__virtual__/mongodb-virtual-3d9fb5213a/0/cache/mongodb-npm-5.7.0-c5e415a2e7-16357b6229.zip/node_modules/mongodb/",\
|
||||
["virtual:806a47d2373274fd76cd2d3daf79db5b84b03c36c63d0a3903a6998364b5ab2d2299d972d445ed6004dba802b10f22f34264a9bdd91c7654035f44410ad707b7#npm:5.7.0", {\
|
||||
"packageLocation": "./.yarn/__virtual__/mongodb-virtual-e218204750/0/cache/mongodb-npm-5.7.0-c5e415a2e7-16357b6229.zip/node_modules/mongodb/",\
|
||||
"packageDependencies": [\
|
||||
["mongodb", "virtual:de9b2a4bee48b47472569f051556d00472ad2cae24f303eab2885fcb163b9304e49630ec473487f25346e199b727589de8b538c4c4621c9a5e46486fe0dda3c9#npm:5.7.0"],\
|
||||
["mongodb", "virtual:806a47d2373274fd76cd2d3daf79db5b84b03c36c63d0a3903a6998364b5ab2d2299d972d445ed6004dba802b10f22f34264a9bdd91c7654035f44410ad707b7#npm:5.7.0"],\
|
||||
["@aws-sdk/credential-providers", null],\
|
||||
["@mongodb-js/zstd", null],\
|
||||
["@types/aws-sdk__credential-providers", null],\
|
||||
@ -1990,13 +1895,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]\
|
||||
]],\
|
||||
["mongoose", [\
|
||||
["npm:7.4.3", {\
|
||||
"packageLocation": "./.yarn/cache/mongoose-npm-7.4.3-de9b2a4bee-e92feec9e7.zip/node_modules/mongoose/",\
|
||||
["npm:7.4.4", {\
|
||||
"packageLocation": "./.yarn/cache/mongoose-npm-7.4.4-806a47d237-54d014b435.zip/node_modules/mongoose/",\
|
||||
"packageDependencies": [\
|
||||
["mongoose", "npm:7.4.3"],\
|
||||
["mongoose", "npm:7.4.4"],\
|
||||
["bson", "npm:5.4.0"],\
|
||||
["kareem", "npm:2.5.1"],\
|
||||
["mongodb", "virtual:de9b2a4bee48b47472569f051556d00472ad2cae24f303eab2885fcb163b9304e49630ec473487f25346e199b727589de8b538c4c4621c9a5e46486fe0dda3c9#npm:5.7.0"],\
|
||||
["mongodb", "virtual:806a47d2373274fd76cd2d3daf79db5b84b03c36c63d0a3903a6998364b5ab2d2299d972d445ed6004dba802b10f22f34264a9bdd91c7654035f44410ad707b7#npm:5.7.0"],\
|
||||
["mpath", "npm:0.9.0"],\
|
||||
["mquery", "npm:5.0.0"],\
|
||||
["ms", "npm:2.1.3"],\
|
||||
@ -2352,15 +2257,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["proxy-from-env", [\
|
||||
["npm:1.1.0", {\
|
||||
"packageLocation": "./.yarn/cache/proxy-from-env-npm-1.1.0-c13d07f26b-ed7fcc2ba0.zip/node_modules/proxy-from-env/",\
|
||||
"packageDependencies": [\
|
||||
["proxy-from-env", "npm:1.1.0"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["punycode", [\
|
||||
["npm:2.3.0", {\
|
||||
"packageLocation": "./.yarn/cache/punycode-npm-2.3.0-df4bdce06b-39f760e09a.zip/node_modules/punycode/",\
|
||||
@ -2702,10 +2598,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]\
|
||||
]],\
|
||||
["systeminformation", [\
|
||||
["npm:5.18.15", {\
|
||||
"packageLocation": "./.yarn/unplugged/systeminformation-npm-5.18.15-6e7be558fc/node_modules/systeminformation/",\
|
||||
["npm:5.19.1", {\
|
||||
"packageLocation": "./.yarn/unplugged/systeminformation-npm-5.19.1-586055f0a7/node_modules/systeminformation/",\
|
||||
"packageDependencies": [\
|
||||
["systeminformation", "npm:5.18.15"]\
|
||||
["systeminformation", "npm:5.19.1"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
yarnPath: .yarn/releases/yarn-3.6.1.cjs
|
||||
yarnPath: .yarn/releases/yarn-3.6.2.cjs
|
||||
|
10
README.md
10
README.md
@ -1,3 +1,7 @@
|
||||
![https://discord.gg/4SnUAFu](https://cdn.discordapp.com/attachments/1015195575693627442/1081877631068295178/DaggerwinServerBanner2023.gif)
|
||||
# Daggerbot-TS Description
|
||||
This is 1st generation bot that is a TypeScript-based Daggerbot converted from JavaScript at (now archived and privated) ~~[SpaceManBuzz/DaggerBot-](https://github.com/SpaceManBuzz/DaggerBot-)~~
|
||||
<p align="center">
|
||||
<img width="450" height="270" src="https://cdn.discordapp.com/attachments/1015195575693627442/1081877631068295178/DaggerwinServerBanner2023.gif">
|
||||
<h1 align="center">Daggerbot-TS Description</h1>
|
||||
<p align="center">
|
||||
This is a 1st generation bot that is a TypeScript-based Daggerbot converted from JavaScript at <s><a href="https://github.com/SpaceManBuzz/DaggerBot-">SpaceManBuzz/DaggerBot-</a></s> (now archived and privated)
|
||||
</p>
|
||||
</p>
|
@ -25,22 +25,21 @@
|
||||
"node": ">=18.17.0",
|
||||
"yarn": ">=3.6.1"
|
||||
},
|
||||
"packageManager": "yarn@3.6.1",
|
||||
"packageManager": "yarn@3.6.2",
|
||||
"dependencies": {
|
||||
"@discord-player/extractor": "4.4.1",
|
||||
"@discordjs/opus": "0.9.0",
|
||||
"@octokit/auth-token": "4.0.0",
|
||||
"@octokit/rest": "20.0.1",
|
||||
"axios": "1.4.0",
|
||||
"canvas": "2.11.2",
|
||||
"discord-player": "6.6.2",
|
||||
"discord.js": "14.13.0",
|
||||
"libsodium-wrappers": "0.7.11",
|
||||
"moment": "2.29.4",
|
||||
"mongoose": "7.4.3",
|
||||
"mongoose": "7.4.4",
|
||||
"ms": "2.1.3",
|
||||
"prism-media": "1.3.5",
|
||||
"systeminformation": "5.18.15",
|
||||
"systeminformation": "5.19.1",
|
||||
"typescript": "5.1.6",
|
||||
"xml-js": "1.6.11",
|
||||
"youtube-sr": "4.3.4",
|
||||
@ -48,6 +47,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/ms": "0.7.31",
|
||||
"@types/node": "20.5.1"
|
||||
"@types/node": "20.5.4"
|
||||
}
|
||||
}
|
||||
|
31
src/DatabaseServer.ts
Normal file
31
src/DatabaseServer.ts
Normal file
@ -0,0 +1,31 @@
|
||||
import TClient from './client';
|
||||
import mongoose from 'mongoose';
|
||||
|
||||
export default async(client:TClient)=>{
|
||||
const LogPrefix = '[DATABASE]';
|
||||
mongoose.set('strictQuery', true);
|
||||
|
||||
const connection = mongoose.connection;
|
||||
connection.openUri(client.tokens.mongodb_uri, {
|
||||
replicaSet: 'toastyy',
|
||||
autoIndex: true,
|
||||
authMechanism: 'SCRAM-SHA-256',
|
||||
authSource: 'admin',
|
||||
serverSelectionTimeoutMS: 15000,
|
||||
waitQueueTimeoutMS: 50000,
|
||||
socketTimeoutMS: 30000,
|
||||
tls: false,
|
||||
family: 4
|
||||
});
|
||||
|
||||
connection
|
||||
.on('connecting', ()=>console.log(client.logTime(), `${LogPrefix} Establishing connection to MongoDB`))
|
||||
.on('connected', ()=>console.log(client.logTime(), `${LogPrefix} Connection to MongoDB has been established`))
|
||||
.on('disconnecting', ()=>console.log(client.logTime(), `${LogPrefix} Disconnecting from MongoDB`))
|
||||
.on('disconnected', ()=>console.log(client.logTime(), `${LogPrefix} Disconnected from MongoDB`))
|
||||
.on('close', ()=>console.log(client.logTime(), `${LogPrefix} MongoDB has closed the connection`))
|
||||
.on('reconnected', ()=>console.log(client.logTime(), `${LogPrefix} Re-establishing a connection to MongoDB`))
|
||||
.on('all', ()=>console.log(client.logTime(), `${LogPrefix} Successfully established a connection to all members`))
|
||||
.on('fullsetup', ()=>console.log(client.logTime(), `${LogPrefix} Successfully established a connection to Primary server & atleast one member`))
|
||||
.on('error', ((err:mongoose.Error)=>console.error(client.logTime(), `${LogPrefix} Encountered an error in MongoDB: ${err.message}`)));
|
||||
}
|
@ -5,7 +5,6 @@ import {FSPlayer, FSData, FSCareerSavegame, TServer} from './typings/interfaces'
|
||||
|
||||
export default async(client:TClient, Channel:string, Message:string, Server:TServer, ServerName:string)=>{
|
||||
let MPLoopPrefix = '[MPLoop] ';
|
||||
//let httpRegex = /^(https?)(\:\/\/)/;
|
||||
let isServerOnline = false;
|
||||
let playerData:Array<string> = [];
|
||||
let noContentImage = 'https://cdn.discordapp.com/attachments/1118960531135541318/1140906691236479036/68efx1.png';
|
||||
@ -13,9 +12,6 @@ export default async(client:TClient, Channel:string, Message:string, Server:TSer
|
||||
const serverErrorEmbed = new client.embed().setColor(client.config.embedColorRed).setTitle('Host did not respond back in time');
|
||||
const genericEmbed = new client.embed();
|
||||
|
||||
// Log bot uptime for the sake of debugging.
|
||||
//(client.channels.resolve('1091300529696673792') as Discord.TextChannel).send(client.formatTime(client.uptime, 2, {longNames: true, commas: true}));
|
||||
|
||||
const decoPlayer = (player:FSPlayer)=>{
|
||||
let decorator = player.isAdmin ? ':detective:' : '';
|
||||
decorator += player.name.includes('Toast') ? '<:toastv2:1132681026662056079>' : '';
|
||||
@ -35,7 +31,7 @@ export default async(client:TClient, Channel:string, Message:string, Server:TSer
|
||||
}
|
||||
|
||||
// Truncate unnecessary parts of the name for the serverLog embed
|
||||
client.MPServerCache[ServerName].name = hitDSS.server.name === 'Official Daggerwin Game Server' ? 'Daggerwin' : hitDSS.server.name === '! ! IRTGaming | Toast Test' ? 'Toast' : client.MPServerCache[ServerName].name;
|
||||
client.MPServerCache[ServerName].name = hitDSS.server.name === 'Official Daggerwin Game Server' ? 'Daggerwin' : hitDSS.server.name === 'undefined' ? 'undefined' : client.MPServerCache[ServerName].name;
|
||||
//Second server name is unknown, will come back and update this later.
|
||||
|
||||
//Timescale formatting
|
||||
@ -57,7 +53,7 @@ export default async(client:TClient, Channel:string, Message:string, Server:TSer
|
||||
const playersInCache = client.MPServerCache[ServerName].players;
|
||||
if (!playersOnServer ?? playersOnServer === undefined) return new Error('[MPLoop] Empty array, ignoring...'); // For the love of god, stop throwing errors everytime.
|
||||
playersOnServer.forEach(player=>playerData.push(`**${player.name}${decoPlayer(player)}**\nFarming for ${client.formatPlayerUptime(player.uptime)}`));
|
||||
|
||||
|
||||
// Player leaving
|
||||
for (const player of playersInCache.filter(x=>!playersOnServer.some(y=>y.name === x.name))){
|
||||
if (player.uptime > 0) serverLog.send({embeds:[playerLogEmbed(player,false)]});
|
||||
@ -66,6 +62,8 @@ export default async(client:TClient, Channel:string, Message:string, Server:TSer
|
||||
if (!playersInCache.length && client.uptime > 32010) playerObject = playersOnServer;
|
||||
if (playerObject) for (const player of playerObject) serverLog.send({embeds:[playerLogEmbed(player,true)]});
|
||||
else if (playersInCache.length) playerObject = playersOnServer.filter(x=>!playersInCache.some(y=>y.name === x.name));
|
||||
|
||||
if (client.MPServerCache[ServerName].name === null) return;
|
||||
const Database:Array<number> = JSON.parse(readFileSync(`src/database/${client.MPServerCache[ServerName].name}PlayerData.json`,{encoding:'utf8',flag:'r+'}));
|
||||
Database.push(hitDSS.slots?.used);
|
||||
writeFileSync(`src/database/${client.MPServerCache[ServerName].name}PlayerData.json`, JSON.stringify(Database));
|
||||
@ -90,7 +88,7 @@ export default async(client:TClient, Channel:string, Message:string, Server:TSer
|
||||
}
|
||||
} catch(err) {
|
||||
msg.edit({content: null, embeds: [new client.embed().setColor(client.config.embedColorRed).setTitle('Host did not respond back in time')]});
|
||||
throw new Error(`Failed to make a request for ${client.MPServerCache[ServerName].name}`, {cause: err.cause})
|
||||
console.log(client.logTime(), `Failed to make a request for ${ServerName}`)
|
||||
}
|
||||
}
|
||||
HITALL();
|
||||
|
@ -1,7 +1,5 @@
|
||||
import Discord, {Client, WebhookClient, GatewayIntentBits, Partials} from 'discord.js';
|
||||
import {readFileSync, readdirSync} from 'node:fs';
|
||||
import {exec} from 'node:child_process';
|
||||
import mongoose from 'mongoose';
|
||||
import {formatTimeOpt, Tokens, Config, repeatedMessages, type MPServerCache} from './typings/interfaces';
|
||||
import bannedWords from './models/bannedWords.js';
|
||||
import userLevels from './models/userLevels.js';
|
||||
@ -10,18 +8,18 @@ import punishments from './models/punishments.js';
|
||||
import tags from './models/tagSystem.js';
|
||||
import bonkCount from './models/bonkCount.js';
|
||||
import MPServer from './models/MPServer.js';
|
||||
import DatabaseServer from './DatabaseServer.js';
|
||||
import xjs from 'xml-js';
|
||||
import axios from 'axios';
|
||||
import moment from 'moment';
|
||||
const tokens = JSON.parse(readFileSync('src/tokens.json', {encoding:'utf8'}));
|
||||
const tokens = JSON.parse(readFileSync('src/tokens.json', 'utf8'));
|
||||
// Import assertion warning workaround yes
|
||||
|
||||
let importconfig:Config
|
||||
try{
|
||||
importconfig = JSON.parse(readFileSync('src/DB-Beta.config.json', {encoding:'utf8'}));
|
||||
importconfig = JSON.parse(readFileSync('src/DB-Beta.config.json', 'utf8'));
|
||||
console.log('Using development config :: Daggerbot Beta')
|
||||
} catch(e){
|
||||
importconfig = JSON.parse(readFileSync('src/config.json', {encoding:'utf8'}))
|
||||
importconfig = JSON.parse(readFileSync('src/config.json', 'utf8'))
|
||||
console.log('Using production config')
|
||||
}
|
||||
|
||||
@ -38,7 +36,6 @@ export default class TClient extends Client {
|
||||
attachmentBuilder: any;
|
||||
moment: typeof moment;
|
||||
xjs: typeof xjs;
|
||||
axios: typeof axios;
|
||||
ms: any;
|
||||
userLevels: userLevels;
|
||||
punishments: punishments;
|
||||
@ -58,7 +55,7 @@ export default class TClient extends Client {
|
||||
GatewayIntentBits.GuildModeration, GatewayIntentBits.GuildInvites,
|
||||
GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.GuildPresences,
|
||||
GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessages,
|
||||
GatewayIntentBits.GuildVoiceStates
|
||||
GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.DirectMessages
|
||||
], partials: [
|
||||
Partials.Channel, Partials.Reaction, Partials.Message
|
||||
], allowedMentions: {users:[],roles:[]}
|
||||
@ -78,7 +75,6 @@ export default class TClient extends Client {
|
||||
this.attachmentBuilder = Discord.AttachmentBuilder;
|
||||
this.moment = moment;
|
||||
this.xjs = xjs;
|
||||
this.axios = axios;
|
||||
this.ms = import('ms').then(i=>i);
|
||||
this.userLevels = new userLevels(this);
|
||||
this.bonkCount = new bonkCount(this);
|
||||
@ -94,18 +90,7 @@ export default class TClient extends Client {
|
||||
}
|
||||
async init(){
|
||||
console.time('Startup');
|
||||
mongoose.set('strictQuery', true);
|
||||
await mongoose.connect(this.tokens.mongodb_uri, {
|
||||
replicaSet: 'toastyy',
|
||||
autoIndex: true,
|
||||
authMechanism: 'DEFAULT',
|
||||
authSource: 'admin',
|
||||
serverSelectionTimeoutMS: 15000,
|
||||
waitQueueTimeoutMS: 50000,
|
||||
socketTimeoutMS: 30000,
|
||||
tls: false,
|
||||
family: 4
|
||||
}).then(()=>console.log(this.logTime(), 'Successfully connected to MongoDB')).catch(()=>{throw new Error('Failed to connect to MongoDB'); exec('pm2 stop Daggerbot', {windowsHide:true})})
|
||||
await DatabaseServer(this);
|
||||
this.login(this.tokens.main);
|
||||
for await (const file of readdirSync('dist/events')){
|
||||
const eventFile = await import(`./events/${file}`);
|
||||
@ -193,28 +178,39 @@ export default class TClient extends Client {
|
||||
let Data:any;
|
||||
|
||||
try {
|
||||
await this.axios.get(`https://www.youtube.com/feeds/videos.xml?channel_id=${YTChannelID}`, {timeout: 5000}).then(xml=>Data = this.xjs.xml2js(xml.data, {compact: true}))
|
||||
await fetch(`https://www.youtube.com/feeds/videos.xml?channel_id=${YTChannelID}`, {signal: AbortSignal.timeout(6000),headers:{'User-Agent':`Daggerbot - Notification/fetch`}}).then(async xml=>Data = this.xjs.xml2js(await xml.text(), {compact: true}))
|
||||
} catch(err){
|
||||
console.log(this.logTime(), `${YTChannelName} YT fail`)
|
||||
}
|
||||
|
||||
if (!Data) return;
|
||||
if (this.YTCache[YTChannelID] === undefined){
|
||||
this.YTCache[YTChannelID] = Data.feed.entry[0]['yt:videoId']._text;
|
||||
return;
|
||||
}
|
||||
if (!this.YTCache[YTChannelID]) return this.YTCache[YTChannelID] = Data.feed.entry[0]['yt:videoId']._text;
|
||||
if (Data.feed.entry[1]['yt:videoId']._text === this.YTCache[YTChannelID]){
|
||||
this.YTCache[YTChannelID] = Data.feed.entry[0]['yt:videoId']._text;
|
||||
(this.channels.resolve(DCChannelID) as Discord.TextChannel).send(`**${YTChannelName}** just uploaded a video!\n${Data.feed.entry[0].link._attributes.href}`)
|
||||
}
|
||||
}
|
||||
// Bytes conversion
|
||||
formatBytes(bytes:number, decimals:number = 2) {
|
||||
if (bytes === 0) return '0 Bytes';
|
||||
const k = 1024;
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(decimals < 0 ? 0 : decimals)) + ' ' + ['Bytes', 'KB', 'MB', 'GB'][i];
|
||||
};
|
||||
}
|
||||
removeUsername = (text: string)=>{
|
||||
let matchesLeft = true;
|
||||
const dirSlash = process.platform === 'linux' ? '\/' : '\\';
|
||||
const array = text.split(dirSlash);
|
||||
while (matchesLeft){
|
||||
let usersIndex = array.indexOf(process.platform === 'linux' ? 'home' : 'Users');
|
||||
if (usersIndex<1) matchesLeft = false;
|
||||
else {
|
||||
let usernameIndex = usersIndex+1;
|
||||
if(array[usernameIndex].length == 0) usernameIndex += 1;
|
||||
array[usernameIndex] = '・'.repeat(array[usernameIndex].length);
|
||||
array[usersIndex] = process.platform === 'linux' ? 'ho\u200bme' : 'Us\u200bers';
|
||||
}
|
||||
} return array.join(dirSlash);
|
||||
}
|
||||
}
|
||||
|
||||
export class WClient extends WebhookClient {
|
||||
|
@ -5,20 +5,6 @@ import {exec} from 'node:child_process';
|
||||
import fs from 'node:fs';
|
||||
import util from 'node:util';
|
||||
import TClient from '../client.js';
|
||||
const removeUsername = (text: string)=>{
|
||||
let matchesLeft = true;
|
||||
const array = text.split('\\');
|
||||
while (matchesLeft){
|
||||
let usersIndex = array.indexOf('Users');
|
||||
if (usersIndex<1) matchesLeft = false;
|
||||
else {
|
||||
let usernameIndex = usersIndex+1;
|
||||
if(array[usernameIndex].length == 0) usernameIndex += 1;
|
||||
array[usernameIndex] = '*'.repeat(array[usernameIndex].length);
|
||||
array[usersIndex] = 'Us\u200bers';
|
||||
}
|
||||
} return array.join('\\');
|
||||
};
|
||||
export default {
|
||||
run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>) {
|
||||
if (!client.config.whitelist.includes(interaction.user.id)) return client.youNeedRole(interaction, 'bottech');
|
||||
@ -40,7 +26,7 @@ export default {
|
||||
const filter = (x:any)=>x.content === 'stack' && x.author.id === interaction.user.id
|
||||
const messagecollector = (interaction.channel as Discord.TextChannel).createMessageCollector({filter, max: 1, time: 60000});
|
||||
messagecollector.on('collect', collected=>{
|
||||
collected.reply({content: `\`\`\`\n${removeUsername(err.stack)}\n\`\`\``, allowedMentions: {repliedUser: false}});
|
||||
collected.reply({content: `\`\`\`\n${client.removeUsername(err.stack)}\n\`\`\``, allowedMentions: {repliedUser: false}});
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -53,7 +39,7 @@ export default {
|
||||
].forEach(x=>output = output.replace(new RegExp(x as string,'g'),':noblank: No token?'));
|
||||
const embed = new client.embed().setColor(client.config.embedColor).setTitle('__Eval__').addFields(
|
||||
{name: 'Input', value: `\`\`\`js\n${code.slice(0,1010)}\n\`\`\``},
|
||||
{name: 'Output', value: `\`\`\`${removeUsername(output).slice(0,1016)}\n\`\`\``}
|
||||
{name: 'Output', value: `\`\`\`${client.removeUsername(output).slice(0,1016)}\n\`\`\``}
|
||||
);
|
||||
interaction.reply({embeds: [embed]}).catch(()=>(interaction.channel as Discord.TextChannel).send({embeds: [embed]}));
|
||||
},
|
||||
@ -76,13 +62,14 @@ export default {
|
||||
}
|
||||
};
|
||||
exec('git pull',{windowsHide:true},(err:Error,stdout)=>{
|
||||
if (err) clarkson.edit(`\`\`\`${removeUsername(err.message)}\`\`\``)
|
||||
if (err) clarkson.edit(`\`\`\`${client.removeUsername(err.message)}\`\`\``)
|
||||
else if (stdout.includes('Already up to date')) clarkson.edit('I am already up to date with the upstream repository.')
|
||||
else clarkson.edit('Compiling TypeScript files...').then(()=>exec('yarn tsc', {windowsHide:true}, (err:Error)=>{
|
||||
if (err) clarkson.edit(`\`\`\`${removeUsername(err.message)}\`\`\``)
|
||||
else clarkson.edit(`[Commit:](<${github.fetchCommit.url}>) **${github.fetchCommit.msg}**\nCommit author: **${github.fetchCommit.author}**\n\n__Commit changes__\nTotal: **${github.fetchChanges.total}**\nAdditions: **${github.fetchChanges.addition}**\nDeletions: **${github.fetchChanges.deletion}**\n\nSuccessfully compiled TypeScript files into JavaScript!\nUptime before restarting: **${client.formatTime(client.uptime as number, 3, {commas: true, longNames: true})}**`).then(()=>exec('pm2 restart Daggerbot', {windowsHide:true}))
|
||||
if (err) clarkson.edit(`\`\`\`${client.removeUsername(err.message)}\`\`\``)
|
||||
if (interaction.options.getBoolean('restart')) clarkson.edit(`[Commit:](<${github.fetchCommit.url}>) **${github.fetchCommit.msg}**\nCommit author: **${github.fetchCommit.author}**\n\n__Commit changes__\nTotal: **${github.fetchChanges.total}**\nAdditions: **${github.fetchChanges.addition}**\nDeletions: **${github.fetchChanges.deletion}**\n\nSuccessfully compiled TypeScript files into JavaScript!\nUptime before restarting: **${client.formatTime(client.uptime, 3, {commas: true, longNames: true})}**`).then(()=>exec('pm2 restart Daggerbot', {windowsHide:true}));
|
||||
else clarkson.edit(`[Commit:](<${github.fetchCommit.url}>) **${github.fetchCommit.msg}**\nCommit author: **${github.fetchCommit.author}**\n\n__Commit changes__\nTotal: **${github.fetchChanges.total}**\nAdditions: **${github.fetchChanges.addition}**\nDeletions: **${github.fetchChanges.deletion}**\n\nSuccessfully compiled TypeScript files into JavaScript!`)
|
||||
}))
|
||||
});
|
||||
})
|
||||
},
|
||||
presence: ()=>{
|
||||
function convertType(Type?: number){
|
||||
@ -91,7 +78,7 @@ export default {
|
||||
case 1: return 'Streaming';
|
||||
case 2: return 'Listening to';
|
||||
case 3: return 'Watching';
|
||||
case 4: return 'Custom Status'; // Will be enabled once PR #9743 on D.JS repo merges in.
|
||||
case 4: return 'Custom Status';
|
||||
case 5: return 'Competing in';
|
||||
}
|
||||
};
|
||||
@ -115,7 +102,7 @@ export default {
|
||||
},
|
||||
statsgraph: ()=>{
|
||||
client.statsGraph = -(interaction.options.getInteger('number', true));
|
||||
interaction.reply(`Successfully set to \`${client.statsGraph}\`\n*Total data points: **${JSON.parse(fs.readFileSync('src/database/MPPlayerData.json', {encoding: 'utf8'})).length.toLocaleString()}***`)
|
||||
interaction.reply(`Successfully set to \`${client.statsGraph}\`\n*Total data points: **${JSON.parse(fs.readFileSync(`src/database/${interaction.options.getString('server')}PlayerData.json`, {encoding: 'utf8'})).length.toLocaleString()}***`)
|
||||
},
|
||||
logs: ()=>{
|
||||
interaction.deferReply();
|
||||
@ -124,15 +111,15 @@ export default {
|
||||
restart: async()=>{
|
||||
const i = await interaction.reply({content: 'Compiling TypeScript files...', fetchReply: true});
|
||||
exec('yarn tsc',{windowsHide:true},(err:Error)=>{
|
||||
if (err) i.edit(`\`\`\`${removeUsername(err.message)}\`\`\``)
|
||||
else i.edit(`Successfully compiled TypeScript files into JavaScript!\nUptime before restarting: **${client.formatTime(client.uptime as number, 3, {commas: true, longNames: true})}**`).then(()=>exec('pm2 restart Daggerbot', {windowsHide:true}))
|
||||
if (err) i.edit(`\`\`\`${client.removeUsername(err.message)}\`\`\``)
|
||||
else i.edit(`Successfully compiled TypeScript files into JavaScript!\nUptime before restarting: **${client.formatTime(client.uptime, 3, {commas: true, longNames: true})}**`).then(()=>exec('pm2 restart Daggerbot', {windowsHide:true}))
|
||||
})
|
||||
},
|
||||
file: ()=>interaction.reply({files:[`./src/database/${interaction.options.getString('name')}.json`]}).catch(()=>'Filesize is too large, upload cancelled.'),
|
||||
wake_device: async()=>{
|
||||
const i = await interaction.reply({content: 'Spawning a task...', fetchReply: true});
|
||||
exec(`cd "../../Desktop/System Tools/wakemeonlan" && WakeMeOnLan.exe /wakeup ${interaction.options.getString('name',true)}`, {windowsHide:true}, (err:Error)=>{
|
||||
if (err) i.edit(removeUsername(err.message))
|
||||
exec(`cd "../../Desktop/System Tools/wakemeonlan" && WakeMeOnLan.exe /wakeup ${interaction.options.getString('name')}`, {windowsHide:true}, (err:Error)=>{
|
||||
if (err) i.edit(client.removeUsername(err.message))
|
||||
else i.edit('Your device should be awake by now!\n||Don\'t blame me if it isn\'t on.||')
|
||||
})
|
||||
}
|
||||
@ -156,7 +143,11 @@ export default {
|
||||
.setDescription('Restart the bot for technical reasons'))
|
||||
.addSubcommand(x=>x
|
||||
.setName('update')
|
||||
.setDescription('Pull from repository and restart'))
|
||||
.setDescription('Pull from repository and restart')
|
||||
.addBooleanOption(x=>x
|
||||
.setName('restart')
|
||||
.setDescription('Restart the bot after pulling from repository')
|
||||
))
|
||||
.addSubcommand(x=>x
|
||||
.setName('wake_device')
|
||||
.setDescription('Remotely wake up a device in the same network as the bot')
|
||||
@ -167,6 +158,10 @@ export default {
|
||||
.addSubcommand(x=>x
|
||||
.setName('statsgraph')
|
||||
.setDescription('Edit the number of data points to pull')
|
||||
.addStringOption(x=>x
|
||||
.setName('server')
|
||||
.setDescription('Server name')
|
||||
.setRequired(true))
|
||||
.addIntegerOption(x=>x
|
||||
.setName('number')
|
||||
.setDescription('Number of data points to pull')
|
||||
|
@ -3,7 +3,7 @@ import TClient from '../client.js';
|
||||
import path from 'node:path';
|
||||
import canvas from 'canvas';
|
||||
import {readFileSync} from 'node:fs';
|
||||
import {FSData, TServer} from 'src/typings/interfaces.js';
|
||||
import {FSData} from 'src/typings/interfaces.js';
|
||||
|
||||
const serverChoices = [
|
||||
{name: 'Main Server', value: 'mainServer'},
|
||||
@ -13,7 +13,7 @@ const serverChoices = [
|
||||
export default {
|
||||
async run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){
|
||||
if (client.uptime < 30000) return interaction.reply('I have just restarted, please wait for MPLoop to finish initializing.')
|
||||
const serverSelector = interaction.options.getString('server', true);
|
||||
const serverSelector = interaction.options.getString('server');
|
||||
if (interaction.channelId === '468835769092669461' && !client.isStaff(interaction.member) && ['status', 'players'].includes(interaction.options.getSubcommand())) return interaction.reply('Please use <#739084625862852715> for `/mp status/players` commands to prevent clutter in this channel.').then(()=>setTimeout(()=>interaction.deleteReply(), 6000));
|
||||
|
||||
const database = await client.MPServer._content.findById(interaction.guildId);
|
||||
@ -276,10 +276,7 @@ export default {
|
||||
.setName('server')
|
||||
.setDescription('The server to update')
|
||||
.setRequired(true)
|
||||
.setChoices(
|
||||
{name: 'Main Server', value: 'mainServer'},
|
||||
{name: 'Second Server', value: 'secondServer'}
|
||||
))
|
||||
.setChoices(serverChoices[0]))
|
||||
.addStringOption(x=>x
|
||||
.setName('address')
|
||||
.setDescription('The URL to the dedicated-server-stats.json file')
|
||||
|
@ -3,6 +3,8 @@ import pkg from 'typescript';
|
||||
import si from 'systeminformation';
|
||||
import TClient from '../client.js';
|
||||
import os from 'node:os';
|
||||
import {readFileSync} from 'node:fs';
|
||||
const packageJson = JSON.parse(readFileSync('package.json', 'utf8'));
|
||||
export default {
|
||||
async run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){
|
||||
const waitForData = await interaction.reply({content: '<a:sakjdfsajkfhsdjhjfsa:1065342869428252743>', fetchReply:true})
|
||||
@ -42,15 +44,15 @@ export default {
|
||||
`**TypeScript:** ${pkg.version}`,
|
||||
`**NodeJS:** ${process.version}`,
|
||||
`**DiscordJS:** ${Discord.version}`,
|
||||
`**Axios:** ${client.axios.VERSION}`
|
||||
`**Yarn:** ${packageJson.packageManager.slice(5)}`
|
||||
].join('\n')},
|
||||
{name: '> __Host__', value: [
|
||||
`**Operating System:** ${osInfo.distro + ' ' + osInfo.release}`,
|
||||
`**CPU:** ${cpu.manufacturer} ${cpu.brand}`,
|
||||
`**Memory:** ${client.formatBytes(ram.used)}/${client.formatBytes(ram.total)}`,
|
||||
`**NodeJS:** ${client.formatBytes(process.memoryUsage().heapUsed)}/${client.formatBytes(process.memoryUsage().heapTotal)}`,
|
||||
`**Process:** ${client.formatBytes(process.memoryUsage().heapUsed)}/${client.formatBytes(process.memoryUsage().heapTotal)}`,
|
||||
`**Load Usage:**\nUser: ${currentLoad.currentLoadUser.toFixed(1)}%\nSystem: ${currentLoad.currentLoadSystem.toFixed(1)}%`,
|
||||
`**Uptime:**\nHost: ${client.formatTime((os.uptime()*1000), 2, {longNames: true, commas: true})}\nBot: ${client.formatTime(client.uptime as number, 2, {commas: true, longNames: true})}`
|
||||
`**Uptime:**\nHost: ${client.formatTime((os.uptime()*1000), 2, {longNames: true, commas: true})}\nBot: ${client.formatTime(client.uptime, 2, {commas: true, longNames: true})}`
|
||||
].join('\n')}
|
||||
);
|
||||
waitForData.edit({content:null,embeds:[embed]}).then(x=>x.edit({embeds:[new client.embed(x.embeds[0].data).setFooter({text: `Load time: ${client.formatTime(x.createdTimestamp - interaction.createdTimestamp, 2, {longNames: true, commas: true})}`})]}))
|
||||
|
@ -2,7 +2,9 @@ import Discord from 'discord.js';
|
||||
import TClient from 'src/client';
|
||||
export default {
|
||||
async run(client:TClient, message:Discord.Message){
|
||||
if (message.author.bot || message.channel.type === Discord.ChannelType.DM) return;
|
||||
if (message.author.bot) return;
|
||||
if (!message.inGuild()) return (client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel).send({content: `<:fish_unamused:1083675172407623711> <@${client.config.whitelist[0]}>\n**${message.author.username}** tried to send me a DM, their message is:\`\`\`${message.content}\`\`\``, allowedMentions: {parse: ['users']}});
|
||||
|
||||
const msgarr = message.content.toLowerCase().replaceAll(/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?\n?1234567890]/g, '').split(' ');
|
||||
let automodded: boolean;
|
||||
|
||||
@ -87,7 +89,8 @@ export default {
|
||||
`Good grief, is it Monday already? Anyways, morning ${PersonnyMcPerson}..`, `This time I can shout! So here we go! 1..2..3\n*inhales*\nMORNING ${PersonnyMcPerson.toUpperCase()}!`,
|
||||
'Gooooood morning to you!', `Good morning to you! You know what else is good? A segue to our sponsor, breakfast!\nGet started with getting out of the bed and have some breakfast!`,
|
||||
`## Morning ${PersonnyMcPerson}!`, '### Have a wonderful day ahead of you!', `Here, have some pancakes for breakfast, ${PersonnyMcPerson}`, 'Is it Friday yet? This week is getting boring already!',
|
||||
`You have reached ${client.moment.utc().dayOfYear().toLocaleString('en-US')}th day of the year. Also good morning to you as well!`, 'Good morning! Have a cookie to start your day with. :cookie:'
|
||||
`You have reached ${client.moment.utc().dayOfYear().toLocaleString('en-US')}th day of the year, also good morning to you as well!`, 'Good morning! Have a cookie to start your day with. :cookie:',
|
||||
'https://tenor.com/view/rambo-family-rambo-rise-and-shine-wake-up-gif-22012440'
|
||||
],
|
||||
afternoon: [
|
||||
`Afternoon ${PersonnyMcPerson}!`, `What a nice day outside, ${PersonnyMcPerson}`, `Good afternoon ${PersonnyMcPerson}`,
|
||||
|
@ -87,7 +87,7 @@ setInterval(async()=>{
|
||||
});
|
||||
|
||||
const formattedDate = Math.floor((now - client.config.LRSstart)/1000/60/60/24);
|
||||
const dailyMsgs = JSON.parse(readFileSync('./src/database/dailyMsgs.json', {encoding: 'utf8'}))
|
||||
const dailyMsgs = JSON.parse(readFileSync('./src/database/dailyMsgs.json', 'utf8'))
|
||||
if (client.config.botSwitches.dailyMsgsBackup && !dailyMsgs.some((x:Array<number>)=>x[0] === formattedDate)){
|
||||
let total = (await client.userLevels._content.find({})).reduce((a,b)=>a + b.messages, 0); // sum of all users
|
||||
const yesterday = dailyMsgs.find((x:Array<number>)=>x[0] === formattedDate - 1);
|
||||
|
@ -1 +1 @@
|
||||
require('node:child_process').spawn('yarn && yarn node dist/index.js', {stdio: [null,process.stdout,process.stderr,null], windowsHide: true, shell: true})
|
||||
require('node:child_process').spawn('yarn node dist/index.js', {stdio: [null,process.stdout,process.stderr,null], windowsHide: true, shell: true})
|
109
yarn.lock
109
yarn.lock
@ -393,10 +393,10 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/node@npm:20.5.1":
|
||||
version: 20.5.1
|
||||
resolution: "@types/node@npm:20.5.1"
|
||||
checksum: 3dbe611cd67afa987102c8558ee70f848949c5dcfee5f60abc073e55c0d7b048e391bf06bb1e0dc052cb7210ca97136ac496cbaf6e89123c989de6bd125fde82
|
||||
"@types/node@npm:20.5.4":
|
||||
version: 20.5.4
|
||||
resolution: "@types/node@npm:20.5.4"
|
||||
checksum: 18de76c990e1c298183661cfc7cf16c9384531538c8090cc27bc3cab801e7c46b9f6943591ab0433955dd57961601684cc0fb19ba2deee9609e137c91afd2e25
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -527,24 +527,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"asynckit@npm:^0.4.0":
|
||||
version: 0.4.0
|
||||
resolution: "asynckit@npm:0.4.0"
|
||||
checksum: 7b78c451df768adba04e2d02e63e2d0bf3b07adcd6e42b4cf665cb7ce899bedd344c69a1dcbce355b5f972d597b25aaa1c1742b52cffd9caccb22f348114f6be
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"axios@npm:1.4.0":
|
||||
version: 1.4.0
|
||||
resolution: "axios@npm:1.4.0"
|
||||
dependencies:
|
||||
follow-redirects: ^1.15.0
|
||||
form-data: ^4.0.0
|
||||
proxy-from-env: ^1.1.0
|
||||
checksum: 7fb6a4313bae7f45e89d62c70a800913c303df653f19eafec88e56cea2e3821066b8409bc68be1930ecca80e861c52aa787659df0ffec6ad4d451c7816b9386b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"balanced-match@npm:^1.0.0":
|
||||
version: 1.0.2
|
||||
resolution: "balanced-match@npm:1.0.2"
|
||||
@ -701,15 +683,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"combined-stream@npm:^1.0.8":
|
||||
version: 1.0.8
|
||||
resolution: "combined-stream@npm:1.0.8"
|
||||
dependencies:
|
||||
delayed-stream: ~1.0.0
|
||||
checksum: 49fa4aeb4916567e33ea81d088f6584749fc90c7abec76fd516bf1c5aa5c79f3584b5ba3de6b86d26ddd64bae5329c4c7479343250cfe71c75bb366eae53bb7c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"concat-map@npm:0.0.1":
|
||||
version: 0.0.1
|
||||
resolution: "concat-map@npm:0.0.1"
|
||||
@ -764,17 +737,16 @@ __metadata:
|
||||
"@octokit/auth-token": 4.0.0
|
||||
"@octokit/rest": 20.0.1
|
||||
"@types/ms": 0.7.31
|
||||
"@types/node": 20.5.1
|
||||
axios: 1.4.0
|
||||
"@types/node": 20.5.4
|
||||
canvas: 2.11.2
|
||||
discord-player: 6.6.2
|
||||
discord.js: 14.13.0
|
||||
libsodium-wrappers: 0.7.11
|
||||
moment: 2.29.4
|
||||
mongoose: 7.4.3
|
||||
mongoose: 7.4.4
|
||||
ms: 2.1.3
|
||||
prism-media: 1.3.5
|
||||
systeminformation: 5.18.15
|
||||
systeminformation: 5.19.1
|
||||
typescript: 5.1.6
|
||||
xml-js: 1.6.11
|
||||
youtube-sr: 4.3.4
|
||||
@ -810,13 +782,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"delayed-stream@npm:~1.0.0":
|
||||
version: 1.0.0
|
||||
resolution: "delayed-stream@npm:1.0.0"
|
||||
checksum: 46fe6e83e2cb1d85ba50bd52803c68be9bd953282fa7096f51fc29edd5d67ff84ff753c51966061e5ba7cb5e47ef6d36a91924eddb7f3f3483b1c560f77a0020
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"delegates@npm:^1.0.0":
|
||||
version: 1.0.0
|
||||
resolution: "delegates@npm:1.0.0"
|
||||
@ -1022,16 +987,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"follow-redirects@npm:^1.15.0":
|
||||
version: 1.15.2
|
||||
resolution: "follow-redirects@npm:1.15.2"
|
||||
peerDependenciesMeta:
|
||||
debug:
|
||||
optional: true
|
||||
checksum: faa66059b66358ba65c234c2f2a37fcec029dc22775f35d9ad6abac56003268baf41e55f9ee645957b32c7d9f62baf1f0b906e68267276f54ec4b4c597c2b190
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"foreground-child@npm:^3.1.0":
|
||||
version: 3.1.1
|
||||
resolution: "foreground-child@npm:3.1.1"
|
||||
@ -1042,17 +997,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"form-data@npm:^4.0.0":
|
||||
version: 4.0.0
|
||||
resolution: "form-data@npm:4.0.0"
|
||||
dependencies:
|
||||
asynckit: ^0.4.0
|
||||
combined-stream: ^1.0.8
|
||||
mime-types: ^2.1.12
|
||||
checksum: 01135bf8675f9d5c61ff18e2e2932f719ca4de964e3be90ef4c36aacfc7b9cb2fceb5eca0b7e0190e3383fe51c5b37f4cb80b62ca06a99aaabfcfd6ac7c9328c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"formdata-polyfill@npm:^4.0.10":
|
||||
version: 4.0.10
|
||||
resolution: "formdata-polyfill@npm:4.0.10"
|
||||
@ -1459,22 +1403,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"mime-db@npm:1.52.0":
|
||||
version: 1.52.0
|
||||
resolution: "mime-db@npm:1.52.0"
|
||||
checksum: 0d99a03585f8b39d68182803b12ac601d9c01abfa28ec56204fa330bc9f3d1c5e14beb049bafadb3dbdf646dfb94b87e24d4ec7b31b7279ef906a8ea9b6a513f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"mime-types@npm:^2.1.12":
|
||||
version: 2.1.35
|
||||
resolution: "mime-types@npm:2.1.35"
|
||||
dependencies:
|
||||
mime-db: 1.52.0
|
||||
checksum: 89a5b7f1def9f3af5dad6496c5ed50191ae4331cc5389d7c521c8ad28d5fdad2d06fd81baf38fed813dc4e46bb55c8145bb0ff406330818c9cf712fb2e9b3836
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"mimic-response@npm:^2.0.0":
|
||||
version: 2.1.0
|
||||
resolution: "mimic-response@npm:2.1.0"
|
||||
@ -1649,9 +1577,9 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"mongoose@npm:7.4.3":
|
||||
version: 7.4.3
|
||||
resolution: "mongoose@npm:7.4.3"
|
||||
"mongoose@npm:7.4.4":
|
||||
version: 7.4.4
|
||||
resolution: "mongoose@npm:7.4.4"
|
||||
dependencies:
|
||||
bson: ^5.4.0
|
||||
kareem: 2.5.1
|
||||
@ -1660,7 +1588,7 @@ __metadata:
|
||||
mquery: 5.0.0
|
||||
ms: 2.1.3
|
||||
sift: 16.0.1
|
||||
checksum: e92feec9e739fd429726b6b17ad0d5c05503d2786aa9605548e2b7e999f990a59bdf950e5cd44aa10e3936277410b4880e760e9e503627fae6c16b4901bf9c49
|
||||
checksum: 54d014b4359c669027561a0570adca43c21a3e0fd22435e845d969274954057ee119088fa138e80f7199a49ccb48c516bde57848c468587eea1bfa51f767e224
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -1943,13 +1871,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"proxy-from-env@npm:^1.1.0":
|
||||
version: 1.1.0
|
||||
resolution: "proxy-from-env@npm:1.1.0"
|
||||
checksum: ed7fcc2ba0a33404958e34d95d18638249a68c430e30fcb6c478497d72739ba64ce9810a24f53a7d921d0c065e5b78e3822759800698167256b04659366ca4d4
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"punycode@npm:^2.1.1":
|
||||
version: 2.3.0
|
||||
resolution: "punycode@npm:2.3.0"
|
||||
@ -2254,12 +2175,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"systeminformation@npm:5.18.15":
|
||||
version: 5.18.15
|
||||
resolution: "systeminformation@npm:5.18.15"
|
||||
"systeminformation@npm:5.19.1":
|
||||
version: 5.19.1
|
||||
resolution: "systeminformation@npm:5.19.1"
|
||||
bin:
|
||||
systeminformation: lib/cli.js
|
||||
checksum: 15555c2c0fac29ca8146153c5b9ad146f5fe5ffe109f0cbc20d2d2b902f8b4d2cc57a1add233edc4914c13f984b96250a51ce351bd570a1ac6ba369ed3caa974
|
||||
checksum: 0e02fbc1082f29732c69ba464069df6d1efb53385d394ba40d55292ab2cf88b2240095908774535adc9244f369a0f52c7aadb7114dd6895243538b263840c27c
|
||||
conditions: (os=darwin | os=linux | os=win32 | os=freebsd | os=openbsd | os=netbsd | os=sunos | os=android)
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
Loading…
Reference in New Issue
Block a user