Update ChannelMessageAck because of api changes (#270)

This commit is contained in:
jonas747 2016-10-13 21:42:05 +02:00 committed by Chris Rhodes
parent 9b41864a68
commit 9f24531220
2 changed files with 13 additions and 2 deletions

View file

@ -1127,9 +1127,15 @@ func (s *Session) ChannelMessage(channelID, messageID string) (st *Message, err
// 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
func (s *Session) ChannelMessageAck(channelID, messageID string) (err error) { // lastToken : token returned by last ack
func (s *Session) ChannelMessageAck(channelID, messageID, lastToken string) (st *Ack, err error) {
_, err = s.request("POST", EndpointChannelMessageAck(channelID, messageID), "", nil, 0) body, err := s.Request("POST", EndpointChannelMessageAck(channelID, messageID), &Ack{Token: lastToken})
if err != nil {
return
}
err = unmarshal(body, &st)
return return
} }

View file

@ -408,6 +408,11 @@ type MessageAck struct {
ChannelID string `json:"channel_id"` ChannelID string `json:"channel_id"`
} }
// An Ack is used to ack messages
type Ack struct {
Token string `json:"token"`
}
// A GuildIntegrationsUpdate stores data for the guild integrations update // A GuildIntegrationsUpdate stores data for the guild integrations update
// websocket event. // websocket event.
type GuildIntegrationsUpdate struct { type GuildIntegrationsUpdate struct {