diff --git a/main.go b/main.go index 4be3246..e04f165 100644 --- a/main.go +++ b/main.go @@ -12,6 +12,7 @@ import ( "github.com/velour/catbase/plugins/achievements" "github.com/velour/catbase/plugins/aoc" "github.com/velour/catbase/plugins/meme" + "github.com/velour/catbase/plugins/sms" "github.com/velour/catbase/plugins/twitter" "github.com/rs/zerolog" @@ -142,6 +143,7 @@ func main() { b.AddPlugin(aoc.New(b)) b.AddPlugin(meme.New(b)) b.AddPlugin(achievements.New(b)) + b.AddPlugin(sms.New(b)) // catches anything left, will always return true b.AddPlugin(fact.New(b)) diff --git a/plugins/sms/sms.go b/plugins/sms/sms.go new file mode 100644 index 0000000..1ada928 --- /dev/null +++ b/plugins/sms/sms.go @@ -0,0 +1,32 @@ +package sms + +import ( + "github.com/velour/catbase/bot" + "github.com/velour/catbase/bot/msg" + "github.com/velour/catbase/config" +) + +type SMSPlugin struct { + b bot.Bot + c *config.Config +} + +func New(b bot.Bot) *SMSPlugin { + sp := &SMSPlugin{ + b: b, + c: b.Config(), + } + b.Register(sp, bot.Message, sp.message) + b.Register(sp, bot.Help, sp.help) + return sp +} + +func (p *SMSPlugin) message(c bot.Connector, kind bot.Kind, message msg.Message, args ...interface{}) bool { + return false +} + +func (p *SMSPlugin) help(c bot.Connector, kind bot.Kind, message msg.Message, args ...interface{}) bool { + ch := message.Channel + p.b.Send(c, bot.Message, ch, "There is no help for you.") + return true +}