From 712a061e8e26130363ca5f2c7d904cef67c99bfa Mon Sep 17 00:00:00 2001 From: diamondburned Date: Sat, 11 Jul 2020 14:27:03 -0700 Subject: [PATCH] API: Added SetNote for user accounts --- api/user.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/api/user.go b/api/user.go index 848e7aa..5f05248 100644 --- a/api/user.go +++ b/api/user.go @@ -85,3 +85,18 @@ func (c *Client) UserConnections() ([]discord.Connection, error) { var conn []discord.Connection 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), + ) +}