discord-api-types APIGuildMember no permissions bit field?
Shouldn't
APIGuildMember
( https://discord-api-types.dev/api/discord-api-types-v10/interface/APIGuildMember ) include permissions, just like GuildMember ( https://discord.com/developers/docs/resources/guild#guild-member-object )?
I'm using the "@discordjs/rest" and "discord-api-types" npm packages in my app (written in typescript) and am trying to check if a user has certain permissions, but the Type doesn't have the permission field.
Also there's basicly no examples of how to use the "@discordjs/rest" package. The only examples are here and they only show post, not get!
Simplified example of what I'm trying to do...
rest.get()
returns a Promise<unknown>
, so what am I gonna do with that in typescript? If I use as APIGuildMember | null
technically typescript has no problem with it, but as soon as I'm trying to use the .permission
typescript's gonna cry that APIGuildMember
doesn't have the property permissions
.
So, am I using the rest.get()
in an unsupported way, or am I just not supposed to do permission stuff with these libraries, or is APIGuildMember.permissions
actually just missing accidentally and will be added?1 Reply
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OP