Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tdakkota/joe-vk-adapter
VK adapter for the Joe bot library
https://github.com/tdakkota/joe-vk-adapter
bot joe vk vk-api
Last synced: 20 days ago
JSON representation
VK adapter for the Joe bot library
- Host: GitHub
- URL: https://github.com/tdakkota/joe-vk-adapter
- Owner: tdakkota
- License: bsd-3-clause
- Created: 2020-02-23T10:17:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-15T02:36:32.000Z (about 1 year ago)
- Last Synced: 2024-10-10T18:23:22.403Z (28 days ago)
- Topics: bot, joe, vk, vk-api
- Language: Go
- Size: 44.9 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Joe Bot - VK Adapter
Connecting joe with the VK chat application. https://github.com/go-joe/joe
---
This repository contains a module for the [Joe Bot library][joe]. Built using
[vksdk][vksdk].## Getting Started
This library is packaged using [Go modules][go-modules]. You can get it via:
```
go get github.com/tdakkota/joe-vk-adapter
```### Example usage
In order to connect your bot to VK you can simply pass it as module when
creating a new bot:```go
package mainimport (
"os""github.com/go-joe/joe"
"github.com/tdakkota/joe-vk-adapter"
)func main() {
b := joe.New("example-bot",
vk.Adapter(os.Getenv("BOT_TOKEN")),
…
)b.Respond("ping", func(msg joe.Message) error {
msg.Respond("pong")
return nil
})err := b.Run()
if err != nil {
b.Logger.Fatal(err.Error())
}
}
```This adapter will emit the following events to the robot brain:
- `joe.ReceiveMessageEvent`
- `ChatCreateEvent`
- `ChatTitleUpdateEvent`
- `ChatPhotoUpdateEvent`
- `ChatPinUpdateEvent`
- `UserEnteredChatEvent`
- `UserLeavedChatEvent`## License
[BSD-3-Clause](LICENSE)
[joe]: https://github.com/go-joe/joe
[vksdk]: https://github.com/SevereCloud/vksdk
[go-modules]: https://github.com/golang/go/wiki/Modules