File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
functions/event-reminders-hourly Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -163,10 +163,13 @@ const handler = async function (event, context) {
163163 } ;
164164
165165 const messages = [
166- createMessage ( DEFAULT_SLACK_EVENT_CHANNEL ) ,
167- createMessage ( event . eventSlackAnnouncementsChannelId ) ,
166+ createMessage ( DEFAULT_SLACK_EVENT_CHANNEL )
168167 ] ;
169-
168+
169+ if ( event . eventSlackAnnouncementsChannelId ) {
170+ messages . push ( createMessage ( event . eventSlackAnnouncementsChannelId ) ) ;
171+ }
172+
170173 return messages ;
171174 } ) ;
172175
@@ -221,6 +224,11 @@ const handler = async function (event, context) {
221224 } ;
222225 }
223226
227+ const channels = [ DEFAULT_SLACK_EVENT_CHANNEL ] ;
228+ if ( event . eventSlackAnnouncementsChannelId ) {
229+ channels . push ( event . eventSlackAnnouncementsChannelId ) ;
230+ }
231+
224232 return [
225233 ...list ,
226234 titleBlock ,
@@ -246,9 +254,7 @@ const handler = async function (event, context) {
246254 type : 'section' ,
247255 text : {
248256 type : 'mrkdwn' ,
249- text : `*Announcement posted to:* <#${ event . eventSlackAnnouncementsChannelId ||
250- DEFAULT_SLACK_EVENT_CHANNEL
251- } >`,
257+ text : `*Announcement posted to:* ` + channels . map ( channel => `<#${ channel } >` ) . join ( ' ' ) ,
252258 } ,
253259 } ,
254260 {
You can’t perform that action at this time.
0 commit comments