From 5512bc1134bc5455245c5c70fed1433e7f46fb81 Mon Sep 17 00:00:00 2001 From: DJj123dj <80536295+DJj123dj@users.noreply.github.com> Date: Thu, 22 Aug 2024 16:09:29 +0200 Subject: [PATCH] Pterodactyl panel support part 2 --- index.js | 11 +++++++++++ package.json | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..4d0255c --- /dev/null +++ b/index.js @@ -0,0 +1,11 @@ +//PLEASE COMPILE USING "npm run build" BEFORE STARTING THE BOT! +//OR USE "npm start" TO INSTANTLY COMPILE & START THE BOT! + +const fs = require("fs") +const child = require("child_process") +if (!fs.existsSync("./dist/src/index.js")){ + console.log("Compiling the bot...") + child.execSync("npm run build",{timeout:10000}) + console.log("\n\nFinished compilation!") +} +require("./dist/src/index") \ No newline at end of file diff --git a/package.json b/package.json index f57ce59..03dc02d 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,10 @@ "plugins", "discord-ticket-bot" ], - "main": "./src/index.ts", + "main": "index.js", "scripts": { "build": "rm -rf ./dist/ && npx tsc -p ./tsconfig.json", - "start": "npm run build && node ./dist/src/index.js", + "start": "npm run build && node index.js", "test": "npm run start -- --dev-config --dev-database" }, "type": "commonjs",