Fixes #20: move plugins to their own pkgs

This commit is contained in:
Chris Sexton 2016-03-24 13:32:40 -04:00
parent dc793a18c9
commit 762ec13780
11 changed files with 25 additions and 18 deletions

23
main.go
View File

@ -10,7 +10,14 @@ import (
"github.com/velour/catbase/config" "github.com/velour/catbase/config"
"github.com/velour/catbase/irc" "github.com/velour/catbase/irc"
"github.com/velour/catbase/plugins" "github.com/velour/catbase/plugins"
"github.com/velour/catbase/plugins/admin"
"github.com/velour/catbase/plugins/beers"
"github.com/velour/catbase/plugins/counter" "github.com/velour/catbase/plugins/counter"
"github.com/velour/catbase/plugins/dice"
"github.com/velour/catbase/plugins/downtime"
"github.com/velour/catbase/plugins/fact"
"github.com/velour/catbase/plugins/talker"
"github.com/velour/catbase/plugins/your"
"github.com/velour/catbase/slack" "github.com/velour/catbase/slack"
) )
@ -34,18 +41,18 @@ func main() {
b := bot.NewBot(c, client) b := bot.NewBot(c, client)
// b.AddHandler(plugins.NewTestPlugin(b)) // b.AddHandler(plugins.NewTestPlugin(b))
b.AddHandler("admin", plugins.NewAdminPlugin(b)) b.AddHandler("admin", admin.NewAdminPlugin(b))
// b.AddHandler("first", plugins.NewFirstPlugin(b)) // b.AddHandler("first", plugins.NewFirstPlugin(b))
b.AddHandler("downtime", plugins.NewDowntimePlugin(b)) b.AddHandler("downtime", downtime.NewDowntimePlugin(b))
b.AddHandler("talker", plugins.NewTalkerPlugin(b)) b.AddHandler("talker", talker.NewTalkerPlugin(b))
b.AddHandler("dice", plugins.NewDicePlugin(b)) b.AddHandler("dice", dice.NewDicePlugin(b))
b.AddHandler("beers", plugins.NewBeersPlugin(b)) b.AddHandler("beers", beers.NewBeersPlugin(b))
b.AddHandler("counter", counter.NewCounterPlugin(b)) b.AddHandler("counter", counter.NewCounterPlugin(b))
b.AddHandler("remember", plugins.NewRememberPlugin(b)) b.AddHandler("remember", fact.NewRememberPlugin(b))
b.AddHandler("skeleton", plugins.NewSkeletonPlugin(b)) b.AddHandler("skeleton", plugins.NewSkeletonPlugin(b))
b.AddHandler("your", plugins.NewYourPlugin(b)) b.AddHandler("your", your.NewYourPlugin(b))
// catches anything left, will always return true // catches anything left, will always return true
b.AddHandler("factoid", plugins.NewFactoidPlugin(b)) b.AddHandler("factoid", fact.NewFactoidPlugin(b))
client.Serve() client.Serve()
} }

View File

@ -1,6 +1,6 @@
// © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors. // © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors.
package plugins package admin
import ( import (
"database/sql" "database/sql"

View File

@ -1,6 +1,6 @@
// © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors. // © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors.
package plugins package beers
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,6 +1,6 @@
// © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors. // © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors.
package plugins package dice
import "github.com/velour/catbase/bot" import "github.com/velour/catbase/bot"

View File

@ -1,6 +1,6 @@
// © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors. // © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors.
package plugins package downtime
import ( import (
"database/sql" "database/sql"

View File

@ -1,6 +1,6 @@
// © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors. // © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors.
package plugins package fact
import ( import (
"database/sql" "database/sql"

View File

@ -1,6 +1,6 @@
// © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors. // © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors.
package plugins package fact
import ( import (
"fmt" "fmt"

View File

@ -1,6 +1,6 @@
// © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors. // © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors.
package plugins package fact
// I hate this, but I'm creating strings of the templates to avoid having to // I hate this, but I'm creating strings of the templates to avoid having to
// track where templates reside. // track where templates reside.

View File

@ -1,6 +1,6 @@
// © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors. // © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors.
package plugins package first
import ( import (
"database/sql" "database/sql"

View File

@ -1,6 +1,6 @@
// © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors. // © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors.
package plugins package talker
import ( import (
"fmt" "fmt"

View File

@ -1,6 +1,6 @@
// © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors. // © 2013 the CatBase Authors under the WTFPL. See AUTHORS for the list of authors.
package plugins package your
import ( import (
"log" "log"