Twitter free plan no longer supports direct messaging, logic change required
Opened this issue · 0 comments
sts-ryan-holton commented
Hi, I recently posted this, but I think it won't initially be possible resolve as the free plan only supports posting tweets, and not running queries.
I wonder whether the logic can be changed to post a tweet via a username, or some workaround implemented for
/**
* Get Twitter direct message receiver.
*
* @return string|mixed
*
* @throws CouldNotSendNotification
*/
public function getReceiver(TwitterOAuth $twitter): mixed
{
if (is_int($this->to)) {
return $this->to;
}
$user = $twitter->get('users/show', [
'screen_name' => $this->to,
'include_user_entities' => false,
'skip_status' => true,
]);
if ($twitter->getLastHttpCode() === 404) {
throw CouldNotSendNotification::userWasNotFound($twitter->getLastBody());
}
return $user->id;
}
As I need to utilise the approach of sending a message to someone's account via their twitter handle