Skip to content

jonvaldes/hipbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Very simple Hipchat bot library.

Docs: http://godoc.org/github.com/jonvaldes/hipbot

Example:

package main

import (
    "github.com/jonvaldes/hipbot"
)

func main() {

    bot, err := hipbot.NewBot("MYUSERID@chat.hipchat.com", "NICKNAME", "PASS")
    if err != nil {
        panic(err)
    }
    bot.JoinRoom("ROOMNAME@conf.hipchat.com")

    mux := hipbot.NewMux()

    mux.AddHandler(`^echo *`, func(b *hipbot.Bot, m hipbot.Msg) {
        b.Answer(m, "Echo "+m.Text)
    })

    bot.KeepAlive() // So Hipchat doesn't kick us out after 3 minutes

    if err := bot.Listen(mux); err != nil {
        panic(err)
    }
}

About

A simple lib to create hipchat chatbots in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages