TypeError: Cannot read property 'ready' of undefined

hi, got a new error again. Here is the error msg

TypeError: Cannot read property 'ready' of undefined
at Object.run (/app/events/uncaughtException.js:5:15)
at process.emitter.(anonymous function).args (/app/lenoxbot.js:95:23)
    at process.emit (events.js:189:13)
    at process._fatalException (internal/bootstrap/node.js:496:27)

It seems that the error was occured from events/uncaughtExeption.js. here is the code:

module.exports = {
	emitter: process,
	run: (error, client) => {
		if (!client.ready || !client.settings || !client.settings.log_channels || !client.settings.log_channels.errors || !error) return;
		let errorMsg = (error ? error.stack || error : '').toString().replace(new RegExp(`${__dirname}\/`, 'g'), './');
		if (client.channels.has(client.settings.log_channels.errors)) client.channels.get(client.settings.log_channels.errors).send(null, {
			embed: {
				color: 15684432,
				timestamp: new Date(),
				title: 'Uncaught Exception',
				description: `\`\`\`x86asm\n${errorMsg.slice(0, 2048)}\n\`\`\``,
				fields: [
					{
						name: 'Error Name:',
						value: `\`${error.name || 'N/A'}\``
					}, {
						name: 'Error Message:',
						value: `\`${error.message || 'N/A'}\``
					}
				]
			}
		}).catch(console.error);
	}
}

It seems that client is not defined. Can you log client?

hmm. I tried to logged it and it says undefined. but what am i doing wrong? i have the client setup ready on my main file.

How are you calling your file? It may be that the error parameter isn’t being provided so client = error and client != client.

can you see my project? here is my project https://glitch.com/~lexy-bot