Skip to content

Commit

Permalink
already_in_channelを除外
Browse files Browse the repository at this point in the history
  • Loading branch information
walnuts1018 committed Mar 31, 2024
1 parent 95da289 commit af1977b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slack/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ func (c *Client) InviteUsersToChannels(ctx context.Context, channelIDs []string,
continue
}

if warn != "" {
if warn != "" && warn != "already_in_channel" {
slog.Warn("Warning joining channel", "channelID", channelID, "warning", warn)
}

if _, err := c.slackClient.InviteUsersToConversationContext(ctx, channelID, userIDs...); err != nil {
if _, err := c.slackClient.InviteUsersToConversationContext(ctx, channelID, userIDs...); err != nil && err.Error() != "already_in_channel" {
slog.Error("Error inviting user to channel", "channelID", channelID, "userIDs", userIDs, "error", err)
continue
}
Expand Down

0 comments on commit af1977b

Please sign in to comment.