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

how do i get all channels in a guild? #8

Closed Milo123459 closed 4 years ago

Milo123459 commented 4 years ago

so If I pass in the options for no channelCaching, how can I get all channels in a guild? Would It be like:

<Guild>.channels.fetch();
//do something
<Guild>.channels.cache.deleteAll();

or does it automatically remove it from the cache?

timotejroiko commented 4 years ago

(answered on discord, but reposting here for visibility)

You can use <Guild>.channels.fetch(false) which will fetch all channels and return a collection of channels, without caching them.