Category : discord

I am trying to run the node index.js to start my discord bot. I have tried almost everything i could. But it still shows: PS F:DISCORDBOTSBeta> node index.js node:internal/modules/cjs/loader:928 throw err; ^ Error: Cannot find module ‘F:DISCORDBOTSBetaindex.js’ at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15) at Function.Module._load (node:internal/modules/cjs/loader:769:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) at node:internal/main/run_main_module:17:47 { code: ‘MODULE_NOT_FOUND’, requireStack: [] ..

Read more

For a specific channel in my server, I want to make it so that a user can’t send two messages in a row. Here’s the code I got so far: client.on(‘message’, message => { if(message.guild.id != ‘123478291364192834’) return; if(message.channel.id != ‘432874912364123984’) return; let messageauthor = ” message.channel.messages.fetch({limit:2}).then(messages=>{ messages .forEach(message=>{ messageauthor = message.author.id }) }) if(messageauthor ..

Read more

my Bot is playing the same audio File for joining and leaving the Voice Channel and i dont know how to solve it: client.on(‘voiceStateUpdate’, (oldMember, newMember) => { let newUserChannel = newMember.voiceChannel let oldUserChannel = oldMember.voiceChannel const voiceChannel = client.channels.cache.get(‘807305239941480543’) const Bot = "808042353477550090" if(oldUserChannel === undefined && newUserChannel !== undefined && oldMember.member.user.bot === false ..

Read more

Hi I am trying to use discord api to add the user to the guild when he login. But I am getting 401 Unauthorized and I am not sure why. This is my code: const data = new FormData(); data.append("client_id", CLIENT_ID); data.append("client_secret", CLIENT_SECRET); data.append("grant_type", "authorization_code"); data.append("redirect_uri", `http://localhost:3000/callback`); data.append("scope", "identify,guilds.join"); data.append("code", req.query.code); var response = await ..

Read more