Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
Completely disable alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
synzen committed Dec 18, 2022
1 parent db5569d commit e100511
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/runSchedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ async function main() {

scheduleManager.on('alert', async (channelId, message) => {
try {
const channel = await fetchChannel(channelId)
await sendAlert(channel.guild_id, channelId, message)
// const channel = await fetchChannel(channelId)
// await sendAlert(channel.guild_id, channelId, message)
} catch (err) {
console.error(`Failed to send alert for channel ${channelId}`, err)
}
Expand Down Expand Up @@ -125,11 +125,11 @@ async function sendMessageToChannel(channelId, content) {
* @returns
*/
async function sendAlert(guildId, channelId, errorMessage) {
const userAlerts = await getUserAlerts(guildId)
if (!userAlerts) {
return await sendMessageToChannel(channelId, errorMessage)
}
await Promise.all(userAlerts.map((id) => sendMessageToUser(id, errorMessage)))
// const userAlerts = await getUserAlerts(guildId)
// if (!userAlerts) {
// return await sendMessageToChannel(channelId, errorMessage)
// }
// await Promise.all(userAlerts.map((id) => sendMessageToUser(id, errorMessage)))
}

async function sendMessageToUser(userId, content) {
Expand Down

0 comments on commit e100511

Please sign in to comment.