Skip to content

Commit

Permalink
add another call into the edge tool
Browse files Browse the repository at this point in the history
  • Loading branch information
rusq committed Mar 26, 2024
1 parent 7300870 commit 0053672
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions cmd/slackdump/internal/diag/edge.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"os"

"github.com/rusq/slack"
"github.com/rusq/slackdump/v3/auth"
"github.com/rusq/slackdump/v3/cmd/slackdump/internal/golang/base"
"github.com/rusq/slackdump/v3/internal/edge"
Expand Down Expand Up @@ -83,18 +84,8 @@ func runEdge(ctx context.Context, cmd *base.Command, args []string) error {
if err := save("counts.json", counts); err != nil {
return err
}
if len(counts.Channels) > 0 {
lg.Print("Conversations Generic Info")
ci, err := cl.ConversationsGenericInfo(ctx, counts.Channels[0].ID)
if err != nil {
return err
}
if err := save("conversations_generic_info.json", ci); err != nil {
return err
}
}

lg.Print("GetConversationsContext")
lg.Print("*** GetConversationsContext ***")
gcc, _, err := cl.GetConversationsContext(ctx, nil)
if err != nil {
return err
Expand All @@ -103,6 +94,25 @@ func runEdge(ctx context.Context, cmd *base.Command, args []string) error {
return err
}

lg.Print("*** GetUsersInConversationContext ***")
if len(gcc) > 0 {
guic, _, err := cl.GetUsersInConversationContext(ctx, &slack.GetUsersInConversationParameters{ChannelID: gcc[0].ID})
if err != nil {
return err
}
if err := save("get_users_in_conversation_context.json", guic); err != nil {
return err
}
lg.Print("*** Conversations Generic Info ***")
ci, err := cl.ConversationsGenericInfo(ctx, gcc[0].ID)
if err != nil {
return err
}
if err := save("conversations_generic_info.json", ci); err != nil {
return err
}
}
lg.Print("OK")
return nil
}

Expand Down

0 comments on commit 0053672

Please sign in to comment.