Read message history being disabled might interfere with reading channel messages

This commit is contained in:
Jeremy Zhang 2017-11-25 02:50:14 +00:00
parent dcab78e0cc
commit 2493cd80bc

View File

@ -123,7 +123,8 @@ class Titan(discord.Client):
for ban in banned: for ban in banned:
await self.database.update_guild_member(ban, False, True) await self.database.update_guild_member(ban, False, True)
for channel in guild.channels: for channel in guild.channels:
if not channel.permissions_for(channel.server.me).read_messages: chanperm = channel.permissions_for(channel.server.me)
if not chanperm.read_messages or not chanperm.read_message_history:
continue continue
async for message in self.logs_from(channel, limit=50, reverse=True): async for message in self.logs_from(channel, limit=50, reverse=True):
await self.database.push_message(message) await self.database.push_message(message)