Files

38 lines
522 B
Go
Raw Permalink Normal View History

2016-03-02 13:20:35 +01:00
// vi:ts=4:sts=4:sw=4:noet:tw=72
2016-03-02 15:07:46 +01:00
// this module will provide an interface to gogs
2016-03-02 13:20:35 +01:00
package modules
import (
"strings"
2016-03-02 15:07:46 +01:00
"time"
2016-03-02 13:20:35 +01:00
"github.com/sorcix/irc"
)
2016-03-02 15:07:46 +01:00
var (
gogsAPIKey string
)
2016-03-02 13:20:35 +01:00
func init() {
2016-03-19 23:49:41 +01:00
MsgFuncs["gogs"] = gogsHandleMessage
RunFuncs["gogs"] = gogsConfig
2016-03-02 13:20:35 +01:00
}
2016-03-02 15:07:46 +01:00
func gogsConfig() {
time.Sleep(5 * time.Second)
gogsAPIKey = ModParams["gogs-api-key"]
}
2016-03-02 13:20:35 +01:00
func gogsHandleMessage(m *irc.Message) {
tok := strings.Split(m.Trailing, " ")
if len(tok) < 1 {
return
}
switch tok[0] {
case "!gogs":
default:
}
}