Skip to content

Commit

Permalink
add ignore subtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
walnuts1018 committed Mar 31, 2024
1 parent ac5d766 commit 50028bd
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 @@ -192,8 +192,8 @@ func (c *Client) GetAllMCGMembers(ctx context.Context, mustIncludeUsers ...strin
func (c *Client) ForwardMessage(ctx context.Context, everythingChannelID string, sourceChannelName string, message slackevents.MessageEvent) error {
slog.Debug("Forwarding message", "everythingChannelID", everythingChannelID, "sourceChannelName", sourceChannelName, "message", message)

allowedSubTypes := []string{"", "message_deleted", "message_changed", "file_share"}
if !slices.Contains(allowedSubTypes, message.SubType) {
ignoreSubtypes := []string{"bot_message", "channel_join", "channel_leave", "channel_topic", "channel_purpose", "channel_name", "channel_archive", "channel_unarchive", "pinned_item", "unpinned_item", "reminder_add"}
if slices.Contains(ignoreSubtypes, message.SubType) {
slog.Info("Ignored message event", "subType", message.SubType)
return nil
}
Expand Down

0 comments on commit 50028bd

Please sign in to comment.