Skip to content

Commit

Permalink
Convert construct message to a query expression
Browse files Browse the repository at this point in the history
  • Loading branch information
adibmbrk committed Jul 4, 2024
1 parent 9842458 commit a7c95ba
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions examples/AutomatedSummaryReport/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,10 @@ public function main() returns error? {
}

// Construct the stand-up report message
string textMessage = "Automated Stand Up Report: ";
int i = 1;
foreach string text in latestText {
textMessage += string `${i}. ${text}\n`;
i += 1;
}
string textMessage = string `Automated Stand Up Report: ${"\n"}${
<string>from [int, string] [index, text] in latestText.enumerate()
select string `${index + 1}. ${text}${"\n"}`
}`;

// Post the stand-up report message to the "general" channel
json postMessageResult = check slack->/chat\.postMessage.post({channel: "general", text: textMessage});
Expand Down

0 comments on commit a7c95ba

Please sign in to comment.