Class Command.Executor

  • Enclosing class:
    Command

    public static class Command.Executor
    extends Object
    This class is used to help define the executor of certain command. There is some special methods used to give more details of this executor.
    • Method Detail

      • setPermission

        @NotNull
        @Deprecated
        public @NotNull Command.Executor setPermission​(@NotNull
                                                       @NotNull net.mamoe.mirai.contact.MemberPermission permission)
        Deprecated.
        Set the executor Mirai Permission (Only if the CommandSender has the command that this executor belongs to and this executor's permissions, this executor runs)
        Parameters:
        permission - the executor Mirai Permission
        Returns:
        the Executor itself
      • setPermission

        @NotNull
        public @NotNull Command.Executor setPermission​(@NotNull
                                                       @NotNull CommandPermission permission)
        Set the executor Mirai Permission (Only if the CommandSender has the command that this executor belongs to and this executor's permissions, this executor runs)
        Parameters:
        permission - the executor Mirai Permission
        Returns:
        the Executor itself
      • setCommandResultExecutors

        @NotNull
        public @NotNull Command.Executor setCommandResultExecutors​(@NotNull
                                                                   @NotNull CommandResult result,
                                                                   @NotNull
                                                                   @NotNull CommandResultExecutor executor)
        Set the executor of the special CommandResult after executing this Executor
        Parameters:
        result - the target CommandResult
        executor - the executor of the special CommandResult
        Returns:
        the Executor itself
      • setExecutorPermission

        @NotNull
        public @NotNull Command.Executor setExecutorPermission​(@NotNull
                                                               @NotNull java.util.function.Predicate<CommandSender> executorPermission)
        Set the executor permission check for this Executor When execute this Executor, it will check Command.executorPermission and the executorPermission
        Parameters:
        executorPermission - the executor permission check for this Executor
        Returns:
        the Executor self
      • removeExecutorPermission

        @NotNull
        public @NotNull Command.Executor removeExecutorPermission()
        Remove the executor permission check for this Executor
        Returns:
        the Executor self
      • overrideExecutorPermission

        @NotNull
        public @NotNull Command.Executor overrideExecutorPermission​(@NotNull
                                                                    @NotNull java.util.function.Predicate<CommandSender> executorPermission)
        Set the executor permission check for this Executor When execute this Executor, it will only check the executorPermission
        Parameters:
        executorPermission - the executor permission check for this Executor
        Returns:
        the Executor self
      • getCommand

        public Command getCommand()
        Get the command this Executor belongs to
        Returns:
        the command this Executor belongs to