Skip to content

Commit

Permalink
Remove deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kanata2 committed Mar 16, 2021
1 parent 93fe17c commit 9152ed0
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 1,586 deletions.
678 changes: 0 additions & 678 deletions channels.go

Large diffs are not rendered by default.

27 changes: 0 additions & 27 deletions examples/channels/channels.go

This file was deleted.

22 changes: 0 additions & 22 deletions examples/groups/groups.go

This file was deleted.

21 changes: 0 additions & 21 deletions examples/ims/ims.go

This file was deleted.

9 changes: 5 additions & 4 deletions examples/pins/pins.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,21 @@ func main() {
postAsUserID = authTest.UserID

// Create a temporary channel
channel, err := api.CreateChannel(channelName)
channel, err := api.CreateConversation(channelName, false)

if err != nil {
// If the channel exists, that means we just need to unarchive it
if err.Error() == "name_taken" {
err = nil
if channels, err = api.GetChannels(false); err != nil {
params := &slack.GetConversationsParameters{ExcludeArchived: "false"}
if channels, _, err = api.GetConversations(params); err != nil {
fmt.Println("Could not retrieve channels")
return
}
for _, archivedChannel := range channels {
if archivedChannel.Name == channelName {
if archivedChannel.IsArchived {
err = api.UnarchiveChannel(archivedChannel.ID)
err = api.UnArchiveConversation(archivedChannel.ID)
if err != nil {
fmt.Printf("Could not unarchive %s: %s\n", archivedChannel.ID, err)
return
Expand Down Expand Up @@ -111,7 +112,7 @@ func main() {
return
}

if err = api.ArchiveChannel(channelID); err != nil {
if err = api.UnArchiveConversation(channelID); err != nil {
fmt.Printf("Error archiving channel: %s\n", err)
return
}
Expand Down
4 changes: 2 additions & 2 deletions examples/reactions/reactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ func main() {
postToUserID = authTest.UserID

// Find the channel.
_, _, chanID, err := api.OpenIMChannel(postToUserID)
channel, _, _, err := api.OpenConversation(&slack.OpenConversationParameters{ChannelID: postToUserID})
if err != nil {
fmt.Printf("Error opening IM: %s\n", err)
return
}
postToChannelID = chanID
postToChannelID = channel.ID

fmt.Printf("Posting as %s (%s) in DM with %s (%s), channel %s\n", postAsUserName, postAsUserID, postToUserName, postToUserID, postToChannelID)

Expand Down
Loading

0 comments on commit 9152ed0

Please sign in to comment.