added simple event handler.

This commit is contained in:
5elenay
2021-08-20 21:53:16 +03:00
parent 27584269dd
commit f91c9f9554
2 changed files with 29 additions and 1 deletions

View File

@@ -13,4 +13,12 @@ const (
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
}