From 7e20b957cba748344d90555c91a369b79db94eab Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Wed, 2 Mar 2016 13:20:35 +0100 Subject: [PATCH 1/2] Gogs module. --- modules/gogs.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 modules/gogs.go diff --git a/modules/gogs.go b/modules/gogs.go new file mode 100644 index 0000000..965cef5 --- /dev/null +++ b/modules/gogs.go @@ -0,0 +1,26 @@ +// vi:ts=4:sts=4:sw=4:noet:tw=72 + +package modules + +import ( + "log" + "strings" + + "github.com/sorcix/irc" +) + +func init() { + MsgHandlers["fuzzytime"] = gogsHandleMessage + log.Println("Initializing gogs module") +} + +func gogsHandleMessage(m *irc.Message) { + tok := strings.Split(m.Trailing, " ") + if len(tok) < 1 { + return + } + switch tok[0] { + case "!gogs": + default: + } +} From 13379b29ea4e5118fc69672aae611699e82530bd Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Wed, 2 Mar 2016 15:07:46 +0100 Subject: [PATCH 2/2] gogs ... --- modules/gogs.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/gogs.go b/modules/gogs.go index 965cef5..8d45700 100644 --- a/modules/gogs.go +++ b/modules/gogs.go @@ -1,19 +1,31 @@ // vi:ts=4:sts=4:sw=4:noet:tw=72 +// this module will provide an interface to gogs + package modules import ( "log" "strings" + "time" "github.com/sorcix/irc" ) +var ( + gogsAPIKey string +) + func init() { MsgHandlers["fuzzytime"] = gogsHandleMessage log.Println("Initializing gogs module") } +func gogsConfig() { + time.Sleep(5 * time.Second) + gogsAPIKey = ModParams["gogs-api-key"] +} + func gogsHandleMessage(m *irc.Message) { tok := strings.Split(m.Trailing, " ") if len(tok) < 1 {