From 673a06376ca564b70fc014453e78d09006a22b62 Mon Sep 17 00:00:00 2001 From: MythEclipse Date: Wed, 13 May 2026 16:32:14 +0700 Subject: [PATCH] feat: implement graceful shutdown process for bot - Added graceful shutdown functionality to handle SIGINT, SIGTERM, uncaught exceptions, and unhandled promise rejections. - Integrated stopRecording and pause functionality during shutdown. - Enhanced logging for shutdown steps and error handling. - Updated package.json to include pino-pretty for improved logging output. --- bun.lockb | Bin 135968 -> 143236 bytes package-lock.json | 1532 --------------------------------------------- package.json | 1 + src/index.ts | 81 ++- 4 files changed, 69 insertions(+), 1545 deletions(-) delete mode 100644 package-lock.json diff --git a/bun.lockb b/bun.lockb index 784d3c2593c7c10eecd11e2b7f4cb5a514103372..b547594a81e42a7fbb693839fd88e088a25faaa0 100755 GIT binary patch delta 22325 zcmeHvd3=pW`}aLbPUIjWwk!u(tP$BoERjVtw}>rOyU>$GWM5J1iM<|_m@;aN+oFrj39#_+ewlU{606c7A|*@mCXJYOtqc_Q|^PjggF^^ zAVy^r@lxjGF$6LE6=tSpCi^5MNYfFarh36V(lYUmVoXB^u{w`b|(hZVSh7vsDXAF-)bhbG7bwfRU7ogQ;7mfXU7zF!c_Dkb1`# zeM#MXUyBb$I$6;Wa%#Ojn0oa&(ur??sh-PV(n~>R)WfS;JI4Hqykt=xnEGZoA{4*s ztmvpb0~)Co zWn?Fr^GCoc$Wd{jLt|C{nMt)mLYyow$oI)ieJeSyAU`8D0cHP;bn2mkj3n41Nf+ES zYgM_WFe5u9BY9ME#&~zt{KOIFjC3dld#GlPFz5RW&oHO7LY%s!0!&@n-BT^-E3JaR zs^~2AsGH8AOv<0wRL$1|Y%f{hp?TRUdCB?t#%8MG5-|0r1g5^f4Mmy?Q=6+T&jC}< z1h>!%M4Sxz3USJJ1WY}V(^73fg2uL9s{Y4%K68F@MpIOr1j{IcODi>l6_}i*z>Lwt zRiAqqdU>VzsID~xOzr3cCi6mk)!YJ1E;oml7@RDd{M0g*g2^Eh{8jBD#A!HE%p+5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N0d^Rn#FqL()u|}KXdp=agVB;@AnK*j8@+5 z^n;@dcEqi;ZS(0LNP!$14zsfeEN5Mwxxhg&z8vND6K|Kpc@#Hs6MvR7kAHc9yRef9 z>OSo!VcyD`Tis6(L$4=J4hNzeS1Sw>Wl+G} z*+Y7CqLo&f^)r8*IqkM}Lbcujahq(=kI3#m7Lx{6u~?Yi5p%I3h5gNL2v2_fbZeWW%(OdYK|y44i1M)7C(a|QNk0y|bb{1* z@QUSG)e64~r=2j_Q8Wjc^y9RfS`I((&9ssD#HJV2MGS>Pn122?FvHJ~G~4i9wZf#q z>f__}%BLq^%R8P?ow8JHq_XuRz2gdob+?wsJgQb`BC2+x19m5?k6fEh(^Kag{2kP- z7q%~wy2e_$ri!0;v-+*|)3m#q7f!0ZxzSMc6lvko&*3(g=e*?+*P3?t+GG8rR1v-h zYhQr4vj?vhsUjCKlYU-z#F<}D&3v3b*NO$G1!+}6omO{~er|W&2hO`Hj{Btjv!2!1 zbW!^wrFhb}dYCREtD_#1@p%lNI!iX3aSf~Zy+@@rYlVF-Ua+J^8Db6;TkGd{9ex!H zygD6UUag^@@ZGy1Cc>j%+hx@$momgT z8#!rHw@a8cdi`V9Fr~p`*NE=16.11.0" - }, - "funding": { - "url": "https://github.com/discordjs/discord.js?sponsor" - } - }, - "node_modules/@discordjs/builders/node_modules/discord-api-types": { - "version": "0.38.41", - "license": "MIT", - "workspaces": [ - "scripts/actions/documentation" - ] - }, - "node_modules/@discordjs/collection": { - "version": "2.1.1", - "license": "Apache-2.0", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/discordjs/discord.js?sponsor" - } - }, - "node_modules/@discordjs/formatters": { - "version": "0.6.2", - "license": "Apache-2.0", - "dependencies": { - "discord-api-types": "^0.38.33" - }, - "engines": { - "node": ">=16.11.0" - }, - "funding": { - "url": "https://github.com/discordjs/discord.js?sponsor" - } - }, - "node_modules/@discordjs/formatters/node_modules/discord-api-types": { - "version": "0.38.41", - "license": "MIT", - "workspaces": [ - "scripts/actions/documentation" - ] - }, - "node_modules/@discordjs/node-pre-gyp": { - "version": "0.4.5", - "license": "BSD-3-Clause", - "dependencies": { - "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.7", - "nopt": "^5.0.0", - "npmlog": "^5.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.11" - }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" - } - }, - "node_modules/@discordjs/opus": { - "version": "0.10.0", - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "@discordjs/node-pre-gyp": "^0.4.5", - "node-addon-api": "^8.1.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/@discordjs/util": { - "version": "1.2.0", - "license": "Apache-2.0", - "dependencies": { - "discord-api-types": "^0.38.33" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/discordjs/discord.js?sponsor" - } - }, - "node_modules/@discordjs/util/node_modules/discord-api-types": { - "version": "0.38.41", - "license": "MIT", - "workspaces": [ - "scripts/actions/documentation" - ] - }, - "node_modules/@discordjs/voice": { - "version": "0.19.1", - "license": "Apache-2.0", - "dependencies": { - "@snazzah/davey": "^0.1.9", - "@types/ws": "^8.18.1", - "discord-api-types": "^0.38.41", - "prism-media": "^1.3.5", - "tslib": "^2.8.1", - "ws": "^8.19.0" - }, - "engines": { - "node": ">=22.12.0" - }, - "funding": { - "url": "https://github.com/discordjs/discord.js?sponsor" - } - }, - "node_modules/@discordjs/voice/node_modules/opusscript": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/opusscript/-/opusscript-0.0.8.tgz", - "integrity": "sha512-VSTi1aWFuCkRCVq+tx/BQ5q9fMnQ9pVZ3JU4UHKqTkf0ED3fKEPdr+gKAAl3IA2hj9rrP6iyq3hlcJq3HELtNQ==", - "license": "MIT", - "optional": true, - "peer": true - }, - "node_modules/@discordjs/voice/node_modules/prism-media": { - "version": "1.3.5", - "license": "Apache-2.0", - "peerDependencies": { - "@discordjs/opus": ">=0.8.0 <1.0.0", - "ffmpeg-static": "^5.0.2 || ^4.2.7 || ^3.0.0 || ^2.4.0", - "node-opus": "^0.3.3", - "opusscript": "^0.0.8" - }, - "peerDependenciesMeta": { - "@discordjs/opus": { - "optional": true - }, - "ffmpeg-static": { - "optional": true - }, - "node-opus": { - "optional": true - }, - "opusscript": { - "optional": true - } - } - }, - "node_modules/@ffmpeg-installer/ffmpeg": { - "version": "1.1.0", - "license": "LGPL-2.1", - "optionalDependencies": { - "@ffmpeg-installer/darwin-arm64": "4.1.5", - "@ffmpeg-installer/darwin-x64": "4.1.0", - "@ffmpeg-installer/linux-arm": "4.1.3", - "@ffmpeg-installer/linux-arm64": "4.1.4", - "@ffmpeg-installer/linux-ia32": "4.1.0", - "@ffmpeg-installer/linux-x64": "4.1.0", - "@ffmpeg-installer/win32-ia32": "4.1.0", - "@ffmpeg-installer/win32-x64": "4.1.0" - } - }, - "node_modules/@ffmpeg-installer/linux-x64": { - "version": "4.1.0", - "cpu": [ - "x64" - ], - "hasInstallScript": true, - "license": "GPLv3", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@minhducsun2002/leb128": { - "version": "1.0.0", - "license": "MIT" - }, - "node_modules/@napi-rs/cli": { - "version": "2.18.4", - "license": "MIT", - "bin": { - "napi": "scripts/index.js" - }, - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - } - }, - "node_modules/@otplib/core": { - "version": "12.0.1", - "license": "MIT" - }, - "node_modules/@otplib/plugin-crypto": { - "version": "12.0.1", - "license": "MIT", - "dependencies": { - "@otplib/core": "^12.0.1" - } - }, - "node_modules/@otplib/plugin-thirty-two": { - "version": "12.0.1", - "license": "MIT", - "dependencies": { - "@otplib/core": "^12.0.1", - "thirty-two": "^1.0.2" - } - }, - "node_modules/@otplib/preset-default": { - "version": "12.0.1", - "license": "MIT", - "dependencies": { - "@otplib/core": "^12.0.1", - "@otplib/plugin-crypto": "^12.0.1", - "@otplib/plugin-thirty-two": "^12.0.1" - } - }, - "node_modules/@otplib/preset-v11": { - "version": "12.0.1", - "license": "MIT", - "dependencies": { - "@otplib/core": "^12.0.1", - "@otplib/plugin-crypto": "^12.0.1", - "@otplib/plugin-thirty-two": "^12.0.1" - } - }, - "node_modules/@sapphire/async-queue": { - "version": "1.5.5", - "license": "MIT", - "engines": { - "node": ">=v14.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@sapphire/shapeshift": { - "version": "4.0.0", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "lodash": "^4.17.21" - }, - "engines": { - "node": ">=v16" - } - }, - "node_modules/@shinyoshiaki/jspack": { - "version": "0.0.6" - }, - "node_modules/@snazzah/davey": { - "version": "0.1.10", - "license": "MIT", - "engines": { - "node": ">= 10" - }, - "funding": { - "url": "https://github.com/sponsors/Snazzah" - }, - "optionalDependencies": { - "@snazzah/davey-android-arm-eabi": "0.1.10", - "@snazzah/davey-android-arm64": "0.1.10", - "@snazzah/davey-darwin-arm64": "0.1.10", - "@snazzah/davey-darwin-x64": "0.1.10", - "@snazzah/davey-freebsd-x64": "0.1.10", - "@snazzah/davey-linux-arm-gnueabihf": "0.1.10", - "@snazzah/davey-linux-arm64-gnu": "0.1.10", - "@snazzah/davey-linux-arm64-musl": "0.1.10", - "@snazzah/davey-linux-x64-gnu": "0.1.10", - "@snazzah/davey-linux-x64-musl": "0.1.10", - "@snazzah/davey-wasm32-wasi": "0.1.10", - "@snazzah/davey-win32-arm64-msvc": "0.1.10", - "@snazzah/davey-win32-ia32-msvc": "0.1.10", - "@snazzah/davey-win32-x64-msvc": "0.1.10" - } - }, - "node_modules/@snazzah/davey-linux-x64-gnu": { - "version": "0.1.10", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@snazzah/davey-linux-x64-musl": { - "version": "0.1.10", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@types/bun": { - "version": "1.3.10", - "resolved": "https://registry.npmjs.org/@types/bun/-/bun-1.3.10.tgz", - "integrity": "sha512-0+rlrUrOrTSskibryHbvQkDOWRJwJZqZlxrUs1u4oOoTln8+WIXBPmAuCF35SWB2z4Zl3E84Nl/D0P7803nigQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "bun-types": "1.3.10" - } - }, - "node_modules/@types/fluent-ffmpeg": { - "version": "2.1.28", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/node": { - "version": "25.3.5", - "license": "MIT", - "dependencies": { - "undici-types": "~7.18.0" - } - }, - "node_modules/@types/ws": { - "version": "8.18.1", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/abbrev": { - "version": "1.1.1", - "license": "ISC" - }, - "node_modules/aes-js": { - "version": "3.1.2", - "license": "MIT" - }, - "node_modules/agent-base": { - "version": "6.0.2", - "license": "MIT", - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/aproba": { - "version": "2.1.0", - "license": "ISC" - }, - "node_modules/are-we-there-yet": { - "version": "2.0.0", - "license": "ISC", - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/async": { - "version": "0.2.10" - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "license": "MIT" - }, - "node_modules/bare-addon-resolve": { - "version": "1.10.0", - "license": "Apache-2.0", - "dependencies": { - "bare-module-resolve": "^1.10.0", - "bare-semver": "^1.0.0" - }, - "peerDependencies": { - "bare-url": "*" - }, - "peerDependenciesMeta": { - "bare-url": { - "optional": true - } - } - }, - "node_modules/bare-module-resolve": { - "version": "1.12.1", - "license": "Apache-2.0", - "dependencies": { - "bare-semver": "^1.0.0" - }, - "peerDependencies": { - "bare-url": "*" - }, - "peerDependenciesMeta": { - "bare-url": { - "optional": true - } - } - }, - "node_modules/bare-semver": { - "version": "1.0.2", - "license": "Apache-2.0" - }, - "node_modules/base64-js": { - "version": "1.5.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/brace-expansion": { - "version": "1.1.12", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/buffer": { - "version": "6.0.3", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/bun-types": { - "version": "1.3.10", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/camelcase": { - "version": "5.3.1", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/chownr": { - "version": "2.0.0", - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/cliui": { - "version": "6.0.0", - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "license": "MIT" - }, - "node_modules/color-support": { - "version": "1.1.3", - "license": "ISC", - "bin": { - "color-support": "bin.js" - } - }, - "node_modules/commander": { - "version": "12.1.0", - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "license": "MIT" - }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "license": "ISC" - }, - "node_modules/crc-32": { - "version": "1.2.2", - "license": "Apache-2.0", - "bin": { - "crc32": "bin/crc32.njs" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/debug": { - "version": "4.4.3", - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/decamelize": { - "version": "1.2.0", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/delegates": { - "version": "1.0.0", - "license": "MIT" - }, - "node_modules/detect-libc": { - "version": "2.1.2", - "license": "Apache-2.0", - "engines": { - "node": ">=8" - } - }, - "node_modules/dijkstrajs": { - "version": "1.0.3", - "license": "MIT" - }, - "node_modules/discord-api-types": { - "version": "0.38.41", - "license": "MIT", - "workspaces": [ - "scripts/actions/documentation" - ] - }, - "node_modules/discord.js-selfbot-v13": { - "version": "3.7.1", - "license": "GNU General Public License v3.0", - "dependencies": { - "@discordjs/builders": "^1.6.3", - "@discordjs/collection": "^2.1.1", - "@sapphire/async-queue": "^1.5.5", - "@sapphire/shapeshift": "^4.0.0", - "discord-api-types": "^0.38.15", - "fetch-cookie": "^3.1.0", - "find-process": "^2.0.0", - "otplib": "^12.0.1", - "prism-media": "^1.3.5", - "qrcode": "^1.5.4", - "tough-cookie": "^5.1.2", - "tree-kill": "^1.2.2", - "undici": "^7.11.0", - "werift-rtp": "^0.8.4", - "ws": "^8.16.0" - }, - "engines": { - "node": ">=20.18" - } - }, - "node_modules/discord.js-selfbot-v13/node_modules/opusscript": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/opusscript/-/opusscript-0.0.8.tgz", - "integrity": "sha512-VSTi1aWFuCkRCVq+tx/BQ5q9fMnQ9pVZ3JU4UHKqTkf0ED3fKEPdr+gKAAl3IA2hj9rrP6iyq3hlcJq3HELtNQ==", - "license": "MIT", - "optional": true, - "peer": true - }, - "node_modules/discord.js-selfbot-v13/node_modules/prism-media": { - "version": "1.3.5", - "license": "Apache-2.0", - "peerDependencies": { - "@discordjs/opus": ">=0.8.0 <1.0.0", - "ffmpeg-static": "^5.0.2 || ^4.2.7 || ^3.0.0 || ^2.4.0", - "node-opus": "^0.3.3", - "opusscript": "^0.0.8" - }, - "peerDependenciesMeta": { - "@discordjs/opus": { - "optional": true - }, - "ffmpeg-static": { - "optional": true - }, - "node-opus": { - "optional": true - }, - "opusscript": { - "optional": true - } - } - }, - "node_modules/duplex-child-process": { - "version": "1.0.1", - "license": "MIT" - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "license": "MIT" - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "license": "MIT" - }, - "node_modules/fetch-cookie": { - "version": "3.2.0", - "license": "Unlicense", - "dependencies": { - "set-cookie-parser": "^2.4.8", - "tough-cookie": "^6.0.0" - } - }, - "node_modules/fetch-cookie/node_modules/tough-cookie": { - "version": "6.0.1", - "license": "BSD-3-Clause", - "dependencies": { - "tldts": "^7.0.5" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/fetch-cookie/node_modules/tough-cookie/node_modules/tldts": { - "version": "7.0.25", - "license": "MIT", - "dependencies": { - "tldts-core": "^7.0.25" - }, - "bin": { - "tldts": "bin/cli.js" - } - }, - "node_modules/fetch-cookie/node_modules/tough-cookie/node_modules/tldts/node_modules/tldts-core": { - "version": "7.0.25", - "license": "MIT" - }, - "node_modules/find-process": { - "version": "2.1.0", - "license": "MIT", - "dependencies": { - "chalk": "~4.1.2", - "commander": "^12.1.0", - "loglevel": "^1.9.2" - }, - "bin": { - "find-process": "dist/cjs/bin/find-process.js" - } - }, - "node_modules/find-up": { - "version": "4.1.0", - "license": "MIT", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fluent-ffmpeg": { - "version": "2.1.3", - "license": "MIT", - "dependencies": { - "async": "^0.2.9", - "which": "^1.1.1" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "license": "ISC", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/fs-minipass/node_modules/minipass": { - "version": "3.3.6", - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "license": "ISC" - }, - "node_modules/gauge": { - "version": "3.0.2", - "license": "ISC", - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "license": "ISC", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/glob": { - "version": "7.2.3", - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/has-unicode": { - "version": "2.0.1", - "license": "ISC" - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "license": "MIT", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "BSD-3-Clause" - }, - "node_modules/inflight": { - "version": "1.0.6", - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "license": "ISC" - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "license": "ISC" - }, - "node_modules/libsodium": { - "version": "0.8.2", - "license": "ISC" - }, - "node_modules/libsodium-wrappers": { - "version": "0.8.2", - "license": "ISC", - "dependencies": { - "libsodium": "^0.8.0" - } - }, - "node_modules/locate-path": { - "version": "5.0.0", - "license": "MIT", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/lodash": { - "version": "4.17.23", - "license": "MIT" - }, - "node_modules/loglevel": { - "version": "1.9.2", - "license": "MIT", - "engines": { - "node": ">= 0.6.0" - }, - "funding": { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/loglevel" - } - }, - "node_modules/make-dir": { - "version": "3.1.0", - "license": "MIT", - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/minimatch": { - "version": "3.1.5", - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minipass": { - "version": "5.0.0", - "license": "ISC", - "engines": { - "node": ">=8" - } - }, - "node_modules/minizlib": { - "version": "2.1.2", - "license": "MIT", - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minizlib/node_modules/minipass": { - "version": "3.3.6", - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "license": "MIT", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mp4box": { - "version": "0.5.4", - "license": "BSD-3-Clause" - }, - "node_modules/ms": { - "version": "2.1.3", - "license": "MIT" - }, - "node_modules/node-addon-api": { - "version": "8.6.0", - "license": "MIT", - "engines": { - "node": "^18 || ^20 || >= 21" - } - }, - "node_modules/node-crc": { - "version": "4.0.0", - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "@napi-rs/cli": "^2.18.4", - "@types/node": "^22.7.8" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/node-crc/node_modules/@types/node": { - "version": "22.19.15", - "license": "MIT", - "dependencies": { - "undici-types": "~6.21.0" - } - }, - "node_modules/node-crc/node_modules/@types/node/node_modules/undici-types": { - "version": "6.21.0", - "license": "MIT" - }, - "node_modules/node-fetch": { - "version": "2.7.0", - "license": "MIT", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/nopt": { - "version": "5.0.0", - "license": "ISC", - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/npmlog": { - "version": "5.0.1", - "license": "ISC", - "dependencies": { - "are-we-there-yet": "^2.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^3.0.0", - "set-blocking": "^2.0.0" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/once": { - "version": "1.4.0", - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/opusscript": { - "version": "0.1.1", - "license": "MIT" - }, - "node_modules/otplib": { - "version": "12.0.1", - "license": "MIT", - "dependencies": { - "@otplib/core": "^12.0.1", - "@otplib/preset-default": "^12.0.1", - "@otplib/preset-v11": "^12.0.1" - } - }, - "node_modules/p-limit": { - "version": "2.3.0", - "license": "MIT", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "4.1.0", - "license": "MIT", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pngjs": { - "version": "5.0.0", - "license": "MIT", - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/prism-media": { - "version": "2.0.0-alpha.0", - "license": "Apache-2.0", - "dependencies": { - "duplex-child-process": "^1.0.1" - } - }, - "node_modules/qrcode": { - "version": "1.5.4", - "license": "MIT", - "dependencies": { - "dijkstrajs": "^1.0.1", - "pngjs": "^5.0.0", - "yargs": "^15.3.1" - }, - "bin": { - "qrcode": "bin/qrcode" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/require-addon": { - "version": "1.2.0", - "license": "Apache-2.0", - "dependencies": { - "bare-addon-resolve": "^1.3.0" - }, - "engines": { - "bare": ">=1.10.0" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "license": "ISC" - }, - "node_modules/rimraf": { - "version": "3.0.2", - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/semver": { - "version": "7.7.4", - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "license": "ISC" - }, - "node_modules/set-cookie-parser": { - "version": "2.7.2", - "license": "MIT" - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "license": "ISC" - }, - "node_modules/sodium-native": { - "version": "4.3.3", - "license": "MIT", - "dependencies": { - "require-addon": "^1.1.0" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/tar": { - "version": "6.2.1", - "license": "ISC", - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^5.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/thirty-two": { - "version": "1.0.2", - "engines": { - "node": ">=0.2.6" - } - }, - "node_modules/tldts": { - "version": "6.1.86", - "license": "MIT", - "dependencies": { - "tldts-core": "^6.1.86" - }, - "bin": { - "tldts": "bin/cli.js" - } - }, - "node_modules/tldts-core": { - "version": "6.1.86", - "license": "MIT" - }, - "node_modules/tough-cookie": { - "version": "5.1.2", - "license": "BSD-3-Clause", - "dependencies": { - "tldts": "^6.1.32" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "license": "MIT" - }, - "node_modules/tree-kill": { - "version": "1.2.2", - "license": "MIT", - "bin": { - "tree-kill": "cli.js" - } - }, - "node_modules/ts-mixer": { - "version": "6.0.4", - "license": "MIT" - }, - "node_modules/tslib": { - "version": "2.8.1", - "license": "0BSD" - }, - "node_modules/undici": { - "version": "7.24.2", - "license": "MIT", - "engines": { - "node": ">=20.18.1" - } - }, - "node_modules/undici-types": { - "version": "7.18.2", - "license": "MIT" - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "license": "MIT" - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "license": "BSD-2-Clause" - }, - "node_modules/werift-rtp": { - "version": "0.8.8", - "license": "MIT", - "dependencies": { - "@minhducsun2002/leb128": "^1.0.0", - "@shinyoshiaki/jspack": "^0.0.6", - "aes-js": "^3.1.2", - "buffer": "^6.0.3", - "mp4box": "^0.5.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/which": { - "version": "1.3.1", - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/which-module": { - "version": "2.0.1", - "license": "ISC" - }, - "node_modules/wide-align": { - "version": "1.1.5", - "license": "ISC", - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, - "node_modules/wrap-ansi": { - "version": "6.2.0", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "license": "ISC" - }, - "node_modules/ws": { - "version": "8.19.0", - "license": "MIT", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/y18n": { - "version": "4.0.3", - "license": "ISC" - }, - "node_modules/yallist": { - "version": "4.0.0", - "license": "ISC" - }, - "node_modules/yargs": { - "version": "15.4.1", - "license": "MIT", - "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs-parser": { - "version": "18.1.3", - "license": "ISC", - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "engines": { - "node": ">=6" - } - } - } -} diff --git a/package.json b/package.json index 01a59e0..56e65e4 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "@types/express": "^5.0.6", "@types/fluent-ffmpeg": "^2.1.28", "@types/ws": "^8.18.1", + "pino-pretty": "^10.3.1", "vitest": "latest" } } diff --git a/src/index.ts b/src/index.ts index d5a0ec8..0e11340 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,10 +5,9 @@ import { getVoiceConnection } from "@discordjs/voice"; import { Client } from "discord.js-selfbot-v13"; import { config } from "./config"; import { discordPlayer } from "./player"; -import { startRecording } from "./recorder"; +import { startRecording, stopRecording } from "./recorder"; import { startWebserver } from "./webserver"; import { createChildLogger } from "./logger"; -import { retryWithBackoff } from "./retry"; const logger = createChildLogger("bot"); @@ -24,6 +23,58 @@ if (!guildId) throw new Error("Missing GUILD_ID in .env"); // Inisialisasi selfbot client const client = new Client(); +// Track shutdown state +let isShuttingDown = false; + +async function gracefulShutdown(signal: string) { + if (isShuttingDown) { + logger.warn(`Already shutting down, ignoring ${signal}`); + return; + } + + isShuttingDown = true; + logger.info({ signal }, "Graceful shutdown initiated"); + + try { + // Step 1: Stop recording + if (guildId) { + logger.info("Stopping recording..."); + stopRecording(guildId); + } + + // Step 2: Pause player + logger.info("Pausing player..."); + discordPlayer.pause(); + + // Step 3: Destroy voice connection + if (guildId) { + const connection = getVoiceConnection(guildId); + if (connection) { + logger.info("Destroying voice connection..."); + try { + connection.destroy(); + } catch (err) { + logger.warn({ error: err }, "Error destroying voice connection"); + } + } + } + + // Step 4: Destroy client + logger.info("Destroying Discord client..."); + try { + client.destroy(); + } catch (err) { + logger.warn({ error: err }, "Error destroying client"); + } + + logger.info("Graceful shutdown completed"); + process.exit(0); + } catch (err) { + logger.error({ error: err }, "Error during graceful shutdown"); + process.exit(1); + } +} + client.on("ready", async () => { if (config.verbose) { logger.info({ user: client.user?.tag }, "Bot logged in"); @@ -70,21 +121,25 @@ client.on("error", (err) => { logger.error({ error: err }, "Client error"); }); -// Graceful shutdown +// Graceful shutdown handlers process.on("SIGINT", () => { - if (config.verbose) { - logger.info("Shutting down gracefully..."); - } - client.destroy(); - process.exit(0); + gracefulShutdown("SIGINT"); }); process.on("SIGTERM", () => { - if (config.verbose) { - logger.info("Terminating..."); - } - client.destroy(); - process.exit(0); + gracefulShutdown("SIGTERM"); +}); + +// Handle uncaught exceptions +process.on("uncaughtException", (err) => { + logger.error({ error: err }, "Uncaught exception"); + gracefulShutdown("uncaughtException"); +}); + +// Handle unhandled promise rejections +process.on("unhandledRejection", (reason, promise) => { + logger.error({ reason, promise }, "Unhandled rejection"); + gracefulShutdown("unhandledRejection"); }); client.login(token);