mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 06:28:53 +00:00
Merge pull request #95 from mariusbegby/changes-and-stuff
Changes and stuff
This commit is contained in:
8 files changed
+171
-145
No files matched your search
+1
-1
@@ -10,7 +10,7 @@ DISCORD_BOT_TOKEN=YOUR_DISCORD_BOT_TOKEN
|
|||||||
DISCORD_APPLICATION_ID=YOUR_DISCORD_BOT_APPLICATION_ID
|
DISCORD_APPLICATION_ID=YOUR_DISCORD_BOT_APPLICATION_ID
|
||||||
|
|
||||||
# Optional: Set a YouTube cookie to reduce the chance of getting rate limited / 429 Too Many Requests
|
# Optional: Set a YouTube cookie to reduce the chance of getting rate limited / 429 Too Many Requests
|
||||||
YOUTUBE_COOKIE=
|
YT_COOKIE=
|
||||||
|
|
||||||
# Optional: Authentication tokens for botlist websites to automatically update server count, etc.
|
# Optional: Authentication tokens for botlist websites to automatically update server count, etc.
|
||||||
# See /src/utils/postBotStats.js for more information
|
# See /src/utils/postBotStats.js for more information
|
||||||
|
|||||||
@@ -40,11 +40,15 @@ This bot is open-source, and if you want to host it yourself, you can do so by f
|
|||||||
6. Deploy slash commands via Discord API by running `npm run deploy`. This is required to make the commands accessible for Discord servers.
|
6. Deploy slash commands via Discord API by running `npm run deploy`. This is required to make the commands accessible for Discord servers.
|
||||||
7. Run `npm start` to start the bot. If everything is configured and setup correctly, the bot should be online and ready to use. You will need to invite the bot to a server, see [Adding your bot to servers](https://discordjs.guide/preparations/adding-your-bot-to-servers.html#bot-invite-links) article for help.
|
7. Run `npm start` to start the bot. If everything is configured and setup correctly, the bot should be online and ready to use. You will need to invite the bot to a server, see [Adding your bot to servers](https://discordjs.guide/preparations/adding-your-bot-to-servers.html#bot-invite-links) article for help.
|
||||||
|
|
||||||
Additional information:
|
### Additional information:
|
||||||
|
|
||||||
- You can use `npm run deploy-pretty` and `npm run start-pretty` to get formatted, colorized output to console instead of JSON format. For this to work, you need the npm package `pino-pretty` installed, `npm install pino-pretty -g` to install it globally.
|
- You can use `npm run deploy-pretty` and `npm run start-pretty` to get formatted, colorized output to console instead of JSON format. For this to work, you need the npm package `pino-pretty` installed, `npm install pino-pretty -g` to install it globally.
|
||||||
- Logs are stored in `/logs` directory, you can configure the logging level to file and console under `loggerOptions` in `/src/config.js`.
|
- Logs are stored in `/logs` directory, you can configure the logging level to file and console under `loggerOptions` in `/src/config.js`.
|
||||||
|
- For production use, I recommend using something like `pm2` to manage the process and automatically restart it if it crashes. Here's a simple setup for `pm2`:
|
||||||
|
- Install `pm2` globally: `npm install pm2 -g`.
|
||||||
|
- Start the bot with `pm2 start ./src/index.js --name "Cadence"`.
|
||||||
|
- Save the process list with `pm2 save`.
|
||||||
|
- To view logs with pino-pretty, run `pm2 logs 0 --out --raw | pino-pretty`. _Note: Does not work well in Windows PowerShell, use command prompt (cmd) to view logs with `pino-pretty` using same command if you are using `pm2`_.
|
||||||
## Get help and support 🛟
|
## Get help and support 🛟
|
||||||
|
|
||||||
If you experience any issues, please open an issue on this repository or join the [Discord support server](https://discord.gg/cadence) for the Cadence bot.
|
If you experience any issues, please open an issue on this repository or join the [Discord support server](https://discord.gg/cadence) for the Cadence bot.
|
||||||
|
|||||||
Generated
+64
-64
@@ -9,14 +9,14 @@
|
|||||||
"version": "2.2.3",
|
"version": "2.2.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discord-player/extractor": "^4.4.1-dev.0",
|
"@discord-player/extractor": "^4.4.1-dev.1",
|
||||||
"@discordjs/opus": "^0.9.0",
|
"@discordjs/opus": "^0.9.0",
|
||||||
"@discordjs/rest": "^1.7.1",
|
"@discordjs/rest": "^1.7.1",
|
||||||
"@discordjs/voice": "^0.16.0",
|
"@discordjs/voice": "^0.16.0",
|
||||||
"discord-player": "^6.6.1",
|
"discord-player": "^6.6.1",
|
||||||
"discord.js": "^14.11.0",
|
"discord.js": "^14.11.0",
|
||||||
"dotenv": "^16.3.1",
|
"dotenv": "^16.3.1",
|
||||||
"mediaplex": "^0.0.0",
|
"mediaplex": "^0.0.1",
|
||||||
"node-os-utils": "^1.3.7",
|
"node-os-utils": "^1.3.7",
|
||||||
"pino": "^8.14.1",
|
"pino": "^8.14.1",
|
||||||
"yt-stream": "^1.4.8"
|
"yt-stream": "^1.4.8"
|
||||||
@@ -41,9 +41,9 @@
|
|||||||
"integrity": "sha512-U86em1cMtopXVuKFDxP8J2DcNOqwCAsYQ2tkzPoJvchsrezcI2cgvN3jtGt9FFECP3pLvSz96ZB9FOHZKG5Mqg=="
|
"integrity": "sha512-U86em1cMtopXVuKFDxP8J2DcNOqwCAsYQ2tkzPoJvchsrezcI2cgvN3jtGt9FFECP3pLvSz96ZB9FOHZKG5Mqg=="
|
||||||
},
|
},
|
||||||
"node_modules/@discord-player/extractor": {
|
"node_modules/@discord-player/extractor": {
|
||||||
"version": "4.4.1-dev.0",
|
"version": "4.4.1-dev.1",
|
||||||
"resolved": "https://registry.npmjs.org/@discord-player/extractor/-/extractor-4.4.1-dev.0.tgz",
|
"resolved": "https://registry.npmjs.org/@discord-player/extractor/-/extractor-4.4.1-dev.1.tgz",
|
||||||
"integrity": "sha512-DVc4B9wGi3OD8rF/s5r+SF+PQAXqIhyuKGQHs/bgKvdrcBiyP7Tqxr3hlcGt/ZtCifiW9Fp77uT7iRkl4gTsWA==",
|
"integrity": "sha512-mz9q5TE8M+e2ia5gvLCx6CBEU9JmsIxeA3xAqDYxaB61fTmPv6jnbZfKS1QpxbtrbfRzth+l2UHglS98jr7mPw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"file-type": "^16.5.4",
|
"file-type": "^16.5.4",
|
||||||
"genius-lyrics": "^4.4.3",
|
"genius-lyrics": "^4.4.3",
|
||||||
@@ -1965,33 +1965,33 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mediaplex": {
|
"node_modules/mediaplex": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mediaplex/-/mediaplex-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mediaplex/-/mediaplex-0.0.1.tgz",
|
||||||
"integrity": "sha512-pFg3SEQakC49Vem1vlUMptBDB5eiWH0v0jvR35oChtucjAtk3pKEqK0DqiQLShzLVvEnGfqXFIqYP+buFqkw5Q==",
|
"integrity": "sha512-zOkIGjnYYNUbQICUOAH+sJgLN674sXv7uRJMtNj8yLTh7Gjdvu2E/pBAS+vJwIDe92ZPcCF2H1Ovlz4WgWTbJw==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10"
|
"node": ">= 10"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"mediaplex-android-arm-eabi": "0.0.0",
|
"mediaplex-android-arm-eabi": "0.0.1",
|
||||||
"mediaplex-android-arm64": "0.0.0",
|
"mediaplex-android-arm64": "0.0.1",
|
||||||
"mediaplex-darwin-arm64": "0.0.0",
|
"mediaplex-darwin-arm64": "0.0.1",
|
||||||
"mediaplex-darwin-universal": "0.0.0",
|
"mediaplex-darwin-universal": "0.0.1",
|
||||||
"mediaplex-darwin-x64": "0.0.0",
|
"mediaplex-darwin-x64": "0.0.1",
|
||||||
"mediaplex-freebsd-x64": "0.0.0",
|
"mediaplex-freebsd-x64": "0.0.1",
|
||||||
"mediaplex-linux-arm-gnueabihf": "0.0.0",
|
"mediaplex-linux-arm-gnueabihf": "0.0.1",
|
||||||
"mediaplex-linux-arm64-gnu": "0.0.0",
|
"mediaplex-linux-arm64-gnu": "0.0.1",
|
||||||
"mediaplex-linux-arm64-musl": "0.0.0",
|
"mediaplex-linux-arm64-musl": "0.0.1",
|
||||||
"mediaplex-linux-x64-gnu": "0.0.0",
|
"mediaplex-linux-x64-gnu": "0.0.1",
|
||||||
"mediaplex-linux-x64-musl": "0.0.0",
|
"mediaplex-linux-x64-musl": "0.0.1",
|
||||||
"mediaplex-win32-arm64-msvc": "0.0.0",
|
"mediaplex-win32-arm64-msvc": "0.0.1",
|
||||||
"mediaplex-win32-ia32-msvc": "0.0.0",
|
"mediaplex-win32-ia32-msvc": "0.0.1",
|
||||||
"mediaplex-win32-x64-msvc": "0.0.0"
|
"mediaplex-win32-x64-msvc": "0.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mediaplex-android-arm-eabi": {
|
"node_modules/mediaplex-android-arm-eabi": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mediaplex-android-arm-eabi/-/mediaplex-android-arm-eabi-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mediaplex-android-arm-eabi/-/mediaplex-android-arm-eabi-0.0.1.tgz",
|
||||||
"integrity": "sha512-cG/Iqebd0CNhf6JcFIejW3VKnYtstm36H73E46UNIemlm8/UOUW1ag8kzhC/4OlgLTThCdwfQG5LIqVI5rqxkA==",
|
"integrity": "sha512-m3f3n1PaxSrCYMjaFsyP8Egyoz8q0dEgw8X6ivvbbXewjZSQ0xeLr31nzz/a2alDHLKs04jzyc/j1o8N6KwsuA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
@@ -2004,9 +2004,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mediaplex-android-arm64": {
|
"node_modules/mediaplex-android-arm64": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mediaplex-android-arm64/-/mediaplex-android-arm64-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mediaplex-android-arm64/-/mediaplex-android-arm64-0.0.1.tgz",
|
||||||
"integrity": "sha512-G9K6UPjetZAYNBrQ7ePLNGsyVnbuN90lC7m2Lcd8e2RVd0kxXlzXbSvT4NhnNgP4qEz6XrEzR1daJoHyIHf/Rw==",
|
"integrity": "sha512-aHAyOSiTSLZmiyzpvrB6pfzViC8n43bNLfdvi9N6G37Yo2pSMZY0aH36ougVK87T/gjwNRo9xH4HkqD2G00nHQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -2019,9 +2019,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mediaplex-darwin-arm64": {
|
"node_modules/mediaplex-darwin-arm64": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mediaplex-darwin-arm64/-/mediaplex-darwin-arm64-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mediaplex-darwin-arm64/-/mediaplex-darwin-arm64-0.0.1.tgz",
|
||||||
"integrity": "sha512-TgzMVcx7P0cfRxqf2icC4KkFJg9PCnzwljBPWoxAvZLHktrod7BJTWj0UA065L3IedHBBQqzAq3XLH/4+ZFHPg==",
|
"integrity": "sha512-rrpRknlz4MCEVT1p4KOhVzt3k9j3layRzE3clK1an/gOC0i1fzsuSMd+8RCPAfvrIOM8XCRCSulhzE8iEGmc8Q==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -2034,9 +2034,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mediaplex-darwin-universal": {
|
"node_modules/mediaplex-darwin-universal": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mediaplex-darwin-universal/-/mediaplex-darwin-universal-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mediaplex-darwin-universal/-/mediaplex-darwin-universal-0.0.1.tgz",
|
||||||
"integrity": "sha512-avLsD2J8HrYv7hgHMFVUSekgr9GMEp31cG57HlfhSF/jPZlZXj70pb0YHE0SW9/CG44eVIdZsSSC8XmWB8iCug==",
|
"integrity": "sha512-5K9aMef4ZZv2j8Tav5W5TSHaX2mOAa7ZAQ8/f1YvMnDBsxHYyTb2wq1k01l6g56gnVKT0wmzRMXOoBJ0+cK+ng==",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
"darwin"
|
"darwin"
|
||||||
@@ -2046,9 +2046,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mediaplex-darwin-x64": {
|
"node_modules/mediaplex-darwin-x64": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mediaplex-darwin-x64/-/mediaplex-darwin-x64-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mediaplex-darwin-x64/-/mediaplex-darwin-x64-0.0.1.tgz",
|
||||||
"integrity": "sha512-JUcgCkXE2fmFo6U6RPs2koRH5XKKRtiP1irnGBuB5282DhSoB90Mb8ZdluOLQYpsAEBSDtcqkLWNoyl56Gbp7Q==",
|
"integrity": "sha512-ojqf2mzsip1YhavdfEnZjJ8b7N+QMIbFNp4i8wT6Xl5RrHsrqOYcjmU0mgZYJ+vCCUdN1KymRqAub1mkyMK+8g==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -2061,9 +2061,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mediaplex-freebsd-x64": {
|
"node_modules/mediaplex-freebsd-x64": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mediaplex-freebsd-x64/-/mediaplex-freebsd-x64-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mediaplex-freebsd-x64/-/mediaplex-freebsd-x64-0.0.1.tgz",
|
||||||
"integrity": "sha512-U10wDBUs2KiVByMZ1VX+QAruNPgABQI+AMZJnb5hIYcqrWM8r9/1IdPzn3jWK6gApUYMLFDJmYGh01YLaycUiQ==",
|
"integrity": "sha512-4wlVHpakZXN8rmM1jCetecy6xuzTMGitYFQxpqwx3YWoWz/HlpbTq+U817av0WXdYb1p1Vs177RuFMM97mVsoQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -2076,9 +2076,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mediaplex-linux-arm-gnueabihf": {
|
"node_modules/mediaplex-linux-arm-gnueabihf": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mediaplex-linux-arm-gnueabihf/-/mediaplex-linux-arm-gnueabihf-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mediaplex-linux-arm-gnueabihf/-/mediaplex-linux-arm-gnueabihf-0.0.1.tgz",
|
||||||
"integrity": "sha512-f1gIHlbWE9/0Qt5GEvY2Vwgqo4k7iNWmZkI2XmLApX/QJ4OVU1UFGG0HyY8rVXQd5iLuxbtPwxkLBWSW+eIkXg==",
|
"integrity": "sha512-mFbTzlnAiS9S+pCK56OzIkIiiNeVVEKfqi3lSVnkqjlpv2t3n8nO47nPqzE8pDqAFcxjQwq/+fbLxKVmN6+kDw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
@@ -2091,9 +2091,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mediaplex-linux-arm64-gnu": {
|
"node_modules/mediaplex-linux-arm64-gnu": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mediaplex-linux-arm64-gnu/-/mediaplex-linux-arm64-gnu-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mediaplex-linux-arm64-gnu/-/mediaplex-linux-arm64-gnu-0.0.1.tgz",
|
||||||
"integrity": "sha512-Gr+Dw9ObUkg0U3uckTJkn19kxs+LHhcSgM3v92gDCXBFu2JzkidoRzpwYRzVtSuHgjBQQfv+EU3JgszzI9UWEg==",
|
"integrity": "sha512-MAqHlUCmw+LIR6NTByKU84V0dPCsg/ODvy/FNTGafxmfHkLsrM/yqzwVH4LlqRO8A/v12w/BLnepdxhooF5QaQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -2106,9 +2106,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mediaplex-linux-arm64-musl": {
|
"node_modules/mediaplex-linux-arm64-musl": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mediaplex-linux-arm64-musl/-/mediaplex-linux-arm64-musl-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mediaplex-linux-arm64-musl/-/mediaplex-linux-arm64-musl-0.0.1.tgz",
|
||||||
"integrity": "sha512-SRajRO2bXudnYICFpFAr3J/OKrWMDi7RRHn90RcfLkUnE3JsiwQHeKJhW6gDj3SPcgBODMgfR5BrpMkLGRmaJQ==",
|
"integrity": "sha512-mEvZzFy82AxI6vXmQgM9t3HVdMGQCQEdY1ivNV2t3M2MhKlk1b9TJ882181Z2CQQRcKU1QUGimmHzpFhuh8Fvw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -2121,9 +2121,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mediaplex-linux-x64-gnu": {
|
"node_modules/mediaplex-linux-x64-gnu": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mediaplex-linux-x64-gnu/-/mediaplex-linux-x64-gnu-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mediaplex-linux-x64-gnu/-/mediaplex-linux-x64-gnu-0.0.1.tgz",
|
||||||
"integrity": "sha512-RbfMUCknCBCJv73HiyWV+nMeLCAvTMn/xlaV2vbhtTYFAWAheOvW4lSzfkBZbeZ4LSeiRnCv+5GOMAtesRgVnw==",
|
"integrity": "sha512-Ia8ELm6l8ZOGUy9hq4X7Y7DrAo9g4lVhT+o0TblpJxoB4odhCvQdfOlkV686OIRsi0SjVpWU92grZyukxGG4rw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -2136,9 +2136,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mediaplex-linux-x64-musl": {
|
"node_modules/mediaplex-linux-x64-musl": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mediaplex-linux-x64-musl/-/mediaplex-linux-x64-musl-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mediaplex-linux-x64-musl/-/mediaplex-linux-x64-musl-0.0.1.tgz",
|
||||||
"integrity": "sha512-GBxA3j+2bdzZAhVtR4QPUhoULMNwfHwNvgyycZS8vmpjLcDGXieEBCc72eFGHOzNFLzzJ0BvEO8R4R/rZ5VzXg==",
|
"integrity": "sha512-TiEZhbiciA6bjps5WQNa6Z1M7vsIZ24Vrj2w98ZLQIS7n7zv33r6kM8/EzQjbcC0IRD7EuS+Xvd2NK0Wcr1/yQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -2151,9 +2151,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mediaplex-win32-arm64-msvc": {
|
"node_modules/mediaplex-win32-arm64-msvc": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mediaplex-win32-arm64-msvc/-/mediaplex-win32-arm64-msvc-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mediaplex-win32-arm64-msvc/-/mediaplex-win32-arm64-msvc-0.0.1.tgz",
|
||||||
"integrity": "sha512-7CkVgz2N47VcLIffEVqdCgBvuUOGE/qNOhAY13Qp/qlbNHlhPLKPiRg8mwZaJ0Js5dsJRqXWZ8+u47PD6twA3A==",
|
"integrity": "sha512-xWk2PEMlmndQL+8AQ3uNiJJUQqv4JZTG6SPKieK7G3bUdH5gGNzWEhqQr3+D0r/ACBy2fstG0SCPpx3iRG71aQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -2166,9 +2166,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mediaplex-win32-ia32-msvc": {
|
"node_modules/mediaplex-win32-ia32-msvc": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mediaplex-win32-ia32-msvc/-/mediaplex-win32-ia32-msvc-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mediaplex-win32-ia32-msvc/-/mediaplex-win32-ia32-msvc-0.0.1.tgz",
|
||||||
"integrity": "sha512-6WbRf8RJ3isEbCjgnc0Z+4w3q+1sAEFQO6vU4ucBpiWWxHIRKUP3ykiVAobAoGw9nsG8UUmDbPliWL0RFcVzDg==",
|
"integrity": "sha512-SR46w2Ns0X+vWStZUGBqcTzelPUxYYiph2SFLLAlMZ1TpIx8Txg/QA6Ob4gRBH8ku4Sm8DUKuOBGhs3v6lxwsw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"ia32"
|
"ia32"
|
||||||
],
|
],
|
||||||
@@ -2181,9 +2181,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mediaplex-win32-x64-msvc": {
|
"node_modules/mediaplex-win32-x64-msvc": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/mediaplex-win32-x64-msvc/-/mediaplex-win32-x64-msvc-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mediaplex-win32-x64-msvc/-/mediaplex-win32-x64-msvc-0.0.1.tgz",
|
||||||
"integrity": "sha512-Uc7L7b2yeHGmFQ+kRz2F3Dr36/xI/H00LUERwmLOVRaac8rMLhvPhWBpxVmwLMD11wGGnYMtbZLuzROtBMZunw==",
|
"integrity": "sha512-ZE3gEn9onjLpZr4qoRa7scEZTJTLGleFiJ0kOfmi76ym7HlDlXgtWrtivnm3drHt/zS9ScC0pp+4r+V5xzIzuw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
|||||||
+2
-2
@@ -26,14 +26,14 @@
|
|||||||
"eslint": "eslint ./"
|
"eslint": "eslint ./"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discord-player/extractor": "^4.4.1-dev.0",
|
"@discord-player/extractor": "^4.4.1-dev.1",
|
||||||
"@discordjs/opus": "^0.9.0",
|
"@discordjs/opus": "^0.9.0",
|
||||||
"@discordjs/rest": "^1.7.1",
|
"@discordjs/rest": "^1.7.1",
|
||||||
"@discordjs/voice": "^0.16.0",
|
"@discordjs/voice": "^0.16.0",
|
||||||
"discord-player": "^6.6.1",
|
"discord-player": "^6.6.1",
|
||||||
"discord.js": "^14.11.0",
|
"discord.js": "^14.11.0",
|
||||||
"dotenv": "^16.3.1",
|
"dotenv": "^16.3.1",
|
||||||
"mediaplex": "^0.0.0",
|
"mediaplex": "^0.0.1",
|
||||||
"node-os-utils": "^1.3.7",
|
"node-os-utils": "^1.3.7",
|
||||||
"pino": "^8.14.1",
|
"pino": "^8.14.1",
|
||||||
"yt-stream": "^1.4.8"
|
"yt-stream": "^1.4.8"
|
||||||
|
|||||||
@@ -24,20 +24,20 @@ for (const folder of commandFolders) {
|
|||||||
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_BOT_TOKEN);
|
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_BOT_TOKEN);
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
|
if (!process.env.DISCORD_APPLICATION_ID || !process.env.DISCORD_BOT_TOKEN) {
|
||||||
|
logger.error('Missing required environment variables for deployment.');
|
||||||
|
logger.error('Provide valid DISCORD_APPLICATION_ID and DISCORD_BOT_TOKEN in .env file.');
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logger.info('DEPLOYING BOT SLASH COMMANDS');
|
logger.info('DEPLOYING BOT SLASH COMMANDS');
|
||||||
logger.info(
|
logger.info(
|
||||||
slashCommands.map((command) => {
|
slashCommands.map((command) => command.name),
|
||||||
return command.name;
|
|
||||||
}),
|
|
||||||
'Bot commands found:'
|
'Bot commands found:'
|
||||||
);
|
);
|
||||||
|
|
||||||
logger.info('Started refreshing application (/) bot commands.');
|
logger.info('Started refreshing application (/) bot commands.');
|
||||||
await rest.put(Routes.applicationCommands(process.env.DISCORD_APPLICATION_ID), {
|
await refreshCommands(Routes.applicationCommands(process.env.DISCORD_APPLICATION_ID), slashCommands);
|
||||||
body: slashCommands
|
|
||||||
});
|
|
||||||
|
|
||||||
logger.info('Successfully refreshed application (/) bot commands.');
|
logger.info('Successfully refreshed application (/) bot commands.');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(error, 'Failed to refresh application (/) bot commands.');
|
logger.error(error, 'Failed to refresh application (/) bot commands.');
|
||||||
@@ -46,22 +46,28 @@ const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_BOT_TOKEN)
|
|||||||
try {
|
try {
|
||||||
logger.info('DEPLOYING SYSTEM SLASH COMMANDS');
|
logger.info('DEPLOYING SYSTEM SLASH COMMANDS');
|
||||||
logger.info(
|
logger.info(
|
||||||
systemCommands.map((systemCommand) => {
|
systemCommands.map((systemCommand) => systemCommand.name),
|
||||||
return systemCommand.name;
|
|
||||||
}),
|
|
||||||
'System commands found:'
|
'System commands found:'
|
||||||
);
|
);
|
||||||
|
|
||||||
logger.info('Started refreshing application (/) system commands.');
|
logger.info('Started refreshing application (/) system commands.');
|
||||||
for (const systemGuildId of systemOptions.systemGuildIds) {
|
const systemGuildIds = systemOptions.systemGuildIds;
|
||||||
logger.info(`Refreshing system commands for guild id ${systemGuildId}.`);
|
await Promise.all(
|
||||||
await rest.put(Routes.applicationGuildCommands(process.env.DISCORD_APPLICATION_ID, systemGuildId), {
|
systemGuildIds.map((systemGuildId) => {
|
||||||
body: systemCommands
|
logger.info(`Refreshing system commands for guild id: ${systemGuildId}.`);
|
||||||
});
|
refreshCommands(
|
||||||
}
|
Routes.applicationGuildCommands(process.env.DISCORD_APPLICATION_ID, systemGuildId),
|
||||||
|
systemCommands
|
||||||
|
);
|
||||||
|
})
|
||||||
|
);
|
||||||
logger.info('Successfully refreshed application (/) system commands.');
|
logger.info('Successfully refreshed application (/) system commands.');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(error, 'Failed to refresh application (/) system commands.');
|
logger.error(error, 'Failed to refresh application (/) system commands.');
|
||||||
|
logger.error('Make sure the bot is in the system guilds provided.');
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
async function refreshCommands(route, commands) {
|
||||||
|
await rest.put(route, { body: commands });
|
||||||
|
}
|
||||||
@@ -2,33 +2,37 @@ const logger = require('../../services/logger');
|
|||||||
const Discord = require('discord.js');
|
const Discord = require('discord.js');
|
||||||
|
|
||||||
exports.createClient = async () => {
|
exports.createClient = async () => {
|
||||||
logger.debug('Creating Discord.js client...');
|
try {
|
||||||
|
logger.info('Creating Discord.js client...');
|
||||||
|
|
||||||
const client = new Discord.Client({
|
const client = new Discord.Client({
|
||||||
intents: [Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildVoiceStates],
|
intents: [Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildVoiceStates],
|
||||||
makeCache: Discord.Options.cacheWithLimits({
|
makeCache: Discord.Options.cacheWithLimits({
|
||||||
...Discord.Options.DefaultMakeCacheSettings,
|
...Discord.Options.DefaultMakeCacheSettings,
|
||||||
MessageManager: 25,
|
MessageManager: 25,
|
||||||
ThreadManager: 25,
|
ThreadManager: 25,
|
||||||
PresenceManager: 0,
|
PresenceManager: 0,
|
||||||
ReactionManager: 0,
|
ReactionManager: 0,
|
||||||
GuildMemberManager: {
|
GuildMemberManager: {
|
||||||
maxSize: 50,
|
maxSize: 50,
|
||||||
keepOverLimit: (member) => member.id === client.user.id
|
keepOverLimit: (member) => member.id === client.user.id
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
sweepers: {
|
||||||
|
...Discord.Options.DefaultSweeperSettings,
|
||||||
|
messages: {
|
||||||
|
interval: 3600,
|
||||||
|
lifetime: 1800
|
||||||
|
},
|
||||||
|
users: {
|
||||||
|
interval: 3600,
|
||||||
|
filter: () => (user) => user.id !== client.user.id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}),
|
});
|
||||||
sweepers: {
|
return client;
|
||||||
...Discord.Options.DefaultSweeperSettings,
|
} catch (error) {
|
||||||
messages: {
|
logger.error('Failed to create Discord.js client', error);
|
||||||
interval: 3600,
|
throw error;
|
||||||
lifetime: 1800
|
}
|
||||||
},
|
|
||||||
users: {
|
|
||||||
interval: 3600,
|
|
||||||
filter: () => (user) => user.id !== client.user.id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return client;
|
|
||||||
};
|
};
|
||||||
@@ -3,38 +3,43 @@ const { Player, onBeforeCreateStream } = require('discord-player');
|
|||||||
const { stream } = require('yt-stream');
|
const { stream } = require('yt-stream');
|
||||||
|
|
||||||
exports.createPlayer = async (client) => {
|
exports.createPlayer = async (client) => {
|
||||||
logger.debug('Creating discord-player player...');
|
try {
|
||||||
|
logger.info('Creating discord-player player...');
|
||||||
|
|
||||||
const player = new Player(client, {
|
const player = new Player(client, {
|
||||||
useLegacyFFmpeg: false,
|
useLegacyFFmpeg: false,
|
||||||
ytdlOptions: {
|
ytdlOptions: {
|
||||||
quality: 'highestaudio',
|
quality: 'highestaudio',
|
||||||
highWaterMark: 1 << 25,
|
highWaterMark: 1 << 25,
|
||||||
requestOptions: {
|
requestOptions: {
|
||||||
headers: {
|
headers: {
|
||||||
cookie: process.env.YOUTUBE_COOKIE || ''
|
cookie: process.env.YT_COOKIE || ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
|
||||||
onBeforeCreateStream(async (track) => {
|
onBeforeCreateStream(async (track) => {
|
||||||
if (track.source === 'youtube') {
|
if (track.source === 'youtube') {
|
||||||
return (
|
return (
|
||||||
await stream(track.url, {
|
await stream(track.url, {
|
||||||
type: 'audio',
|
type: 'audio',
|
||||||
quality: 'high',
|
quality: 'high',
|
||||||
highWaterMark: 1 << 25,
|
highWaterMark: 1 << 25,
|
||||||
cookie: process.env.YOUTUBE_COOKIE || ''
|
cookie: process.env.YT_COOKIE || ''
|
||||||
})
|
})
|
||||||
).stream;
|
).stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
await player.extractors.loadDefault();
|
await player.extractors.loadDefault();
|
||||||
logger.debug(`discord-player loaded dependencies:\n${player.scanDeps()}`);
|
logger.debug(`discord-player loaded dependencies:\n${player.scanDeps()}`);
|
||||||
|
|
||||||
return player;
|
return player;
|
||||||
|
} catch (error) {
|
||||||
|
logger.error('Failed to create discord-player player', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
@@ -5,16 +5,23 @@ const { Collection } = require('discord.js');
|
|||||||
|
|
||||||
exports.registerClientCommands = (client) => {
|
exports.registerClientCommands = (client) => {
|
||||||
logger.debug('Registering client commands...');
|
logger.debug('Registering client commands...');
|
||||||
|
|
||||||
client.commands = new Collection();
|
client.commands = new Collection();
|
||||||
|
|
||||||
const commandFolders = fs.readdirSync(path.resolve('./src/commands'));
|
const commandFolders = fs.readdirSync(path.resolve('./src/commands'));
|
||||||
for (const folder of commandFolders) {
|
for (const folder of commandFolders) {
|
||||||
const commandFiles = fs.readdirSync(path.resolve(`./src/commands/${folder}`)).filter((file) => file.endsWith('.js'));
|
const commandFiles = fs
|
||||||
|
.readdirSync(path.resolve(`./src/commands/${folder}`))
|
||||||
|
.filter((file) => file.endsWith('.js'));
|
||||||
|
|
||||||
for (const file of commandFiles) {
|
for (const file of commandFiles) {
|
||||||
logger.debug(`Registering command ${folder}/${file}...`);
|
try {
|
||||||
const command = require(`../commands/${folder}/${file}`);
|
logger.debug(`Registering command ${folder}/${file}...`);
|
||||||
client.commands.set(command.data.name, command);
|
const command = require(`../commands/${folder}/${file}`);
|
||||||
|
client.commands.set(command.data.name, command);
|
||||||
|
} catch (error) {
|
||||||
|
logger.error(`Error registering command ${folder}/${file}: ${error.message}`);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user