fix wordcount
This commit is contained in:
parent
9be4f0d55a
commit
cace903669
1 changed files with 2 additions and 2 deletions
|
@ -67,7 +67,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 = int(stored) if stored else 0
|
||||
stored = int(stored.decode()) 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)
|
||||
|
@ -85,7 +85,7 @@ class MemeteraCounter(niobot.Module):
|
|||
for key in await self.bot.redis.keys("june_wordcount_*"):
|
||||
key = key.decode()
|
||||
value = await self.bot.redis.get(key)
|
||||
value = int(value)
|
||||
value = int(value.decode())
|
||||
if raw:
|
||||
lines.append(f"* {key}: {value}")
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue