INNER CODE UNIT · Python
schedule_reply
trevorhobenshield/twitter-api-client · twitter/account.py:193
def schedule_reply(self, text: str, date: int | str, tweet_id: int, *, media: list = None) -> dict:
variables = {
'post_tweet_request': {
'auto_populate_reply_metadata': True,
'in_reply_to_status_id': tweet_id,
'status': text,
'exclude_reply_user_ids': [],
'media_ids': [],
},
'execute_at': (
datetime.strptime(date, "%Y-%m-%d %H:%M").timestamp()
if isinstance(date, str)
else date
),
}
if media:
for m in media:
media_id = self._upload_media(m['media'])