Premium only command

I want to make a command that checks if you have the premium role in a specific guild (i already added that guilds id to config.json) and then it adds the interaction user id to the json database with the value "true" so the bot can check it with other commands for premium only commands
3 Replies
d.js toolkit
d.js toolkit9mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Doraa
Doraa9mo ago
guess you can just add users ids to a premiumUsers.json and check on your .run() if the user is inside the file, i think it's the easiest way but there is probably a better way to do that instead of doing True or false for each user you can then do a script to add/remove users if they are not premium anymore what's your issue there ?
Spaxter
Spaxter9mo ago
Don't use json files as a database Use an actual database you're only shooting yourself in the foot by inventing your own database with json files. They're not scalable, corruption prone and unstable. There's no reason to use them over a real database engine.
Want results from more Discord servers?
Add your server