From df205634fab25f5d9557673d41d6270ef6b1d54b Mon Sep 17 00:00:00 2001 From: Qin Yu Date: Sat, 12 Nov 2022 00:18:05 +0100 Subject: [PATCH] Remove DM event section in docs/expansions_and_fields.rst The documentation for dm_event.fields is different and there are no endpoints with that parameter that return other types of objects, so this section is unnecessary. @Harmon758 have plans to improve this documentation as a whole to include documentation from https://developer.twitter.com/en/docs/twitter-api/expansions, so for now, for consistency, this section shouldn't be here. But if we want some completeness in this doc page before the next big doc improvement (and also for the consistency in Client methods' docstrings), we can put the following code back later just in case people thought the doc is not up-to-date: ```rst .. _dm_event_fields_parameter: ``dm_event_fields`` --------------- Extra fields to include in the event payload. `id`, `text` and `event_type` are returned by default. .. _Direct Message event fields: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/dm-events ``` Co-Authored-By: Harmon --- docs/expansions_and_fields.rst | 33 --------------------------------- tweepy/client.py | 3 +-- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/docs/expansions_and_fields.rst b/docs/expansions_and_fields.rst index 34f1421..2e33bcb 100644 --- a/docs/expansions_and_fields.rst +++ b/docs/expansions_and_fields.rst @@ -157,38 +157,6 @@ Specify the desired fields in a comma-separated list without spaces between commas and fields. These specified user fields will display directly in the user data objects. -.. _dm_event_fields_parameter: - -``dm_event_fields`` ---------------- - -For methods that return DirectMessageEvents, this `fields`_ parameter enables -you to select which specific `Direct Message event fields`_ will deliver in -each returned DirectMessageEvent. Specify the desired fields in a comma- -separated list without spaces between commas and fields. When requesting DM -events, there are three default event object attributes, or fields, included: -``id``, ``event_type``, and ``text``. To receive additional event fields, use -the fields parameter ``dm_event_fields`` to select others. Other available -event fields include the following: ``dm_conversation_id``, ``created_at``, -``sender_id``, ``attachments``, ``participant_ids``, and ``referenced_tweets``. - -Several of these fields provide the IDs of other Twitter objects related to the -Direct Message event: - -* ``sender_id`` - The ID of the account that sent the message, or who invited -a participant to a group conversation -* ``partricipants_ids`` - An array of account IDs. For ParticipantsJoin and -ParticipantsLeave events this array will contain a single ID of the account -that created the event -* ``attachments`` - Provides media IDs for content that has been uploaded to -Twitter by the sender -* ``referenced_tweets`` - If a Tweet URL is found in the text field, the ID of -that Tweet is included in the response - -The ``sender_id``, ``participant_ids``, ``referenced_tweets.id``, and -``attachments.media_keys`` `expansions`_ are available to expand on these Twitter -object IDs. - .. _Expansions: https://developer.twitter.com/en/docs/twitter-api/expansions .. _fields: https://developer.twitter.com/en/docs/twitter-api/fields .. _list fields: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/lists @@ -198,4 +166,3 @@ object IDs. .. _Space fields: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/space .. _Tweet fields: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/tweet .. _user fields: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/user -.. _Direct Message event fields: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/dm-events diff --git a/tweepy/client.py b/tweepy/client.py index d55f135..2afda8e 100644 --- a/tweepy/client.py +++ b/tweepy/client.py @@ -2813,8 +2813,7 @@ class Client(BaseClient): having a 1-1 conversation with. dm_event_fields : list[str] | str | None Extra fields to include in the event payload. ``id``, ``text``, and - ``event_type`` are returned by default. - :ref:`dm_event_fields_parameter` + ``event_type`` are returned by default. event_types : str The type of Direct Message event to returm. If not included, all types are returned. -- 2.25.1