mirror of https://github.com/velour/catbase.git
Small improvement to the situation with no counters
This commit is contained in:
parent
5fc0d31db5
commit
dbb2e97ba3
|
@ -55,6 +55,12 @@ func (p *CounterPlugin) Message(message bot.Message) bool {
|
||||||
// pull all of the items associated with "subject"
|
// pull all of the items associated with "subject"
|
||||||
var items []Item
|
var items []Item
|
||||||
p.Coll.Find(bson.M{"nick": subject}).All(&items)
|
p.Coll.Find(bson.M{"nick": subject}).All(&items)
|
||||||
|
|
||||||
|
if len(items) == 0 {
|
||||||
|
p.Bot.SendMessage(channel, fmt.Sprintf("%s has no counters.", subject))
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
resp := fmt.Sprintf("%s has the following counters:", subject)
|
resp := fmt.Sprintf("%s has the following counters:", subject)
|
||||||
for i, item := range items {
|
for i, item := range items {
|
||||||
if i != 0 {
|
if i != 0 {
|
||||||
|
|
Loading…
Reference in New Issue