From d1b1bea36652b2e4852e6ed5a0f606cfb6eba723 Mon Sep 17 00:00:00 2001 From: Matthew Faltys Date: Thu, 28 Mar 2019 16:09:15 -0500 Subject: [PATCH] Fix bug where lore wasn't being removed from proper indecies --- lorebot/botfunc.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lorebot/botfunc.go b/lorebot/botfunc.go index 82e249e..5ca833a 100644 --- a/lorebot/botfunc.go +++ b/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 }