Compare commits
21 Commits
1.0.0-alph
...
1.0.0-alph
Author | SHA1 | Date | |
---|---|---|---|
cc50a0a089 | |||
27f625155e
|
|||
8b72326419
|
|||
d9c81ef3f2
|
|||
71b401dbee
|
|||
fda6166483
|
|||
df2548dba6
|
|||
ca29f047e9
|
|||
7a5d7f46b6
|
|||
0c9000a48c
|
|||
657a58f3a5
|
|||
f695f0162f
|
|||
4fef4e8045
|
|||
df8d186139
|
|||
f7727c3542
|
|||
7be72df267
|
|||
f8d029431f
|
|||
cd60d7dabc
|
|||
62aa05031f
|
|||
dc6755eb19
|
|||
def44d2774
|
@ -10,4 +10,5 @@ ENV NODE_ENV=production
|
||||
COPY --from=builder node_modules ./node_modules
|
||||
COPY build/ .
|
||||
VOLUME [ "/usr/src/app/data" ]
|
||||
EXPOSE 80
|
||||
CMD ["node", "--enable-source-maps", "index.js"]
|
27
README.md
27
README.md
@ -15,15 +15,26 @@ Adds the word to the server specific blocklist
|
||||
#### /blocklist remove [word]
|
||||
Removes the word from the server specific blocklist
|
||||
|
||||
### /info
|
||||
Returns general information about the bot and the servers stats
|
||||
|
||||
### /preservesettings
|
||||
Changes the behaviour when the bot leaves the server.
|
||||
Options are:
|
||||
- Keep settings persistent even if the bot leaves
|
||||
- Delete setting when the bot leaves the server [default]
|
||||
|
||||
## Environment variables
|
||||
| Name | Description | Required | Example |
|
||||
| :---------- | :------------------------------------------------------------ | :------: | :------------------ |
|
||||
| TOKEN | Discord bot token to log into the API with | ▶️/🚀 | NzYzMDP3MzE1Mzky... |
|
||||
| DB_HOST | Hostname of the database | ▶️ | 127.0.0.1:3546 |
|
||||
| DB_USERNAME | Username of the database | ▶️ | root |
|
||||
| DB_PASSWORD | Password of the database | ▶️ | abc123 |
|
||||
| DB_DATABASE | Database name | ▶️ | white-leopard |
|
||||
| CLIENT_ID | Client ID of the Discord appication associated with the token | 🚀 | 763035392692274 |
|
||||
| Name | Description | Required | Example |
|
||||
| :--------------- | :------------------------------------------------------------------------------ | :------: | :------------------ |
|
||||
| TOKEN | Discord bot token to log into the API with | ▶️/🚀 | NzYzMDP3MzE1Mzky... |
|
||||
| DB_HOST | Hostname of the database | ▶️ | 127.0.0.1:3546 |
|
||||
| DB_USERNAME | Username of the database | ▶️ | root |
|
||||
| DB_PASSWORD | Password of the database | ▶️ | abc123 |
|
||||
| DB_DATABASE | Database name | ▶️ | white-leopard |
|
||||
| CLIENT_ID | Client ID of the Discord appication associated with the token | 🚀 | 763035392692274 |
|
||||
| DEPLOY_TOKEN | Production Discord bot token to log into the API with | 🚀 | NzYzMDP3MzE1Mzky... |
|
||||
| DEPLOY_CLIENT_ID | Production Client ID of the Discord appication associated with the deploy token | 🚀 | 763035392692274 |
|
||||
|
||||
### Icon explanation:
|
||||
- ▶️ = Required in runtime
|
||||
|
@ -4,8 +4,8 @@ import dotenv from "dotenv";
|
||||
dotenv.config({ path: path.join(__dirname, "../.env") });
|
||||
|
||||
// Environment checking
|
||||
const TOKEN = process.env["TOKEN"];
|
||||
const CLIENT_ID = process.env["CLIENT_ID"];
|
||||
const TOKEN = process.env["DEPLOY_TOKEN"];
|
||||
const CLIENT_ID = process.env["DEPLOY_CLIENT_ID"];
|
||||
|
||||
if (!TOKEN) throw new ReferenceError("Environment variable TOKEN is missing");
|
||||
if (!CLIENT_ID) throw new ReferenceError("Environment variable CLIENT_ID is missing");
|
||||
|
@ -1,8 +1,12 @@
|
||||
version: "2"
|
||||
version: "3.9"
|
||||
services:
|
||||
app:
|
||||
image: astrogd/white-leopard:dev
|
||||
build: ./
|
||||
ports:
|
||||
- 80:80
|
||||
tty: true
|
||||
stdin_open: true
|
||||
depends_on:
|
||||
- database
|
||||
restart: unless-stopped
|
||||
|
5
index.ts
5
index.ts
@ -4,8 +4,12 @@ import swapConsole from "./src/tools/consoleSwapper";
|
||||
config();
|
||||
swapConsole();
|
||||
|
||||
import "./src/tools/startupTime";
|
||||
import "./src/client/init";
|
||||
import "./src/commands";
|
||||
import "./src/events";
|
||||
import "./src/cli";
|
||||
import "./src/service";
|
||||
import client from "./src/client";
|
||||
|
||||
function shutdown() {
|
||||
@ -16,3 +20,4 @@ function shutdown() {
|
||||
|
||||
process.on("SIGINT", shutdown);
|
||||
process.on("SIGHUP", shutdown);
|
||||
process.on("SIGTERM", shutdown);
|
664
package-lock.json
generated
664
package-lock.json
generated
@ -1,21 +1,24 @@
|
||||
{
|
||||
"name": "eu.astrogd.white-leopard",
|
||||
"version": "1.0.0-alpha.1",
|
||||
"version": "1.0.0-beta.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "eu.astrogd.white-leopard",
|
||||
"version": "1.0.0-alpha.1",
|
||||
"version": "1.0.0-beta.1",
|
||||
"license": "CC-BY-NC-ND-4.0",
|
||||
"dependencies": {
|
||||
"discord.js": "^14.6.0",
|
||||
"dotenv": "^16.0.3",
|
||||
"express": "^4.18.2",
|
||||
"fs-extra": "^10.1.0",
|
||||
"moment": "^2.29.4",
|
||||
"pg": "^8.8.0",
|
||||
"typeorm": "^0.3.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^4.17.14",
|
||||
"@types/fs-extra": "^9.0.13",
|
||||
"@types/node": "^18.11.9",
|
||||
"rimraf": "^3.0.2",
|
||||
@ -176,6 +179,48 @@
|
||||
"integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==",
|
||||
"devOptional": true
|
||||
},
|
||||
"node_modules/@types/body-parser": {
|
||||
"version": "1.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz",
|
||||
"integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/connect": "*",
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/connect": {
|
||||
"version": "3.4.35",
|
||||
"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz",
|
||||
"integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/express": {
|
||||
"version": "4.17.14",
|
||||
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz",
|
||||
"integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/body-parser": "*",
|
||||
"@types/express-serve-static-core": "^4.17.18",
|
||||
"@types/qs": "*",
|
||||
"@types/serve-static": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/express-serve-static-core": {
|
||||
"version": "4.17.31",
|
||||
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz",
|
||||
"integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"@types/qs": "*",
|
||||
"@types/range-parser": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/fs-extra": {
|
||||
"version": "9.0.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz",
|
||||
@ -185,11 +230,39 @@
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/mime": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz",
|
||||
"integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "18.11.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz",
|
||||
"integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg=="
|
||||
},
|
||||
"node_modules/@types/qs": {
|
||||
"version": "6.9.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz",
|
||||
"integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/range-parser": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz",
|
||||
"integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/serve-static": {
|
||||
"version": "1.15.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.0.tgz",
|
||||
"integrity": "sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/mime": "*",
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/ws": {
|
||||
"version": "8.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz",
|
||||
@ -198,6 +271,18 @@
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/accepts": {
|
||||
"version": "1.3.8",
|
||||
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
|
||||
"integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
|
||||
"dependencies": {
|
||||
"mime-types": "~2.1.34",
|
||||
"negotiator": "0.6.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.8.1",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz",
|
||||
@ -265,6 +350,11 @@
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
|
||||
},
|
||||
"node_modules/array-flatten": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
|
||||
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
|
||||
},
|
||||
"node_modules/balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
@ -289,6 +379,42 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"node_modules/body-parser": {
|
||||
"version": "1.20.1",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz",
|
||||
"integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==",
|
||||
"dependencies": {
|
||||
"bytes": "3.1.2",
|
||||
"content-type": "~1.0.4",
|
||||
"debug": "2.6.9",
|
||||
"depd": "2.0.0",
|
||||
"destroy": "1.2.0",
|
||||
"http-errors": "2.0.0",
|
||||
"iconv-lite": "0.4.24",
|
||||
"on-finished": "2.4.1",
|
||||
"qs": "6.11.0",
|
||||
"raw-body": "2.5.1",
|
||||
"type-is": "~1.6.18",
|
||||
"unpipe": "1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8",
|
||||
"npm": "1.2.8000 || >= 1.4.16"
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser/node_modules/debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"dependencies": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser/node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
@ -340,6 +466,26 @@
|
||||
"node": ">=10.16.0"
|
||||
}
|
||||
},
|
||||
"node_modules/bytes": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
|
||||
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
|
||||
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.1",
|
||||
"get-intrinsic": "^1.0.2"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
@ -444,6 +590,38 @@
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
|
||||
},
|
||||
"node_modules/content-disposition": {
|
||||
"version": "0.5.4",
|
||||
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
|
||||
"integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
|
||||
"dependencies": {
|
||||
"safe-buffer": "5.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/content-type": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
|
||||
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/cookie": {
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz",
|
||||
"integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/cookie-signature": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
|
||||
"integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
|
||||
},
|
||||
"node_modules/create-require": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||
@ -478,6 +656,23 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/depd": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
|
||||
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/destroy": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
|
||||
"integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
|
||||
"engines": {
|
||||
"node": ">= 0.8",
|
||||
"npm": "1.2.8000 || >= 1.4.16"
|
||||
}
|
||||
},
|
||||
"node_modules/diff": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||
@ -522,11 +717,24 @@
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/ee-first": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
|
||||
},
|
||||
"node_modules/emoji-regex": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
|
||||
},
|
||||
"node_modules/encodeurl": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
|
||||
"integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/escalade": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
|
||||
@ -535,6 +743,73 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/escape-html": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
||||
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
|
||||
},
|
||||
"node_modules/etag": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
||||
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "4.18.2",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz",
|
||||
"integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==",
|
||||
"dependencies": {
|
||||
"accepts": "~1.3.8",
|
||||
"array-flatten": "1.1.1",
|
||||
"body-parser": "1.20.1",
|
||||
"content-disposition": "0.5.4",
|
||||
"content-type": "~1.0.4",
|
||||
"cookie": "0.5.0",
|
||||
"cookie-signature": "1.0.6",
|
||||
"debug": "2.6.9",
|
||||
"depd": "2.0.0",
|
||||
"encodeurl": "~1.0.2",
|
||||
"escape-html": "~1.0.3",
|
||||
"etag": "~1.8.1",
|
||||
"finalhandler": "1.2.0",
|
||||
"fresh": "0.5.2",
|
||||
"http-errors": "2.0.0",
|
||||
"merge-descriptors": "1.0.1",
|
||||
"methods": "~1.1.2",
|
||||
"on-finished": "2.4.1",
|
||||
"parseurl": "~1.3.3",
|
||||
"path-to-regexp": "0.1.7",
|
||||
"proxy-addr": "~2.0.7",
|
||||
"qs": "6.11.0",
|
||||
"range-parser": "~1.2.1",
|
||||
"safe-buffer": "5.2.1",
|
||||
"send": "0.18.0",
|
||||
"serve-static": "1.15.0",
|
||||
"setprototypeof": "1.2.0",
|
||||
"statuses": "2.0.1",
|
||||
"type-is": "~1.6.18",
|
||||
"utils-merge": "1.0.1",
|
||||
"vary": "~1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/express/node_modules/debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"dependencies": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/express/node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
|
||||
},
|
||||
"node_modules/fast-deep-equal": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||
@ -556,6 +831,52 @@
|
||||
"url": "https://github.com/sindresorhus/file-type?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/finalhandler": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
|
||||
"integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==",
|
||||
"dependencies": {
|
||||
"debug": "2.6.9",
|
||||
"encodeurl": "~1.0.2",
|
||||
"escape-html": "~1.0.3",
|
||||
"on-finished": "2.4.1",
|
||||
"parseurl": "~1.3.3",
|
||||
"statuses": "2.0.1",
|
||||
"unpipe": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/finalhandler/node_modules/debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"dependencies": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/finalhandler/node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
|
||||
},
|
||||
"node_modules/forwarded": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
||||
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/fresh": {
|
||||
"version": "0.5.2",
|
||||
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
|
||||
"integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/fs-extra": {
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
|
||||
@ -577,8 +898,7 @@
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
|
||||
"dev": true
|
||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
|
||||
},
|
||||
"node_modules/get-caller-file": {
|
||||
"version": "2.0.5",
|
||||
@ -588,6 +908,19 @@
|
||||
"node": "6.* || 8.* || >= 10.*"
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz",
|
||||
"integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.1",
|
||||
"has": "^1.0.3",
|
||||
"has-symbols": "^1.0.3"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/glob": {
|
||||
"version": "7.2.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||
@ -616,7 +949,6 @@
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
|
||||
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.1"
|
||||
},
|
||||
@ -632,6 +964,17 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/has-symbols": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
|
||||
"integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/highlight.js": {
|
||||
"version": "10.7.3",
|
||||
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz",
|
||||
@ -640,6 +983,32 @@
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/http-errors": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
|
||||
"integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
|
||||
"dependencies": {
|
||||
"depd": "2.0.0",
|
||||
"inherits": "2.0.4",
|
||||
"setprototypeof": "1.2.0",
|
||||
"statuses": "2.0.1",
|
||||
"toidentifier": "1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ieee754": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
||||
@ -682,6 +1051,14 @@
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/ipaddr.js": {
|
||||
"version": "1.9.1",
|
||||
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
||||
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/is-core-module": {
|
||||
"version": "2.11.0",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz",
|
||||
@ -740,6 +1117,57 @@
|
||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
||||
"devOptional": true
|
||||
},
|
||||
"node_modules/media-typer": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
||||
"integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/merge-descriptors": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
|
||||
"integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
|
||||
},
|
||||
"node_modules/methods": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
||||
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
|
||||
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
|
||||
"bin": {
|
||||
"mime": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "2.1.35",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
||||
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||
"dependencies": {
|
||||
"mime-db": "1.52.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
@ -771,6 +1199,14 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/moment": {
|
||||
"version": "2.29.4",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
|
||||
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
@ -786,6 +1222,14 @@
|
||||
"thenify-all": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/negotiator": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
|
||||
"integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
@ -794,6 +1238,25 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.12.2",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
|
||||
"integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/on-finished": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
|
||||
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
|
||||
"dependencies": {
|
||||
"ee-first": "1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
@ -825,6 +1288,14 @@
|
||||
"resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz",
|
||||
"integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw=="
|
||||
},
|
||||
"node_modules/parseurl": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
||||
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
@ -839,6 +1310,11 @@
|
||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
|
||||
"integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
|
||||
},
|
||||
"node_modules/peek-readable": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz",
|
||||
@ -960,6 +1436,54 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
|
||||
"dependencies": {
|
||||
"forwarded": "0.2.0",
|
||||
"ipaddr.js": "1.9.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.11.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
|
||||
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/range-parser": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
|
||||
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/raw-body": {
|
||||
"version": "2.5.1",
|
||||
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz",
|
||||
"integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",
|
||||
"dependencies": {
|
||||
"bytes": "3.1.2",
|
||||
"http-errors": "2.0.0",
|
||||
"iconv-lite": "0.4.24",
|
||||
"unpipe": "1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||
@ -1064,11 +1588,76 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
},
|
||||
"node_modules/sax": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||
},
|
||||
"node_modules/send": {
|
||||
"version": "0.18.0",
|
||||
"resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
|
||||
"integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
|
||||
"dependencies": {
|
||||
"debug": "2.6.9",
|
||||
"depd": "2.0.0",
|
||||
"destroy": "1.2.0",
|
||||
"encodeurl": "~1.0.2",
|
||||
"escape-html": "~1.0.3",
|
||||
"etag": "~1.8.1",
|
||||
"fresh": "0.5.2",
|
||||
"http-errors": "2.0.0",
|
||||
"mime": "1.6.0",
|
||||
"ms": "2.1.3",
|
||||
"on-finished": "2.4.1",
|
||||
"range-parser": "~1.2.1",
|
||||
"statuses": "2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/send/node_modules/debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"dependencies": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/send/node_modules/debug/node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
|
||||
},
|
||||
"node_modules/send/node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||
},
|
||||
"node_modules/serve-static": {
|
||||
"version": "1.15.0",
|
||||
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz",
|
||||
"integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==",
|
||||
"dependencies": {
|
||||
"encodeurl": "~1.0.2",
|
||||
"escape-html": "~1.0.3",
|
||||
"parseurl": "~1.3.3",
|
||||
"send": "0.18.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/setprototypeof": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
||||
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
|
||||
},
|
||||
"node_modules/sha.js": {
|
||||
"version": "2.4.11",
|
||||
"resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
|
||||
@ -1114,6 +1703,19 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
|
||||
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.0",
|
||||
"get-intrinsic": "^1.0.2",
|
||||
"object-inspect": "^1.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/split2": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz",
|
||||
@ -1122,6 +1724,14 @@
|
||||
"node": ">= 10.x"
|
||||
}
|
||||
},
|
||||
"node_modules/statuses": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
|
||||
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/streamsearch": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",
|
||||
@ -1220,6 +1830,14 @@
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/toidentifier": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/token-types": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz",
|
||||
@ -1289,6 +1907,18 @@
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz",
|
||||
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA=="
|
||||
},
|
||||
"node_modules/type-is": {
|
||||
"version": "1.6.18",
|
||||
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
|
||||
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
|
||||
"dependencies": {
|
||||
"media-typer": "0.3.0",
|
||||
"mime-types": "~2.1.24"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/typeorm": {
|
||||
"version": "0.3.10",
|
||||
"resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.10.tgz",
|
||||
@ -1428,11 +2058,27 @@
|
||||
"node": ">= 10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/unpipe": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
||||
"integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
|
||||
},
|
||||
"node_modules/utils-merge": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
|
||||
"integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "8.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||
@ -1447,6 +2093,14 @@
|
||||
"integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
|
||||
"devOptional": true
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/wrap-ansi": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||
|
12
package.json
12
package.json
@ -1,13 +1,16 @@
|
||||
{
|
||||
"name": "eu.astrogd.white-leopard",
|
||||
"version": "1.0.0-alpha.2",
|
||||
"version": "1.0.0-alpha.6",
|
||||
"description": "A Discord bot that checks channel names for blacklisted words and reverts the changes if necessary",
|
||||
"main": "build/index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"build": "tsc && shx cp package-lock.json build/package-lock.json",
|
||||
"deploy-dev": "ts-node ci/devDeploy.ts",
|
||||
"start": "npm run build && npm run deploy-dev && docker-compose up --no-start && docker compose start database && node --enable-source-maps .",
|
||||
"deploy-commands:dev": "ts-node ci/devDeploy.ts",
|
||||
"deploy-commands:prod": "ts-node ci/deploy.ts",
|
||||
"deploy:dev": "npm run build && npm run deploy-commands:dev && docker compose build && docker compose up -d",
|
||||
"deploy:prod": "rimraf build && npm run build && npm run deploy-commands:prod && docker build -t astrogd/white-leopard:latest . && docker push astrogd/white-leopard:latest",
|
||||
"start": "npm run build && npm run deploy-commands:dev && docker-compose up --no-start && docker compose start database && node --enable-source-maps .",
|
||||
"migration:create": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:generate -d src/data/dataSource.ts -p src/data/migrations/data",
|
||||
"migration:run": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:run -d src/data/dataSource.ts",
|
||||
"migration:revert": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:revert -d src/data/dataSource.ts",
|
||||
@ -25,6 +28,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/r-Overwatch2/eu.astrogd.white-leopard#readme",
|
||||
"devDependencies": {
|
||||
"@types/express": "^4.17.14",
|
||||
"@types/fs-extra": "^9.0.13",
|
||||
"@types/node": "^18.11.9",
|
||||
"rimraf": "^3.0.2",
|
||||
@ -35,7 +39,9 @@
|
||||
"dependencies": {
|
||||
"discord.js": "^14.6.0",
|
||||
"dotenv": "^16.0.3",
|
||||
"express": "^4.18.2",
|
||||
"fs-extra": "^10.1.0",
|
||||
"moment": "^2.29.4",
|
||||
"pg": "^8.8.0",
|
||||
"typeorm": "^0.3.10"
|
||||
}
|
||||
|
80
src/cli/global.ts
Normal file
80
src/cli/global.ts
Normal file
@ -0,0 +1,80 @@
|
||||
import { IsNull } from "typeorm";
|
||||
import { Badword, database } from "../data";
|
||||
import { Console } from "console";
|
||||
|
||||
const console = new Console(process.stdout);
|
||||
|
||||
export default async function execute(args: string[]) {
|
||||
const command = args[0];
|
||||
if (!command) return printHelp();
|
||||
|
||||
switch (command.toLowerCase()) {
|
||||
case "get": {
|
||||
const globalWords = await database.getRepository(Badword).find({
|
||||
where: {
|
||||
guildID: IsNull()
|
||||
}
|
||||
});
|
||||
|
||||
console.log(`Global blocked words:\n\n${globalWords.map(w => w.value).reduce((c, n) => c + ", " + n, "").slice(2)}`);
|
||||
break;
|
||||
}
|
||||
|
||||
case "add": {
|
||||
const word = args[1]?.toLowerCase();
|
||||
if (!word) return printHelp();
|
||||
|
||||
if (await database.getRepository(Badword).count({
|
||||
where: {
|
||||
value: word,
|
||||
guildID: IsNull()
|
||||
}
|
||||
}) > 0) return console.log(`${word} is already in the blocklist`);
|
||||
|
||||
const entity = new Badword();
|
||||
entity.value = word;
|
||||
|
||||
await database.getRepository(Badword).save(entity);
|
||||
console.log(`${word} has been added to the global block list`);
|
||||
break;
|
||||
}
|
||||
|
||||
case "remove": {
|
||||
const word = args[1]?.toLowerCase();
|
||||
if (!word) return printHelp();
|
||||
|
||||
await database.getRepository(Badword).delete({
|
||||
value: word,
|
||||
guildID: IsNull()
|
||||
});
|
||||
|
||||
console.log(`Removed ${word} from the global block list`);
|
||||
break;
|
||||
}
|
||||
|
||||
case "count": {
|
||||
const count = await database.getRepository(Badword).count({
|
||||
where: {
|
||||
guildID: IsNull()
|
||||
}
|
||||
});
|
||||
|
||||
console.log(`There are ${count} globally blocked words`);
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
printHelp();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function printHelp() {
|
||||
console.log(`Usage "global":
|
||||
|
||||
global get
|
||||
global add [WORD]
|
||||
global remove [WORD]
|
||||
global count`);
|
||||
}
|
167
src/cli/guild.ts
Normal file
167
src/cli/guild.ts
Normal file
@ -0,0 +1,167 @@
|
||||
import { getGuildSetting, isPremiumActive } from "../tools/data";
|
||||
import moment from "moment";
|
||||
import { Badword, database, GuildSetting } from "../data";
|
||||
import { Console } from "console";
|
||||
|
||||
const console = new Console(process.stdout);
|
||||
|
||||
export default async function execute(args: string[]) {
|
||||
const command = args[0];
|
||||
if (!command) return printHelp();
|
||||
|
||||
switch (command.toLowerCase()) {
|
||||
case "info": {
|
||||
if (!args[1]) return printHelp();
|
||||
const settings = await getGuildSetting(args[1]);
|
||||
const isPremium = isPremiumActive(settings.isPremiumUntil);
|
||||
const wordCount = await database.getRepository(Badword).count({
|
||||
where: {
|
||||
guildID: args[1]
|
||||
}
|
||||
});
|
||||
|
||||
console.log(`Guild ${args[1]}:
|
||||
- Premium: ${isPremium ? `ACTIVE for ${moment(settings.isPremiumUntil).fromNow(true)}` : "INACTIVE"}
|
||||
- Preserve Settings: ${settings.preserveDataOnGuildLeave ? "ENABLED" : "DISABLED"}
|
||||
- Logchannel: ${settings.notificationChannelID ? `ENABLED (${settings.notificationChannelID})` : "DISABLED"}
|
||||
- blocked Words: ${wordCount}`);
|
||||
break;
|
||||
}
|
||||
|
||||
case "setpremium": {
|
||||
if (!args[1] || !args[2]) return printHelp();
|
||||
const settings = await getGuildSetting(args[1]);
|
||||
|
||||
if (args[2].toLowerCase() === "null") {
|
||||
settings.isPremiumUntil = null;
|
||||
await database.getRepository(GuildSetting).save(settings);
|
||||
console.log("Premium status removed for guild " + args[1]);
|
||||
break;
|
||||
}
|
||||
|
||||
const date = new Date(args[2]);
|
||||
if (isNaN(Number(date))) return printHelp();
|
||||
|
||||
const now = new Date();
|
||||
if (now > date) return console.log("Date lies in the past");
|
||||
|
||||
settings.isPremiumUntil = date;
|
||||
await database.getRepository(GuildSetting).save(settings);
|
||||
console.log(`Premium status for guild ${args[1]} is now active for ${moment(date).fromNow(true)}`);
|
||||
break;
|
||||
}
|
||||
|
||||
case "words": {
|
||||
if (!args[1] || !args[2]) return printWordHelp();
|
||||
|
||||
const badWords = await database.getRepository(Badword).find({
|
||||
where: {
|
||||
guildID: args[2]
|
||||
}
|
||||
});
|
||||
|
||||
switch (args[1].toLowerCase()) {
|
||||
case "get": {
|
||||
console.log(`Bad words for ${args[2]}:\n\n${badWords.map((badWord) => badWord.value).reduce((prev, next) => prev + ", " + next, "").slice(2)}`);
|
||||
break;
|
||||
}
|
||||
|
||||
case "add": {
|
||||
if (!args[3]) {
|
||||
printWordHelp();
|
||||
break;
|
||||
}
|
||||
|
||||
if (badWords.filter(w => w.value === args[3]!.toLowerCase()).length > 0) {
|
||||
console.log("Word already exists");
|
||||
break;
|
||||
}
|
||||
|
||||
const badWord = new Badword();
|
||||
badWord.guildID = args[2];
|
||||
badWord.value = args[3].toLowerCase();
|
||||
|
||||
await database.getRepository(Badword).save(badWord);
|
||||
console.log(`${args[3].toLowerCase()} added to guild ${args[2]}`);
|
||||
break;
|
||||
}
|
||||
|
||||
case "remove": {
|
||||
if (!args[3]) {
|
||||
printWordHelp();
|
||||
break;
|
||||
}
|
||||
|
||||
const badWord = badWords.find((w) => w.value === args[3]?.toLowerCase());
|
||||
|
||||
if (!badWord) {
|
||||
console.log(`${args[3].toLowerCase()} is not in blocklist of guild ${args[2]}`);
|
||||
break;
|
||||
}
|
||||
|
||||
await database.getRepository(Badword).delete({
|
||||
id: badWord.id
|
||||
});
|
||||
|
||||
console.log(`${badWord.value} deleted for guild ${args[2]}`);
|
||||
break;
|
||||
}
|
||||
|
||||
case "clear": {
|
||||
await database.getRepository(Badword).delete({
|
||||
guildID: args[2]
|
||||
});
|
||||
|
||||
console.log(`Deleted ${badWords.length} entries`);
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
printHelp();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "delete": {
|
||||
if (!args[1]) return printHelp();
|
||||
|
||||
await database.getRepository(GuildSetting).delete({
|
||||
id: args[1]
|
||||
});
|
||||
|
||||
await database.getRepository(Badword).delete({
|
||||
guildID: args[1]
|
||||
});
|
||||
|
||||
console.log(`Deleted all data for guild ${args[1]}`);
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
printHelp();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function printHelp() {
|
||||
console.log(`Usage "guild":
|
||||
|
||||
guild info [GUILDID]
|
||||
guild setPremium [GUILDID] [YYYY-MM-DD or NULL]
|
||||
guild words [get|add|remove|clear]
|
||||
guild delete [GUILDID]`);
|
||||
}
|
||||
|
||||
function printWordHelp() {
|
||||
console.log(`Usage "guild words":
|
||||
|
||||
guild words get [GUILDID]
|
||||
guild words add [GUILDID] [WORD]
|
||||
guild words remove [GUILDID] [WORD]
|
||||
guild words clear [GUILDID]`);
|
||||
}
|
75
src/cli/index.ts
Normal file
75
src/cli/index.ts
Normal file
@ -0,0 +1,75 @@
|
||||
import * as readline from "node:readline/promises";
|
||||
import { stdin as input, stdout as output } from "node:process";
|
||||
import pack from "../../package.json";
|
||||
import { Console } from "node:console";
|
||||
import moment from "moment";
|
||||
import startupTime from "../tools/startupTime";
|
||||
import client from "../client";
|
||||
|
||||
import guild from "./guild";
|
||||
import global from "./global";
|
||||
|
||||
const console = new Console(process.stdout);
|
||||
|
||||
const rl = readline.createInterface(input, output);
|
||||
|
||||
rl.on("line", async (msg) => {
|
||||
const [command, ...args] = msg.split(" ");
|
||||
if (!command) return;
|
||||
|
||||
switch (command.toLowerCase()) {
|
||||
case "version": {
|
||||
console.log(`Channel filter V${pack.version} by AstroGD®`);
|
||||
break;
|
||||
}
|
||||
|
||||
case "uptime": {
|
||||
console.log(`Application is running for ${moment(startupTime).fromNow(true)}`);
|
||||
break;
|
||||
}
|
||||
|
||||
case "clear": {
|
||||
console.clear();
|
||||
break;
|
||||
}
|
||||
|
||||
case "guild": {
|
||||
await guild(args);
|
||||
break;
|
||||
}
|
||||
|
||||
case "help": {
|
||||
printHelp();
|
||||
break;
|
||||
}
|
||||
|
||||
case "global": {
|
||||
await global(args);
|
||||
break;
|
||||
}
|
||||
|
||||
case "servercount": {
|
||||
console.log(`This bot is on ${client.guilds.cache.size} guilds`);
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
console.log(`Unknown command. Try "help" for help`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
rl.prompt();
|
||||
});
|
||||
|
||||
function printHelp() {
|
||||
console.log(`Commands:
|
||||
|
||||
version
|
||||
uptime
|
||||
guild
|
||||
global
|
||||
help
|
||||
servercount
|
||||
clear`);
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
import { runCleanup } from "../service";
|
||||
import client from "./index";
|
||||
|
||||
const token = process.env["TOKEN"];
|
||||
@ -7,4 +8,6 @@ client.login(token);
|
||||
|
||||
client.on("ready", () => {
|
||||
console.log(`Connected to Discord API. Bot account is ${client.user?.tag} (${client.user?.id})`);
|
||||
|
||||
runCleanup();
|
||||
});
|
@ -4,6 +4,7 @@ import { IsNull } from "typeorm";
|
||||
import { getGuildSetting, isPremiumActive } from "../tools/data";
|
||||
import getDefaultEmbed, { getFailedEmbed, getSuccessEmbed } from "../tools/defaultEmbeds";
|
||||
import { getGuildChannel } from "../tools/discord";
|
||||
import { Color, Emoji } from "../tools/design";
|
||||
|
||||
const builder = new SlashCommandBuilder();
|
||||
builder.setName("blocklist");
|
||||
@ -81,7 +82,7 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
|
||||
const limit = isPremium ? 100 : 10;
|
||||
if (count >= limit) {
|
||||
const embed = getFailedEmbed();
|
||||
embed.setDescription("You reached the word limit for your guild. Please delete a word before adding a new one");
|
||||
embed.setDescription(`You reached the word limit for your guild. Please delete a word before adding a new one`);
|
||||
interaction.reply({
|
||||
embeds: [embed],
|
||||
ephemeral: true
|
||||
@ -122,7 +123,8 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
|
||||
});
|
||||
|
||||
const logMessage = getDefaultEmbed();
|
||||
logMessage.setTitle("Word added");
|
||||
logMessage.setTitle(`${Emoji.SETTINGS} Word added`);
|
||||
logMessage.setColor(Color.INFORMING_BLUE);
|
||||
logMessage.setDescription(`"||${word}||" has been added to the blocklist`);
|
||||
logMessage.addFields({
|
||||
name: "This action was performed by",
|
||||
@ -168,7 +170,8 @@ async function execute(interaction: ChatInputCommandInteraction): Promise<void>
|
||||
}).catch();
|
||||
|
||||
const logMessage = getDefaultEmbed();
|
||||
logMessage.setTitle("Word removed");
|
||||
logMessage.setTitle(`${Emoji.SETTINGS} Word removed`);
|
||||
logMessage.setColor(Color.INFORMING_BLUE);
|
||||
logMessage.setDescription(`"||${word}||" has been removed from the blocklist`);
|
||||
logMessage.addFields({
|
||||
name: "This action was performed by",
|
||||
|
@ -1,7 +1,9 @@
|
||||
import * as notification from "./notification";
|
||||
import * as blocklist from "./blocklist";
|
||||
import * as info from "./info";
|
||||
import * as preserveSettings from "./preserveSettings";
|
||||
|
||||
const array = [notification.builder.toJSON(), blocklist.builder.toJSON()];
|
||||
const array = [notification.builder.toJSON(), blocklist.builder.toJSON(), info.builder.toJSON(), preserveSettings.builder.toJSON()];
|
||||
|
||||
export {
|
||||
array
|
||||
|
@ -1,12 +1,16 @@
|
||||
import { ChatInputCommandInteraction, Collection, Events, SlashCommandBuilder } from "discord.js";
|
||||
import * as notification from "./notification";
|
||||
import * as blocklist from "./blocklist";
|
||||
import * as info from "./info";
|
||||
import * as preserveSettings from "./preserveSettings";
|
||||
import client from "../client";
|
||||
import getDefaultEmbed from "../tools/defaultEmbeds";
|
||||
|
||||
const commands = new Collection<string, { builder: SlashCommandBuilder, execute: (interaction: ChatInputCommandInteraction) => Promise<void> }>();
|
||||
commands.set(notification.builder.name, notification);
|
||||
commands.set(blocklist.builder.name, blocklist);
|
||||
commands.set(info.builder.name, info);
|
||||
commands.set(preserveSettings.builder.name, preserveSettings);
|
||||
|
||||
client.on(Events.InteractionCreate, async (interaction) => {
|
||||
if (!interaction.isChatInputCommand()) return;
|
||||
|
66
src/commands/info.ts
Normal file
66
src/commands/info.ts
Normal file
@ -0,0 +1,66 @@
|
||||
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import { IsNull } from "typeorm";
|
||||
import { Badword, database } from "../data";
|
||||
import { getGuildSetting, isPremiumActive } from "../tools/data";
|
||||
import getDefaultEmbed from "../tools/defaultEmbeds";
|
||||
import pack from "../../package.json";
|
||||
import { Color, Emoji } from "../tools/design";
|
||||
|
||||
const builder = new SlashCommandBuilder();
|
||||
builder.setName("info");
|
||||
builder.setDescription("Shows information about this bot and the server settings");
|
||||
builder.setDMPermission(false);
|
||||
|
||||
async function execute(interaction: ChatInputCommandInteraction): Promise<void> {
|
||||
if (!interaction.inGuild()) throw new Error("Command was executed outside guild context");
|
||||
|
||||
const settings = await getGuildSetting(interaction.guildId);
|
||||
const isPremium = isPremiumActive(settings.isPremiumUntil);
|
||||
const globalBlockedWordsCount = await database.getRepository(Badword).count({
|
||||
where: {
|
||||
guildID: IsNull()
|
||||
}
|
||||
});
|
||||
const localBlockedWordsCount = await database.getRepository(Badword).count({
|
||||
where: {
|
||||
guildID: interaction.guildId
|
||||
}
|
||||
});
|
||||
|
||||
const embed = getDefaultEmbed();
|
||||
embed.setTitle(`${Emoji.SECURITY_CHALLENGE} Channel filter V${pack.version} by AstroGD®`);
|
||||
embed.setDescription(`Codename eu.astrogd.white-leopard`);
|
||||
embed.setColor(isPremium ? Color.PREMIUM_ORANGE : Color.INFORMING_BLUE);
|
||||
embed.addFields({
|
||||
name: "What does this bot do?",
|
||||
value: "This bot checks for blocked words contained in channel names and reverts the changes if found."
|
||||
},{
|
||||
name: "Author",
|
||||
value: `This bot was created by AstroGD#0001 ${Emoji.ASTROGD} mainly for the official r/Overwatch2 Subreddit Discord server`
|
||||
},{
|
||||
name: "Server status",
|
||||
value: `${isPremium ? Emoji.PREMIUM : Emoji.SWITCH_OFF} Premium features are ${isPremium ? "enabled" : "disabled"} on this server`,
|
||||
inline: true
|
||||
},{
|
||||
name: "Global word count",
|
||||
value: globalBlockedWordsCount.toString(),
|
||||
inline: true
|
||||
},{
|
||||
name: "Local word count",
|
||||
value: localBlockedWordsCount.toString(),
|
||||
inline: true
|
||||
},{
|
||||
name: `${Emoji.WAVING} Have a question or want to say hello?`,
|
||||
value: "Join the support Discord server at https://go.astrogd.eu/discord"
|
||||
});
|
||||
|
||||
interaction.reply({
|
||||
embeds: [embed],
|
||||
ephemeral: true
|
||||
}).catch();
|
||||
}
|
||||
|
||||
export {
|
||||
builder,
|
||||
execute
|
||||
}
|
@ -3,6 +3,7 @@ import getDefaultEmbed, { getSuccessEmbed } from "../tools/defaultEmbeds";
|
||||
import { database, GuildSetting } from "../data";
|
||||
import { getGuildSetting } from "../tools/data";
|
||||
import { getGuildChannel } from "../tools/discord";
|
||||
import { Emoji } from "../tools/design";
|
||||
|
||||
const builder = new SlashCommandBuilder();
|
||||
builder.setName("logchannel");
|
||||
@ -57,7 +58,7 @@ const execute = async (interaction: ChatInputCommandInteraction) => {
|
||||
if (guildSetting.notificationChannelID) {
|
||||
const oldLogChannel = await getGuildChannel(guildSetting.id, guildSetting.notificationChannelID);
|
||||
const embed = getDefaultEmbed();
|
||||
embed.setTitle("Settings changed");
|
||||
embed.setTitle(`${Emoji.SETTINGS} Settings changed`);
|
||||
embed.setDescription(`Log channel has been switched to <#${channel.id}>`);
|
||||
embed.addFields({
|
||||
name: "This action was performed by",
|
||||
@ -75,7 +76,7 @@ const execute = async (interaction: ChatInputCommandInteraction) => {
|
||||
await database.getRepository(GuildSetting).save(guildSetting);
|
||||
|
||||
const embed = getDefaultEmbed();
|
||||
embed.setTitle("Settings changed");
|
||||
embed.setTitle(`${Emoji.SETTINGS} Settings changed`);
|
||||
embed.setDescription("This channel has been set as the log channel");
|
||||
embed.addFields({
|
||||
name: "This action was performed by",
|
||||
|
66
src/commands/preserveSettings.ts
Normal file
66
src/commands/preserveSettings.ts
Normal file
@ -0,0 +1,66 @@
|
||||
import { SlashCommandBuilder, ChatInputCommandInteraction, PermissionFlagsBits } from "discord.js";
|
||||
import { database, GuildSetting } from "../data";
|
||||
import { getGuildSetting } from "../tools/data";
|
||||
import getDefaultEmbed, { getSuccessEmbed } from "../tools/defaultEmbeds";
|
||||
import { Emoji } from "../tools/design";
|
||||
import { getGuildChannel } from "../tools/discord";
|
||||
|
||||
const builder = new SlashCommandBuilder();
|
||||
builder.setName("preservesettings");
|
||||
builder.setDescription("Sets if the bot should save the server settings and blocklist if it leaves the server or delete it");
|
||||
builder.addStringOption((option) => {
|
||||
option.addChoices({
|
||||
name: "Keep data when bot leaves the server",
|
||||
value: "keep"
|
||||
}, {
|
||||
name: "Delete data when bot leaves the server",
|
||||
value: "delete"
|
||||
});
|
||||
option.setName("behaviour");
|
||||
option.setDescription("How the bot behaves when leaving the server");
|
||||
option.setRequired(true);
|
||||
return option;
|
||||
});
|
||||
builder.setDMPermission(false);
|
||||
builder.setDefaultMemberPermissions(PermissionFlagsBits.Administrator);
|
||||
|
||||
async function execute(interaction: ChatInputCommandInteraction): Promise<void> {
|
||||
if (!interaction.inGuild()) throw new Error("Command was executed outside guild context");
|
||||
|
||||
const settings = await getGuildSetting(interaction.guildId);
|
||||
const option = interaction.options.getString("behaviour", true).toLowerCase();
|
||||
|
||||
if (option !== "keep" && option !== "delete") throw new TypeError(`option "behaviour" expected to be of type "keep" | "delete" but was "${option}"`);
|
||||
|
||||
settings.preserveDataOnGuildLeave = option === "keep";
|
||||
|
||||
await database.getRepository(GuildSetting).save(settings);
|
||||
|
||||
const embed = getSuccessEmbed();
|
||||
embed.setDescription(`Preserve settings on server leave is now ${settings.preserveDataOnGuildLeave ? "ENABLED" : "DISABLED"}`);
|
||||
|
||||
interaction.reply({
|
||||
embeds: [embed],
|
||||
ephemeral: true
|
||||
}).catch();
|
||||
|
||||
if (!settings.notificationChannelID) return;
|
||||
const logChannel = await getGuildChannel(interaction.guildId, settings.notificationChannelID);
|
||||
if (!logChannel || !logChannel.isTextBased()) return;
|
||||
const logEmbed = getDefaultEmbed();
|
||||
logEmbed.setTitle(`${Emoji.SETTINGS} Settings changed`);
|
||||
logEmbed.setDescription(`Preserve settings on server leave is now ${settings.preserveDataOnGuildLeave ? "ENABLED" : "DISABLED"}`);
|
||||
logEmbed.addFields({
|
||||
name: "This action was performed by",
|
||||
value: `${interaction.user.tag} (${interaction.user.id})`
|
||||
});
|
||||
|
||||
logChannel.send({
|
||||
embeds: [logEmbed]
|
||||
}).catch();
|
||||
}
|
||||
|
||||
export {
|
||||
builder,
|
||||
execute
|
||||
}
|
19
src/data/migrations/1669392941776-data.ts
Normal file
19
src/data/migrations/1669392941776-data.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class data1669392941776 implements MigrationInterface {
|
||||
name = 'data1669392941776'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE "guild_setting"
|
||||
ADD "preserveDataOnGuildLeave" boolean NOT NULL DEFAULT false
|
||||
`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE "guild_setting" DROP COLUMN "preserveDataOnGuildLeave"
|
||||
`);
|
||||
}
|
||||
|
||||
}
|
@ -10,4 +10,7 @@ export class GuildSetting {
|
||||
|
||||
@Column("timestamp", { nullable: true, default: null })
|
||||
isPremiumUntil!: Date | null;
|
||||
|
||||
@Column("boolean", { default: false })
|
||||
preserveDataOnGuildLeave!: boolean
|
||||
}
|
85
src/events/channelUpdate.ts
Normal file
85
src/events/channelUpdate.ts
Normal file
@ -0,0 +1,85 @@
|
||||
import client from "../client";
|
||||
import { Events } from "discord.js";
|
||||
import { getGuildSetting, isPremiumActive } from "../tools/data";
|
||||
import { Badword, database } from "../data";
|
||||
import { IsNull } from "typeorm";
|
||||
import getDefaultEmbed, { getFailedEmbed } from "../tools/defaultEmbeds";
|
||||
import { getGuildChannel } from "../tools/discord";
|
||||
import { Color, Emoji } from "../tools/design";
|
||||
|
||||
client.on(Events.ChannelUpdate, async (oldChannel, newChannel) => {
|
||||
if (oldChannel.isDMBased() || newChannel.isDMBased()) return;
|
||||
const name = newChannel.name.toLowerCase();
|
||||
if (name === "censored") return;
|
||||
|
||||
const guild = oldChannel.guild;
|
||||
const settings = await getGuildSetting(guild.id);
|
||||
const isPremium = isPremiumActive(settings.isPremiumUntil);
|
||||
|
||||
const globalBlocklist = await database.getRepository(Badword).find({
|
||||
where: {
|
||||
guildID: IsNull()
|
||||
}
|
||||
});
|
||||
const localBlocklist = await database.getRepository(Badword).find({
|
||||
where: {
|
||||
guildID: guild.id
|
||||
}
|
||||
});
|
||||
|
||||
const blocklist = [...globalBlocklist, ...localBlocklist];
|
||||
let found: string | null = null;
|
||||
|
||||
for (let i = 0; i < blocklist.length; i++) {
|
||||
const word = blocklist[i];
|
||||
if (!word) continue;
|
||||
|
||||
if (!name.includes(word.value)) continue;
|
||||
found = word.value;
|
||||
break;
|
||||
}
|
||||
|
||||
if (found === null) return;
|
||||
|
||||
const logChannel = settings.notificationChannelID ? await getGuildChannel(guild.id, settings.notificationChannelID) : null;
|
||||
|
||||
try {
|
||||
await newChannel.setName("CENSORED", `[Automated] Detected blocked word in channel name. Name has been censored`);
|
||||
} catch (error) {
|
||||
if (!logChannel || !logChannel.isTextBased()) return;
|
||||
const embed = getFailedEmbed();
|
||||
embed.setDescription(`Couldn't censor <#${newChannel.id}> (${newChannel.id}): ${error instanceof Error ? error.message : error}`);
|
||||
if (isPremium) embed.addFields({
|
||||
name: "Detected banned word:",
|
||||
value: `||${found}||`
|
||||
},{
|
||||
name: "Old channel name:",
|
||||
value: `||${name}||`,
|
||||
inline: true
|
||||
});
|
||||
|
||||
logChannel.send({
|
||||
embeds: [embed]
|
||||
}).catch();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!logChannel || !logChannel.isTextBased()) return;
|
||||
const embed = getDefaultEmbed();
|
||||
embed.setTitle(`${Emoji.SECURITY_CHALLENGE_FAILED} Blocked word detected`);
|
||||
embed.setDescription(`<#${newChannel.id}> (${newChannel.id}) has been renamed because its name contained a blocked word.`);
|
||||
embed.setColor(Color.WARNING_YELLOW);
|
||||
if (isPremium) embed.addFields({
|
||||
name: "Detected banned word:",
|
||||
value: `||${found}||`,
|
||||
inline: true
|
||||
},{
|
||||
name: "Old channel name:",
|
||||
value: `||${name}||`,
|
||||
inline: true
|
||||
});
|
||||
|
||||
logChannel.send({
|
||||
embeds: [embed]
|
||||
}).catch();
|
||||
});
|
17
src/events/guildDelete.ts
Normal file
17
src/events/guildDelete.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import client from "../client";
|
||||
import { Events } from "discord.js";
|
||||
import { getGuildSetting } from "../tools/data";
|
||||
import { Badword, database, GuildSetting } from "../data";
|
||||
|
||||
client.on(Events.GuildDelete, async (guild) => {
|
||||
const settings = await getGuildSetting(guild.id);
|
||||
if (settings.preserveDataOnGuildLeave) return;
|
||||
|
||||
await database.getRepository(GuildSetting).delete({
|
||||
id: guild.id
|
||||
});
|
||||
|
||||
await database.getRepository(Badword).delete({
|
||||
guildID: guild.id
|
||||
});
|
||||
});
|
2
src/events/index.ts
Normal file
2
src/events/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
import "./channelUpdate";
|
||||
import "./guildDelete";
|
39
src/service/cleanup.ts
Normal file
39
src/service/cleanup.ts
Normal file
@ -0,0 +1,39 @@
|
||||
import { Badword, database, GuildSetting } from "../data";
|
||||
import client from "../client";
|
||||
import { DiscordAPIError } from "discord.js";
|
||||
|
||||
export default async function execute(): Promise<void> {
|
||||
const guilds = await database.getRepository(GuildSetting).find({
|
||||
where: {
|
||||
preserveDataOnGuildLeave: false
|
||||
}
|
||||
});
|
||||
|
||||
for (const guild of guilds) {
|
||||
try {
|
||||
await client.guilds.fetch(guild.id);
|
||||
} catch (error) {
|
||||
if (!(error instanceof DiscordAPIError)) {
|
||||
console.error(`service.cleanup failed: ${error}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const id = guild.id;
|
||||
|
||||
// 5001 = Missing access
|
||||
if (error.code.toString() !== "50001") {
|
||||
console.warn(`Guild ${guild.id} is unavailable but not because of error 5001:\n${error}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
await database.getRepository(Badword).delete({
|
||||
guildID: guild.id
|
||||
});
|
||||
|
||||
await database.getRepository(GuildSetting).remove(guild);
|
||||
console.log(`Removed data for guild ${id}`);
|
||||
}
|
||||
}
|
||||
|
||||
console.log("Cleanup completed");
|
||||
}
|
6
src/service/index.ts
Normal file
6
src/service/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import "./uptime";
|
||||
import runCleanup from "./cleanup";
|
||||
|
||||
export {
|
||||
runCleanup
|
||||
}
|
19
src/service/uptime.ts
Normal file
19
src/service/uptime.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import express from "express";
|
||||
import pack from "../../package.json";
|
||||
import startupTime from "../tools/startupTime";
|
||||
|
||||
const app = express();
|
||||
|
||||
app.get("/", (_req, res) => {
|
||||
res.status(200).json({
|
||||
running: true,
|
||||
version: pack.version,
|
||||
runningSince: startupTime.toISOString()
|
||||
});
|
||||
});
|
||||
|
||||
app.all("*", (_req, res) => {
|
||||
res.status(404).end();
|
||||
});
|
||||
|
||||
app.listen(80);
|
@ -12,15 +12,13 @@ export async function getGuildSetting(guildID: string): Promise<GuildSetting> {
|
||||
guildSetting.id = guildID;
|
||||
guildSetting.isPremiumUntil = null;
|
||||
guildSetting.notificationChannelID = null;
|
||||
guildSetting.preserveDataOnGuildLeave = false;
|
||||
}
|
||||
|
||||
return guildSetting;
|
||||
}
|
||||
|
||||
export function isPremiumActive(timestamp: Date | null): boolean {
|
||||
|
||||
console.log(timestamp);
|
||||
|
||||
if (timestamp === null) return false;
|
||||
const now = Number(new Date());
|
||||
const activeUntil = Number(timestamp);
|
||||
|
@ -1,31 +1,32 @@
|
||||
import pack from "../../package.json";
|
||||
import { EmbedBuilder } from "discord.js";
|
||||
import client from "../client";
|
||||
import { Color, Emoji } from "./design";
|
||||
|
||||
// const _coolColors = [0x054566];
|
||||
|
||||
export default function getDefaultEmbed(): EmbedBuilder {
|
||||
const embed = new EmbedBuilder();
|
||||
embed.setFooter({
|
||||
text: `Channel filter V${pack.version} by AstroGD®`,
|
||||
text: `Channel filter V${pack.version}`,
|
||||
iconURL: client.user?.avatarURL() || undefined,
|
||||
});
|
||||
embed.setTimestamp(new Date());
|
||||
embed.setColor(0x3682cc);
|
||||
embed.setColor(Color.ANONYMOUS_GRAY);
|
||||
|
||||
return embed;
|
||||
}
|
||||
|
||||
export function getSuccessEmbed(): EmbedBuilder {
|
||||
const embed = getDefaultEmbed();
|
||||
embed.setTitle("Success");
|
||||
embed.setColor(0x32d122);
|
||||
embed.setTitle(`${Emoji.CHAT_APPROVE} Success`);
|
||||
embed.setColor(Color.SUCCESSFUL_GREEN);
|
||||
return embed;
|
||||
}
|
||||
|
||||
export function getFailedEmbed(): EmbedBuilder {
|
||||
const embed = getDefaultEmbed();
|
||||
embed.setTitle("Failed");
|
||||
embed.setColor(0xD01B15);
|
||||
embed.setTitle(`${Emoji.CHAT_DENY} Failed`);
|
||||
embed.setColor(Color.STOPSIGN_RED);
|
||||
return embed;
|
||||
}
|
30
src/tools/design.ts
Normal file
30
src/tools/design.ts
Normal file
@ -0,0 +1,30 @@
|
||||
export enum Emoji {
|
||||
DOUBLE_ARROW_RIGHT = "<:double_arrow_right:918922668936413267>",
|
||||
SETTINGS = "<:settings:918912063970099232>",
|
||||
TIME = "<:time:918913616743387156>",
|
||||
DOCS = "<:docs:918917779283918899>",
|
||||
MESSAGE = "<:message:918920872683786280>",
|
||||
WAVING = "<:waving:918949572804505640>",
|
||||
CHAT_APPROVE = "<:chat_approve:918910607317667860>",
|
||||
CHAT_DENY = "<:chat_deny:918911411663544410>",
|
||||
WARN = "<:warn:918914600181825556>",
|
||||
INFORMATION = "<:information:918912973874028614>",
|
||||
ERROR = "<:error:918915254447136841>",
|
||||
SWITCH_ON = "<:switch_on:918915977662586892>",
|
||||
SWITCH_OFF = "<:switch_off:918917065899925584>",
|
||||
SWITCH_UNSET = "<:switch_unset:918917082807156796>",
|
||||
SECURITY_CHALLENGE = "<:security_challenge:918919903405305946>",
|
||||
SECURITY_CHALLENGE_SUCCESS = "<:security_challenge_success:918919918672576562>",
|
||||
SECURITY_CHALLENGE_FAILED = "<:security_challenge_failed:918919932887064696>",
|
||||
ASTROGD = "<:astrogd:918906741125697626>",
|
||||
PREMIUM = "<:premium:918909591255908442>",
|
||||
}
|
||||
|
||||
export enum Color {
|
||||
PREMIUM_ORANGE = 0xFFC800,
|
||||
SUCCESSFUL_GREEN = 0x77DE37,
|
||||
STOPSIGN_RED = 0xDA2132,
|
||||
WARNING_YELLOW = 0xF0E210,
|
||||
INFORMING_BLUE = 0x2FAAE2,
|
||||
ANONYMOUS_GRAY = 0x7B7B7B
|
||||
}
|
3
src/tools/startupTime.ts
Normal file
3
src/tools/startupTime.ts
Normal file
@ -0,0 +1,3 @@
|
||||
const startupTime = new Date();
|
||||
|
||||
export default startupTime;
|
Reference in New Issue
Block a user