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
|
key = "june_wordcount_%s" % word
|
||||||
self.log.debug("Fetching redis key %r", key)
|
self.log.debug("Fetching redis key %r", key)
|
||||||
stored = await self.bot.redis.get(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
|
stored += count
|
||||||
await self.bot.redis.set(key, count)
|
await self.bot.redis.set(key, count)
|
||||||
self.log.debug("June has now said %r %d times", word, stored)
|
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_*"):
|
for key in await self.bot.redis.keys("june_wordcount_*"):
|
||||||
key = key.decode()
|
key = key.decode()
|
||||||
value = await self.bot.redis.get(key)
|
value = await self.bot.redis.get(key)
|
||||||
value = int(value)
|
value = int(value.decode())
|
||||||
if raw:
|
if raw:
|
||||||
lines.append(f"* {key}: {value}")
|
lines.append(f"* {key}: {value}")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue