Skip to content

Commit

Permalink
Account.unbanUser
Browse files Browse the repository at this point in the history
  • Loading branch information
Vorkytaka committed Apr 24, 2017
1 parent f58f7f9 commit f5ee541
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 16 additions & 0 deletions easyvk/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit f5ee541

Please sign in to comment.