fix redis wanting bytes
This commit is contained in:
parent
d9cc1e2651
commit
ff81adde75
1 changed files with 2 additions and 1 deletions
|
@ -58,7 +58,7 @@ class MemeteraCounter(niobot.Module):
|
|||
key = "june_wordcount_%s" % word
|
||||
self.log.debug("Fetching redis key %r", key)
|
||||
stored = await self.bot.redis.get(key)
|
||||
stored = stored or 0
|
||||
stored = int(stored) if stored else 0
|
||||
stored += count
|
||||
await self.bot.redis.set(key, count)
|
||||
self.log.debug("June has now said %r %d times", word, stored)
|
||||
|
@ -76,6 +76,7 @@ class MemeteraCounter(niobot.Module):
|
|||
lines.append("```md")
|
||||
for key in await self.bot.redis.keys("june_wordcount_*"):
|
||||
value = await self.bot.redis.get(key)
|
||||
value = int(value)
|
||||
if raw:
|
||||
lines.append(f"* {key}: {value}")
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue