forked from pothtonswer/discordmuffin
Update ChannelMessageAck because of api changes (#270)
This commit is contained in:
parent
9b41864a68
commit
9f24531220
2 changed files with 13 additions and 2 deletions
10
restapi.go
10
restapi.go
|
@ -1127,9 +1127,15 @@ func (s *Session) ChannelMessage(channelID, messageID string) (st *Message, err
|
|||
// ChannelMessageAck acknowledges and marks the given message as read
|
||||
// channeld : The ID of a Channel
|
||||
// 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
|
||||
}
|
||||
|
||||
|
|
|
@ -408,6 +408,11 @@ type MessageAck struct {
|
|||
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
|
||||
// websocket event.
|
||||
type GuildIntegrationsUpdate struct {
|
||||
|
|
Loading…
Reference in a new issue