@@ -114,11 +114,21 @@ export default class WikiUpdates {
114114 console . log (
115115 `🚨 Sending error notification to ${ channelType } channel for ${ errorCode } ` ,
116116 )
117+
118+ const alertUserId = process . env . ALERT_USER_ID
119+
120+ const mentionText = alertUserId ? `<@${ alertUserId } > ` : ''
121+
122+ const messageContent = `${ mentionText } `
123+
117124 await channel . send ( {
125+ content : messageContent ,
118126 embeds : [
119127 await this . messageApiErrorStyle ( link , errorCode , channelType ) ,
120128 ] ,
121129 } )
130+
131+ console . log ( '✅ Message sent successfully' )
122132 }
123133 } catch ( error ) {
124134 console . error ( `❌ Failed to send error notification:` , error )
@@ -243,7 +253,6 @@ export default class WikiUpdates {
243253 `Error ${ errorCode } : API Request to ${ link } failed. Attempt ${ count + 1 } /${ maxRetries } ` ,
244254 )
245255
246-
247256 if ( count >= maxRetries - 1 ) {
248257 await this . notifyError ( count + 1 , channelType , link , errorCode )
249258 throw new Error (
@@ -332,6 +341,16 @@ export default class WikiUpdates {
332341
333342 if ( previousStatus && ! previousStatus . isHealthy ) {
334343 console . log ( `🎉 API ${ channelType } has recovered!` )
344+ const channelId =
345+ channelType === ChannelTypes . DEV
346+ ? this . CHANNEL_IDS . DEV . WIKI
347+ : this . CHANNEL_IDS . PROD . WIKI
348+ const channel = client . channels . cache . get ( channelId ) as TextChannel
349+ if ( channel ) {
350+ await channel . send (
351+ `✅ **RECOVERY** - ${ channelType } API is back online! 🎉` ,
352+ )
353+ }
335354 }
336355 }
337356 }
0 commit comments