slack-go/slack

Replies array is empty in slack.Messagee

aleksa11010 opened this issue · 0 comments

What happened

When you are trying to get the messages and checking for the replies we see that the Replies count actually shows the number of replies but the Replies array has no messages inside
image

Created PR to fix this : #1167

Expected behavior

I expect to be able to access all the replies without having to run additional API call to get the replies based on the first threads timestamp. Also, default Slack API returns a field reply_users which will have an array of all users that replied to that thread, is it possible to have it included here as well?

Steps to reproduce

Running any GetConversationHistory function on any channels that has threads with replies should result with messages that have ReplyCount set properly but no actual Reply messages.

reproducible code

func getMessages(channel string, timestamp string) ([]slack.Message, error) {
	// Get the messages from the channel
	history, err := GetSlackClient().GetConversationHistory(&slack.GetConversationHistoryParameters{
		ChannelID:          channel,
		Oldest:             timestamp,
		Inclusive:          true,
		IncludeAllMetadata: true,
	})
	if err != nil {
		log.Printf("Error getting channel history : %s", err)
		return nil, err
	}

	return history.Messages, nil
}
msg, err := getMessages(os.Getenv("CHANNEL"), ts)
	if err != nil {
		log.Println(err)
	}

Versions

  • Go: 1.19
  • slack-go/slack: v0.12.1