25 lines
421 B
Go
25 lines
421 B
Go
package revoltgo
|
|
|
|
import (
|
|
"github.com/sacOO7/gowebsocket"
|
|
)
|
|
|
|
const (
|
|
WS_URL = "wss://ws.revolt.chat"
|
|
API_URL = "https://api.revolt.chat"
|
|
)
|
|
|
|
// Client struct
|
|
type Client struct {
|
|
Token string
|
|
Socket gowebsocket.Socket
|
|
|
|
// Functions
|
|
OnReadyFunction func()
|
|
}
|
|
|
|
// On Ready event will run when websocket connection is started and bot is ready to work.
|
|
func (c *Client) OnReady(fn func()) {
|
|
c.OnReadyFunction = fn
|
|
}
|