diff options
author | Wim <wim@42.be> | 2020-08-21 00:14:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-21 00:14:33 +0200 |
commit | b451285af70df0651989b43149eb748648ac8c1b (patch) | |
tree | 9a3d9f9093cdceb7325bcddfda36983862b5b80b /vendor/github.com/matterbridge/gozulipbot/message.go | |
parent | 63a1847cdc895a3e968c567c20d20359f0785ce2 (diff) | |
download | matterbridge-msglm-b451285af70df0651989b43149eb748648ac8c1b.tar.gz matterbridge-msglm-b451285af70df0651989b43149eb748648ac8c1b.tar.bz2 matterbridge-msglm-b451285af70df0651989b43149eb748648ac8c1b.zip |
Sync with upstream gozulipbot fixes (#1202)
Diffstat (limited to 'vendor/github.com/matterbridge/gozulipbot/message.go')
-rw-r--r-- | vendor/github.com/matterbridge/gozulipbot/message.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/vendor/github.com/matterbridge/gozulipbot/message.go b/vendor/github.com/matterbridge/gozulipbot/message.go index df963f43..16d88312 100644 --- a/vendor/github.com/matterbridge/gozulipbot/message.go +++ b/vendor/github.com/matterbridge/gozulipbot/message.go @@ -194,8 +194,10 @@ func (b *Bot) UpdateMessage(id string, content string) (*http.Response, error) { // React adds an emoji reaction to an EventMessage. func (b *Bot) React(e EventMessage, emoji string) (*http.Response, error) { - url := fmt.Sprintf("messages/%d/emoji_reactions/%s", e.ID, emoji) - req, err := b.constructRequest("PUT", url, "") + requestURL := fmt.Sprintf("messages/%d/reactions", e.ID) + values := url.Values{} + values.Set("emoji_name", emoji) + req, err := b.constructRequest("POST", requestURL, values.Encode()) if err != nil { return nil, err } @@ -204,8 +206,10 @@ func (b *Bot) React(e EventMessage, emoji string) (*http.Response, error) { // Unreact removes an emoji reaction from an EventMessage. func (b *Bot) Unreact(e EventMessage, emoji string) (*http.Response, error) { - url := fmt.Sprintf("messages/%d/emoji_reactions/%s", e.ID, emoji) - req, err := b.constructRequest("DELETE", url, "") + requestURL := fmt.Sprintf("messages/%d/reactions", e.ID) + values := url.Values{} + values.Set("emoji_name", emoji) + req, err := b.constructRequest("DELETE", requestURL, values.Encode()) if err != nil { return nil, err } |