From f3f075b27f446c14c4b114b59212891fd2f9f59a Mon Sep 17 00:00:00 2001 From: diamondburned Date: Sat, 26 Dec 2020 16:13:10 -0800 Subject: [PATCH] API: Add get Note endpoint --- api/user.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/user.go b/api/user.go index 762bba0..ef94b17 100644 --- a/api/user.go +++ b/api/user.go @@ -86,6 +86,16 @@ func (c *Client) UserConnections() ([]discord.Connection, error) { 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 // only work for user accounts. func (c *Client) SetNote(userID discord.UserID, note string) error {