From 74c666fe75a45d62f549f06704c230a44916cc3d Mon Sep 17 00:00:00 2001 From: Steve McCoy Date: Sat, 6 Aug 2016 21:22:03 -0400 Subject: [PATCH] Handle "remind me" --- plugins/reminder/reminder.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/reminder/reminder.go b/plugins/reminder/reminder.go index 5dc86c7..820b443 100644 --- a/plugins/reminder/reminder.go +++ b/plugins/reminder/reminder.go @@ -74,6 +74,10 @@ func reminderer(p *ReminderPlugin) { } p.mutex.Unlock() + + if reminder.from == reminder.who { + reminder.from = "you" + } message := fmt.Sprintf("Hey %s, %s wanted you to be reminded: %s", reminder.who, reminder.from, reminder.what) p.Bot.SendMessage(reminder.channel, message) @@ -90,6 +94,9 @@ func (p *ReminderPlugin) Message(message msg.Message) bool { if len(parts) >= 5 { if strings.ToLower(parts[0]) == "remind" { who := parts[1] + if who == "me" { + who = from + } dur, err := time.ParseDuration(parts[3]) if err != nil { p.Bot.SendMessage(channel, "Easy cowboy, not sure I can parse that duration.")