mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-09-28 21:29:25 +00:00
discord: Fixed APIString method for emoji
This commit is contained in:
parent
ea9f2c2036
commit
cea3e47c27
|
@ -112,7 +112,8 @@ func (c *Client) ExecuteWebhook(
|
|||
param.Set("wait", "true")
|
||||
}
|
||||
|
||||
var URL = EndpointWebhooks + webhookID.String() + "?" + param.Encode()
|
||||
var URL = EndpointWebhooks + webhookID.String() + "/" + token +
|
||||
"?" + param.Encode()
|
||||
var msg *discord.Message
|
||||
|
||||
if len(data.Files) == 0 {
|
||||
|
|
|
@ -22,7 +22,7 @@ func (e Emoji) APIString() string {
|
|||
return e.Name // is unicode
|
||||
}
|
||||
|
||||
return e.ID.String() + ":" + e.Name
|
||||
return e.Name + ":" + e.ID.String()
|
||||
}
|
||||
|
||||
// String formats the string like how the client does.
|
||||
|
@ -31,7 +31,7 @@ func (e Emoji) String() string {
|
|||
return e.Name
|
||||
}
|
||||
|
||||
var parts = []string{
|
||||
var parts = [3]string{
|
||||
"", e.Name, e.ID.String(),
|
||||
}
|
||||
|
||||
|
@ -39,5 +39,5 @@ func (e Emoji) String() string {
|
|||
parts[0] = "a"
|
||||
}
|
||||
|
||||
return "<" + strings.Join(parts, ":") + ">"
|
||||
return "<" + strings.Join(parts[:], ":") + ">"
|
||||
}
|
||||
|
|
|
@ -336,6 +336,13 @@ func (s *State) Message(
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// Fill the GuildID, because Discord doesn't do it for us.
|
||||
c, err := s.Channel(channelID)
|
||||
if err == nil {
|
||||
// If it's 0, it's 0 anyway. We don't need a check here.
|
||||
m.GuildID = c.GuildID
|
||||
}
|
||||
|
||||
return m, s.Store.MessageSet(m)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue