#Bot not starting
1 messages · Page 1 of 1 (latest)
Are all the files imported ? Even in the folders ?
Yh, i imported everything with FileZilla
Have you tried restarting the bot
Same thing, every file has loaded but the bot won't start
Can you send the content of your events/Discord/ready.js file ?
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)
})
Can you try to use this code and restart the bot ? Make sure to save the file before exiting it on the pterodactyl panel. It should log TEST - CLIENT READY
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)
})```
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.