From 026a882d526f04421c05951a91ada237a05d287c Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 3 Mar 2026 20:42:56 -0500 Subject: [PATCH] Raise context menu command limit to 15 to match Discord --- discord/app_commands/tree.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/discord/app_commands/tree.py b/discord/app_commands/tree.py index ce756306a..4db1d83f6 100644 --- a/discord/app_commands/tree.py +++ b/discord/app_commands/tree.py @@ -257,7 +257,7 @@ class CommandTree(Generic[ClientT]): -------- CommandLimitReached The maximum number of commands was reached for that guild. - This is currently 100 for slash commands and 5 for context menu commands. + This is currently 100 for slash commands and 15 for context menu commands. """ try: @@ -277,9 +277,9 @@ class CommandTree(Generic[ClientT]): counter = Counter(cmd_type for _, _, cmd_type in ctx_menu) for cmd_type, count in counter.items(): - if count > 5: + if count > 15: as_enum = AppCommandType(cmd_type) - raise CommandLimitReached(guild_id=guild.id, limit=5, type=as_enum) + raise CommandLimitReached(guild_id=guild.id, limit=15, type=as_enum) self._context_menus.update(ctx_menu) self._guild_commands[guild.id] = mapping @@ -338,7 +338,7 @@ class CommandTree(Generic[ClientT]): Or, ``guild`` and ``guilds`` were both given. CommandLimitReached The maximum number of commands was reached globally or for that guild. - This is currently 100 for slash commands and 5 for context menu commands. + This is currently 100 for slash commands and 15 for context menu commands. """ guild_ids = _retrieve_guild_ids(command, guild, guilds) @@ -361,8 +361,8 @@ class CommandTree(Generic[ClientT]): # read as `0 if override and found else 1` if confusing to_add = not (override and found) total = sum(1 for _, g, t in self._context_menus if g == guild_id and t == type) - if total + to_add > 5: - raise CommandLimitReached(guild_id=guild_id, limit=5, type=AppCommandType(type)) + if total + to_add > 15: + raise CommandLimitReached(guild_id=guild_id, limit=15, type=AppCommandType(type)) data[key] = command if guild_ids is None: