timotejroiko / discord.js-light

All the power of discord.js, zero caching. This library modifies discord.js's internal classes and functions in order to give you full control over its caching behaviour.
Apache License 2.0
292 stars 29 forks source link

Channel NSFW status #42

Closed PrivateGER closed 3 years ago

PrivateGER commented 3 years ago

The library seems to return an incorrect NSFW status for text channels in message objects when channel caching is disabled. Despite the channel being NSFW, the property always is false.

PrivateGER commented 3 years ago

Fetching the channel manually using client.channels.fetch(message.channel.id) returns a channel with a properly set nsfw property.

timotejroiko commented 3 years ago

yes, Discord only sends channel IDs in the message payload, therefore message.channel is a partial if caching is disabled

PrivateGER commented 3 years ago

Thank you, noted. You maybe should mention that specifically in the readme, since it's an unexpected breaking change.

Also, in case you're interested in adding my bot to the README list: Here it is.

timotejroiko commented 3 years ago

It is mentioned in the readme:

Structures not marked as partial only guarantee the contents of its top-level properties. Linked structures such as message.channel or reaction.message may still be partials if not previously cached or fetched.

Feel free to make a PR to add your bot or if you dont mind waiting, i can look into it later today

timotejroiko commented 3 years ago

Added your bot but had to put it in the bottom of the list because it doesnt have a badge yet. let me know if you ever get a badge thingy

PrivateGER commented 3 years ago

Yeah, that's sadly not going to happen, top.gg is extremely hostile towards NSFW bots for some reason. :/ Maybe I'll make my own badge image some day.