From 7179f550b48b6f7c9de4fe87a0a0020c9bda8d36 Mon Sep 17 00:00:00 2001 From: Rivalo Date: Thu, 7 Jan 2016 19:44:50 +0100 Subject: [PATCH] Added UserVerify function --- restapi.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/restapi.go b/restapi.go index 31e4ef0..0d64d1c 100644 --- a/restapi.go +++ b/restapi.go @@ -242,6 +242,21 @@ func (s *Session) UserGuilds(userID string) (st []Guild, err error) { return } +// UserVerify updates account information to make vertification possible. +// Account still needs to be activated using the send email +func (s *Session) UserVerify(username, email, password string) (st User, err error) { + + data := struct { + Username string `json:"username"` + Email string `json:"email"` + Password string `json:"password"` + }{username, email, password} + + body, err := s.Request("PATCH", USER("@me"), data) + err = json.Unmarshal(body, &st) + return +} + // ------------------------------------------------------------------------------------------------ // Functions specific to Discord Guilds // ------------------------------------------------------------------------------------------------