From cb07de82475f8b6b149617591ca63c3da94c69c2 Mon Sep 17 00:00:00 2001 From: Ralph Date: Sun, 18 Apr 2021 22:27:10 -0400 Subject: [PATCH 1/3] Change Max Channel per Category to 49 Addresses https://github.com/kyb3r/modmail/issues/3002 Will add a 1 channel buffer to the check to account for Discord API bugs preventing the category from actually reaching 50 channels. --- core/thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/thread.py b/core/thread.py index 7798454958..c0cb1559e7 100644 --- a/core/thread.py +++ b/core/thread.py @@ -1205,7 +1205,7 @@ async def create( # Schedule thread setup for later cat = self.bot.main_category - if category is None and len(cat.channels) == 50: + if category is None and len(cat.channels) == 49: fallback_id = self.bot.config["fallback_category_id"] if fallback_id: fallback = discord.utils.get(cat.guild.categories, id=int(fallback_id)) From 482fa7e675e5dfbe7d1b9e37443bd02722d3a4fb Mon Sep 17 00:00:00 2001 From: Ralph Date: Mon, 19 Apr 2021 10:11:34 -0400 Subject: [PATCH 2/3] Change comparison to Greater than or equal to Co-authored-by: Jerrie <70805800+Jerrie-Aries@users.noreply.github.com> --- core/thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/thread.py b/core/thread.py index c0cb1559e7..eaaaecb940 100644 --- a/core/thread.py +++ b/core/thread.py @@ -1205,7 +1205,7 @@ async def create( # Schedule thread setup for later cat = self.bot.main_category - if category is None and len(cat.channels) == 49: + if category is None and len(cat.channels) >= 49: fallback_id = self.bot.config["fallback_category_id"] if fallback_id: fallback = discord.utils.get(cat.guild.categories, id=int(fallback_id)) From 36935e7d6a339227ea62e4c22b299b461fe96a4d Mon Sep 17 00:00:00 2001 From: Ralph Date: Thu, 22 Apr 2021 11:56:20 -0400 Subject: [PATCH 3/3] Update thread.py --- core/thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/thread.py b/core/thread.py index eaaaecb940..cd9e477237 100644 --- a/core/thread.py +++ b/core/thread.py @@ -1209,7 +1209,7 @@ async def create( fallback_id = self.bot.config["fallback_category_id"] if fallback_id: fallback = discord.utils.get(cat.guild.categories, id=int(fallback_id)) - if fallback and len(fallback.channels) != 50: + if fallback and len(fallback.channels) < 49: category = fallback if not category: