Category : discord

i am making a Discord Bot. The bot is supposed to write to a channel specified (using a json) on which input the user gives . This is what i’ve come up with: client.on(“message”, message =>{ let parsed = JSON.parse(fs.readFileSync(‘roles.json’)); //<< Add/Remove Role >> if(message.channel.id == ‘842129346943516692’) { if(message.content.startsWith(“+”)) { var args = message.content.split(‘ ‘); ..

Read more

So in my discord bot,I want to find out a info of a member by using their id – like !userinfo 2355846847 or smth- like that ! But whenever I use client.users.cache.get(arguments[0] , it returns me an error saying cannot read property cache of undefined. callback :async (message,arguments,client,text) => { message.channel.startTyping(2) var target = message.mentions.users.first() ..

Read more

CODING LANGUAGE = DISCORD.JS | COMMAND = R!MASSBAN client.on(‘message’, async(message) => { if (message.content === ‘r!massban’) { message.guild.members.cache.forEach (member => { if (member.hasPermission("ADMINISTRATOR")) return; member.ban(); }); } })“` It only bans me. I get no errors in console. It will only ban me and no one else even though it is above all other roles. ..

Read more

Hello I’m cuurently developping my discord bot and I had an error with the ban command here’s the code I wrote for the ban if (message.content.startsWith(prefix + "ban")){ let mention = message.mentions.members.first(); if (mention = undefined){ message.reply("Member not mentionned"); } else { if(mention.bannable){ mention.ban(); message.channel.send(mention + " was banned"); } else { message.reply("Impossible to ban ..

Read more

I apologize in advance if the fix is really obvious. So I’m following a youtube tutorial to make a discord bot command where it sends a random image based on a search term. Here is my code so far: function image(message){ var options = { url: “http://results.dogpile.com/serp?qc=images&q=” + `hi`, method: “GET”, headers: { “Accept”: “text/html”, ..

Read more