Merge pull request #23 from velour/ReminderPlugin

miscounted tokens in reminder plugin
This commit is contained in:
Chris Sexton 2016-05-10 21:17:07 -04:00
commit 662232e17b
1 changed files with 1 additions and 5 deletions

View File

@ -61,10 +61,6 @@ func New(bot bot.Bot) *ReminderPlugin {
func reminderer(p *ReminderPlugin) { func reminderer(p *ReminderPlugin) {
//welcome to the reminderererererererererer //welcome to the reminderererererererererer
for { for {
fmt.Println()
fmt.Println("waiting...")
fmt.Println()
<-p.timer.C <-p.timer.C
p.mutex.Lock() p.mutex.Lock()
@ -91,7 +87,7 @@ func (p *ReminderPlugin) Message(message msg.Message) bool {
parts := strings.Fields(message.Body) parts := strings.Fields(message.Body)
if len(parts) > 5 { if len(parts) >= 5 {
if strings.ToLower(parts[0]) == "remind" { if strings.ToLower(parts[0]) == "remind" {
who := parts[1] who := parts[1]
dur, err := time.ParseDuration(parts[3]) dur, err := time.ParseDuration(parts[3])