#How to create private channel on button click
1 messages · Page 1 of 1 (latest)
Hey! Once your issue is solved, press the button below to close this thread!
create a channel and then you have to modify the permissions
everyone role should be set to NOT see the channel, and then one user to see it
To change the permissions to the channel through the bot, I have to do something like PermissionOverwrite?
yes
Ok, I'll try
Could you show me a code example?
po = interactions.PermissionOverwrite(id=ctx.guild.id, type=0) # everyone role
po.add_denies(interactions.Permissions.VIEW_CHANNEL)
await ctx.guild.create_channel(channel_type=your_type, name=your_name, permission_overwrites=po)
Should work like this
Super! I just misunderstood what needed to be specified in "type". Thanks for the help.
The channel_type or the normal type in Overwrites?
normal type in Overwrites
type=0 is for roles and type=1 is for users
Thanks