mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-01-05 19:57:02 +00:00
Discord: Revert "APIEmoji shouldn't be path-encoded"
This reverts commit dae2a0ffc1
.
This commit is contained in:
parent
dae2a0ffc1
commit
78a76ecb42
|
@ -21,7 +21,7 @@ func (c *Client) React(
|
|||
"PUT",
|
||||
EndpointChannels+channelID.String()+
|
||||
"/messages/"+messageID.String()+
|
||||
"/reactions/"+emoji.String()+"/@me",
|
||||
"/reactions/"+emoji.PathString()+"/@me",
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ func (c *Client) reactionsRange(
|
|||
return users, c.RequestJSON(
|
||||
&users, "GET", EndpointChannels+channelID.String()+
|
||||
"/messages/"+messageID.String()+
|
||||
"/reactions/"+emoji.String(),
|
||||
"/reactions/"+emoji.PathString(),
|
||||
httputil.WithSchema(c, param),
|
||||
)
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ func (c *Client) DeleteUserReaction(
|
|||
"DELETE",
|
||||
EndpointChannels+channelID.String()+
|
||||
"/messages/"+messageID.String()+
|
||||
"/reactions/"+emoji.String()+"/"+user,
|
||||
"/reactions/"+emoji.PathString()+"/"+user,
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -216,7 +216,7 @@ func (c *Client) DeleteReactions(
|
|||
"DELETE",
|
||||
EndpointChannels+channelID.String()+
|
||||
"/messages/"+messageID.String()+
|
||||
"/reactions/"+emoji.String(),
|
||||
"/reactions/"+emoji.PathString(),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package discord
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -81,9 +82,9 @@ func NewCustomEmoji(id EmojiID, name string) APIEmoji {
|
|||
return APIEmoji(name + ":" + id.String())
|
||||
}
|
||||
|
||||
// String converts the APIEmoji to a string.
|
||||
func (e APIEmoji) String() string {
|
||||
return string(e)
|
||||
// PathString returns the APIEmoji as a path-encoded string.
|
||||
func (e APIEmoji) PathString() string {
|
||||
return url.PathEscape(string(e))
|
||||
}
|
||||
|
||||
// APIString returns a string usable for sending over to the API.
|
||||
|
|
Loading…
Reference in a new issue