mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-10-31 20:14:21 +00:00
API: Add get Note endpoint
This commit is contained in:
parent
d69d6750dc
commit
f3f075b27f
10
api/user.go
10
api/user.go
|
@ -86,6 +86,16 @@ func (c *Client) UserConnections() ([]discord.Connection, error) {
|
||||||
return conn, c.RequestJSON(&conn, "GET", EndpointMe+"/connections")
|
return conn, c.RequestJSON(&conn, "GET", EndpointMe+"/connections")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note gets the note for the given user. This endpoint is undocumented and
|
||||||
|
// might only work for user accounts.
|
||||||
|
func (c *Client) Note(userID discord.UserID) (string, error) {
|
||||||
|
var body struct {
|
||||||
|
Note string `json:"note"`
|
||||||
|
}
|
||||||
|
|
||||||
|
return body.Note, c.RequestJSON(&body, "GET", EndpointMe+"/notes/"+userID.String())
|
||||||
|
}
|
||||||
|
|
||||||
// SetNote sets a note for the user. This endpoint is undocumented and might
|
// SetNote sets a note for the user. This endpoint is undocumented and might
|
||||||
// only work for user accounts.
|
// only work for user accounts.
|
||||||
func (c *Client) SetNote(userID discord.UserID, note string) error {
|
func (c *Client) SetNote(userID discord.UserID, note string) error {
|
||||||
|
|
Loading…
Reference in a new issue