Skip to content

Commit

Permalink
Fix AttributeError: 'Thread' object has no attribute 'set_permissions'
Browse files Browse the repository at this point in the history
Signed-off-by: Draper <[email protected]>
  • Loading branch information
Drapersniper committed Feb 7, 2023
1 parent 68962b1 commit d38c1e0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plcontroller/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ async def disable_slow_mode(self) -> None:
await self.channel.edit(slowmode_delay=0)

async def set_permissions(self) -> bool:
if isinstance(self.channel, discord.Thread):
# Threads don't have permissions, so we can't set them
# We don't want o edit the permissions of the parent channel
# as that would affect the entire channel and all its threads.
return
permissions = self.channel.permissions_for(self.channel.guild.me)
if permissions.manage_roles or self.guild.me.guild_permissions.manage_roles:
default_role_permissions = self.channel.permissions_for(self.channel.guild.default_role)
Expand Down

0 comments on commit d38c1e0

Please sign in to comment.