Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ All notable changes to KoalaBot will be documented in this file. A lot of these
administrators

## [Unreleased]
### ReactForRole
- Fixed issues with permissions for a text channel resetting when a react for role is created.

## [0.4.5] - 25-08-2021
### Other
Expand Down
7 changes: 4 additions & 3 deletions cogs/ReactForRole.py
Original file line number Diff line number Diff line change
Expand Up @@ -942,10 +942,11 @@ async def overwrite_channel_add_reaction_perms(self, guild: discord.Guild, chann
"""
# Get the @everyone role.
role: discord.Role = discord.utils.get(guild.roles, id=guild.id)
overwrite: discord.PermissionOverwrite = discord.PermissionOverwrite()
overwrite.update(add_reactions=False)
await channel.set_permissions(role, overwrite=overwrite)
perms = channel.overwrites_for(role)
Comment on lines 944 to +945
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All current roles should have the add_reactions perm set to false, not just everyone. (although this successfully doesn't screw with other perms, as mentioned in issue, gj!)

perms.update(add_reactions=False)
await channel.set_permissions(role, overwrite=perms)
bot_members = [member for member in guild.members if member.bot and member.id == self.bot.user.id]
overwrite: discord.PermissionOverwrite = discord.PermissionOverwrite()
overwrite.update(add_reactions=True)
for bot_member in bot_members:
await channel.set_permissions(bot_member, overwrite=overwrite)
Expand Down