Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rtk-rnjn committed Jul 20, 2023
1 parent 5b0f931 commit 2ed0402
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cogs/defcon/defcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ async def defcon_set(self, ctx: Context, level: int) -> None:
channel_hidded = []
settings = DEFCON_SETTINGS[level]["SETTINGS"]
if settings.get("HIDE_CHANNELS"):
for channel in ctx.guild.text_channels:
if channel.overwrites_for(ctx.guild.default_role).read_messages:
for channel in ctx.guild.channels:
if channel.permissions_for(ctx.guild.default_role).read_messages:
try:
overwrite = channel.overwrites_for(ctx.guild.default_role)
overwrite.update(read_messages=False)
Expand All @@ -122,7 +122,7 @@ async def defcon_set(self, ctx: Context, level: int) -> None:
channel_locked = []
if settings.get("LOCK_VOICE_CHANNELS"):
for channel in ctx.guild.voice_channels:
if channel.overwrites_for(ctx.guild.default_role).connect:
if channel.permissions_for(ctx.guild.default_role).connect:
try:
overwrite = channel.overwrites_for(ctx.guild.default_role)
overwrite.update(connect=False)
Expand All @@ -138,7 +138,7 @@ async def defcon_set(self, ctx: Context, level: int) -> None:

if settings.get("LOCK_TEXT_CHANNELS"):
for channel in ctx.guild.text_channels:
if channel.overwrites_for(ctx.guild.default_role).send_messages:
if channel.permissions_for(ctx.guild.default_role).send_messages:
try:
overwrite = channel.overwrites_for(ctx.guild.default_role)
overwrite.update(send_messages=False)
Expand Down
2 changes: 1 addition & 1 deletion cogs/defcon/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async def on_member_join(self, member: discord.Member):

@Cog.listener("on_audit_log_entry_create")
async def audit_member_update(self, entry: discord.AuditLogEntry) -> None:
if entry.action != discord.AuditLogAction.member_update:
if entry.action != discord.AuditLogAction.member_role_update:
return

defcon = self.has_defcon_in(entry.guild)
Expand Down

0 comments on commit 2ed0402

Please sign in to comment.