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
827 stars 172 forks source link

After some time of running, bot doesnt to anything anymore #1213

Closed xL0b0 closed 1 month ago

xL0b0 commented 4 months ago

Which package has the bugs?

The core library

Issue description

If I keep running for a few days, after some time no new messages are being mirrored anymore. I need to always restart the script, then it works right away again. Can it be fixed so it stays logged in the entire time and always sends messages ?

Code sample

No response

Package version

3.1.4

Node.js version

v20.13.1

Operating system

No response

Priority this issue should have

Low (slightly annoying)

Checklist

Additional Information

No response

prljav commented 4 months ago

seems like a issue on your end, my bot was running (similar use case as yours) for about 3 months with absolutely no issues

xL0b0 commented 4 months ago

Which version are you / were you running? A colleague of mine experienced 1:1 the same issue

002-sans commented 4 months ago

I use the latest version and no probleme with it

xL0b0 commented 4 months ago

Issue is simply that it just doesn't crash or anything, it's just stuck and I have no idea how to fix it

zrSadek commented 4 months ago

show us ur code?

xL0b0 commented 3 months ago
// Function to initialize and start the bot
async function startBot() {
    try {
        const client = new Client({
            restGlobalRateLimit: 50,
            sweepers: {
                messages: { interval: 60, lifetime: 60 }
            }
        });

        const eventsPath = path.join(__dirname, 'events');
        const eventFiles = fs.readdirSync(eventsPath).filter(file => file.endsWith('.js'));

        for (const file of eventFiles) {
            const filePath = path.join(eventsPath, file);
            const event = require(filePath);
            if (event.once) {
                client.once(event.name, (...args) => event.execute({ ...args, client }));
            } else {
                client.on(event.name, (...args) => event.execute({ ...args, client }));
            }
        }

        await client.login(global.config.token);
    } catch (error) {
        console.log(error)
    }
}
async function main() {
    await startBot();
}

// Start the bot
main();

My main index.js code

002-sans commented 3 months ago
const client = new Client({
        restGlobalRateLimit: 50,
        sweepers: {
            messages: { interval: 60, lifetime: 60 }
        }
    });

    const eventsPath = path.join(__dirname, 'events');
    const eventFiles = fs.readdirSync(eventsPath).filter(file => file.endsWith('.js'));

    for (const file of eventFiles) {
        const filePath = path.join(eventsPath, file);
        const event = require(filePath);
        if (event.once) {
            client.once(event.name, (...args) => event.execute({ ...args, client }));
        } else {
            client.on(event.name, (...args) => event.execute({ ...args, client }));
        }
    }

client.login(global.config.token);
xL0b0 commented 3 months ago

So, is it about the way I init the client?

002-sans commented 3 months ago

So, is it about the way I init the client?

I am so sorry and stupid, it's bcs of ur sweepers, remove it from the Client

002-sans commented 3 months ago
- const client = new Client({
-    restGlobalRateLimit: 50,
-    sweepers: {
-        messages: { interval: 60, lifetime: 60 }
-    }
- });

+ const client = new Client({ restGlobalRateLimit: 50 });