Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 535 Bytes

README.md

File metadata and controls

34 lines (26 loc) · 535 Bytes

DaZeus go client library

To get started, see the following example:

package main

import (
    "os"

    "github.com/dazeus/dazeus-go"
)

func main() {
    connStr := "unix:/tmp/dazeus.sock"
    if len(os.Args) > 1 {
        connStr = os.Args[1]
    }

    dz, err := dazeus.Connect(connStr)
    if err != nil {
        panic(err)
    }

    _, err = dz.Subscribe(dazeus.EventPrivMsg, func(evt dazeus.Event) {
        evt.Reply(evt.Params[3], false)
    })
    if err != nil {
        panic(err)
    }

    dz.Listen()
}