diff --git a/helpers/channels/createChannel.ts b/helpers/channels/createChannel.ts index 58ff87760..5992c30ff 100644 --- a/helpers/channels/createChannel.ts +++ b/helpers/channels/createChannel.ts @@ -22,11 +22,11 @@ export async function createChannel(bot: Bot, guildId: bigint, options?: CreateG position: options.position, parent_id: options.parentId?.toString(), nsfw: options.nsfw, - permission_overwrites: options?.permissionOverwrites?.map((perm) => ({ - id: perm.id.toString(), - type: perm.type, - allow: perm.allow ? bot.utils.calculateBits(perm.allow) : "0", - deny: perm.deny ? bot.utils.calculateBits(perm.deny) : "0", + permission_overwrites: options?.permissionOverwrites?.map((overwrite) => ({ + id: overwrite.id.toString(), + type: overwrite.type, + allow: overwrite.allow ? bot.utils.calculateBits(overwrite.allow) : null, + deny: overwrite.deny ? bot.utils.calculateBits(overwrite.deny) : null, })), type: options?.type || ChannelTypes.GuildText, reason, diff --git a/helpers/channels/editChannel.ts b/helpers/channels/editChannel.ts index 8e67ec0b2..9c6455795 100644 --- a/helpers/channels/editChannel.ts +++ b/helpers/channels/editChannel.ts @@ -46,13 +46,12 @@ export async function editChannel(bot: Bot, channelId: bigint, options: ModifyCh locked: options.locked, invitable: options.invitable, permission_overwrites: options.permissionOverwrites - ? options.permissionOverwrites?.map((overwrite) => { - return { - ...overwrite, - allow: overwrite.allow ? bot.utils.calculateBits(overwrite.allow) : "0", - deny: overwrite.deny ? bot.utils.calculateBits(overwrite.deny) : "0", - }; - }) + ? options.permissionOverwrites?.map((overwrite) => ({ + id: overwrite.id.toString(), + type: overwrite.type, + allow: overwrite.allow ? bot.utils.calculateBits(overwrite.allow) : null, + deny: overwrite.deny ? bot.utils.calculateBits(overwrite.deny) : null, + })) : undefined, reason, });