[GH-ISSUE #43] AttributeError: 'NoneType' object has no attribute 'text' #8

Closed
opened 2026-09-02 13:08:55 +02:00 by TheLovinator · 2 comments
Owner

Originally created by @GioveWasTaken on GitHub (Jun 8, 2022).
Original GitHub issue: https://github.com/TheLovinator1/discord-twitter-webhooks/issues/43

Hi Joakim!
I got a new error, something which happen randomly for some reason. Here is the log.

17:12:16 ERROR Stream encountered an exception
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\discord-twitter-webhooks-KyRCDMAP-py3.9\lib\site-packages\tweepy\streaming.py", line 91, in _connect
    self.on_data(line)
  File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\discord-twitter-webhooks-KyRCDMAP-py3.9\lib\site-packages\tweepy\streaming.py", line 928, in on_data
    self.on_response(
  File "C:\Users\Administrator\Desktop\Nintendo Italia\Twitter Nintendo\discord_twitter_webhooks\main.py", line 114, in on_response
    main(response)
  File "C:\Users\Administrator\Desktop\Nintendo Italia\Twitter Nintendo\discord_twitter_webhooks\main.py", line 48, in main
    text = data.text
AttributeError: 'NoneType' object has no attribute 'text'
17:12:16 INFO Stream disconnected

After i got this message, i simply restart the stream with poetry, but this happen like every couple of days.

Originally created by @GioveWasTaken on GitHub (Jun 8, 2022). Original GitHub issue: https://github.com/TheLovinator1/discord-twitter-webhooks/issues/43 Hi Joakim! I got a new error, something which happen randomly for some reason. Here is the log. ``` 17:12:16 ERROR Stream encountered an exception Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\discord-twitter-webhooks-KyRCDMAP-py3.9\lib\site-packages\tweepy\streaming.py", line 91, in _connect self.on_data(line) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\discord-twitter-webhooks-KyRCDMAP-py3.9\lib\site-packages\tweepy\streaming.py", line 928, in on_data self.on_response( File "C:\Users\Administrator\Desktop\Nintendo Italia\Twitter Nintendo\discord_twitter_webhooks\main.py", line 114, in on_response main(response) File "C:\Users\Administrator\Desktop\Nintendo Italia\Twitter Nintendo\discord_twitter_webhooks\main.py", line 48, in main text = data.text AttributeError: 'NoneType' object has no attribute 'text' 17:12:16 INFO Stream disconnected ``` After i got this message, i simply restart the stream with poetry, but this happen like every couple of days.
Author
Owner

@TheLovinator1 commented on GitHub (Jun 15, 2022):

Hi,

Sorry for the late reply. I think the error is on Twitters side and not mine. I made it so the bot won't crash when no text is found. (I think, just write back if it didn't work lol)

Do you still have a URL to a tweets that breaks the bot?

Is there any other bug that I need to fix? Did you use my README when figuring out how to use rules? Was there anything there that was confusing that I need to expand on?

~TheLovinator

<!-- gh-comment-id:1157007034 --> @TheLovinator1 commented on GitHub (Jun 15, 2022): Hi, Sorry for the late reply. I think the error is on Twitters side and not mine. I made it so the bot won't crash when no text is found. (I think, just write back if it didn't work lol) Do you still have a URL to a tweets that breaks the bot? Is there any other bug that I need to fix? Did you use my README when figuring out how to use rules? Was there anything there that was confusing that I need to expand on? ~TheLovinator
Author
Owner

@GioveWasTaken commented on GitHub (Jun 23, 2022):

Hey!
Now the bot works flawless! if you want a link just for your curiosity, you can check this one: https://twitter.com/Sora_Sakurai/status/1537268726852210689

<!-- gh-comment-id:1164067316 --> @GioveWasTaken commented on GitHub (Jun 23, 2022): Hey! Now the bot works flawless! if you want a link just for your curiosity, you can check this one: https://twitter.com/Sora_Sakurai/status/1537268726852210689
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TheLovinator/discord-twitter-webhooks#8
No description provided.