2
0
mirror of https://github.com/42wim/matterbridge synced 2024-11-19 03:25:33 +00:00
matterbridge/vendor/github.com/slack-go/slack/history.go

38 lines
1.1 KiB
Go
Raw Normal View History

2016-09-05 14:34:37 +00:00
package slack
const (
DEFAULT_HISTORY_LATEST = ""
DEFAULT_HISTORY_OLDEST = "0"
DEFAULT_HISTORY_COUNT = 100
DEFAULT_HISTORY_INCLUSIVE = false
DEFAULT_HISTORY_UNREADS = false
)
// HistoryParameters contains all the necessary information to help in the retrieval of history for Channels/Groups/DMs
type HistoryParameters struct {
Latest string
Oldest string
Count int
Inclusive bool
Unreads bool
}
// History contains message history information needed to navigate a Channel / Group / DM history
type History struct {
Latest string `json:"latest"`
Messages []Message `json:"messages"`
HasMore bool `json:"has_more"`
2020-05-23 22:06:21 +00:00
Unread int `json:"unread_count_display"`
2016-09-05 14:34:37 +00:00
}
// NewHistoryParameters provides an instance of HistoryParameters with all the sane default values set
func NewHistoryParameters() HistoryParameters {
return HistoryParameters{
Latest: DEFAULT_HISTORY_LATEST,
Oldest: DEFAULT_HISTORY_OLDEST,
Count: DEFAULT_HISTORY_COUNT,
Inclusive: DEFAULT_HISTORY_INCLUSIVE,
Unreads: DEFAULT_HISTORY_UNREADS,
}
}