Reimplement remove message table

This commit is contained in:
Jeremy Zhang
2018-07-16 23:47:25 +00:00
parent 89b12d06ab
commit 56ba9bc127
7 changed files with 41 additions and 139 deletions

View File

@ -81,7 +81,6 @@ class Titan(discord.AutoShardedClient):
async def on_message(self, message):
await self.socketio.on_message(message)
await self.database.push_message(message)
await self.redisqueue.push_message(message)
msg_arr = message.content.split() # split the message
@ -96,13 +95,11 @@ class Titan(discord.AutoShardedClient):
await getattr(self.command, msg_cmd)(message) #actually run cmd, passing in msg obj
async def on_message_edit(self, message_before, message_after):
await self.database.update_message(message_after)
await self.redisqueue.update_message(message_after)
await self.socketio.on_message_update(message_after)
async def on_message_delete(self, message):
self.delete_list.append(message.id)
await self.database.delete_message(message)
await self.redisqueue.delete_message(message)
await self.socketio.on_message_delete(message)
@ -125,11 +122,6 @@ class Titan(discord.AutoShardedClient):
chanperm = channel.permissions_for(channel.guild.me)
if not chanperm.read_messages or not chanperm.read_message_history or not isinstance(channel, discord.channel.TextChannel):
continue
async for message in channel.history(limit=50, reverse=True):
try:
await self.database.push_message(message)
except:
pass
await self.postStats()
async def on_guild_remove(self, guild):