<commit_before># Go VK bot package

This is simple VK.com bot API.

It can:

* Reply to messages (private and chat)  
* Send greetings message when invited to chat
* Add and remove mutual friends
* Send notifies to admin

Installatioin:

`go get github.com/nikepan/govkbot`

For work you need get VK access token with rights: messages,friends,offline.

You can get it by this url in browser:

https://oauth.vk.com/authorize?client_id={{app_id}}&scope=offline,group,messages,friends&display=page&response_type=token&redirect_uri=https://oauth.vk.com/blank.html

app_id you can get on page https://vk.com/editapp?act=create (standalone app)

# Quickstart

```Go
package main
import "github.com/nikepan/govkbot"
import "log"

func helpHandler(m *govkbot.Message) (reply string) {
  return "help received"
}

func errorHandler(m *govkbot.Message, err error) {
  log.Fatal(err.Error())
}

//govkbot.HandleMessage("/", anyHandler)
//govkbot.HandleMessage("/me", meHandler)
govkbot.HandleMessage("/help", helpHandler)

//govkbot.HandleAction("chat_invite_user", inviteHandler)
//govkbot.HandleAction("chat_kick_user", kickHandler)
//govkbot.HandleAction("friend_add", addFriendHandler)
//govkbot.HandleAction("friend_delete", deleteFriendHandler)

govkbot.HandleError(errorHandler)

bovkbot.SetDebug(true)

govkbot.Listen(config.VKToken, "", "")
```<commit_msg>readme example fix<commit_after># Go VK bot package

This is simple VK.com bot API.

It can:

* Reply to messages (private and chat)  
* Send greetings message when invited to chat
* Add and remove mutual friends
* Send notifies to admin

Installatioin:

`go get github.com/nikepan/govkbot`

For work you need get VK access token with rights: messages,friends,offline.

You can get it by this url in browser:

https://oauth.vk.com/authorize?client_id={{app_id}}&scope=offline,group,messages,friends&display=page&response_type=token&redirect_uri=https://oauth.vk.com/blank.html

app_id you can get on page https://vk.com/editapp?act=create (standalone app)

# Quickstart

```Go
package main
import "github.com/nikepan/govkbot"
import "log"

var VKAdminID = "3759927"
var VKToken = "<PASSWORD>"

func helpHandler(m *govkbot.Message) (reply string) {
  return "help received"
}

func errorHandler(m *govkbot.Message, err error) {
  log.Fatal(err.Error())
}

//govkbot.HandleMessage("/", anyHandler)
//govkbot.HandleMessage("/me", meHandler)
govkbot.HandleMessage("/help", helpHandler)

//govkbot.HandleAction("chat_invite_user", inviteHandler)
//govkbot.HandleAction("chat_kick_user", kickHandler)
//govkbot.HandleAction("friend_add", addFriendHandler)
//govkbot.HandleAction("friend_delete", deleteFriendHandler)

govkbot.HandleError(errorHandler)

bovkbot.SetDebug(true)

govkbot.Listen(VKToken, "", "", VKAdminID)
```
{'fraction_non_alphanumeric': 0.12775171418260556, 'fraction_numerical': 0.0025261638397690365, 'mean_word_length': 5.827586206896552, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5946372', 'n_tokens_mistral': 968, 'n_tokens_neox': 941, 'n_words': 225}