diff --git a/utils/help.py b/utils/help.py index 00e569ee..7ba3532e 100644 --- a/utils/help.py +++ b/utils/help.py @@ -1,4 +1,5 @@ import discord +import random import math from discord import Interaction @@ -277,6 +278,11 @@ async def send_cog_help(self, cog: Cog): # All my homies hate Assistance # If there is >25 commands create multiple Selects and add a suffix indicating what commands are inside [A-C] if len(commands) > SELECT_MAX_VALUES: + # Workaround some cogs having way too many commands, let's go gambling + if len(commands) > 100: + random.shuffle(commands) + commands = commands[:100] + commands.sort(key=lambda x: x.name) for i in range(0, len(commands), SELECT_MAX_VALUES - 1): view.add_item(CommandSelect(cog, commands[i:i + SELECT_MAX_VALUES - 1], self.context, suffix=f"[{commands[i].name[0].upper()}-{commands[i:i + SELECT_MAX_VALUES - 2][-1].name[0].upper()}]"))