Convert discord.js collection to json with keeping keys and values
I already tried Collection.toJSON() but it removes the key name and converts it into an array.
Code:
Output:
14 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.Discord.js:
└── [email protected]
Node:
v16.7.0
what is your problem?
I'm trying to convert a discord.js collection to json without losing the key names.
[...Collection.entires()]
I will try, thank you!
How do I get something that can be saved into JSON out of this?
u didn't do like o said
Like this?
Or do what?
like that
what it consoles?