diff --git a/setup.py b/setup.py index 28493868..9968b934 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ 'fake_useragent', 'filetype' ], - python_requires='>=3.8', + python_requires='>=3.9', description='Twitter API wrapper for python with **no API key required**.', long_description=long_description, long_description_content_type='text/markdown', diff --git a/twikit/twikit_async/client.py b/twikit/twikit_async/client.py index e4465caa..ff546e82 100644 --- a/twikit/twikit_async/client.py +++ b/twikit/twikit_async/client.py @@ -866,7 +866,8 @@ async def create_tweet( poll_uri: str | None = None, reply_to: str | None = None, conversation_control: Literal[ - 'followers', 'verified', 'mentioned'] | None = None + 'followers', 'verified', 'mentioned'] | None = None, + attachment_url: str | None = None ) -> Tweet: """ Creates a new tweet on Twitter with the specified @@ -959,6 +960,9 @@ async def create_tweet( 'mode': limit_mode } + if attachment_url is not None: + variables['attachment_url'] = attachment_url + data = { 'variables': variables, 'queryId': get_query_id(Endpoint.CREATE_TWEET), diff --git a/twikit/twikit_async/tweet.py b/twikit/twikit_async/tweet.py index 536ae536..8ad56560 100644 --- a/twikit/twikit_async/tweet.py +++ b/twikit/twikit_async/tweet.py @@ -283,7 +283,8 @@ async def delete_bookmark(self) -> Response: async def reply( self, text: str = '', - media_ids: list[str] | None = None + media_ids: list[str] | None = None, + **kwargs ) -> Tweet: """ Replies to the tweet. @@ -318,7 +319,7 @@ async def reply( `Client.upload_media` """ return await self._client.create_tweet( - text, media_ids, reply_to=self.id + text, media_ids, reply_to=self.id, **kwargs ) async def get_retweeters(