Revert "Remove messages table", Accidentally committed in dev code

This reverts commit 6d6b390431.
This commit is contained in:
Jeremy Zhang
2018-07-16 23:43:41 +00:00
parent 6d6b390431
commit 89b12d06ab
10 changed files with 152 additions and 73 deletions

View File

@ -1,4 +1,4 @@
from titanembeds.utils import get_formatted_message, get_formatted_user
from titanembeds.utils import get_formatted_message
from urllib.parse import urlparse
import asyncio_redis
import json
@ -107,13 +107,4 @@ class RedisQueue:
async def update_message(self, message):
await self.delete_message(message)
await self.push_message(message)
async def on_get_guild_member(self, key, params):
member = self.bot.get_guild(int(params["guild_id"])).get_member(int(params["user_id"]))
if not member:
await self.connection.set(key, "")
return
await self.connection.delete([key])
user = get_formatted_user(member)
await self.connection.set(key, json.dumps(user))
await self.push_message(message)