functional
This commit is contained in:
1
data/global.json
Normal file
1
data/global.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"a":"aaaaa","b":"bbbbb","c":"ccccc"}
|
||||||
@@ -17,11 +17,13 @@
|
|||||||
"author": "ashley zomo",
|
"author": "ashley zomo",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/fs-extra": "^9.0.13",
|
||||||
"discord.js": "^13.6.0",
|
"discord.js": "^13.6.0",
|
||||||
"prettier": "^2.6.2",
|
"prettier": "^2.6.2",
|
||||||
"typescript": "^4.6.3"
|
"typescript": "^4.6.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esbuild": "^0.14.28"
|
"esbuild": "^0.14.28",
|
||||||
|
"fs-extra": "^10.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
331
pnpm-lock.yaml
generated
331
pnpm-lock.yaml
generated
@@ -1,26 +1,28 @@
|
|||||||
lockfileVersion: 5.3
|
lockfileVersion: 5.3
|
||||||
|
|
||||||
specifiers:
|
specifiers:
|
||||||
|
'@types/fs-extra': ^9.0.13
|
||||||
discord.js: ^13.6.0
|
discord.js: ^13.6.0
|
||||||
esbuild: ^0.14.28
|
esbuild: ^0.14.28
|
||||||
|
fs-extra: ^10.1.0
|
||||||
prettier: ^2.6.2
|
prettier: ^2.6.2
|
||||||
typescript: ^4.6.3
|
typescript: ^4.6.3
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
esbuild: 0.14.28
|
esbuild: 0.14.28
|
||||||
|
fs-extra: 10.1.0
|
||||||
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
|
'@types/fs-extra': 9.0.13
|
||||||
discord.js: 13.6.0
|
discord.js: 13.6.0
|
||||||
prettier: 2.6.2
|
prettier: 2.6.2
|
||||||
typescript: 4.6.3
|
typescript: 4.6.3
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
/@discordjs/builders/0.11.0:
|
/@discordjs/builders/0.11.0:
|
||||||
resolution:
|
resolution: {integrity: sha512-ZTB8yJdJKrKlq44dpWkNUrAtEJEq0gqpb7ASdv4vmq6/mZal5kOv312hQ56I/vxwMre+VIkoHquNUAfnTbiYtg==}
|
||||||
{
|
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
|
||||||
integrity: sha512-ZTB8yJdJKrKlq44dpWkNUrAtEJEq0gqpb7ASdv4vmq6/mZal5kOv312hQ56I/vxwMre+VIkoHquNUAfnTbiYtg==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=16.0.0', npm: '>=7.0.0' }
|
|
||||||
dependencies:
|
dependencies:
|
||||||
'@sindresorhus/is': 4.6.0
|
'@sindresorhus/is': 4.6.0
|
||||||
discord-api-types: 0.26.1
|
discord-api-types: 0.26.1
|
||||||
@@ -30,88 +32,67 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@discordjs/collection/0.4.0:
|
/@discordjs/collection/0.4.0:
|
||||||
resolution:
|
resolution: {integrity: sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==}
|
||||||
{
|
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
|
||||||
integrity: sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=16.0.0', npm: '>=7.0.0' }
|
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@sapphire/async-queue/1.3.0:
|
/@sapphire/async-queue/1.3.0:
|
||||||
resolution:
|
resolution: {integrity: sha512-z+CDw5X4UgIEpZL8KM+ThVx1i8V60HBg0l/oFewTNbQQeRDJHdVxHyJykv+SF1H+Rc8EkMS81VTWo95jVYgO/g==}
|
||||||
{
|
engines: {node: '>=v14.0.0', npm: '>=7.0.0'}
|
||||||
integrity: sha512-z+CDw5X4UgIEpZL8KM+ThVx1i8V60HBg0l/oFewTNbQQeRDJHdVxHyJykv+SF1H+Rc8EkMS81VTWo95jVYgO/g==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=v14.0.0', npm: '>=7.0.0' }
|
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@sindresorhus/is/4.6.0:
|
/@sindresorhus/is/4.6.0:
|
||||||
resolution:
|
resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==}
|
||||||
{
|
engines: {node: '>=10'}
|
||||||
integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==,
|
dev: true
|
||||||
}
|
|
||||||
engines: { node: '>=10' }
|
/@types/fs-extra/9.0.13:
|
||||||
|
resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==}
|
||||||
|
dependencies:
|
||||||
|
'@types/node': 17.0.23
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/node-fetch/2.6.1:
|
/@types/node-fetch/2.6.1:
|
||||||
resolution:
|
resolution: {integrity: sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==}
|
||||||
{
|
|
||||||
integrity: sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==,
|
|
||||||
}
|
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 17.0.23
|
'@types/node': 17.0.23
|
||||||
form-data: 3.0.1
|
form-data: 3.0.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/node/17.0.23:
|
/@types/node/17.0.23:
|
||||||
resolution:
|
resolution: {integrity: sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==}
|
||||||
{
|
|
||||||
integrity: sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==,
|
|
||||||
}
|
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/ws/8.5.3:
|
/@types/ws/8.5.3:
|
||||||
resolution:
|
resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==}
|
||||||
{
|
|
||||||
integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==,
|
|
||||||
}
|
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 17.0.23
|
'@types/node': 17.0.23
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/asynckit/0.4.0:
|
/asynckit/0.4.0:
|
||||||
resolution: { integrity: sha1-x57Zf380y48robyXkLzDZkdLS3k= }
|
resolution: {integrity: sha1-x57Zf380y48robyXkLzDZkdLS3k=}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/combined-stream/1.0.8:
|
/combined-stream/1.0.8:
|
||||||
resolution:
|
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
|
||||||
{
|
engines: {node: '>= 0.8'}
|
||||||
integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==,
|
|
||||||
}
|
|
||||||
engines: { node: '>= 0.8' }
|
|
||||||
dependencies:
|
dependencies:
|
||||||
delayed-stream: 1.0.0
|
delayed-stream: 1.0.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/delayed-stream/1.0.0:
|
/delayed-stream/1.0.0:
|
||||||
resolution: { integrity: sha1-3zrhmayt+31ECqrgsp4icrJOxhk= }
|
resolution: {integrity: sha1-3zrhmayt+31ECqrgsp4icrJOxhk=}
|
||||||
engines: { node: '>=0.4.0' }
|
engines: {node: '>=0.4.0'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/discord-api-types/0.26.1:
|
/discord-api-types/0.26.1:
|
||||||
resolution:
|
resolution: {integrity: sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/discord.js/13.6.0:
|
/discord.js/13.6.0:
|
||||||
resolution:
|
resolution: {integrity: sha512-tXNR8zgsEPxPBvGk3AQjJ9ljIIC6/LOPjzKwpwz8Y1Q2X66Vi3ZqFgRHYwnHKC0jC0F+l4LzxlhmOJsBZDNg9g==}
|
||||||
{
|
engines: {node: '>=16.6.0', npm: '>=7.0.0'}
|
||||||
integrity: sha512-tXNR8zgsEPxPBvGk3AQjJ9ljIIC6/LOPjzKwpwz8Y1Q2X66Vi3ZqFgRHYwnHKC0jC0F+l4LzxlhmOJsBZDNg9g==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=16.6.0', npm: '>=7.0.0' }
|
|
||||||
dependencies:
|
dependencies:
|
||||||
'@discordjs/builders': 0.11.0
|
'@discordjs/builders': 0.11.0
|
||||||
'@discordjs/collection': 0.4.0
|
'@discordjs/collection': 0.4.0
|
||||||
@@ -129,11 +110,8 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/esbuild-android-64/0.14.28:
|
/esbuild-android-64/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-A52C3zq+9tNwCqZ+4kVLBxnk/WnrYM8P2+QNvNE9B6d2OVPs214lp3g6UyO+dKDhUdefhfPCuwkP8j2A/+szNA==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-A52C3zq+9tNwCqZ+4kVLBxnk/WnrYM8P2+QNvNE9B6d2OVPs214lp3g6UyO+dKDhUdefhfPCuwkP8j2A/+szNA==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [android]
|
os: [android]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -141,11 +119,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-android-arm64/0.14.28:
|
/esbuild-android-arm64/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-sm0fDEGElZhMC3HLZeECI2juE4aG7uPfMBMqNUhy9CeX399Pz8rC6e78OXMXInGjSdEAwQmCOHmfsP7uv3Q8rA==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-sm0fDEGElZhMC3HLZeECI2juE4aG7uPfMBMqNUhy9CeX399Pz8rC6e78OXMXInGjSdEAwQmCOHmfsP7uv3Q8rA==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [android]
|
os: [android]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -153,11 +128,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-darwin-64/0.14.28:
|
/esbuild-darwin-64/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-nzDd7mQ44FvsFHtOafZdBgn3Li5SMsnMnoz1J2MM37xJmR3wGNTFph88KypjHgWqwbxCI7MXS1U+sN4qDeeW6Q==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-nzDd7mQ44FvsFHtOafZdBgn3Li5SMsnMnoz1J2MM37xJmR3wGNTFph88KypjHgWqwbxCI7MXS1U+sN4qDeeW6Q==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -165,11 +137,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-darwin-arm64/0.14.28:
|
/esbuild-darwin-arm64/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-XEq/bLR/glsUl+uGrBimQzOVs/CmwI833fXUhP9xrLI3IJ+rKyrZ5IA8u+1crOEf1LoTn8tV+hInmX6rGjbScw==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-XEq/bLR/glsUl+uGrBimQzOVs/CmwI833fXUhP9xrLI3IJ+rKyrZ5IA8u+1crOEf1LoTn8tV+hInmX6rGjbScw==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -177,11 +146,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-freebsd-64/0.14.28:
|
/esbuild-freebsd-64/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-rTKLgUj/HEcPeE5XZ7IZwWpFx7IWMfprN7QRk/TUJE1s1Ipb58esboIesUpjirJz/BwrgHq+FDG9ChAI8dZAtQ==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-rTKLgUj/HEcPeE5XZ7IZwWpFx7IWMfprN7QRk/TUJE1s1Ipb58esboIesUpjirJz/BwrgHq+FDG9ChAI8dZAtQ==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [freebsd]
|
os: [freebsd]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -189,11 +155,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-freebsd-arm64/0.14.28:
|
/esbuild-freebsd-arm64/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-sBffxD1UMOsB7aWMoExmipycjcy3HJGwmqE4GQZUTZvdiH4GhjgUiVdtPyt7kSCdL40JqnWQJ4b1l8Y51oCF4Q==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-sBffxD1UMOsB7aWMoExmipycjcy3HJGwmqE4GQZUTZvdiH4GhjgUiVdtPyt7kSCdL40JqnWQJ4b1l8Y51oCF4Q==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [freebsd]
|
os: [freebsd]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -201,11 +164,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-linux-32/0.14.28:
|
/esbuild-linux-32/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-+Wxidh3fBEQ9kHcCsD4etlBTMb1n6QY2uXv3rFhVn88CY/JP782MhA57/ipLMY4kOLeSKEuFGN4rtjHuhmRMig==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-+Wxidh3fBEQ9kHcCsD4etlBTMb1n6QY2uXv3rFhVn88CY/JP782MhA57/ipLMY4kOLeSKEuFGN4rtjHuhmRMig==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [ia32]
|
cpu: [ia32]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -213,11 +173,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-linux-64/0.14.28:
|
/esbuild-linux-64/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-7+xgsC4LvR6cnzaBdiljNnPDjbkwzahogN+S9uy9AoYw7ZjPnnXc6sjQAVCbqGb7MEgrWdpa6u/Tao79i4lWxg==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-7+xgsC4LvR6cnzaBdiljNnPDjbkwzahogN+S9uy9AoYw7ZjPnnXc6sjQAVCbqGb7MEgrWdpa6u/Tao79i4lWxg==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -225,11 +182,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-linux-arm/0.14.28:
|
/esbuild-linux-arm/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-L5isjmlLbh9E0WVllXiVETbScgMbth/+XkXQii1WwgO1RvLIfaGrVFz8d2n6EH/ImtgYxPYGx+OcvIKQBc91Rg==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-L5isjmlLbh9E0WVllXiVETbScgMbth/+XkXQii1WwgO1RvLIfaGrVFz8d2n6EH/ImtgYxPYGx+OcvIKQBc91Rg==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -237,11 +191,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-linux-arm64/0.14.28:
|
/esbuild-linux-arm64/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-EjRHgwg+kgXABzyoPGPOPg4d5wZqRnZ/ZAxBDzLY+i6DS8OUfTSlZHWIOZzU4XF7125WxRBg9ULbrFJBl+57Eg==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-EjRHgwg+kgXABzyoPGPOPg4d5wZqRnZ/ZAxBDzLY+i6DS8OUfTSlZHWIOZzU4XF7125WxRBg9ULbrFJBl+57Eg==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -249,11 +200,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-linux-mips64le/0.14.28:
|
/esbuild-linux-mips64le/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-krx9SSg7yfiUKk64EmjefOyiEF6nv2bRE4um/LiTaQ6Y/6FP4UF3/Ou/AxZVyR154uSRq63xejcAsmswXAYRsw==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-krx9SSg7yfiUKk64EmjefOyiEF6nv2bRE4um/LiTaQ6Y/6FP4UF3/Ou/AxZVyR154uSRq63xejcAsmswXAYRsw==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [mips64el]
|
cpu: [mips64el]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -261,11 +209,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-linux-ppc64le/0.14.28:
|
/esbuild-linux-ppc64le/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-LD0Xxu9g+DNuhsEBV5QuVZ4uKVBMup0xPIruLweuAf9/mHXFnaCuNXUBF5t0DxKl7GQ5MSioKtnb92oMo+QXEw==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-LD0Xxu9g+DNuhsEBV5QuVZ4uKVBMup0xPIruLweuAf9/mHXFnaCuNXUBF5t0DxKl7GQ5MSioKtnb92oMo+QXEw==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [ppc64]
|
cpu: [ppc64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -273,11 +218,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-linux-riscv64/0.14.28:
|
/esbuild-linux-riscv64/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-L/DWfRh2P0vxq4Y+qieSNXKGdMg+e9Qe8jkbN2/8XSGYDTPzO2OcAxSujob4qIh7iSl+cknbXV+BvH0YFR0jbg==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-L/DWfRh2P0vxq4Y+qieSNXKGdMg+e9Qe8jkbN2/8XSGYDTPzO2OcAxSujob4qIh7iSl+cknbXV+BvH0YFR0jbg==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [riscv64]
|
cpu: [riscv64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -285,11 +227,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-linux-s390x/0.14.28:
|
/esbuild-linux-s390x/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-rrgxmsbmL8QQknWGnAL9bGJRQYLOi2AzXy5OTwfhxnj9eqjo5mSVbJXjgiq5LPUAMQZGdPH5yaNK0obAXS81Zw==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-rrgxmsbmL8QQknWGnAL9bGJRQYLOi2AzXy5OTwfhxnj9eqjo5mSVbJXjgiq5LPUAMQZGdPH5yaNK0obAXS81Zw==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [s390x]
|
cpu: [s390x]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -297,11 +236,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-netbsd-64/0.14.28:
|
/esbuild-netbsd-64/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-h8wntIyOR8/xMVVM6TvJxxWKh4AjmLK87IPKpuVi8Pq0kyk0RMA+eo4PFGk5j2XK0D7dj8PcSF5NSlP9kN/j0A==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-h8wntIyOR8/xMVVM6TvJxxWKh4AjmLK87IPKpuVi8Pq0kyk0RMA+eo4PFGk5j2XK0D7dj8PcSF5NSlP9kN/j0A==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [netbsd]
|
os: [netbsd]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -309,11 +245,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-openbsd-64/0.14.28:
|
/esbuild-openbsd-64/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-HBv18rVapbuDx52/fhZ/c/w6TXyaQAvRxiDDn5Hz/pBcwOs3cdd2WxeIKlWmDoqm2JMx5EVlq4IWgoaRX9mVkw==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-HBv18rVapbuDx52/fhZ/c/w6TXyaQAvRxiDDn5Hz/pBcwOs3cdd2WxeIKlWmDoqm2JMx5EVlq4IWgoaRX9mVkw==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [openbsd]
|
os: [openbsd]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -321,11 +254,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-sunos-64/0.14.28:
|
/esbuild-sunos-64/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-zlIxePhZxKYheR2vBCgPVvTixgo/ozOfOMoP6RZj8dxzquU1NgeyhjkcRXucbLCtmoNJ+i4PtWwPZTLuDd3bGg==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-zlIxePhZxKYheR2vBCgPVvTixgo/ozOfOMoP6RZj8dxzquU1NgeyhjkcRXucbLCtmoNJ+i4PtWwPZTLuDd3bGg==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [sunos]
|
os: [sunos]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -333,11 +263,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-windows-32/0.14.28:
|
/esbuild-windows-32/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-am9DIJxXlld1BOAY/VlvBQHMUCPL7S3gB/lnXIY3M4ys0gfuRqPf4EvMwZMzYUbFKBY+/Qb8SRgPRRGhwnJ8Kg==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-am9DIJxXlld1BOAY/VlvBQHMUCPL7S3gB/lnXIY3M4ys0gfuRqPf4EvMwZMzYUbFKBY+/Qb8SRgPRRGhwnJ8Kg==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [ia32]
|
cpu: [ia32]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -345,11 +272,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-windows-64/0.14.28:
|
/esbuild-windows-64/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-78PhySDnmRZlsPNp/W/5Fim8iivlBQQxfhBFIqR7xwvfDmCFUSByyMKP7LCHgNtb04yNdop8nJJkJaQ8Xnwgiw==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-78PhySDnmRZlsPNp/W/5Fim8iivlBQQxfhBFIqR7xwvfDmCFUSByyMKP7LCHgNtb04yNdop8nJJkJaQ8Xnwgiw==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -357,11 +281,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild-windows-arm64/0.14.28:
|
/esbuild-windows-arm64/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-VhXGBTo6HELD8zyHXynV6+L2jWx0zkKnGx4TmEdSBK7UVFACtOyfUqpToG0EtnYyRZ0HESBhzPSVpP781ovmvA==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-VhXGBTo6HELD8zyHXynV6+L2jWx0zkKnGx4TmEdSBK7UVFACtOyfUqpToG0EtnYyRZ0HESBhzPSVpP781ovmvA==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
@@ -369,11 +290,8 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/esbuild/0.14.28:
|
/esbuild/0.14.28:
|
||||||
resolution:
|
resolution: {integrity: sha512-YLNprkCcMVKQ5sekmCKEQ3Obu/L7s6+iij38xNKyBeSmSsTWur4Ky/9zB3XIGT8SCJITG/bZwAR2l7YOAXch4Q==}
|
||||||
{
|
engines: {node: '>=12'}
|
||||||
integrity: sha512-YLNprkCcMVKQ5sekmCKEQ3Obu/L7s6+iij38xNKyBeSmSsTWur4Ky/9zB3XIGT8SCJITG/bZwAR2l7YOAXch4Q==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=12' }
|
|
||||||
hasBin: true
|
hasBin: true
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
@@ -400,11 +318,8 @@ packages:
|
|||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/form-data/3.0.1:
|
/form-data/3.0.1:
|
||||||
resolution:
|
resolution: {integrity: sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==}
|
||||||
{
|
engines: {node: '>= 6'}
|
||||||
integrity: sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==,
|
|
||||||
}
|
|
||||||
engines: { node: '>= 6' }
|
|
||||||
dependencies:
|
dependencies:
|
||||||
asynckit: 0.4.0
|
asynckit: 0.4.0
|
||||||
combined-stream: 1.0.8
|
combined-stream: 1.0.8
|
||||||
@@ -412,41 +327,50 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/form-data/4.0.0:
|
/form-data/4.0.0:
|
||||||
resolution:
|
resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==}
|
||||||
{
|
engines: {node: '>= 6'}
|
||||||
integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==,
|
|
||||||
}
|
|
||||||
engines: { node: '>= 6' }
|
|
||||||
dependencies:
|
dependencies:
|
||||||
asynckit: 0.4.0
|
asynckit: 0.4.0
|
||||||
combined-stream: 1.0.8
|
combined-stream: 1.0.8
|
||||||
mime-types: 2.1.35
|
mime-types: 2.1.35
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/fs-extra/10.1.0:
|
||||||
|
resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
dependencies:
|
||||||
|
graceful-fs: 4.2.10
|
||||||
|
jsonfile: 6.1.0
|
||||||
|
universalify: 2.0.0
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/graceful-fs/4.2.10:
|
||||||
|
resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/jsonfile/6.1.0:
|
||||||
|
resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
|
||||||
|
dependencies:
|
||||||
|
universalify: 2.0.0
|
||||||
|
optionalDependencies:
|
||||||
|
graceful-fs: 4.2.10
|
||||||
|
dev: false
|
||||||
|
|
||||||
/mime-db/1.52.0:
|
/mime-db/1.52.0:
|
||||||
resolution:
|
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
|
||||||
{
|
engines: {node: '>= 0.6'}
|
||||||
integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==,
|
|
||||||
}
|
|
||||||
engines: { node: '>= 0.6' }
|
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/mime-types/2.1.35:
|
/mime-types/2.1.35:
|
||||||
resolution:
|
resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
|
||||||
{
|
engines: {node: '>= 0.6'}
|
||||||
integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==,
|
|
||||||
}
|
|
||||||
engines: { node: '>= 0.6' }
|
|
||||||
dependencies:
|
dependencies:
|
||||||
mime-db: 1.52.0
|
mime-db: 1.52.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/node-fetch/2.6.7:
|
/node-fetch/2.6.7:
|
||||||
resolution:
|
resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==}
|
||||||
{
|
engines: {node: 4.x || >=6.0.0}
|
||||||
integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==,
|
|
||||||
}
|
|
||||||
engines: { node: 4.x || >=6.0.0 }
|
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
encoding: ^0.1.0
|
encoding: ^0.1.0
|
||||||
peerDependenciesMeta:
|
peerDependenciesMeta:
|
||||||
@@ -457,58 +381,48 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/prettier/2.6.2:
|
/prettier/2.6.2:
|
||||||
resolution:
|
resolution: {integrity: sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==}
|
||||||
{
|
engines: {node: '>=10.13.0'}
|
||||||
integrity: sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=10.13.0' }
|
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/tr46/0.0.3:
|
/tr46/0.0.3:
|
||||||
resolution: { integrity: sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= }
|
resolution: {integrity: sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/ts-mixer/6.0.1:
|
/ts-mixer/6.0.1:
|
||||||
resolution:
|
resolution: {integrity: sha512-hvE+ZYXuINrx6Ei6D6hz+PTim0Uf++dYbK9FFifLNwQj+RwKquhQpn868yZsCtJYiclZF1u8l6WZxxKi+vv7Rg==}
|
||||||
{
|
|
||||||
integrity: sha512-hvE+ZYXuINrx6Ei6D6hz+PTim0Uf++dYbK9FFifLNwQj+RwKquhQpn868yZsCtJYiclZF1u8l6WZxxKi+vv7Rg==,
|
|
||||||
}
|
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/tslib/2.3.1:
|
/tslib/2.3.1:
|
||||||
resolution:
|
resolution: {integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==}
|
||||||
{
|
|
||||||
integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==,
|
|
||||||
}
|
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/typescript/4.6.3:
|
/typescript/4.6.3:
|
||||||
resolution:
|
resolution: {integrity: sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==}
|
||||||
{
|
engines: {node: '>=4.2.0'}
|
||||||
integrity: sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=4.2.0' }
|
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/universalify/2.0.0:
|
||||||
|
resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==}
|
||||||
|
engines: {node: '>= 10.0.0'}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/webidl-conversions/3.0.1:
|
/webidl-conversions/3.0.1:
|
||||||
resolution: { integrity: sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= }
|
resolution: {integrity: sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/whatwg-url/5.0.0:
|
/whatwg-url/5.0.0:
|
||||||
resolution: { integrity: sha1-lmRU6HZUYuN2RNNib2dCzotwll0= }
|
resolution: {integrity: sha1-lmRU6HZUYuN2RNNib2dCzotwll0=}
|
||||||
dependencies:
|
dependencies:
|
||||||
tr46: 0.0.3
|
tr46: 0.0.3
|
||||||
webidl-conversions: 3.0.1
|
webidl-conversions: 3.0.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/ws/8.5.0:
|
/ws/8.5.0:
|
||||||
resolution:
|
resolution: {integrity: sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==}
|
||||||
{
|
engines: {node: '>=10.0.0'}
|
||||||
integrity: sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=10.0.0' }
|
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
bufferutil: ^4.0.1
|
bufferutil: ^4.0.1
|
||||||
utf-8-validate: ^5.0.2
|
utf-8-validate: ^5.0.2
|
||||||
@@ -520,8 +434,5 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/zod/3.14.3:
|
/zod/3.14.3:
|
||||||
resolution:
|
resolution: {integrity: sha512-OzwRCSXB1+/8F6w6HkYHdbuWysYWnAF4fkRgKDcSFc54CE+Sv0rHXKfeNUReGCrHukm1LNpi6AYeXotznhYJbQ==}
|
||||||
{
|
|
||||||
integrity: sha512-OzwRCSXB1+/8F6w6HkYHdbuWysYWnAF4fkRgKDcSFc54CE+Sv0rHXKfeNUReGCrHukm1LNpi6AYeXotznhYJbQ==,
|
|
||||||
}
|
|
||||||
dev: true
|
dev: true
|
||||||
|
|||||||
11
src/flags.ts
Normal file
11
src/flags.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
const Flags = {
|
||||||
|
dir: './storage'
|
||||||
|
}
|
||||||
|
|
||||||
|
export function setFlag<T extends keyof typeof Flags>(key: T, val: typeof Flags[T]) {
|
||||||
|
Flags[key] = val
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getFlag(key: keyof typeof Flags) {
|
||||||
|
return Flags[key]
|
||||||
|
}
|
||||||
23
src/fs.ts
Normal file
23
src/fs.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { Guild } from 'discord.js'
|
||||||
|
import { readFileSync, writeFileSync, ensureDirSync, ensureFileSync } from 'fs-extra'
|
||||||
|
import { getFlag } from './flags'
|
||||||
|
|
||||||
|
type storageTypes = 'global' | Guild
|
||||||
|
|
||||||
|
function filePath(storage: storageTypes) {
|
||||||
|
if (storage === 'global') {
|
||||||
|
return `${getFlag('dir')}/global.json`
|
||||||
|
}
|
||||||
|
return `${getFlag('dir')}/guild_${storage.id}.json`
|
||||||
|
}
|
||||||
|
|
||||||
|
export function readFile(storage: storageTypes) {
|
||||||
|
let path = filePath(storage)
|
||||||
|
ensureFileSync(path)
|
||||||
|
return readFileSync(path).toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
export function writeFile(storage: storageTypes, data: string) {
|
||||||
|
ensureDirSync(getFlag('dir'))
|
||||||
|
writeFileSync(filePath(storage), data)
|
||||||
|
}
|
||||||
69
src/main.ts
69
src/main.ts
@@ -1,52 +1,25 @@
|
|||||||
/*
|
import { setFlag } from "./flags";
|
||||||
|
import { globalStorage, initGlobalCache } from './storage'
|
||||||
|
|
||||||
initGlobalStorage()
|
function test2() {
|
||||||
initChannelStorage(channel/channels)
|
let storage = globalStorage()
|
||||||
|
storage.set({
|
||||||
channelStorage(channel) => Storage
|
a: 'aaaaa',
|
||||||
|
b: 'bbbbb',
|
||||||
Storage {
|
c: 'ccccc',
|
||||||
get() => string
|
})
|
||||||
set(string | json)
|
|
||||||
|
|
||||||
getJson() => json
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
function test() {
|
||||||
|
setFlag('dir', './data')
|
||||||
import { JSONObject } from './util'
|
initGlobalCache({
|
||||||
|
a: 'aaa',
|
||||||
class StorageBase {
|
b: 'bbb',
|
||||||
val: string
|
})
|
||||||
fallbackJSON: JSONObject
|
let storage = globalStorage()
|
||||||
constructor(val: string | JSONObject, fallbackJSON?: JSONObject) {
|
console.log(storage.get())
|
||||||
if (typeof val !== 'string') {
|
test2()
|
||||||
val = JSON.stringify(val)
|
console.log(storage.get())
|
||||||
}
|
|
||||||
if (fallbackJSON === undefined) {
|
|
||||||
fallbackJSON = val.constructor() as JSONObject
|
|
||||||
}
|
|
||||||
this.val = val
|
|
||||||
this.fallbackJSON = fallbackJSON
|
|
||||||
}
|
|
||||||
set(val: string | JSONObject) {
|
|
||||||
if (typeof val !== 'string') {
|
|
||||||
val = JSON.stringify(val)
|
|
||||||
}
|
|
||||||
this.val = val
|
|
||||||
}
|
|
||||||
|
|
||||||
get(): string {
|
|
||||||
return this.val
|
|
||||||
}
|
|
||||||
|
|
||||||
getJson(): JSONObject {
|
|
||||||
let val
|
|
||||||
try {
|
|
||||||
val = JSON.parse(this.val)
|
|
||||||
} catch (e) {
|
|
||||||
val = {}
|
|
||||||
}
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test()
|
||||||
|
|||||||
48
src/storage.ts
Normal file
48
src/storage.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import { Guild } from 'discord.js'
|
||||||
|
import { readFile, writeFile } from './fs'
|
||||||
|
import { GlobalStorage, GuildStorage } from './storageclass'
|
||||||
|
import { defaultJson, JSONObject } from './util'
|
||||||
|
|
||||||
|
var GlobalCache = ''
|
||||||
|
/** Map<guild id, stringified data> */
|
||||||
|
const GuildCache = new Map<string, string>()
|
||||||
|
|
||||||
|
export function initGlobalCache(defaultValue?: string | JSONObject) {
|
||||||
|
if (GlobalCache.length === 0) {
|
||||||
|
let data = readFile('global')
|
||||||
|
GlobalCache = defaultJson(data, defaultValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function initGuildCache(guild: Guild, defaultValue?: string | JSONObject) {
|
||||||
|
if (!GuildCache.has(guild.id)) {
|
||||||
|
let data = readFile(guild)
|
||||||
|
GuildCache.set(guild.id, defaultJson(data, defaultValue))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function globalStorage() {
|
||||||
|
initGlobalCache()
|
||||||
|
|
||||||
|
let val = {
|
||||||
|
get: () => GlobalCache,
|
||||||
|
set: (val: string) => {
|
||||||
|
GlobalCache = val
|
||||||
|
writeFile('global', val)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return new GlobalStorage(val)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function guildStorage(guild: Guild) {
|
||||||
|
initGuildCache(guild)
|
||||||
|
|
||||||
|
let val = {
|
||||||
|
get: () => GuildCache.get(guild.id) || '',
|
||||||
|
set: (val: string) => {
|
||||||
|
GuildCache.set(guild.id, val)
|
||||||
|
writeFile(guild, val)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return new GuildStorage(guild, val)
|
||||||
|
}
|
||||||
46
src/storageclass.ts
Normal file
46
src/storageclass.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import { JSONObject } from './util'
|
||||||
|
import { Guild } from 'discord.js'
|
||||||
|
|
||||||
|
export interface StorageValue {
|
||||||
|
get(): string
|
||||||
|
set(val: string): void
|
||||||
|
}
|
||||||
|
|
||||||
|
export class StorageBase {
|
||||||
|
val: StorageValue
|
||||||
|
|
||||||
|
constructor(val: StorageValue) {
|
||||||
|
this.val = val
|
||||||
|
}
|
||||||
|
set(val: string | JSONObject) {
|
||||||
|
if (typeof val !== 'string') {
|
||||||
|
val = JSON.stringify(val)
|
||||||
|
}
|
||||||
|
this.val.set(val)
|
||||||
|
}
|
||||||
|
|
||||||
|
get(): string {
|
||||||
|
return this.val.get()
|
||||||
|
}
|
||||||
|
|
||||||
|
getJson(): JSONObject {
|
||||||
|
let val
|
||||||
|
try {
|
||||||
|
val = JSON.parse(this.val.get())
|
||||||
|
} catch (e) {
|
||||||
|
val = {}
|
||||||
|
}
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GlobalStorage extends StorageBase {}
|
||||||
|
|
||||||
|
export class GuildStorage extends StorageBase {
|
||||||
|
public guild: Guild
|
||||||
|
|
||||||
|
constructor(guild: Guild, val: StorageValue) {
|
||||||
|
super(val)
|
||||||
|
this.guild = guild
|
||||||
|
}
|
||||||
|
}
|
||||||
40
src/util.ts
40
src/util.ts
@@ -2,3 +2,43 @@ export type JSONDataTypes = string | number | boolean
|
|||||||
export type JSONObject<Value = JSONDataTypes, Key extends string = string> = {
|
export type JSONObject<Value = JSONDataTypes, Key extends string = string> = {
|
||||||
[key in Key]: Value
|
[key in Key]: Value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function defaultJson(data: string, defaultValue: string | JSONObject = '') {
|
||||||
|
|
||||||
|
if (data.length === 0) {
|
||||||
|
//no existing data, give the default value instead
|
||||||
|
|
||||||
|
if (typeof defaultValue === 'string') {
|
||||||
|
return defaultValue
|
||||||
|
} else {
|
||||||
|
return JSON.stringify(defaultValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (typeof defaultValue !== 'string') {
|
||||||
|
//existing data should be compared
|
||||||
|
//nothing to compare if default value is string
|
||||||
|
|
||||||
|
try {
|
||||||
|
let foundJson = JSON.parse(data)
|
||||||
|
|
||||||
|
for (let key in defaultValue) {
|
||||||
|
if (
|
||||||
|
!(key in foundJson) ||
|
||||||
|
typeof foundJson[key] !== typeof defaultValue[key]
|
||||||
|
) {
|
||||||
|
//key doesnt exist OR key exists, but type is incorrect
|
||||||
|
foundJson[key] = defaultValue[key]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return JSON.stringify(foundJson)
|
||||||
|
} catch (e) {
|
||||||
|
//couldn't parse data
|
||||||
|
return JSON.stringify(defaultValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user