create channel doesn't return channel object

hello i want to create an text channel and store it in variable but after debug variable this value is null what i do incorrect?
let guildChannelId = interaction.guild.channels.create({
name: "informacja-" + channelId,
parent: category.id,
type: ChannelType.GuildText,
permissionOverwrites: [
{
id: interaction.guild.roles.everyone,
deny: [PermissionFlagsBits.ViewChannel],
},
{
id: interaction.user.id,
allow: [PermissionFlagsBits.ViewChannel],
}
]
});
let guildChannelId = interaction.guild.channels.create({
name: "informacja-" + channelId,
parent: category.id,
type: ChannelType.GuildText,
permissionOverwrites: [
{
id: interaction.guild.roles.everyone,
deny: [PermissionFlagsBits.ViewChannel],
},
{
id: interaction.user.id,
allow: [PermissionFlagsBits.ViewChannel],
}
]
});
1 Reply
wisienka
wisienkaOP2y ago
already fixed, variable returns promise so i must to make my interaction as async (for next people with this trouble)
Want results from more Discord servers?
Add your server