Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
49 views

Cannot read properties of undefined (reading 'length') discord.js

Attached below is my code. It works the first time it is run but not the second time. const { Client, GatewayIntentBits } = require('discord.js') const client = new Client({ intents: [...
FrostZer0's user avatar
0 votes
1 answer
1k views

How to send a message to a Discord webhook in node.js?

I have tried the code posted in this answer (with some modification), but it tells me that fetch is not a function. const fetch = import("node-fetch"); fetch(process.env.WEBHOOK, { 'method'...
vlone's user avatar
  • 43
0 votes
2 answers
3k views

Trying to install node-fetch but it results in an error

I started to mess around with discord bots and I would need node-fetch for the tutorial which I started learning from. I'm simply trying to run: (to install node-fetch) npm install node-fetch Which ...
Adam Varhegyi's user avatar
1 vote
1 answer
8k views

How to get all of the members of a guild with a certain role in discord.js v13

I'm currently working on a discord.js bot to start getting some practice with node.js I have currently run into a problem when trying to get all the members of a guild with a certain role. Here is the ...
Verve's user avatar
  • 68
0 votes
0 answers
906 views

Discord oAuth2: How do I get the authentification header working

What I am trying/wanting it to do: I am trying to make it log the info of a user after authorization What happens: It says { message: '401: Unauthorized', code: 0 } whenever I fetch the users info, ...
FireyJS's user avatar
  • 61
-2 votes
1 answer
104 views

why does my code in nodejs gives error and asks me to write catch but i have already said it in the code

So this is the error (node:24077) UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'id' of undefined at Client.msg (/app/bot.js:18:22) at Client.emit (events.js:196:13) at ...
ridhesh walavalkar's user avatar
0 votes
2 answers
908 views

Why am I getting a '400: Bad Request' when i try to change my Discord avatar?

Before i get 100 people telling me that automating user accounts is against the Terms of Service, I know that and i am willing to take the risk, i just came here for help because i've been trying for ...
c8h_'s user avatar
  • 143
1 vote
1 answer
359 views

Using node-fetch to embed DnD spells from api

I'm wanting to be able to embed specific DnD spells taken from the 5e Api using a Discord bot. I can log all of the spells to the console using node-fetch but completely unsure of the next step in ...
JHPrime's user avatar
  • 45
1 vote
1 answer
3k views

node-fetch in discord.js cannot read property

I have been following the REST API guide from Discord.js, but I keep getting errors that the first property of the returning json cannot be read. I know that the api address is correct. This is what ...
Zoef's user avatar
  • 403
7 votes
4 answers
14k views

Discord Oauth2 Join Guild

const guildMembersResponse = fetch(`http://discordapp.com/api/guilds/440494010595803136/members/278628366213709824`, { method: 'PUT', headers: { ...
G33RY's user avatar
  • 148