1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-01 04:24:19 +00:00

API: Add get Note endpoint

This commit is contained in:
diamondburned 2020-12-26 16:13:10 -08:00
parent d69d6750dc
commit f3f075b27f

View file

@ -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 {