#bot.rest.create_guild_text_channel permission overwrites
1 messages · Page 1 of 1 (latest)

channel_created = await ctx.rest.fetch_channel(...)
overwrites_new = hikari.PermissionOverwrite(...)
# or a sequence of over writes using a list that will contain multiple overwrites.
await channel_created.edit(overwrites=overwrites_new)
this might help
and how to use hikari.PermissionOverwrite?
the docs say in great detail how to use it:
https://docs.hikari-py.dev/en/latest/reference/hikari/channels/#hikari.channels.PermissionOverwrite
another question how do i get the id of a channel, which i created with await bot.rest.create_guild_text_channel? i only have the name of the channel
that method returns GuildTextChannel (https://docs.hikari-py.dev/en/latest/reference/hikari/channels/#hikari.channels.GuildTextChannel)
just do .id on it
no need to fetch the channel btw, that's making one extra useless api call
but i want to get the channel id of the channel i just created with await bot.rest.create_guild_text_channel
if u dont really understand what i want i will explain it: i created a slash cmd which creates a channel by given variables and i want overwrite the channel permissions in the sact same slashcommand
I understand you perfectly
channel = bot.rest.create_guild_text_channel(...)
print(channel.id) # your created channel's ID
@gusty condor
and anyway, as the docs say you can set permission overwrites when creating the channel
no need to edit it afterwards
perhaps you could give the documentation a read?
https://docs.hikari-py.dev/en/latest/reference/hikari/api/rest/#hikari.api.rest.RESTClient.create_guild_text_channel
thank u, but idk how to use these build in permission overwrites
and how do i do 2 overwrites?
pass a sequence (list) of overwrite objects to the overwrites paramater of create_guild_text_channel