#bot.rest.create_guild_text_channel permission overwrites

1 messages · Page 1 of 1 (latest)

gusty condor
#

i created a slashcommand in lightbulb and now i wonder how to overwrite the permissions of the channel, i want that the default guild role gets the read messages permission removed and the user of the command gets the read messages permission

unique pivot
#
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

gusty condor
#

and how to use hikari.PermissionOverwrite?

gusty condor
#

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

fallen mantle
gusty condor
gusty condor
#

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

fallen mantle
#

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

gusty condor
#

thank u, but idk how to use these build in permission overwrites

fallen mantle
#

the docs explain exactly how

gusty condor
#

and how do i do 2 overwrites?

fallen mantle
#

pass a sequence (list) of overwrite objects to the overwrites paramater of create_guild_text_channel