At a hearing held pursuant to section ten hundred twenty-two of this act at which the respondent is present, the court shall advise the respondent of the allegations in the application and shall appoint counsel for the respondent pursuant to section two hundred sixty-two of this act where the respondent is indigent.