EHN: Save the raw JSON on DirectMessages as well.
authorUtkarsh Upadhyay <502876+musically-ut@users.noreply.github.com>
Mon, 23 Mar 2020 08:51:30 +0000 (09:51 +0100)
committerGitHub <noreply@github.com>
Mon, 23 Mar 2020 08:51:30 +0000 (09:51 +0100)
This brings the behavior of the `DirectMessage` model in line with other `Model`s.

tweepy/models.py

index 03620678e933626fae0f79b794ce1f01afa894c3..0bbb6d7c929722c4abde015e26cdda0093d67f0e 100644 (file)
@@ -231,6 +231,7 @@ class DirectMessage(Model):
     @classmethod
     def parse(cls, api, json):
         dm = cls(api)
+        setattr(dm, '_json', json)
         if "event" in json:
             json = json["event"]
         for k, v in json.items():