def check_private_message_policy(realm: Realm, sender: UserProfile, user_profiles: Sequence[UserProfile]) -> None:
    if (realm.private_message_policy == Realm.PRIVATE_MESSAGE_POLICY_DISABLED):
        if (sender.is_bot or ((len(user_profiles) == 1) and user_profiles[0].is_bot)):
            return
        raise JsonableError(_('Private messages are disabled in this organization.'))
def check_private_message_policy(realm: Realm, sender: UserProfile, user_profiles: Sequence[UserProfile]) -> None:
    if (realm.private_message_policy == Realm.PRIVATE_MESSAGE_POLICY_DISABLED):
        if (sender.is_bot or ((len(user_profiles) == 1) and user_profiles[0].is_bot)):
            return
        raise JsonableError(_('Private messages are disabled in this organization.'))