From 00b0f71fee790b02f764df8c765d0dc86bc335f5 Mon Sep 17 00:00:00 2001 From: Utkarsh Upadhyay <502876+musically-ut@users.noreply.github.com> Date: Thu, 2 Jul 2020 20:40:59 +0200 Subject: [PATCH] Save raw JSON after extracting the event, if present. Co-authored-by: Harmon --- tweepy/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.25.1