2017-09-04 21:09:59 +00:00
|
|
|
package telegraph
|
|
|
|
|
|
|
|
import (
|
|
|
|
http "github.com/valyala/fasthttp"
|
|
|
|
)
|
|
|
|
|
2018-07-27 11:51:14 +00:00
|
|
|
// EditAccountInfo update information about a Telegraph account. Pass only the
|
|
|
|
// parameters that you want to edit. On success, returns an Account object with
|
|
|
|
// the default fields.
|
2019-07-24 08:03:29 +00:00
|
|
|
func (a *Account) EditAccountInfo(update Account) (*Account, error) {
|
2018-07-27 11:51:14 +00:00
|
|
|
args := http.AcquireArgs()
|
|
|
|
defer http.ReleaseArgs(args)
|
|
|
|
args.Add("access_token", a.AccessToken) // required
|
2017-09-04 21:09:59 +00:00
|
|
|
args.Add("short_name", update.ShortName)
|
|
|
|
args.Add("author_name", update.AuthorName)
|
|
|
|
args.Add("author_url", update.AuthorURL)
|
|
|
|
|
2019-07-24 08:03:29 +00:00
|
|
|
data, err := makeRequest("editAccountInfo", args)
|
2017-09-04 21:09:59 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
2019-07-24 08:03:29 +00:00
|
|
|
var result Account
|
|
|
|
err = parser.Unmarshal(data, &result)
|
|
|
|
return &result, err
|
2017-09-04 21:09:59 +00:00
|
|
|
}
|