Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
d60 authored Mar 28, 2024
1 parent 3c15854 commit 994c854
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 5 additions & 1 deletion twikit/twikit_async/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down
5 changes: 3 additions & 2 deletions twikit/twikit_async/tweet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 994c854

Please sign in to comment.