I am making a bot using Python. I am very new to coding with Python and I don’t understand a lot of things, I am just following a tutorial(https://youtu.be/j_sD9udZnCk) but I am stuck with my bot not responding to my messages. It goes online and offline as intented but it does not respond to my messages…
Tag: node.js
Concatenate array of object inside array of object
Suppose I have array of object as: I want the O/P as: For this I tried, It gives the O/p as required but it starts giving value as, What could be the issue, is there any other way to achieve this? Answer See my comment and georg’s, your code works just fine (other than using map incorrectly) provided yo…
Can’t Post JSON with Javascript ‘fetch’ in React Native?
I’m currently working on a really simple project. When I tried to console log req.body it gives me empty object. app.js (React Native) server.js (Node JS Backend API) Answer You should parse the incoming requests with JSON payloads. In server.js add the middleware fucntion:
How to fix code not moving channel under category
The code created category and channel and gave me this error: TypeError: Cannot read property ‘hasOwnProperty’ of undefined without moving the channel in the category This is the code to the error: Answer The channel.setParent call fails on this line since category is undefined. Looks like the gui…
Send a message to my private channel on join & leave
Heyo, I want my bot to send a embed message to my private discord server when it joins & leaves a server. But the problem is that it does not send anything anywhere. My code looks like this: Answer Your code doesn’t activate upon joining the server. For that you have a nice event (that has a mislead…
How to use child-process-promise
What I want is to add some processing after command produced output in stdout. So finally I want to create a function to use like this: The function should use promise from child-process-promise, wait until successful result produced and return promise for processing data. Answer Welcome to Stack Overflow @Sc…
Change footer regarding on image in discord.js
When the image of an embed is randomized, is there a way to change the footer regarding on the image that is used in a message? I have tried if(images = “[link]”) embed.setFooter(“Hello!”) But then this footer is on every image, not just on one. Now three “=” because of the…
node.js – Check if word has an added/changed letter to a previous word
I’m working on a command for my Discord bot that allows for a game to be played, in which the goal is to post words that either change one letter in the previous word, or add a letter. I’m using this function: and it works fine if you change a letter, or add a letter to the end of the
Why doesn’t Node.js exit after Promise.race is finished?
In Node.js, I use Promise.race to timeout and cancel requests made by the Request-Promise library. My Promise.race implementation seems to block the program. Promise.race does resolve and return but after that, the program never exits. Again, I want to emphasize that the await indeed completes and logs the re…
Discord.js cannot read property id of undefined
so here’s the thing. I’ve done a bot with discord.js, it was working well and then it crashed. The reason I get is “guild.channels.set(channel.id, channel); ^ TypeError: Cannot read property ‘id’ of undefined” And this error seems to be in node_modulesdiscord.jssrcclientCli…