#Discord undoing channel permission change

1 messages · Page 1 of 1 (latest)

wicked breach
#

Hey - I've got a bot that locks/unlocks a channel via denying Send Message

Here's a code sample for what I've been doing

import disnake

r = ctx.guild.get_role(role id here)

x = ctx.channel.overwrites

x_r = x.get(r)

x_r.update(send_messages=True)

x.update({r: x_r})

await ctx.channel.edit(reason="unlock channel", overwrites=x)

Expected: Send Messages is set to True, and people can send messages
Actual: (attached)

wicked breach
#

Discord undoing channel permission change

quasi canyon
#

not a fix but why are you censoring roles

wicked breach
#

¯_(ツ)_/¯

#

just looking for a reason why the permission is being reset after being set

wicked breach
#

bump

hot quiver
#

Looks like the audit log entry is displayed in a weird way, but the change should've gone through regardless

#

that being said, your snippet could be simplified to await ctx.channel.set_permissions(<role>, send_messages=True)