fix issue with AI unable to load from local storage if redis not enabled

This commit is contained in:
Madpeter 2025-02-01 23:46:40 +00:00
parent 969d98adfe
commit 4aedf5823e

View file

@ -302,7 +302,7 @@ namespace SecondBotEvents.Services
// are we using redis?
if (RedisLive() == false)
{
return null;
return new List<KeyValuePair<string, string>>();
}
// is redis enabled for this message type?
if ((myConfig.GetRedisImchat() == true) && (avatarchat == true))
@ -321,7 +321,7 @@ namespace SecondBotEvents.Services
return ReadChatFromRedis(store);
}
// Redis is not enabled for this message type, use local storage
return null;
return new List<KeyValuePair<string, string>>();
}
@ -399,6 +399,10 @@ namespace SecondBotEvents.Services
return history;
}
}
else
{
history = chatHistoryAI[store];
}
return history;
}
return history;