mirror of https://github.com/velour/catbase.git
Merge pull request #23 from velour/ReminderPlugin
miscounted tokens in reminder plugin
This commit is contained in:
commit
662232e17b
|
@ -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])
|
||||||
|
|
Loading…
Reference in New Issue