From: Utkarsh Upadhyay <502876+musically-ut@users.noreply.github.com> Date: Thu, 2 Jul 2020 18:40:59 +0000 (+0200) Subject: Save raw JSON after extracting the event, if present. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=00b0f71fee790b02f764df8c765d0dc86bc335f5;p=tweepy.git Save raw JSON after extracting the event, if present. Co-authored-by: Harmon --- diff --git a/tweepy/models.py b/tweepy/models.py index 0bbb6d7..6f764c2 100644 --- a/tweepy/models.py +++ b/tweepy/models.py @@ -231,9 +231,9 @@ class DirectMessage(Model): @classmethod def parse(cls, api, json): dm = cls(api) - setattr(dm, '_json', json) if "event" in json: json = json["event"] + setattr(dm, '_json', json) for k, v in json.items(): setattr(dm, k, v) return dm