#Bot not starting

1 messages · Page 1 of 1 (latest)

spark rivet
#

And the bot is online or?

simple agate
#

nope

#

It works fine in my PC, but not in Pterodactyl panel

north herald
simple agate
#

Yh, i imported everything with FileZilla

north herald
#

Have you tried restarting the bot

simple agate
#

Same thing, every file has loaded but the bot won't start

north herald
simple agate
north herald
#

Hmm

#

What about the src/loader.js file

simple agate
#
const { readdirSync } = require('fs');
const { Collection } = require('discord.js');
const { useMainPlayer } = require('discord-player');
client.commands = new Collection();
CommandsArray = [];
const player = useMainPlayer()



const DiscordEvents = readdirSync('./events/Discord/').filter(file => file.endsWith('.js'));
const PlayerEvents = readdirSync('./events/Player/').filter(file => file.endsWith('.js'));

for (const file of DiscordEvents) {
    const DiscordEvent = require(`../events/Discord/${file}`);
    console.log(`-> [Loaded Discord Event] ${file.split('.')[0]}`);
    client.on(file.split('.')[0], DiscordEvent.bind(null, client));
    delete require.cache[require.resolve(`../events/Discord/${file}`)];
};

for (const file of PlayerEvents) {
    const PlayerEvent = require(`../events/Player/${file}`);
    console.log(`-> [Loaded Player Event] ${file.split('.')[0]}`);
    player.events.on(file.split('.')[0], PlayerEvent.bind(null));
    delete require.cache[require.resolve(`../events/Player/${file}`)];
};


readdirSync('./commands/').forEach(dirs => {
    const commands = readdirSync(`./commands/${dirs}`).filter(files => files.endsWith('.js'));

    for (const file of commands) {
        const command = require(`../commands/${dirs}/${file}`);
        if (command.name && command.description) {
        CommandsArray.push(command);
        console.log(`-> [Loaded Command] ${command.name.toLowerCase()}`);
        client.commands.set(command.name.toLowerCase(), command);
        delete require.cache[require.resolve(`../commands/${dirs}/${file}`)];
        } else console.log(`[failed Command]  ${command.name.toLowerCase()}`)
    };
});

client.on('ready', (client) => {
 if (client.config.app.global) client.application.commands.set(CommandsArray)
  else client.guilds.cache.get(client.config.app.guild).commands.set(CommandsArray)
})
north herald
#
const { readdirSync } = require('fs');
const { Collection } = require('discord.js');
const { useMainPlayer } = require('discord-player');
client.commands = new Collection();
CommandsArray = [];
const player = useMainPlayer()



const DiscordEvents = readdirSync('./events/Discord/').filter(file => file.endsWith('.js'));
const PlayerEvents = readdirSync('./events/Player/').filter(file => file.endsWith('.js'));

for (const file of DiscordEvents) {
    const DiscordEvent = require(`../events/Discord/${file}`);
    console.log(`-> [Loaded Discord Event] ${file.split('.')[0]}`);
    client.on(file.split('.')[0], DiscordEvent.bind(null, client));
    delete require.cache[require.resolve(`../events/Discord/${file}`)];
};

for (const file of PlayerEvents) {
    const PlayerEvent = require(`../events/Player/${file}`);
    console.log(`-> [Loaded Player Event] ${file.split('.')[0]}`);
    player.events.on(file.split('.')[0], PlayerEvent.bind(null));
    delete require.cache[require.resolve(`../events/Player/${file}`)];
};


readdirSync('./commands/').forEach(dirs => {
    const commands = readdirSync(`./commands/${dirs}`).filter(files => files.endsWith('.js'));

    for (const file of commands) {
        const command = require(`../commands/${dirs}/${file}`);
        if (command.name && command.description) {
        CommandsArray.push(command);
        console.log(`-> [Loaded Command] ${command.name.toLowerCase()}`);
        client.commands.set(command.name.toLowerCase(), command);
        delete require.cache[require.resolve(`../commands/${dirs}/${file}`)];
        } else console.log(`[failed Command]  ${command.name.toLowerCase()}`)
    };
});

client.on('ready', (client) => {
console.log(`TEST - CLIENT READY`)
 if (client.config.app.global) client.application.commands.set(CommandsArray)
  else client.guilds.cache.get(client.config.app.guild).commands.set(CommandsArray)
})```
simple agate
#

lemme try

#

same thing again🫠

north herald
#

its weird

#

its like the bot doesn't call events

formal grove
# simple agate lemme try

I've experienced it before, so I used Ptero from Pylex the issue was exactly the same as yours right now, so I redeployed but on a different node. Now my bot is running normally again.

#

If you built the Pterodactyl on your own, it seems like there's something wrong with your Pterodactyl setup. If you purchased it from a third party seller, try moving your bot to another node provided by the seller.