Update src/helpers/channels/clone_channel.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>
This commit is contained in:
Skillz4Killz
2021-04-14 08:47:21 -04:00
committed by GitHub
parent 6063bc0aff
commit 4183ffd21d
+2 -6
View File
@@ -15,14 +15,10 @@ export async function cloneChannel(channelId: string, reason?: string) {
//If "name" is undefined as specified by types //If "name" is undefined as specified by types
channelToClone.name ??= "new-channel"; channelToClone.name ??= "new-channel";
//Merge channel data with reason for createChannel options
const creationData = {
reason,
...channelToClone,
};
//Create the channel (also handles permissions) //Create the channel (also handles permissions)
return createChannel( return createChannel(
channelToClone.guildId!, channelToClone.guildId!,
creationData as CreateGuildChannel channelToClone,
reason,
); );
} }