Browse Source

Fix bug where lore wasn't being removed from proper indecies

develop
Matthew Faltys 6 years ago
parent
commit
d1b1bea366
  1. 10
      lorebot/botfunc.go

10
lorebot/botfunc.go

@ -86,10 +86,16 @@ func loreRmString(nick, rmString, rmType string, redisClient *redis.Client) erro
}
// add lore to index
redisClient.SAdd(fmt.Sprintf("index:%s:removed", rmType))
redisClient.SAdd(fmt.Sprintf("index:%s:removed", rmType), rmString).Err()
if err != nil {
glogger.Error.Printf("error removing lore from 'index:%s:removed'\n", rmType)
}
// remove lore form added index
redisClient.SRem(fmt.Sprintf("index:%s:added", rmType))
redisClient.SRem(fmt.Sprintf("index:%s:added", rmType), rmString).Err()
if err != nil {
glogger.Error.Printf("error removing lore from 'index:%s:added'\n", rmType)
}
return nil
}

Loading…
Cancel
Save