Skip to content

Commit

Permalink
slack api updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay Pavlovich committed Mar 2, 2021
1 parent fe5305f commit 9a914ef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ Loop:
if !strings.HasPrefix(ev.Msg.Channel, "D") {
continue
}
_, _, userChannel, err := rtm.OpenIMChannel(ev.Msg.User)
params := slack.OpenConversationParameters{ChannelID: ev.Msg.Channel}
userChannel, _, _, err := rtm.OpenConversation(&params)
if err != nil {
log.Printf("Get channel Error: %v\n", err)
continue
}
if userChannel != ev.Msg.Channel {
if userChannel.ID != ev.Msg.Channel {
continue
}

Expand All @@ -76,7 +77,7 @@ Loop:
continue
}

log.Printf("User: %v; Message: %v\n", userInfo.Profile.Email, ev.Msg.Text) // ev.Msg.User, ev.Msg.Channel
log.Printf("User: %v (%v); Message: %v\n", ev.Msg.User, userInfo.Profile.Email, ev.Msg.Text) // ev.Msg.User, ev.Msg.Channel

client := &http.Client{}
parameters := url.Values{}
Expand Down

0 comments on commit 9a914ef

Please sign in to comment.