Building further on my music bot… I’m trying to make the jump from having him play a single song, and then leave, to having him play a finite list of songs, and then leave. This should not be confused with a queue – the list of songs is predetermined and finite. It can’t be added to or…
Tag: node.js
How to exclude keys from a map and display only the values?
I have an Object obj as below: I want to exclude the key Hostname and it value. I only want to capture the values excluding keys such that the output looks as below: 189883:error message:script name The final output should be a string. I have written the following code but it is creating array element for eve…
How to fix cannot read property “send” of undefined
This question might have a few duplicates, but the code there is different and none of the answers work for me. I’m new to discord.js so it might just be a silly mistake. This is my code – I really don’t know how to fix this, so all the solutions I have tried lead to […]
How to fix cannot read property “send” of undefined
This question might have a few duplicates, but the code there is different and none of the answers work for me. I’m new to discord.js so it might just be a silly mistake. This is my code – I really don’t know how to fix this, so all the solutions I have tried lead to this error. Also if you
ExpressJS: Adding routes dynamically at runtime
I want to be able to add new routes at runtime without restarting the server with NodeJS & ExpressJS. I made a similiar approach like in this article: https://alexanderzeitler.com/articles/expressjs-dynamic-runtime-routing/Technically I’m able to add new files and logic at runtime likewise in the ar…
ExpressJS: Adding routes dynamically at runtime
I want to be able to add new routes at runtime without restarting the server with NodeJS & ExpressJS. I made a similiar approach like in this article: https://alexanderzeitler.com/articles/expressjs-dynamic-runtime-routing/Technically I’m able to add new files and logic at runtime likewise in the ar…
Validating JWT Token in vue.js Router
I am using the following code to generate a JWT token: Once generated, I send the token to the client, which stores it within a cookie: Furthermore, I am using vue.js Router for my navigation. From my understanding, if one adds the following code in the router file, one can insert middle-ware in order to prot…
TypeError Joi.validate is not a function
please help with that i am not sure what is happening im using the following: but it is only the joi that im having issues with Answer Try schema.validate instead of Joi.validate Reference: https://joi.dev/api#example
Node.js child process exec returning : Error: kill EPERM STDERR STDOUT_SIZE
I am exposing and API dedicated to printing logs from a Linux System D service. Here is a sample of the code: If the date in “completeCmd” is close enough (ex: last 10 days), everything works… if the date is too far back (ex: 3 months ago), the process fails in a weird way: The response is r…
POST http://localhost:3000/data 400 (Bad Request) when trying to send data from client to server
Hey guys so i’ve got some problem with sending data from client-side to server-side. Basically i have a function that on click is setting variable called categorySearch to a string e.g categorySearch = “pork” and send it to server; But for some reason i keep getting error mentioned in the ti…