Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check the reposnse from the API #257

Open
3rdxw opened this issue Nov 21, 2024 · 0 comments
Open

check the reposnse from the API #257

3rdxw opened this issue Nov 21, 2024 · 0 comments

Comments

@3rdxw
Copy link

3rdxw commented Nov 21, 2024

using:

        try:
            xclient.load_cookies('cookies.json')
            await xclient.create_tweet(text=message_text)
        except Exception as excpt_:
            print(f"Tweet creation error: {excpt_}")
            msg_ = "Exception Type: {}\n".format(type(excpt_).__name__) \
                    + "Exception Message: {}\n".format(str(excpt_)) \
                    + "Stack Trace:\n" \
                    + "".join(traceback.format_exception(None, excpt_, excpt_.__traceback__))
            print(msg_)

but I need to get the response from the API like is it duplicate or rate limit or whatever it is

I don't want this:

raceback (most recent call last):
File "E:\gggg-master\ggg.py", line 201, in tweet_message
await xclient.create_tweet(text=message_text)
File "C:\Users\fdg\AppData\Local\Programs\Python\Python311\Lib\site-packages\twikit\client\client.py", line 1241, in create_tweet
_result = response['data']['create_tweet']['tweet_results']
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'create_tweet'

this gives no details!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant