From dbe5d8633bd7420c60668a76a0b1ee80f27746ae Mon Sep 17 00:00:00 2001 From: Schlauer-Hax Date: Thu, 8 Feb 2024 19:14:37 +0100 Subject: [PATCH] advanced way of creating channels --- main.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/main.ts b/main.ts index e66640f..2ab8a19 100644 --- a/main.ts +++ b/main.ts @@ -191,13 +191,8 @@ client.on('guildMemberUpdate', async (oldMember, newMember) => { const channel = await newMember.guild.channels.create({ name: `link-${newMember.id}`, parent: await newMember.guild.channels.fetch(Deno.env.get("LINK_CATEGORY")!) as CategoryChannel, - permissionOverwrites: [ - { - id: newMember.id, - allow: [ 'ViewChannel' ] - } - ] }); + await channel.permissionOverwrites.create(newMember, { ViewChannel: true }); await channel.send({ content: `<@${newMember.id}> Looks like you just boosted the server! Unfortunately, you are not linked to your BBN account yet. Please send your Email address to this channel to link your account. Our Team will respond as soon as possible.`, allowedMentions: { users: [ newMember.id ] } }); } }