def METHOD_NAME(self, channel_name: str) -> Optional[str]:
    if self.is_admin:
        endpoint = "channels/search"
        url = self._get_full_mattermost_url(endpoint)
        payload = {"term": channel_name}
        if self.team_id:
            payload["team_ids"] = [self.team_id]
    else:
        endpoint = f"teams/{self.team_id}/channels/search"
        url = self._get_full_mattermost_url(endpoint)
        payload = {"term": channel_name}
    response = self._send_mattermost_request(url, HttpMethod.POST, json=payload)
    if check_response_succeed(response):
        response = response.json()
        if not len(response):
            return None
        return response[0].get("id")