mirror of https://github.com/velour/catbase.git
reminder: fix bad subtraction
This commit is contained in:
parent
83815324bf
commit
2a00308695
|
@ -91,8 +91,12 @@ func (p *ReminderPlugin) message(kind bot.Kind, message msg.Message, args ...int
|
||||||
t, err := p.when.Parse(message.Body, time.Now())
|
t, err := p.when.Parse(message.Body, time.Now())
|
||||||
// Allowing err to fallthrough for other parsing
|
// Allowing err to fallthrough for other parsing
|
||||||
if t != nil && err == nil {
|
if t != nil && err == nil {
|
||||||
t2 := time.Now().Sub(t.Time).String()
|
t2 := t.Time.Sub(time.Now()).String()
|
||||||
message.Body = string(message.Body[0:t.Index]) + t2 + string(message.Body[t.Index+len(t.Text):])
|
message.Body = string(message.Body[0:t.Index]) + t2 + string(message.Body[t.Index+len(t.Text):])
|
||||||
|
log.Debug().
|
||||||
|
Str("body", message.Body).
|
||||||
|
Str("text", t.Text).
|
||||||
|
Msg("Got time request")
|
||||||
}
|
}
|
||||||
parts := strings.Fields(message.Body)
|
parts := strings.Fields(message.Body)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue