Cannot read properties of undefined (reading 'Flags')
My Code:
Error: TypeError: Cannot read properties of undefined (reading 'Flags')
What´s wrong?
14 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Post the full error stack trace, not just the top part!
- Show your code!
- Explain what exactly your issue is.
- Not a discord.js issue? Check out #useful-servers.PermissionsBitFieldBitField
that's one too many BitFieldsOk but now it says DiscordAPIError[10062]: Unknown interaction
Common causes of
DiscordAPIError[10062]: Unknown interaction
:
- Initial response took more than 3 seconds ➞ defer the response *.
- Wrong interaction object inside a collector.
* Note: you cannot defer modal or autocomplete value responsesCan i use 0x0000000000000002 instead of PermissionsBitField.Flags.kickMember in
or how can i use the integer value?
1. it's PascalCase, so it'd be
KickMember
with a capital K
2. permission flags are bigints
3. why would you prefer to make your code less readable?
4. you know that 0x0000000000000002 is just 2 right?1. Ok
2. ok
3. idk. i just want to know if it's possible
4. yeah...
well then the answer is you can, but it's recommended to use the enums so you can read your code
Ok, but why comes this error when i try to kick someone without having kick perms?
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined.
oh right it should be KickMembers plural
this makes no difference?
no I mean
PermissionsBitField.Flags.KickMembers
your variables can be named whatever you wantOh bruh. You are right. XD it works now XDDDD
Thanks again. XDD
👍