Skip to content

Commit

Permalink
inb4 whitespace saga
Browse files Browse the repository at this point in the history
  • Loading branch information
eip618 committed Aug 2, 2023
1 parent 6640ec9 commit 9813ff6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cogs/extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ async def uptime(self, ctx: KurisuContext):
@commands.command(hidden=True, aliases=['copyrole', 'crp'])
async def copyroleperms(self, ctx: GuildContext, role: discord.Role, src_channel: discord.TextChannel | discord.VoiceChannel, des_channels: commands.Greedy[discord.TextChannel | discord.VoiceChannel]):
"""Copy role overwrites from a channel to channels"""
if any(type(c) != type(src_channel) for c in des_channels):
return await ctx.send("Voice channels and text channel permissions are incompatible!")
channel_type = type(src_channel)
if any(not isinstance(c, channel_type)) for c in des_channels):
return await ctx.send("Voice channels and text channel permissions are incompatible!")
role_overwrites = src_channel.overwrites_for(role)
for c in des_channels:
await c.set_permissions(role, overwrite=role_overwrites)
Expand Down

0 comments on commit 9813ff6

Please sign in to comment.