From 9a9fdb25240f5b7a7375894189ae6fd32892661d Mon Sep 17 00:00:00 2001 From: bodombeach Date: Thu, 16 May 2024 17:38:23 +0200 Subject: [PATCH] fix max channels per archive --- src/utils/archive.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/archive.js b/src/utils/archive.js index 8fa4d97..f16bdab 100644 --- a/src/utils/archive.js +++ b/src/utils/archive.js @@ -3,7 +3,7 @@ export const allowedCategories = ['🪂 SORTIES', '🏃Sorties pas rapente', ' export async function archive(channel) { const archiveCategories = channel.guild.channels.cache.filter(channel => channel.type === 4 && channel.name.slice(0,11).toLowerCase() === '📁archives_'); - let available_archive = archiveCategories.find(cat => cat.children.cache.size < 3) + let available_archive = archiveCategories.find(cat => cat.children.cache.size < 50) if (available_archive) { channel.setParent(available_archive) @@ -11,7 +11,7 @@ export async function archive(channel) { // creating a new archive category const count = Math.max(...archiveCategories.map(cat => parseInt(cat.name.split('_')[1]))) available_archive = await channel.guild.channels.create({ - name: `📁archives_${count + 1}`, + name: `📁ARCHIVES_${count + 1}`, type: 4, }) console.log('Created new archive category');