geduldig / TwitterAPI

Minimal python wrapper for Twitter's REST and Streaming APIs
936 stars 263 forks source link

DM Example not working #208

Closed Falimonda closed 2 years ago

Falimonda commented 2 years ago

I am trying to send a direct message using https://github.com/geduldig/TwitterAPI/blob/master/examples/v1.1/direct_message.py

I have confirmed that the api object can successfully make requests to other endpoints and therefore there is no issue with my credentials.

I am using Python 3.9.4 (tags/v3.9.4:1f2e308, Apr 6 2021, 13:40:21) [MSC v.1928 64 bit (AMD64)] on win32

The following error occurs:

$ python direct_message.py Traceback (most recent call last): File "C:\Users\ABC\Documents\Me\git\project\direct_message.py", line 33, in r = api.request('direct_messages/events/new', json.dumps(event)) File "C:\Users\ABC\Documents\Me\git\project\venv\lib\site-packages\TwitterAPI\TwitterAPI .py", line 179, in request params['delimited'] = 'length' TypeError: 'str' object does not support item assignment

geduldig commented 2 years ago

Hi I just uploaded v2.7.10. Can you upgrade and test. Thank you.

Falimonda commented 2 years ago

@geduldig It works now. Cheers.