Official dlist.top gateway client for Go.
go get github.com/dlist-top/client-go
To get your token please refer to the DList.top documentation.
package main
import (
"context"
"log"
dlist "github.com/dlist-top/client-go"
)
func main() {
c := dlist.NewClient("YOUR_API_TOKEN")
if err := c.Connect(context.Background()); err != nil {
panic(err)
}
c.OnVote(func(data dlist.VoteData) {
log.Printf("%v voted for our bot / server. Total: %v", data.UserID, data.TotalVotes)
})
<-make(chan bool)
}
Notice: You can have up to 2 connections (per token) at the same time.