diff --git a/threads/plugin.go b/threads/plugin.go new file mode 100644 index 0000000..c7a015a --- /dev/null +++ b/threads/plugin.go @@ -0,0 +1,19 @@ +package threads + +import ( + "github.com/abourget/slick" +) + +type Plugin struct { + bot *slick.Bot +} + +func init() { + slick.RegisterPlugin(&Plugin{}) +} + +func (p *Plugin) InitPlugin(bot *slick.Bot) { + p.bot = bot + + p.listenThreads() +} diff --git a/threads/threads.go b/threads/threads.go new file mode 100644 index 0000000..7574fd9 --- /dev/null +++ b/threads/threads.go @@ -0,0 +1,17 @@ +package threads + +import ( + "github.com/abourget/slick" +) + +func (p *Plugin) listenThreads() { + p.bot.Listen(&slick.Listener{ + MessageHandlerFunc: p.handleThreads, + }) +} + +func (p *Plugin) handleThreads(listen *slick.Listener, msg *slick.Message) { + if msg.ThreadTimestamp != "" { + msg.Reply("Can I haz no threadz plz!") + } +}