Merge branch 'dev' into 'main'
Updated scripts to use esm syntax See merge request illegitimate/illegitimate-bot!275
This commit is contained in:
@@ -1 +1 @@
|
||||
nodeLinker: node-modules
|
||||
nodeLinker: node-modules
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
"$schema": "https://json.schemastore.org/nodemon.json",
|
||||
"restartable": "rs",
|
||||
"ignore": [
|
||||
".git",
|
||||
"node_modules",
|
||||
"src",
|
||||
"data"
|
||||
"node_modules"
|
||||
],
|
||||
"verbose": true,
|
||||
"env": {
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/nodemon.json",
|
||||
"ignore": [
|
||||
".git",
|
||||
"node_modules",
|
||||
"data"
|
||||
"node_modules"
|
||||
],
|
||||
"env": {
|
||||
"NODE_ENV": "dev"
|
||||
|
||||
@@ -2,13 +2,10 @@
|
||||
"$schema": "https://json.schemastore.org/nodemon.json",
|
||||
"restartable": "rs",
|
||||
"ignore": [
|
||||
".git",
|
||||
"node_modules",
|
||||
"data"
|
||||
"node_modules"
|
||||
],
|
||||
"verbose": true,
|
||||
"env": {
|
||||
"NODE_PATH": "src/",
|
||||
"NODE_ENV": "dev",
|
||||
"TYPESCRIPT": "true"
|
||||
},
|
||||
|
||||
31
package.json
31
package.json
@@ -16,16 +16,15 @@
|
||||
"build": "swc src -d dist --strip-leading-paths",
|
||||
"watch": "swc src -d dist --strip-leading-paths --watch",
|
||||
"dev": "nodemon --config nodemon-swc.json",
|
||||
"dev:conc": "conc --names \"SWC,BOT\" --prefix-colors \"blue, magenta\" \"yarn watch\" \"yarn dev:js\"",
|
||||
"dev:ts": "nodemon --config nodemon.json src/index.ts",
|
||||
"dev:js": "nodemon --config nodemon-js.json dist/index.js",
|
||||
"format": "dprint fmt \"**/*.ts\"",
|
||||
"check": "tsc --noEmit",
|
||||
"lint": "eslint",
|
||||
"lint:fix": "eslint --fix",
|
||||
"push:prod": "cross-env NODE_PATH=src/ \"ts-node scripts/deploy-commands.ts\"",
|
||||
"push:dev": "cross-env NODE_PATH=src/ \"ts-node scripts/dev-deploy.ts\"",
|
||||
"delete:dev": "ts-node scripts/delete-commands.ts"
|
||||
"push:prod": "tsx scripts/deploy-commands.ts",
|
||||
"push:dev": "tsx scripts/dev-deploy.ts",
|
||||
"delete:dev": "tsx scripts/delete-commands.ts"
|
||||
},
|
||||
"author": "Taken",
|
||||
"license": "GPL-3.0-only",
|
||||
@@ -33,15 +32,15 @@
|
||||
"@discord-player/extractor": "^4.5.1",
|
||||
"@evan/opus": "^1.0.3",
|
||||
"anilist": "^0.12.4",
|
||||
"axios": "^1.7.5",
|
||||
"axios": "^1.7.7",
|
||||
"chalk": "^5.3.0",
|
||||
"cron": "^3.1.7",
|
||||
"discord-player": "^6.7.1",
|
||||
"discord-player-youtubei": "^1.2.6",
|
||||
"discord.js": "^14.15.3",
|
||||
"discord-player-youtubei": "^1.3.1",
|
||||
"discord.js": "^14.16.1",
|
||||
"dotenv": "^16.4.5",
|
||||
"ioredis": "^5.4.1",
|
||||
"mongoose": "^8.5.3",
|
||||
"mongoose": "^8.6.1",
|
||||
"ms": "^2.1.3",
|
||||
"pg": "^8.12.0",
|
||||
"pg-hstore": "^2.3.4",
|
||||
@@ -51,23 +50,21 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.1.0",
|
||||
"@eslint/js": "^9.9.0",
|
||||
"@eslint/js": "^9.10.0",
|
||||
"@swc/cli": "^0.4.0",
|
||||
"@swc/core": "^1.7.14",
|
||||
"@swc/core": "^1.7.24",
|
||||
"@types/ms": "^0.7.34",
|
||||
"@types/node": "^22.5.0",
|
||||
"@types/node": "^22.5.4",
|
||||
"@types/pg": "^8",
|
||||
"@typescript-eslint/eslint-plugin": "^8.2.0",
|
||||
"@typescript-eslint/parser": "^8.2.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.4.0",
|
||||
"@typescript-eslint/parser": "^8.4.0",
|
||||
"chokidar": "^3.6.0",
|
||||
"concurrently": "^8.2.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"dprint": "^0.47.2",
|
||||
"eslint": "^9.9.0",
|
||||
"eslint": "^9.10.0",
|
||||
"globals": "^15.9.0",
|
||||
"sqlite3": "^5.1.7",
|
||||
"tsx": "^4.19.0",
|
||||
"typescript": "^5.5.4"
|
||||
},
|
||||
"packageManager": "yarn@4.4.0"
|
||||
"packageManager": "yarn@4.4.1"
|
||||
}
|
||||
|
||||
@@ -3,16 +3,13 @@ import env from "../src/utils/Env"
|
||||
|
||||
const rest = new REST({ version: "10" }).setToken(env.dev.devtoken)
|
||||
|
||||
async function deleteCommands() {
|
||||
try {
|
||||
console.log("Started deleting application (/) commands.")
|
||||
await rest.put(
|
||||
Routes.applicationGuildCommands(env.dev.devid, env.dev.guildid),
|
||||
{ body: [] }
|
||||
)
|
||||
console.log("Successfully deleted application (/) commands.")
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
try {
|
||||
console.log("Started deleting application (/) commands.")
|
||||
await rest.put(
|
||||
Routes.applicationGuildCommands(env.dev.devid, env.dev.guildid),
|
||||
{ body: [] }
|
||||
)
|
||||
console.log("Successfully deleted application (/) commands.")
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
deleteCommands()
|
||||
|
||||
@@ -10,29 +10,27 @@ const commandFiles = fs.readdirSync("./src/commands").filter(file => file.endsWi
|
||||
const contentMenuCommands = fs.readdirSync("./src/commands-contextmenu").filter(file => file.endsWith(".ts"))
|
||||
|
||||
for (const file of commandFiles) {
|
||||
const command: ICommand = require(`../src/commands/${file}`)
|
||||
const { default: command } = await import(`../src/commands/${file}`) as { default: ICommand }
|
||||
commands.push(command.data.toJSON())
|
||||
}
|
||||
for (const file of contentMenuCommands) {
|
||||
const command: ICommand = require(`../src/commands-contextmenu/${file}`)
|
||||
const { default: command } = await import(`../src/commands-contextmenu/${file}`) as { default: ICommand }
|
||||
commands.push(command.data.toJSON())
|
||||
}
|
||||
|
||||
;(async () => {
|
||||
try {
|
||||
console.log(color(`Started refreshing ${commands.length} application (/) commands.`, "green"))
|
||||
try {
|
||||
console.log(color(`Started refreshing ${commands.length} application (/) commands.`, "green"))
|
||||
|
||||
const commandsString = commands.map(command => " " + command.name)
|
||||
console.log(color(commandsString.join("\n"), "lavender"))
|
||||
const commandsString = commands.map(command => " " + command.name)
|
||||
console.log(color(commandsString.join("\n"), "lavender"))
|
||||
|
||||
await rest.put(
|
||||
Routes.applicationCommands(env.dev.clientid),
|
||||
{ body: commands }
|
||||
).then(() => {
|
||||
console.log(color(`Successfully reloaded ${commands.length} application (/) commands.`, "green"))
|
||||
process.exit(0)
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
})()
|
||||
await rest.put(
|
||||
Routes.applicationCommands(env.dev.clientid),
|
||||
{ body: commands }
|
||||
).then(() => {
|
||||
console.log(color(`Successfully reloaded ${commands.length} application (/) commands.`, "green"))
|
||||
process.exit(0)
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
@@ -9,30 +9,28 @@ const commandFiles = fs.readdirSync("./src/commands/").filter(file => file.endsW
|
||||
const contentMenuCommands = fs.readdirSync("./src/commands-contextmenu/").filter(file => file.endsWith(".ts"))
|
||||
|
||||
for (const file of commandFiles) {
|
||||
const command: ICommand = require(`../src/commands/${file}`)
|
||||
const { default: command } = await import(`../src/commands/${file}`) as { default: ICommand }
|
||||
if (command.dev) {
|
||||
commands.push(command.data.toJSON())
|
||||
}
|
||||
}
|
||||
for (const file of contentMenuCommands) {
|
||||
const command: ICommand = require(`../src/commands-contextmenu/${file}`)
|
||||
const { default: command } = await import(`../src/commands-contextmenu/${file}`) as { default: ICommand }
|
||||
if (command.dev) {
|
||||
commands.push(command.data.toJSON())
|
||||
}
|
||||
}
|
||||
|
||||
;(async () => {
|
||||
try {
|
||||
console.log(`Started refreshing ${commands.length} application (/) commands.`)
|
||||
try {
|
||||
console.log(`Started refreshing ${commands.length} application (/) commands.`)
|
||||
|
||||
await rest.put(
|
||||
Routes.applicationGuildCommands(env.dev.devid, env.dev.guildid),
|
||||
{ body: commands }
|
||||
).then(() => {
|
||||
console.log(`Successfully reloaded ${commands.length} application (/) commands.`)
|
||||
process.exit(0)
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
})()
|
||||
await rest.put(
|
||||
Routes.applicationGuildCommands(env.dev.devid, env.dev.guildid),
|
||||
{ body: commands }
|
||||
).then(() => {
|
||||
console.log(`Successfully reloaded ${commands.length} application (/) commands.`)
|
||||
process.exit(0)
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user