Hello, I'm trying to setup an auto-delete feature on created secret channels after x number of minutes but I'm not sure how to achieve this..
Here's the code I made:
@commands.has_any_role(*roles)
async def open(ctx: discord.ApplicationContext, channel):
"""Creates a private text channel""" # description
guild = ctx.guild
category = bot.get_channel(category_id)
overwrites = {
guild.default_role: discord.PermissionOverwrite(read_messages=False),
ctx.author: discord.PermissionOverwrite(read_messages=True, send_messages=True, add_reactions=True, read_message_history=True, manage_channels=True)
}
channel_name = await guild.create_text_channel(name='{}'.format(channel), category=category, overwrites=overwrites)
embed = discord.Embed(
title = 'Success!',
description = "Channel: {} has been successfully created.".format(channel_name.mention)
)
await ctx.respond(embed=embed, ephemeral=True)```
I tried setting the overwrite from ctx.author to guild.me but I can't access it after the channel was created. Please advise? Thanks in advance.

