Skip to content

Commit

Permalink
Merge pull request #787 from descholar-ceo/master
Browse files Browse the repository at this point in the history
Add explanation how the message could be sent in a proper way
  • Loading branch information
kanata2 authored Aug 20, 2020
2 parents ae526aa + ca60d3c commit 7a67a6a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/messages/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ func main() {
*/
}

channelID, timestamp, err := api.PostMessage("CHANNEL_ID", slack.MsgOptionText("Some text", false), slack.MsgOptionAttachments(attachment))
channelID, timestamp, err := api.PostMessage(
"CHANNEL_ID",
slack.MsgOptionText("Some text", false),
slack.MsgOptionAttachments(attachment),
slack.MsgOptionAsUser(true), // Add this if you want that the bot would post message as a user, otherwise it will send response using the default slackbot
)
if err != nil {
fmt.Printf("%s\n", err)
return
Expand Down

0 comments on commit 7a67a6a

Please sign in to comment.