Currently, I have been working on a Discord.js bot for a discord server I have. I want to make a command so that a user can open a ticket using !oticket and it will make a new channel that all of their dms to the bot will come through. I have working code for the channel creation, but when I
Tag: node.js
Discord.js Error – MaxListenersExceededWarning: Possible EventEmitter memory leak detected
Every time I try to make more than 10 commands I get the error: I tried fixing it by doing emitter.setMaxListeners() and it didn’t fix it so I searched online and tried to fix it by using process.setMaxListeners(0); but that didn’t work either. If there is a fix for this please let me know, and if…
how can i move users with reaction
im trying to create bot that move users when they react in message create channel and move the user to the channel that was created , err = Cannot read property ‘setChannel’ of undefined Answer You need a GuildMember to access their voice state. Your mem variable is wrong so, you need to get the m…
Promise resolving too early
I’m having an issue where my Promise.all is resolving too early. For a test I want to console.log the length of the array which is getting pushed from within the promise map but it is returning 0 sadly. I’m sure it’s something simple… Any help would be greatly appreciated. Answer There…
activities of bot update informations
I put it in the status to show how many members are online of the total number, but it does not update the real number, only when the bot is restarted, is there any way that when this activity arrives, the information appears with the new data? Answer You need to regenerate the Strings in the Array every run:
node js send token through the header
i try to send token use header, (login form to index page use the header) my index file is the page redirect index page ,but the token not send the index page Answer If I understood you correctly, you expect that the authtok header will be set by the browser when a request to /index page is made. Headers are
How to pass array inputs as parameter to async function?
I got set of urls from txt file [which I am having in my local] which I got as array inputs with below code Sample output when I do console.log(testurls) [ ‘https://sample1.com’ ‘https://sample2.com’ ] How to pass the values to below function as parameter/argument to run scan on each u…
Decrypt the crypto data
I am trying to encrypt and decrypt values using node inbuild module crypto. I have followed this tutorial to encrypt the data. They haven’t to gave any sample code to decrypt. When I try to use other tutorial code to decrypt the data. It not working out. Please help me out, Code Answer Since you havent …
MongoDB get sum of fields in last stage of aggregate
I’m using an aggregate to gather some related data. The following is a sample pipeline that joins a Parent Collection to a Children One (Each Parent will have a Child). I then use a projection to gather some fields from both collections. This includes getting a count of the “number of sodas”…
resolve and reject issue using node js
Is this possible way to return resolve or reject message from one function to another? As I am writing to pass resolve message in postman whenever my task is completed or reject message when there is some error But after after writing return it still not returning the resolve message or reject message inside …