mirror of https://github.com/velour/catbase.git
Fixes #20: move plugins to their own pkgs
This commit is contained in:
parent
dc793a18c9
commit
762ec13780
23
main.go
23
main.go
|
@ -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()
|
||||||
}
|
}
|
||||||
|
|
|
@ -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"
|
|
@ -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"
|
|
@ -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"
|
||||||
|
|
|
@ -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"
|
|
@ -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"
|
|
@ -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"
|
|
@ -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.
|
|
@ -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"
|
|
@ -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"
|
|
@ -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"
|
Loading…
Reference in New Issue