im trying to create a cooldown for my status command, because they spam a lot on the server the status command and i want a cooldown like 5m and that send a message like, “you need to wait 5m more to use this command im really newbie to javascript, so if anyone can help me Here its my entire command:
Tag: node.js
Get buffer from post body in Expressjs
I am making an express application that handles post data. Because the request body could be any content type and/or binary, I would like req.body to be a Buffer. So what should I use to get a Buffer that represents the request body? Here is my code: Answer body-parser can help achieve this, code example woul…
Querying String data from database into array Sequelize
So i basically trying to get string value from database into an Array using Sequelize: with my code showed as below, i try sequelize literal to change it but i cannot resolve how to turn it from string into array and split it by “,” (comma): what i want is like this is there is somthing wrong with…
Express Can’t “findAll” Users By Key, Only By Email
I have a simple Express/Pug app that is supposed to allow me to search users in a database by “email” and by “key.” In this schema, a key is simply a string that each user is assigned. My user model and index model files look like this: models/index.js: models/users.model.js: My contro…
the id of cart shows null in controller but i m sure i m sending it NODE JS
I m sending the id of the product from this view (I m using express and mongoose db) I m sure it is not null here then I have this middleware to receive it and here is the function post Cart When I first receive it in the postcard function I made a log and it gives me the log
How do I add to existing data with findByIdAndUpdate instead of updating the data entirely
This is my object schema I am trying to update the number of votes like this Let’s say the original amount of votes is 1, and the requested amount of votes is 5. The put request will update the amount of votes to be 5. Instead I would like to add the requested amount of votes on top of the
Antdesign table not rerendering on new column values
I am having trouble rerendering the columns of my table, the library i am using is ant design and I am trying to create a feature where I reorder the column of the table on demand. I have created an example the issue here: https://replit.com/@coupacoupa/Ant-Design-column-reordering In the example, I created a…
How to pass an array from a form into a URL with JavaScript?
I have a form which uses a get method. There is a select element in the form that allows the user to select multiple options. This gets passed to the URL when the user clicks submit. However, it does not get neatly presented in the URL at all. Is there a a way to pass the array in a neat
How can I run a node script in a Vite React project
I am trying to build a little SPA where a user can run a Presto query, I am using a Node presto client. When running the script via node it works without any issues. I am trying to implement it now via Vite This is how I currently have it set up. When running the script via a React FE
im trying to insert data to mysql from puppeteer (async) but I getting “connection.query is not a function”
I just want to store the data I collected in the database but I getting “connection.query is not a function” I’ve checked a lot of options to solve the issue and I can not find anything that works. In some of the ways the variables I collected were null and in the other part the connection.q…