Skip to content

Commit

Permalink
Update usage of implemented suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Chilliwiddit committed Jul 8, 2024
1 parent bf2d4ed commit e6808ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/survey-feedback-analysis/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ final slack:Client slack = check new ({
public function main() returns error? {

// Create a new channel for the survey
json|error createChannelResponse = check slack->/conversations\.create.post({name: channelName});
json|error createChannelResponse = slack->/conversations\.create.post({name: CHANNEL_NAME});
if createChannelResponse is error {
log:printError("Error creating the survey conversation: " + createChannelResponse.message());
return;
}

// Post a message to the conversation created and get the timestamp of the message
json|error sendMsgResponse = slack->/chat\.postMessage.post({channel: channelName, text: surveyRequestMessage});
json|error sendMsgResponse = slack->/chat\.postMessage.post({channel: CHANNEL_NAME, text: SURVEY_REQUEST_MSG});
if sendMsgResponse is error {
log:printError(sendMsgResponse.message());
return;
}
string messageTimestamp = check sendMsgResponse.message.ts;

// Check for replies to the survey message
json|error repliesResponse = slack->/conversations\.replies({channel: channelName, ts: messageTimestamp});
json|error repliesResponse = slack->/conversations\.replies({channel: CHANNEL_NAME, ts: messageTimestamp});
if repliesResponse is error {
log:printError(repliesResponse.message());
return;
Expand Down

0 comments on commit e6808ef

Please sign in to comment.