Skip to content

Commit

Permalink
fx
Browse files Browse the repository at this point in the history
  • Loading branch information
hirenko-v committed Sep 27, 2024
1 parent df855d9 commit 0e3fe72
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions cmd/snippet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,21 +277,22 @@ func (SnippetExecutor) Execute(ctx context.Context, in executor.ExecuteInput) (e
return executor.ExecuteOutput{}, err
}

// Step 4: Complete the upload and post the message
err = completeUpload(botToken, fileID, channelID, message)
if err != nil {
return executor.ExecuteOutput{}, err
}

// fmt.Printf("%s has been successfully executed\n", command)
if msg != "" {
message = fmt.Sprintf("%s please check attachement with the following name: %s", msg, filename)
} else {
message = fmt.Sprintf("Command %s result sent, please check attachement with the following name: %s", cmd, filename)
}


// Step 4: Complete the upload and post the message
err = completeUpload(botToken, fileID, channelID, message)
if err != nil {
return executor.ExecuteOutput{}, err
}

return executor.ExecuteOutput{
Message: api.NewCodeBlockMessage(message, false),
Message: api.NewCodeBlockMessage(fmt.Sprintf("Command %s result sent, please check attachement with the following name: %s", cmd, filename), false),
}, nil
}

Expand Down

0 comments on commit 0e3fe72

Please sign in to comment.