mirror of https://github.com/velour/catbase.git
fact: remove ownership check for delete
This commit is contained in:
parent
2ebc5fe18f
commit
59b92bdf3c
|
@ -439,18 +439,15 @@ func (p *Factoid) forgetLastFact(message msg.Message) bool {
|
||||||
p.Bot.SendMessage(message.Channel, "I refuse.")
|
p.Bot.SendMessage(message.Channel, "I refuse.")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if message.User.Admin || message.User.Name == p.LastFact.Owner {
|
|
||||||
err := p.LastFact.delete(p.db)
|
err := p.LastFact.delete(p.db)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("Error removing fact: ", p.LastFact, err)
|
log.Println("Error removing fact: ", p.LastFact, err)
|
||||||
}
|
|
||||||
fmt.Printf("Forgot #%d: %s %s %s\n", p.LastFact.id.Int64, p.LastFact.Fact,
|
|
||||||
p.LastFact.Verb, p.LastFact.Tidbit)
|
|
||||||
p.Bot.SendAction(message.Channel, "hits himself over the head with a skillet")
|
|
||||||
p.LastFact = nil
|
|
||||||
} else {
|
|
||||||
p.Bot.SendMessage(message.Channel, "You don't own that fact.")
|
|
||||||
}
|
}
|
||||||
|
fmt.Printf("Forgot #%d: %s %s %s\n", p.LastFact.id.Int64, p.LastFact.Fact,
|
||||||
|
p.LastFact.Verb, p.LastFact.Tidbit)
|
||||||
|
p.Bot.SendAction(message.Channel, "hits himself over the head with a skillet")
|
||||||
|
p.LastFact = nil
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue