From 7eff961a90b467bd22a71e78f7a9b5da518c6c37 Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Thu, 28 Jan 2016 23:02:45 -0500 Subject: [PATCH 1/2] add gentoo reaction --- bot.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bot.go b/bot.go index 13d8591..3359b7a 100644 --- a/bot.go +++ b/bot.go @@ -109,11 +109,24 @@ func (bot *Bot) ConstructReply(message map[string]interface{}, subtype interface return Mention(message["user"].(string), message["channel"].(string), "hi ", "") } else if text == "slacksoc: pm me" { return bot.DirectMessage(message["user"].(string), "hi") + } else if text == "have you tried installing Gentoo?" { + go bot.React(message, "funroll-loops") + return nil } return nil } } +func (bot *Bot) React(message map[string]interface{}, reaction string) { + channel := message["channel"].(string) + timestamp := message["ts"].(string) + parameters := url.Values{} + parameters.Set("channel", channel) + parameters.Set("timestamp", timestamp) + parameters.Set("name", reaction) + bot.Call("reactions.add", parameters) +} + func (bot *Bot) SetRealNameFields(message map[string]interface{}) interface{} { channel := message["channel"].(string) if channel != bot.Channels["general"] { From 6769c0fb5412f6d35f18cabdcce54a65118a1293 Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Thu, 28 Jan 2016 23:08:00 -0500 Subject: [PATCH 2/2] bump to 0.0.5 --- bot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.go b/bot.go index 3359b7a..564f097 100644 --- a/bot.go +++ b/bot.go @@ -16,7 +16,7 @@ const ( TOKEN_VAR = "SLACKSOC_TOKEN" NO_TOKEN_ERROR = "You must have the SLACKSOC_TOKEN variable to run the" + " slacksoc bot" - VERSION = "0.0.4" + VERSION = "0.0.5" ) type Bot struct {