diff --git a/README.md b/README.md index 085ca38..8f4f1db 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ if err != nil { * [GetCounters](https://vk.com/dev/account.getCounters) * [GetInfo](https://vk.com/dev/account.getInfo) * [GetProfileInfo](https://vk.com/dev/account.getProfileInfo) + * [UnbanUser](https://vk.com/dev/account.unbanUser) * [Fave](https://vk.com/dev/fave) * [GetLinks](https://vk.com/dev/fave.getLinks) * [GetPhotos](https://vk.com/dev/fave.getPhotos) diff --git a/easyvk/account.go b/easyvk/account.go index 9899309..3fa701d 100644 --- a/easyvk/account.go +++ b/easyvk/account.go @@ -158,3 +158,19 @@ func (a *Account) BanUser(userID uint) (bool, error) { } return ok == 1, nil } + +// UnbanUser deletes user from the blacklist. +func (a *Account) UnbanUser(userID uint) (bool, error) { + params := map[string]string{ + "user_id": fmt.Sprint(userID), + } + resp, err := a.vk.Request("account.unbanUser", params) + if err != nil { + return false, err + } + ok, err := strconv.ParseUint(string(resp), 10, 8) + if err != nil { + return false, err + } + return ok == 1, nil +}