So I am working on a Twitter bot and during the exceptions I run into a error that causes the program to stop. I am not to sure what is causing it.
I've been searching around trying to figure it out but have had no luck.
Any chance someone can spot the issue.
except tweepy.error.TweepError as e:
error_code = list(e)[0][0].get('code')
if error_code == 327:
print('no need')
elif error_code == 88:
print('wait 16 minutes we have hit limit')
time.sleep(15 * 60)
elif error_code == 226:
print('STOP')
time.sleep(15 * 60)
elif error_code == 261:
print(' banned')
else:
print(str(e))
except AttributeError as e:
print('Something bad has happened')
except Error as e:
print(str(e))
the error it give me is the following:
error_code = list(e)[0][0].get('code')
TypeError: 'TweepError' object is not iterable
any help would be great.