#Thread Permissions not working when I set the permission overwrites

1 messages · Page 1 of 1 (latest)

torpid phoenix
#
thread: interactions.ThreadChannel = await modmail_channel.create_thread(
        name=f"new-issue", 
        invitable=False, 
        thread_type= interactions.ChannelType.GUILD_PRIVATE_THREAD,
        auto_archive_duration=interactions.AutoArchiveDuration.ONE_WEEK,
        reason=f"New Modmail Issue"
    )
    issue_id = db.store_modmail(ctx.author.id, thread.id, message)
    permissions = Permissions.ADD_REACTIONS | Permissions.SEND_MESSAGES | Permissions.READ_MESSAGE_HISTORY | Permissions.ADD_REACTIONS | Permissions.VIEW_CHANNEL

    logger.debug("Permissions: %s", permissions)
    member_overwrite = PermissionOverwrite(
        id=ctx.author.id,  
        type=1,  # 1 for member, 0 for role
        allow=permissions,
    )
    
    role_overwrites = [
        PermissionOverwrite(
            id=role,
            type=0,
            allow=permissions,
        )
        for role in config.HELPER_ROLES
    ]
 overwrites = [member_overwrite, *role_overwrites]


 await thread.edit(name=f"issue-#{issue_id}", permission_overwrites=overwrites)
thin plinthBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

torpid phoenix
#

for some reason the thread permissions seem to not be being set correctly?

#

when I print the thread.permission_overwrites I get an empty list

#

I've had success just adding them manually