@@ -346,13 +346,6 @@ class PrefixedCommand(BaseCommand):
346
346
),
347
347
default = True ,
348
348
)
349
- hierarchical_checking : bool = attrs .field (
350
- metadata = docs (
351
- "If `True` and if the base of a subcommand, every subcommand underneath it will run this command's checks"
352
- " and cooldowns before its own. Otherwise, only the subcommand's checks are checked."
353
- ),
354
- default = True ,
355
- )
356
349
help : Optional [str ] = attrs .field (repr = False , metadata = docs ("The long help text for the command." ), default = None )
357
350
brief : Optional [str ] = attrs .field (repr = False , metadata = docs ("The short help text for the command." ), default = None )
358
351
parent : Optional ["PrefixedCommand" ] = attrs .field (
@@ -638,7 +631,7 @@ def subcommand(
638
631
enabled : bool = True ,
639
632
hidden : bool = False ,
640
633
ignore_extra : bool = True ,
641
- hierarchical_checking : bool = True ,
634
+ inherit_checks : bool = True ,
642
635
) -> Callable [..., Self ]:
643
636
"""
644
637
A decorator to declare a subcommand for a prefixed command.
@@ -654,8 +647,7 @@ def subcommand(
654
647
hidden: If `True`, the default help command (when it is added) does not show this in the help output.
655
648
ignore_extra: If `True`, ignores extraneous strings passed to a command if all its requirements are met \
656
649
(e.g. ?foo a b c when only expecting a and b). Otherwise, an error is raised.
657
- hierarchical_checking: If `True` and if the base of a subcommand, every subcommand underneath it will \
658
- run this command's checks before its own. Otherwise, only the subcommand's checks are checked.
650
+ inherit_checks: If `True`, the subcommand will inherit its checks from the parent command.
659
651
"""
660
652
661
653
def wrapper (func : Callable ) -> Self :
@@ -670,7 +662,7 @@ def wrapper(func: Callable) -> Self:
670
662
enabled = enabled ,
671
663
hidden = hidden ,
672
664
ignore_extra = ignore_extra ,
673
- hierarchical_checking = hierarchical_checking ,
665
+ checks = self . checks if inherit_checks else [] ,
674
666
)
675
667
self .add_command (cmd )
676
668
return cmd
@@ -776,7 +768,6 @@ def prefixed_command(
776
768
enabled : bool = True ,
777
769
hidden : bool = False ,
778
770
ignore_extra : bool = True ,
779
- hierarchical_checking : bool = True ,
780
771
) -> Callable [..., PrefixedCommand ]:
781
772
"""
782
773
A decorator to declare a coroutine as a prefixed command.
@@ -792,8 +783,6 @@ def prefixed_command(
792
783
hidden: If `True`, the default help command (when it is added) does not show this in the help output.
793
784
ignore_extra: If `True`, ignores extraneous strings passed to a command if all its requirements are \
794
785
met (e.g. ?foo a b c when only expecting a and b). Otherwise, an error is raised.
795
- hierarchical_checking: If `True` and if the base of a subcommand, every subcommand underneath it will \
796
- run this command's checks before its own. Otherwise, only the subcommand's checks are checked.
797
786
"""
798
787
799
788
def wrapper (func : Callable ) -> PrefixedCommand :
@@ -807,7 +796,6 @@ def wrapper(func: Callable) -> PrefixedCommand:
807
796
enabled = enabled ,
808
797
hidden = hidden ,
809
798
ignore_extra = ignore_extra ,
810
- hierarchical_checking = hierarchical_checking ,
811
799
)
812
800
813
801
return wrapper
0 commit comments