if (!
$message instanceof ChatMessage
) { throw new UnsupportedMessageTypeException(__CLASS__, ChatMessage::
class,
$message);
} $options =
$message->
getOptions()?->
toArray() ??
[];
$options['status'
] =
$message->
getSubject();
$response = null;
try { if (isset($options['attach'
])) { $options['media_ids'
] =
$this->
uploadMedia($options['attach'
]);
unset($options['attach'
]);
} $response =
$this->
request('POST', '/api/v1/statuses',
['json' =>
$options]);
$statusCode =
$response->
getStatusCode();
$result =
$response->
toArray(false
);
} catch (ExceptionInterface
$e) { if (null !==
$response) { throw new TransportException($e->
getMessage(),
$response, 0,
$e);
}