mirror of https://github.com/velour/catbase.git
Enforced admin right on editing non-personal facts
This commit is contained in:
parent
fa83472c50
commit
63785e7102
|
@ -11,7 +11,7 @@
|
||||||
"QuoteChance": 0.10,
|
"QuoteChance": 0.10,
|
||||||
"QuoteTime": 30,
|
"QuoteTime": 30,
|
||||||
"LogLength": 50,
|
"LogLength": 50,
|
||||||
"Admins": ["flyngpngn"],
|
"Admins": ["flyngpngn1"],
|
||||||
|
|
||||||
"comment": "Follows is the old bot",
|
"comment": "Follows is the old bot",
|
||||||
|
|
||||||
|
|
|
@ -263,6 +263,10 @@ func (p *FactoidPlugin) changeFact(message bot.Message) bool {
|
||||||
} else {
|
} else {
|
||||||
result = make([]Factoid, 1)
|
result = make([]Factoid, 1)
|
||||||
iter.One(&result[0])
|
iter.One(&result[0])
|
||||||
|
if result[0].CreatedBy != message.User.Name && !message.User.Admin {
|
||||||
|
p.Bot.SendMessage(message.Channel, "That's not your fact to edit.")
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// make the changes
|
// make the changes
|
||||||
msg := fmt.Sprintf("Changing %d facts.", len(result))
|
msg := fmt.Sprintf("Changing %d facts.", len(result))
|
||||||
|
|
Loading…
Reference in New Issue