@fluxerjs/core 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,6 +23,19 @@ client.on(Events.MessageCreate, async (m) => {
23
23
  await client.login(process.env.FLUXER_BOT_TOKEN);
24
24
  ```
25
25
 
26
+ ### Cache limits and sweeps
27
+
28
+ ```javascript
29
+ const client = new Client({
30
+ cache: { guilds: 100, messages: 25 }, // messages: false to disable
31
+ });
32
+
33
+ client.on(Events.Ready, () => console.log(client.cache.stats()));
34
+ client.cache.sweepMessages((msg) => Date.now() - Date.parse(msg.timestamp) > 3_600_000);
35
+ ```
36
+
37
+ See `examples/cache-bot.js` and the [Caching guide](https://fluxerjs.blstmo.com/guides/caching/).
38
+
26
39
  Self-hosted / multi-instance: use `Client.fromDiscovery(origin)` or `ClientOptions.instance`.
27
40
  **Beta:** `ClientCluster` (also `@fluxerjs/core/cluster`) can add/remove/restart independently-tokened
28
41
  runtimes without process restart — see `examples/multi-instance-bot.js`. API may change.