Mam funkcję withdraw, która wywołuje się w następujący sposób
client.on('ready',async function (message) {
console.log(`Bot ${client.user.username} dołączył na serwer`);
setInterval(() => {
const now = new Date();
const day = now.getDay();
const hours = now.getHours();
const minutes = now.getMinutes();
const seconds = now.getSeconds();
const withdrawTime = "0235959";
const time = day.toString() + hours + minutes + seconds;
console.log(withdrawTime, time);
if (withdrawTime)
{
withdraw(message);
}
}, 10000);
});
Ostatnia linijka funckji
await message.channel.send(`Gracz ${username} otrzymał wynagrodzenie w wysokości ${workerWeeklyEarnings}`);
Wywala błąd
Cannot read properties of undefined (reading 'send')
Czemu send jest undefined? Jak to naprawić?