wtfnotavailable / discord-musicbot Goto Github PK
View Code? Open in Web Editor NEWThis project forked from sudhanplayz/discord-musicbot
Discord Music Bot Source Tree
License: Other
This project forked from sudhanplayz/discord-musicbot
Discord Music Bot Source Tree
License: Other
Frequent:
djs-bot | [27:9:2023 - 20:49] [ERROR] | [FATAL] Possibly Unhandled Rejection
djs-bot | Reason: TypeError: Cannot read properties of undefined (reading 'logger')
djs-bot |
djs-bot | Promise {
djs-bot | <rejected> TypeError: Cannot read properties of undefined (reading 'logger')
djs-bot | at warn (/djs-bot/lib/Bot.js:72:8)
djs-bot | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
djs-bot | at async /djs-bot/util/controlChannel.js:146:22
djs-bot | }
Cause:
Verify correct export in:
Discord-MusicBot/djs-bot/bot.js
Lines 2 to 4 in c8a0ae6
Error is referring to:
Discord-MusicBot/djs-bot/lib/Bot.js
Lines 71 to 73 in c8a0ae6
The filters
command has broken since the initial implementation of v5x due to library changes and missing lavalink plugins.
The command should be reimplemented.
Refer to:
Discord-MusicBot/djs-bot/lib/clients/Erela.js
Lines 170 to 174 in d25d067
Playing a song while another is playing does not add it to the Queue. The bot still ends after finishing.
Additionally, the message for auto queue implies that it's enabled or disabled but either way it seems to be always disabled.
/playlists add-remove
subcommand's autocomplete is broken:
/**
* Autocomplete handler, takes autocomplete options specified in the command properties
* and shows them to the user
* node_modules\discord.js\src\structures\AutocompleteInteraction.js
* @param {import("discord.js").Interaction} interaction
* @returns
*/
static async checkAutocomplete(interaction) {
if (!interaction.isAutocomplete()) return;
const client = getClient();
// Getting input from user
/** @type {string} */
let input = interaction.options.getFocused() || " ";
// Gets the index of the option in which the user is currently typing
/** @type {number} */
const index = interaction.options._hoistedOptions
.map((option) => option.focused)
.indexOf(true);
// Gets the autocomplete options provided by the command
/** @type {{name:string, value:string}[]} */
let targets = interaction.options._subcommand ?
await client.slash
.get(interaction.commandName)
?.options.find(
(option) => option.name === interaction.options._subcommand)
.autocompleteOptions(input, index, interaction, client) :
await client.slash
.get(interaction.commandName)
?.autocompleteOptions?.(input, index, interaction, client);
// guards for outdated/ex other bot command,
// simply don't respond to render error loading message in the discord client
if (!targets) return;
// This should make the algorithm faster by pre preparing the array, but no noticable changes
targets.forEach((option) => (option.filePrepared = fuzzysort.prepare(option.name)));
targets.map((option) => option.filePrepared);
fuzzysort.go(input, targets, {
threshold: -10000, // Don't return matches worse than this (higher is faster)
limit: 30, // Don't return more results than this (lower is faster)
all: false, // If true, returns all results for an empty search
key: "name", // For when targets are objects
});
// Avoiding calculating levenshteing distances if it's not needed
if (targets.length > 1) {
// Assigns Levenshtein distances for each option based on what the user is currently typing
for (let option of targets) {
option.levenshteinDistance = levDistance(option.name, input);
}
// Sorts the array of targets and displays it according to the Levenshtein distance from the typed value
targets.sort((a, b) => a.levenshteinDistance - b.levenshteinDistance);
}
return interaction.respond(targets.slice(0, 24));
}
specifically:
let targets = interaction.options._subcommand ?
await client.slash
.get(interaction.commandName)
?.options.find(
(option) => option.name === interaction.options._subcommand)
.autocompleteOptions(input, index, interaction, client) :
await client.slash
.get(interaction.commandName)
?.autocompleteOptions?.(input, index, interaction, client);
basically this might not be accurate for subcommand groups:
const index = interaction.options._hoistedOptions
.map((option) => option.focused)
.indexOf(true);
The indexing from the autocomplete options in the subcommands never trigger as the index is never referred to correctly for the specific subcommand objects
As the title implies, further development and analysis has brought this issue to light.
I had mistakenly opted to save if a user was a DJ to the DB by flagging a boolean property, which isn't really ideal.
The proposed solution is to create a new Guild
model within the current prisma schema which has a DJRole
property of type String?
which will be the ID of the role which be used to give special permissions to users using the bot.
1: Multi-language support
2: Play, NowPlaying, Settings etc. interface buttons
3: General admin commands
Thanks andR egards...
just updated the bot to the latest version and now i can't login and fails as 404 error
https://i.imgur.com/A9YPHjH.png
I seem to have mine working somewhat :). The bot works, loads and plays music.
But when I go to my dashboard, it gives me this error:
Unhandled Runtime Error
TypeError: param is undefined
Source:
utils/data.ts (21:30) @ getData/</commands<
19 | let commands = await (apiCall("GET", "/commands", {
20 | method: "GET"
> 21 | })).then(async ({data}) => {
| ^
22 | return await data;
23 | });
24 | resolve(await commands)
Image of the error:
https://i.imgur.com/Of58v5I.png
Docker Compose, with stuff redacted:
https://paste.ec/paste/5baGzWAl#u-i6fk4vyuBB7B9r33+8WesZnqLaDsYIyexCeEgflFr
Also, on an unrelated note..
There seems to be a few settings missing from config.js
, that the v5.0 had in their config.js
. Specifically missing the autoQueue
, 247
features 😄 .
And the v5.0 also had some auto cleaning feature, where it removed the last few messages in the channel. Not sure if that ever was toggleable or just default. E.g. SudhanPlayz#1023 & SudhanPlayz#936
Originally posted by @vp-en in SudhanPlayz#1227 (comment)
Mid-High
// Place your code here
In case the bot were to be connected to more than one lavalink the relevant stats shown with the /stats
command would only show the first node (which is a bit misleading)
Discord-MusicBot/djs-bot/commands/utility/stats.js
Lines 61 to 71 in d25d067
Problem: The currently-being-used erela.js lacks support for lavalink v4.
Migrate the project to a newer player: https://github.com/tomato6966/lavalink-client
The updated erela.js from the same author: https://github.com/tomato6966/
The package-lock.json file generated by NPM during install is currently being ignored under .gitignore.
This is specifically discouraged by NPM's documentation found here. The relevant extract is shown below:
This file is intended to be committed into source repositories, and serves various purposes:
- Describe a single representation of a dependency tree such that teammates, deployments, and continuous integration are guaranteed to install exactly the same dependencies.
- Provide a facility for users to "time-travel" to previous states of node_modules without having to commit the directory itself.
- Facilitate greater visibility of tree changes through readable source control diffs.
- Optimize the installation process by allowing npm to skip repeated metadata resolutions for previously-installed packages.
- As of npm v7, lockfiles include enough information to gain a complete picture of the package tree, reducing the need to read package.json files, and allowing for significant performance improvements.
Most significantly, adding the package-lock.json allows for reproducibility in both testing and production deployments. For example, it would become possible to easily distinguish between a regression introduced by developer code, versus some dependency that just so happened to change versions. Furthermore, it will reduce confusion among end-users, who may be annoyed that newer deployments don't share the same behavior to older deployments.
npm ci
instead of npm install
, while warning against using npm install
(this is because npm ci
does not update package-lock.json, and installs packages exactly according to the lock file)npm ci
instead of npm install
None considered.
This issue is copy of #1266 on the SudhanPlayz repo, since I'm not exactly sure which is being actively developed.
PR #40 has been merged and thus v5.2 has gone up in beta development, Docs need to be updated accordingly
since #21 the make
command presented a bug on the rebuild script:
rebuild accept no* arguments, so like exclude which image to rebuild make rebuild noll nofe nodb so i think i should have added a check to shift the argument
As analysed, the probable solution is:
if [[ "$1" == "rebuild" ]]; then
shift
done
@BioCla One of the reasons I liked v5 is because it had buttons. It would be pointless to create a v5.1 without buttons
The player needs the buttons for they simplified the work in addition to the pause, play, stop, and volume commands
Originally posted by @C-EO in SudhanPlayz#1227 (comment)
I'll take that as a suggestion. I was already planning on reimplementing them under a different dress:
Instead of having it be on the player message itself it would be in a dedicated channel (kinda like hydra).I'll try to reimplement it as you suggested as well
Originally posted by @BioCla in SudhanPlayz#1227 (comment)
None
Can't access them
// Place your code here
up to date, audited 385 packages in 4s
45 packages are looking for funding
run `npm fund` for details
10 moderate severity vulnerabilities
To address all issues possible (including breaking changes), run:
npm audit fix --force
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
node:internal/modules/cjs/loader:1147
throw err;
^
Error: Cannot find module '../api/v1/dist'
Require stack:
- /home/container/lib/Bot.js
- /home/container/bot.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (/home/container/lib/Bot.js:7:24)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/home/container/lib/Bot.js', '/home/container/bot.js' ]
}
Node.js v20.10.0
When I try to log into the web dashboard the OAuth process loops and the /api/v1/dashboard endpoint gives a 404 causing that the logging process to loop. I'm using the 5.1/2 repo and deploying using docker. Here are my logs, they don't show any errors. https://gist.github.com/NereaCassian/117674bf44a2238b76a31994aa346713
I have already notified this issue in the discord server, I'm just creating this issue to keep track. The web dashboard is public, you can check the error by yourself https://judy.nereacassian.com
What I have already tried:
The 401 error
This is my NGINX config
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
location /api {
proxy_pass http://127.0.0.1:1023;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
Currently the playlist command uses a lot of intricate steps to perform it's functions, taking many parameters from hooks and querying DBs in different ways depending on the input. While it's functional it's not very maintainable.
This feature request proposes to refactor the playlist command to become a super set of commands which will have it's own subset of commands, using the newly implemented sub commands dynamic parser (See config
commands in Utility
category)
It would be useful to be able to control the web player using the previous, play/pause and next keyboard shortcuts like you do in the web version of Spotify for example. This way you can control the bot without commands or while doing other thing.
Btw, the dashboard is looking neat, you are doing an awesome job.
The latest release causes the dashboard container to loop due to failed compilation.
Linting and checking validity of types ..Failed to compile.
2024-01-06 20:54:49
2024-01-06 20:54:49 ./src/libs/kbdsrct.ts:101:17
2024-01-06 20:54:49 Type error: Type 'string | undefined' is not assignable to type 'string'.
2024-01-06 20:54:49 Type 'undefined' is not assignable to type 'string'.
2024-01-06 20:54:49
2024-01-06 20:54:49 99 | if (!ref) {
2024-01-06 20:54:49 100 | allShortcuts.push({
2024-01-06 20:54:49 > 101 | category: k.category,
2024-01-06 20:54:49 | ^
2024-01-06 20:54:49 102 | shorcuts: [k],
2024-01-06 20:54:49 103 | });
2024-01-06 20:54:49 104 |
I was able to make it compile by changing category to category? in the following snippet of code from file dashboard/src/interfaces/kbdsrct.ts
export interface IShorcutGroup {
category: string;
shorcuts: IKbdsrct[];
In djs-bot/lib/Bot.js, there seems to be a problem, app and wsApp are being called from api/v1/dist, except that the dist folder isn't actually there I've checked this git branch and it doesn't seem to be a problem that is on my end because the folder is not on git either.
const { app, wsApp } = require("../api/v1/dist");
While @BioCla is busy making the dashboard, I will update the whole slash commands code to djs v14 support. I noticed that the code is still using djs v13 format. Unfortunately i cant do it anytime soon, I would say in 2 weeks as i will have long school holiday during that time.
https://github.com/Tomato6966/erela.js/
This is a updated version of the erela.js with full support to lavalink 2-3-4. It also support filters without a plugin.
There is a slimmed down version which only support lavalink 4.
https://github.com/Tomato6966/erela.js/tree/slim
You can't send slash commands to the control-channel, so you need to send the shuffle command in another channel, its not a big deal but a little bit annoying.
Either adding a shuffle button in the embed, allowing to turn on shuffle sending "shuffle" in the control-channel or allowing slash commands in the control-channel.
Pterodactyl Panel running on 8080 port and it's conflict between bot and panel. Pterodactyl uses a docker and is easy to use so it's a great alternative
Discord-MusicBot/djs-bot/commands/music/playlists.js
Lines 26 to 32 in 27cc640
I forgot to implement the play function for the playlists.
The playlists
command should have a new option called play
which, once a playlist is selected, should add all the songs in that playlist into the queue of bot.
Alternatively, since sub commands are now supported, the command could be refactored to have various sub commands instead of options
One of the challenges I have faced when using the bot to play music is the censorship of explicit words in songs sourced from YouTube. Many Spotify links I have sent always have played a clean version of it from YouTube. This censorship can significantly impact the quality and authenticity of the listening experience, especially when a user requests a certain song and it plays something completely different.
I would like to suggest a feature that allows the bot to play songs directly from Spotify. This functionality would ensure the preservation of unaltered content, allowing users to experience the music they requested exactly as intended, free from any censorship or modification of explicit lyrics.
The ability to play songs directly from Spotify would be a valuable addition to the bot, addressing the issue of censorship while offering a more enjoyable music listening experience. This feature would align with the desire for unaltered music playback and would be a significant improvement for users who value the song how it was suppose to be heard (unless they requested for the clean version)
Doing this command creates a new channel this could disturb users
Ask the user to select which channel they want to initialize it to. with a discord drop-down menu in the command
or another command ex: set-control-channel
When I run the lite version with "make lite" I get a "Error: No database configured" message despite me not running it with the 'db' option.
[13:11:2023 - 23:12] [ERROR] | [FATAL] Possibly Uncaught Exception
Reason: Error: No database configured
uncaughtException
I have both DATABASE and DATABASE_URL set to "" in the .env file
Running the latest master branch with Node.js v21.4.0 on Arch Linux.
Is your feature request related to a problem?
No, its just a feature request.
A clear and concise description of what the problem is.
If I need more than 1 bot, people will have to choose wich bot they wanna use... and thats kinda annoying.
Describe the ideal solution
Idk if this is possible, but I would like a system like the Jockie Music. Basically, you just type the command, and the bots will automatically organise to play the music.
Example: Some people are listening music in channel A with bot A while theyre playing, and a second group of people want to study and they want music too... obviously they will not join channel A because there are people there, so they just join channel B and they have to write the command and select the bot B, instead of this I suggest to make it automatically... so the Bot A recognises they are in a different channel, so Bot A calls to Bot B and it joins automatically and plays the music group B wants.
Describe alternatives you've considered
Alternative 1: Make a "host" bot that manages all the other bots
Alternative 2: Make all bots "listen" and they organise themselves (this way, if bot "host" is offline, the other bots will be able to play).
Additional context
If I were the developer, I would implement a option to enable/disable this feature (although that depends on how it is implemented, it would not really be necessary either).
Hello 👋
I have just installed this version from v5. It runs pretty well for me right now.
I launched the bot without docker/database and it was pretty sketchy, i will call this kind of installation as a "lite version"
here are the "problems" i had to deal with :
Maybe a sh script to help setup with inputs for a lite deploy ?
In fact we dont need a lot to run, like bot name + token + client id&secret + lavalink address
It could help a lot of users who have trouble to launch the bot
I'm on arm, might be the issue?
Getting this error:
OS: Linux
ARCHITECURE: aarch64
PROJECT_NAME: discord-musicbot
PROJECT_PATH: /home/ubuntu/DOCKERS/musicbot/Discord-MusicBot
WARN[0000] The "JWT_SECRET_KEY" variable is not set. Defaulting to a blank string.
WARN[0000] The "JWT_SECRET_KEY" variable is not set. Defaulting to a blank string.
> [email protected] start
> npm i && npm run bot
npm ERR! code 1
npm ERR! path /home/ubuntu/DOCKERS/musicbot/Discord-MusicBot/djs-bot/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build --update-binary
npm ERR! Failed to execute '/root/.nvm/versions/node/v20.8.0/bin/node /root/.nvm/versions/node/v20.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/home/ubuntu/DOCKERS/musicbot/Discord-MusicBot/djs-bot/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/ubuntu/DOCKERS/musicbot/Discord-MusicBot/djs-bot/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v115' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | linux | arm64
npm ERR! node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-linux-glibc-arm64.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-linux-glibc-arm64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v115 ABI, glibc) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-linux-glibc-arm64.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | arm64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | arm64
npm ERR! gyp info find Python using Python version 3.10.12 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v20.8.0/node-v20.8.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v20.8.0/node-v20.8.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v20.8.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v20.8.0/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/root/.nvm/versions/node/v20.8.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/ubuntu/DOCKERS/musicbot/Discord-MusicBot/djs-bot/node_modules/canvas/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/.nvm/versions/node/v20.8.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/.cache/node-gyp/20.8.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/20.8.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/root/.nvm/versions/node/v20.8.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/20.8.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/ubuntu/DOCKERS/musicbot/Discord-MusicBot/djs-bot/node_modules/canvas',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! /bin/sh: 1: pkg-config: not found
npm ERR! gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/root/.nvm/versions/node/v20.8.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:325:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:514:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Linux 5.15.0-1040-oracle
npm ERR! gyp ERR! command "/root/.nvm/versions/node/v20.8.0/bin/node" "/root/.nvm/versions/node/v20.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--update-binary" "--module=/home/ubuntu/DOCKERS/musicbot/Discord-MusicBot/djs-bot/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/ubuntu/DOCKERS/musicbot/Discord-MusicBot/djs-bot/node_modules/canvas/build/Release" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v115"
npm ERR! gyp ERR! cwd /home/ubuntu/DOCKERS/musicbot/Discord-MusicBot/djs-bot/node_modules/canvas
npm ERR! gyp ERR! node -v v20.8.0
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/root/.nvm/versions/node/v20.8.0/bin/node /root/.nvm/versions/node/v20.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/home/ubuntu/DOCKERS/musicbot/Discord-MusicBot/djs-bot/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/ubuntu/DOCKERS/musicbot/Discord-MusicBot/djs-bot/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v115' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/ubuntu/DOCKERS/musicbot/Discord-MusicBot/djs-bot/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:514:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1105:16)
npm ERR! node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:305:5)
npm ERR! node-pre-gyp ERR! System Linux 5.15.0-1040-oracle
npm ERR! node-pre-gyp ERR! command "/root/.nvm/versions/node/v20.8.0/bin/node" "/home/ubuntu/DOCKERS/musicbot/Discord-MusicBot/djs-bot/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
npm ERR! node-pre-gyp ERR! cwd /home/ubuntu/DOCKERS/musicbot/Discord-MusicBot/djs-bot/node_modules/canvas
npm ERR! node-pre-gyp ERR! node -v v20.8.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.11
npm ERR! node-pre-gyp ERR! not ok
npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-10-01T13_06_04_924Z-debug-0.log
Exiting gracefully with code 130
make: *** [Makefile:27: lite] Error 130
While looking out to fix this issue it is very important to work on and try to finish the v5.0 project tasks for the dashboard, which will be attached in the following links:
Keeping this issue open until the FE has been completed and/or becomes functional
i was wondering if you can add this a service when linux reboots?
[29:7:2023 - 13:54] [ERROR] | Error: connect ETIMEDOUT 2606:4700:3036::ac43:b2c7:2333
[29:7:2023 - 13:54] [ERROR] | [FATAL] Possibly Uncaught Exception
Reason: ReferenceError: player is not defined
uncaughtException
[29:7:2023 - 13:57] [ERROR] | [FATAL] Possibly Unhandled Rejection
Reason: RangeError: No available nodes.
Promise {
<rejected> RangeError: No available nodes.
at new Player (/Discord-MusicBot/djs-bot/node_modules/erela.js/dist/structures/Player.js:102:19)
at new <anonymous> (/Discord-MusicBot/djs-bot/lib/clients/Erela.js:21:4)
at ErelaExtended.create (/Discord-MusicBot/djs-bot/node_modules/erela.js/dist/structures/Manager.js:213:16)
at ErelaExtended.createPlayer (/Discord-MusicBot/djs-bot/lib/clients/Erela.js:87:15)
at SlashCommand.run (/Discord-MusicBot/djs-bot/commands/music/play.js:64:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
[29:7:2023 - 13:57] [ERROR] | [FATAL] Possibly Unhandled Rejection
Reason: RangeError: No available nodes.
Promise {
<rejected> RangeError: No available nodes.
at new Player (/Discord-MusicBot/djs-bot/node_modules/erela.js/dist/structures/Player.js:102:19)
at new <anonymous> (/Discord-MusicBot/djs-bot/lib/clients/Erela.js:21:4)
at ErelaExtended.create (/Discord-MusicBot/djs-bot/node_modules/erela.js/dist/structures/Manager.js:213:16)
at ErelaExtended.createPlayer (/Discord-MusicBot/djs-bot/lib/clients/Erela.js:87:15)
at SlashCommand.run (/Discord-MusicBot/djs-bot/commands/music/play.js:64:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
```
Impossible to build or run the dashboard. nextui got updated to 2.0.0 in this commit 8e1b7f6 and the code is not up to date to match nextui 2.0.0 so it crash.
// Place your code here
Given the recent development and implementations of the lite version, some minor fixes here and there in the startup script and other miscellaneous components the documentation and READMEs have been left outdated. As a note this issue is to remind us that the documentation needs to be updated and expanded in the future minor versions.
The /play command shows search results, which is very convenient and helpful to find the right song. Since the control channel doesn't allow commands, you have to switch channels to use the command or copy the text from the search results, which is inconvenient.
Allow the /play command to be used in the control channel.
It's just a QOL thing. You can use the command in another channel but that's just inconvenient when the control channel is there to, well, control the music.
Same for the queue, would be nice to be allowed to see it in the control channel. Perhaps add it to the permanent/pinned message so it's always there. Should I open a separate issue/feature request for the queue suggestion?
I can't show you the screenshot cuz it will expose my ip, but i tried changing the api ports to the port i have forwarded for dashboard.
I have also tried changing the filter, from js to ts, for the rest i only configured the .env files. What i didnt configure was the jwt_secret_key, because i don't know what that is.
https://i.imgur.com/kt8Z3MO.png
any help to fix, also this error now occurs when starting the bot
so I grabbed the latest version(5.5.0) and ran the npm run update
and it ran fine. but every time you try to start it gives the following error after > tsc -p api/v1/tsconfig.json
:
I'm able to fix it by setting fastify to 4.25.0 in package.json:
so maybe a change to fastify broke something or it an issue with my nodejs/windows 10.
it seems to be related to deploying the slash commands since it also throws an error when running npm run deploy
it seems to start in djs-bot/api/v1/src/index.ts
the playlist create commands is not working. it looks to be an issue with the user id.
in create.js:
const playlist = await client.db.playlist.create({
data: {
name: playlistName,
user: {
connectOrCreate: {
where: {
id: interaction.user.id,
},
create: {
id: interaction.user.id,
username: interaction.user.username,
},
},
},
},
});
just running in windows 10 using node.js
Simply using make up on the development branch, should I be using master instead?
First issue is that oddly it's skipping djs-bot. Then the table parsing issue, which I'm not sure which table it is trying to parse.
user@SERVER:~/Docker/Discord-MusicBot-v5-1/Discord-MusicBot$ sudo make up
OS: Linux
ARCHITECURE: x86_64
PROJECT_NAME: discord-musicbot
PROJECT_PATH: /home/nate/Docker/Discord-MusicBot-v5-1/Discord-MusicBot
format value "table" could not be parsed: parsing failed
format value "table" could not be parsed: parsing failed
Pulling images for: djs-bot dashboard postgres-db lavalink
WARN[0000] The "JWT_SECRET_KEY" variable is not set. Defaulting to a blank string.
[+] Running 4/4
⠿ djs-bot Skipped 0.0s
⠿ lavalink Pulled 4.4s
⠿ dashboard Pulled 5.0s
⠿ postgres-db Pulled 4.8s
Creating container for: djs-bot dashboard postgres-db lavalink
unknown flag: --pull
Starting djs-bot dashboard postgres-db lavalink
no container found for project "discord-musicbot": not found
Env has the following defined
POSTGRES=root
POSTGRES_USER=root
POSTGRES_PASSWORD=root
TOKEN={redacted}
CLIENTID={redacted}
CLIENTSECRET={redacted}
DEVUID={redacted}
DATABASE_URL="postgres://root:root@localhost:5432/base"
I do not, I copied my .env from the old repo for this to this new one.
Full development branch, whatever is in there unmodified other than my .env
Given the rapid development of the latest v5.1/2 a new necessity has risen: A Figma Design
The design should aim to make producing the front end easier and more trackable.
Check out the progress on Figma. If you wish to contribute to the figma please contact staff on the official discord support server
Music Player page: /players/:id
Bot Setting: /servers/:id
Info
and Bot Setting
Maybe a player list? /players
that lists active players but ig it's essentially the same as server list, so no need a design for this, or no need a player list page at all
add more here ...
/discovery
Error when running the command npm run deploy
.
It seems like the repo is missing some files/modules when npm trying to call it, in this case it's anything on the /djs-bot/api/v1/dist
.
I've run npm run update
sucessfully before invoking the deploy command.
This is running behind a reverse proxy:
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name musicbot.domain.com;
underscores_in_headers on;
ssl_certificate /certificates/musicbot/fullchain.pem;
ssl_certificate_key /certificates/musicbot/privkey.pem;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass_request_headers on;
}
location /api {
proxy_pass http://127.0.0.1:8010;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass_request_headers on;
}
location /ws {
proxy_pass http://127.0.0.1:8001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass_request_headers on;
}
logs:
[06.02.2024 - 09:23] | Spawned shard 0
[06.02.2024 - 09:23] [WARN ] | Bot running on OPLevel: 1
[06.02.2024 - 09:23] [WARN ] | Debug mode is [ENABLED]!
[06.02.2024 - 09:23] [WARN ] | Booting up the bot...
[REDACTED]/v5.5.0 (ID: [REDACTED])
[06.02.2024 - 09:23] [WARN ] | Loading error handlers...
[06.02.2024 - 09:23] [INFO ] | Loaded debug error handlers!
[06.02.2024 - 09:23] [DEBUG] | Music engine "Erela" has been loaded
[06.02.2024 - 09:23] [ERROR] | Prisma ORM failed to load
[06.02.2024 - 09:23] [ERROR] | Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues
[06.02.2024 - 09:23] [INFO ] | Slash commands have been loaded. Waiting for bot to finish initializing...
[06.02.2024 - 09:23] [INFO ] | Schedules have been loaded.
[06.02.2024 - 09:23] [INFO ] | Event listeners have been loaded.
[06.02.2024 - 09:23] [INFO ] | WS is now listening on port 8001
[06.02.2024 - 09:23] [INFO ] | Successfully logged in as [REDACTED]
[06.02.2024 - 09:23] [INFO ] | API is now listening on port 8010
[06.02.2024 - 09:23] [INFO ] | Slash commands have been pushed to application
[06.02.2024 - 09:23] [SILLY] | [REDACTED]/v5.5.0 (ID: [REDACTED]) is online!
[06.02.2024 - 09:23] [DEBUG] | Node: DockerNode | Lavalink node is connected.
prisma generate
[06.02.2024 - 09:26] [ERROR] | Unhandled server error:
[06.02.2024 - 09:26] [ERROR] | TypeError: Cannot read properties of null (reading 'userAuth')
TypeError: Cannot read properties of null (reading 'userAuth')
at Object.updateUserAuth (/djs-bot/api/v1/dist/lib/db.js:28:30)
at Object.handler (/djs-bot/api/v1/dist/routes/v1/routesHandler/login.js:72:22)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
idk
I would like to request a feature that would allow the bot to play music from online radio stations, such as OnlyHit. OnlyHit has an API that provides information about the current song, the next song, and the stream URL
My suggestion for this feature is to use a json file to store the radio stations, so that they can be easily modified.
Got this error when the song started playing on the newest git update
djs-bot | [24:7:2023 - 13:43] [ERROR] | [FATAL] Possibly Unhandled Rejection
djs-bot | Reason: TypeError: Cannot read properties of undefined (reading 'send')
djs-bot |
djs-bot | Promise {
djs-bot | TypeError: Cannot read properties of undefined (reading 'send')
djs-bot | at /djs-bot/util/controlChannel.js:315:4
djs-bot | at runIfNotControlChannel (/djs-bot/util/controlChannel.js:299:10)
djs-bot | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
djs-bot | }
I noticed that some of the embeds have an issue where there extra text that is not needed in the "Requested by" section of the embed.
They are in queue.js and embeds.js
I was going to make a Poll request but I was not sure if it was just a Windows issue or not.
queue.js:
Between 78-84:
.setFields([
{
name: "Requested by",
value: `<@${song.requester}>`,
inline: true,
},
])
The fix that I did:
.setFields([
{
name: "Requested by",
value: `${song.requester}`,
inline: true,
},
])
Between 115-121:
.setFields([
{
name: "Requested by",
value: `<@${song.requester}>`,
inline: true,
},
])
The fix I did:
.setFields([
{
name: "Requested by",
value: `${song.requester}`,
inline: true,
},
])
embeds.js:
Between 78-84:
.addFields([
{
name: "Requested by",
value: `<@${track.requester}>`,
inline: true,
},
{
The fix I did:
.addFields([
{
name: "Requested by",
value: `${track.requester}`,
inline: true,
},
{
running it in Windows 10 in node.js.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.