Add function to get a single message by ID
This commit is contained in:
parent
339ec5f4d7
commit
912d26b6bf
1 changed files with 14 additions and 0 deletions
14
restapi.go
14
restapi.go
|
@ -1043,6 +1043,20 @@ func (s *Session) ChannelMessages(channelID string, limit int, beforeID, afterID
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ChannelMessage gets a single message by ID from a given channel.
|
||||||
|
// channeld : The ID of a Channel
|
||||||
|
// messageID : the ID of a Message
|
||||||
|
func (s *Session) ChannelMessage(channelID, messageID string) (st *Message, err error) {
|
||||||
|
|
||||||
|
response, err := s.Request("GET", EndpointChannelMessage(channelID, messageID), nil)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err = unmarshal(response, &st)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// ChannelMessageAck acknowledges and marks the given message as read
|
// ChannelMessageAck acknowledges and marks the given message as read
|
||||||
// channeld : The ID of a Channel
|
// channeld : The ID of a Channel
|
||||||
// messageID : the ID of a Message
|
// messageID : the ID of a Message
|
||||||
|
|
Loading…
Reference in a new issue