aiko-chan-ai / discord.js-selfbot-v13

An unofficial discord.js fork for creating selfbots
https://discordjs-self-v13.netlify.app
GNU General Public License v3.0
704 stars 145 forks source link

Sweep Cache #1109

Closed ghost closed 3 months ago

ghost commented 3 months ago

Which package has the bugs?

The core library

Issue description

Install discord.js selfbot package and run i guess.

Code sample

const { Client, Options } = require("discord.js-selfbot-v13");
const client = new Client({
  disableEveryone: true,
  sweepers: {
    ...Options.DefaultSweeperSettings,
    messages: {
      interval: 3_600, // Every hour.
      lifetime: 1_800, // Remove messages older than 30 minutes.
    },
  },
});

Package version

3.1.4

Node.js version

18

Operating system

Window 10

Priority this issue should have

High (immediate attention needed)

Checklist

Additional Information

The caching is a problem in this library, sweeper options does even work at all? It doesn't have a direct reference in the API, and it's ridiculous how it just defaultly cache everything non stop which leads to memory usage to sky rocket over a short period of time. How do i sweep everything? Not the docs or even discord.js docs have a wide variety of options to sweep other than messages and users but it seems i've done some digging and there is more options to it. So whats the approach i should take? Please let me know if the sweeper is operational in the library and how do i enable it for all types of cache not just messages and users.

aiko-chan-ai commented 3 months ago

Please let me know if the sweeper is operational in the library and how do i enable it for all types of cache not just messages and users.

The core is the discord.js library, I didn't change anything about the cache system

ghost commented 3 months ago

Thank you yes it works i guess.