mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-25 06:27:03 +01:00
Dont read messages if the channel has no permissions
This commit is contained in:
parent
5c04dffb0d
commit
346a68c780
@ -103,9 +103,11 @@ class RedisQueue:
|
|||||||
return
|
return
|
||||||
await self.connection.delete([key])
|
await self.connection.delete([key])
|
||||||
messages = []
|
messages = []
|
||||||
async for message in channel.history(limit=50):
|
me = channel.guild.get_member(self.bot.user.id)
|
||||||
formatted = get_formatted_message(message)
|
if channel.permissions_for(me).read_messages:
|
||||||
messages.append(json.dumps(formatted, separators=(',', ':')))
|
async for message in channel.history(limit=50):
|
||||||
|
formatted = get_formatted_message(message)
|
||||||
|
messages.append(json.dumps(formatted, separators=(',', ':')))
|
||||||
await self.connection.sadd(key, [""] + messages)
|
await self.connection.sadd(key, [""] + messages)
|
||||||
|
|
||||||
async def push_message(self, message):
|
async def push_message(self, message):
|
||||||
|
Loading…
Reference in New Issue
Block a user