Sven.
Sven.
DIAdiscord.js - Imagine an app
Created by Sven. on 11/20/2023 in #djs-questions
Updating Channel Name
Hi im trying to update the channel name every 10 minutes for the server status. But if he is trying to set the name he crashes.. CODE:
} else {
client.channels.cache.get(`1089550987527717027`).setName(`🟢 | play.PulseTopia.nl`);
client.channels.cache.get(`1107336229307043850`).setName(`👤 | Online: ${image.players.online}`);
}
} else {
client.channels.cache.get(`1089550987527717027`).setName(`🟢 | play.PulseTopia.nl`);
client.channels.cache.get(`1107336229307043850`).setName(`👤 | Online: ${image.players.online}`);
}
ERROR: /home/container/src/events/mcstatus.js:24 client.channels.cache.get("1089550987527717027").setName(🟢 | play.PulseTopia.nl); ^ TypeError: Cannot read properties of undefined (reading 'setName') at Timeout._onTimeout (/home/container/src/events/mcstatus.js:24:53) at processTicksAndRejections (node:internal/process/task_queues:96:5) ```
5 replies
DIAdiscord.js - Imagine an app
Created by Sven. on 11/20/2023 in #djs-questions
Updating Channel Name
Hi im trying to update the channel name every 10 minutes for the server status. But if he is trying to set the name he crashes.. CODE:
} else {
client.channels.cache.get(`1089550987527717027`).setName(`🟢 | play.PulseTopia.nl`);
client.channels.cache.get(`1107336229307043850`).setName(`👤 | Online: ${image.players.online}`);
}
} else {
client.channels.cache.get(`1089550987527717027`).setName(`🟢 | play.PulseTopia.nl`);
client.channels.cache.get(`1107336229307043850`).setName(`👤 | Online: ${image.players.online}`);
}
ERROR:
/home/container/src/events/mcstatus.js:24
client.channels.cache.get(`1089550987527717027`).setName(`🟢 | play.PulseTopia.nl`);
^
TypeError: Cannot read properties of undefined (reading 'setName')
at Timeout._onTimeout (/home/container/src/events/mcstatus.js:24:53)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
/home/container/src/events/mcstatus.js:24
client.channels.cache.get(`1089550987527717027`).setName(`🟢 | play.PulseTopia.nl`);
^
TypeError: Cannot read properties of undefined (reading 'setName')
at Timeout._onTimeout (/home/container/src/events/mcstatus.js:24:53)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2 replies