mirror of
https://git.femboyfinancial.jp/james/FemScoreboard.git
synced 2025-10-22 01:55:35 -07:00
Check channel existence before sending motd
This commit is contained in:
@@ -77,6 +77,10 @@ async function scheduleRandomMessage(firstTime = false)
|
||||
{
|
||||
if (!firstTime) {
|
||||
const channel = <TextChannel> await client.channels.fetch(process.env.MOTD_CHANNEL);
|
||||
if (!channel) {
|
||||
console.warn(`[bot] Channel ${process.env.MOTD_CHANNEL} not found, disabling MOTD.`);
|
||||
return;
|
||||
}
|
||||
const randomMessage = await fetchMotd();
|
||||
await channel.send(randomMessage);
|
||||
logInfo(`[bot] Sent MOTD: ${randomMessage}`);
|
||||
|
||||
Reference in New Issue
Block a user