[Solved] Get the word, from a sentence that the user is talking about [closed]

[ad_1] Credit: ThuverX let word if(content.indexOf(“what”) !== -1 && content[content.indexOf(“what”)+1] !== “is”) word = content[content.indexOf(“what”)+1] else if(content.indexOf(“meaning”) !== -1) word = content[content.indexOf(“meaning”)+2] else if(content.indexOf(“means”) !== -1) word = content[content.indexOf(“means”)-1] 0 [ad_2] solved Get the word, from a sentence that the user is talking about [closed]

[Solved] NODE.JS How do I save JSON data without filling up my storage [closed]

[ad_1] config For this answer we’ll establish a simple config object to store any values – // config.json {“counter”:0} server We will create a simple server using http.createServer. We will use the request method and request URL to look up a handler or respond with 404 when no handler is found – // server.js import … Read more

[Solved] how do i send a private message to all people who have a certain role? (discord.js) [closed]

[ad_1] You can use the Role.members property. // get role by name const role = message.guild.roles.cache.find(role => role.name === ‘<roleName>’); // send a message to everyone with the role role.members.each(user => user.send(‘This is a DM’)); This method assumes you have a way to get the <roleName> value from a string; perhaps with an args variable. … Read more

[Solved] im new to making discord bots with node.js, i am having trouble with an error, it says that message is not defined in line 14 and 18

[ad_1] im new to making discord bots with node.js, i am having trouble with an error, it says that message is not defined in line 14 and 18 [ad_2] solved im new to making discord bots with node.js, i am having trouble with an error, it says that message is not defined in line 14 … Read more

[Solved] how do i send two messages in one? [closed]

[ad_1] You Could Use \n To Make a New Line or You Can Use this code to make the text a link const embed = new Discord.MessageEmbed() embed.setTitle(“BOT INVITE LINK”) embed.setColor(“BLACK”) embed.setURL(“INVITE LINK”) embed.setDescription(“**Click On The Blue Title Above to Invite BOT to Your Server :D**”) message.channel.send(embed) [ad_2] solved how do i send two messages … Read more

[Solved] Unable to use await in an if function

[ad_1] Your issue starts with question 4. You are trying to run code without waiting for the return. if (positionInput.content.toLowerCase() === ‘community agent’) { // Won’t wait call.prompt(question5CommunityString, { time: 50000, channel: usersDMs }).then(question5CMsg => { question5Answer = question5CMsg.content; // Won’t run we likely already left the scope without waiting for the return }); // … Read more

[Solved] What does this if-statement exactly do?

[ad_1] The first if statement if(command.name) checks, whether the property name of commands is empty or not. If it’s empty, it will **not execute the code inside the brackets and jump straight to the else block If not, it will execute the code inside the brackets The second line client.commands.set(command.name, command); calls the .set() function … Read more

[Solved] How can I add Embed message from an array discord.js?

[ad_1] Well You just need to use embeds like in the help command. Here the code: if (command === “t”) { // Truth const truth = t[Math.floor(Math.random() * t.length)]; message.channel.send(new Discord.MessageEmbed() .setTitle(“Truth”) .setDescription(truth)); } else if (command === “d”) { // Dare const dare = d[Math.floor(Math.random() * d.length)]; message.channel.send(new Discord.MessageEmbed() .setTitle(“Dare”) .setDescription(dare)); } [ad_2] solved … Read more

[Solved] how to @ youself and someone else in a embed on discord

[ad_1] You are getting the result you get because you use the same code at two places. message.author.toString() + ‘called’ + message.author.toString() ^ once here ^ and once here What you need to do is get the member you mentioned and use that instead. message.mentions.members.first().toString() 1 [ad_2] solved how to @ youself and someone else … Read more