Skip to content

Create new object if it doesn’t exist, else update

I’m having quite some trouble handling objects and storing them as JSON. What I’m trying to do is next: parse json file If user1 exists, update the whole object with new data, ELSE create new object As you can probably tell, the above doesn’t work as I’d want it to. I’m used with…

How to change numeric validation to string validation

Currently I have a validation where I disable the buttons depending on the numerical value as follows: Where I disable the button in the values 0,2,3,5 now these values ​​will change to strings giving the following assignment to the numeric values ​​like this: What I require now is to validate no longer with …

Can I randomize message replies? (Discord.js)

What I am trying to do is randomize messages, i don’t know how though. I’ve been using the code: I’m wondering if it is possible to make it send random replies when a command is executed on Discord. Answer You can defined list of answer in array and random of one those answer Ex: