Skip to content

Commit

Permalink
help.py: Use variable for max amount of commands per cog help
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenChen committed Oct 5, 2024
1 parent bf43b1c commit 998ef4e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions utils/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from utils.views import BasePaginator, BasePaginatedView

SELECT_MAX_VALUES = 25
COG_MAX_COMMANDS = 96


class CategoryHelpPaginator(BasePaginator):
Expand Down Expand Up @@ -279,9 +280,9 @@ async def send_cog_help(self, cog: Cog):
# 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:

if len(commands) > 100: # Workaround some cogs having way too many commands, let's go gambling
if len(commands) > COG_MAX_COMMANDS: # Workaround some cogs having way too many commands, let's go gambling
random.shuffle(commands)
commands = commands[:96]
commands = commands[:COG_MAX_COMMANDS]
commands.sort(key=lambda x: x.name)

for batch in batched(commands, SELECT_MAX_VALUES - 1):
Expand Down

0 comments on commit 998ef4e

Please sign in to comment.