1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-12-01 03:03:48 +00:00

API: Added SetNote for user accounts

This commit is contained in:
diamondburned 2020-07-11 14:27:03 -07:00
parent 91e494ba51
commit 712a061e8e

View file

@ -85,3 +85,18 @@ func (c *Client) UserConnections() ([]discord.Connection, error) {
var conn []discord.Connection var conn []discord.Connection
return conn, c.RequestJSON(&conn, "GET", EndpointMe+"/connections") return conn, c.RequestJSON(&conn, "GET", EndpointMe+"/connections")
} }
// SetNote sets a note for the user. This endpoint is undocumented and might
// only work for user accounts.
func (c *Client) SetNote(userID discord.Snowflake, note string) error {
var body = struct {
Note string `json:"note"`
}{
Note: note,
}
return c.FastRequest(
"PUT", EndpointMe+"/notes/"+userID.String(),
httputil.WithJSONBody(body),
)
}