Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the create playlist command does not work. #175

Open
RJ1002 opened this issue Nov 3, 2023 · 10 comments
Open

the create playlist command does not work. #175

RJ1002 opened this issue Nov 3, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@RJ1002
Copy link

RJ1002 commented Nov 3, 2023

Please describe the problem you are having in as much detail as possible:

the playlist create commands is not working. it looks to be an issue with the user id.

image

Include a reproducible code sample here, if possible, the snippet of code which is throwing the error or which you presume is giving issues:

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,
					},
				},
			},
		},
	});

If you have your own setup, without the original docker configuration, please provide:

just running in windows 10 using node.js

Further details:

  • discord.js version: 14.13.0
  • Node.js version: 18.15.0
  • Operating system: windows
  • Priority this issue should have – please be realistic and elaborate if possible:

Relevant client options:

  • partials: none
  • gateway intents: none
  • other: none
@brianferri
Copy link
Member

I am unable to replicate this.
Can you make sure that the DB you're using is set up correctly and that it is connected through the ORM?
Furthermore, please try running the bot using the docker setup and/or from another machine.
This might just be an issue with your current machine.
Also try clearing your node modules and caches and reinstalling the packages

@RJ1002
Copy link
Author

RJ1002 commented Nov 4, 2023

I cleared the node modules and caches but no luck.
I tried it on a Windows 11 computer and also had no luck.
also, it says I have 11 vulnerabilities. should I run the fix command?
I'm using MongoDB the server version so it has mongodb+srv://
the /config commands works fine.
I don't know how to run/make a docker.

also, notice that I missed a part of the error message at the bottom:
image

@brianferri
Copy link
Member

Seems like this is a common error between mongo users. Might be the provider.
I'll investigate it when I have the time.

No, you don't need to fix the "vulnerabilities".
Thanks for the report.

If you'd like to set up the docker configuration in the meanwhile you can click on the various links provided in the Readme file, following the instructions

@RJ1002
Copy link
Author

RJ1002 commented Nov 6, 2023

my provider is from MongoDB.
that the URL layout I'm using but remove secret info: mongodb+srv://USERNAME:PASSWORD@********.*******.mongodb.net/base
they provide a free one up to 500 MB.

Copy link

github-actions bot commented Jan 6, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@RJ1002
Copy link
Author

RJ1002 commented Jan 9, 2024

@BioCla I managed to fix the playlist commands. it took me a while to figure it out lol.

if you want I can put the changes in my GitHub and you can test to see if the changes I did will affect the docker or not. if it does not I can do a pull request.

@RJ1002
Copy link
Author

RJ1002 commented Jan 9, 2024

well it did work until it started to throw a different error.... it looks like it not making the full table.
image
image
i guess i should have check to see if it can make more then one playlist...

@RJ1002
Copy link
Author

RJ1002 commented Jan 9, 2024

Update: got it kind of working. all the commands work now except the add command.

could someone send me an example layout of what the MongoDB is supposed to look like?
not sure if the model User id is supposed to have Objectid or just the id of the user.
image
image
image

here is what I edited in mongodb.prisma:
image

@RJ1002
Copy link
Author

RJ1002 commented Jan 9, 2024

well, it seems I got the add command working again but not sure if it is because the bot is still being worked on or there is still an issue with the mongodb.prisma file but if there are 2 playlists and you add the same song to the other playlist(2) but the song was already in the other playlist(1), it will remove the song from playlist(1) and add it to playlist(2). so it looks like each song can only be in one playlist. not sure if my mongodb.prisma file is messed up or needs to be fixed.

my mongodb.prisma file:
image
not sure if lines 34 and 42 are working or not.

what the DB look like:
image
image

also, I still would like an example layout of what the MongoDB is supposed to look like.

@DarrenOfficial
Copy link
Member

also, I still would like an example layout of what the MongoDB is supposed to look like.

Did you figured it out yet? 🙂

@DarrenOfficial DarrenOfficial added the bug Something isn't working label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants