Skip to content

Commit

Permalink
fix(chat): add auth for ls
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Sep 21, 2022
1 parent 6d75d63 commit 0229184
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/chat/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ func List(ctx context.Context) error {
}

return c.Run(ctx, func(ctx context.Context) error {
status, err := c.Auth().Status(ctx)
if err != nil {
return err
}
if !status.Authorized {
return fmt.Errorf("not authorized. please login first")
}

color.Blue("Getting dialogs...")

dialogs, err := query.GetDialogs(c.API()).BatchSize(100).Collect(ctx)
Expand Down

0 comments on commit 0229184

Please sign in to comment.