[][src]Module egg_mode::direct

👎 Deprecated since 0.15:

the direct message endpoints used in this module are no longer in service, and this module has not been migrated over to the DM Events API

Structs and methods for working with direct messages.

Note that direct message access requires a special permissions level above regular read/write access. Your app must be configured to have "read, write, and direct message" access to use any function in this module, even the read-only ones.

Although the Twitter website and official apps display DMs as threads between the authenticated user and specific other users, the API does not expose them like this. Separate calls to received and sent are necessary to fully reconstruct a DM thread. You can partition on sender_id/receiver_id and sort by their created_at to weave the streams together.

Types

  • DirectMessage/DMEntities: A single DM and its associated entities. The DMEntities struct contains information about URLs, user mentions, and hashtags in the DM.
  • Timeline: Effectively the same as tweet::Timeline, but gives out DirectMessages instead. Returned by functions that traverse collections of DMs.
  • ConversationTimeline/DMConversations: This struct and alias are part of the "conversations" wrapper for loading direct messages into per-recipient threads.

Functions

Lookup

These functions pull a user's DMs for viewing. sent and received can be cursored with sub-views like with tweets, so they return a Timeline instance that can be navigated at will.

  • sent
  • received
  • show
  • conversations

Actions

These functions are your basic write access to DMs. As a DM does not carry as much metadata as a tweet, the send action does not go through a builder struct like with DraftTweet.

  • send
  • delete

Structs

ConversationTimelineDeprecated

Helper struct to load both sent and received direct messages, pre-sorting them into conversations by their recipient.

DMEntitiesDeprecated

Container for URL, hashtag, mention, and media information associated with a direct message.

DirectMessageDeprecated

Represents a single direct message.

TimelineDeprecated

Helper struct to navigate collections of direct messages by requesting DMs older or newer than certain IDs.

Functions

conversationsDeprecated

Create a ConversationTimeline loader that can load direct messages as a collection of pre-sorted conversations.

deleteDeprecated

Delete the direct message with the given ID.

receivedDeprecated

Create a Timeline struct to navigate the direct messages received by the authenticated user.

sendDeprecated

Send a new direct message to the given user.

sentDeprecated

Create a Timeline struct to navigate the direct messages sent by the authenticated user.

showDeprecated

Lookup a single DM by its numeric ID.

Type Definitions

DMConversationsDeprecated

Wrapper around a collection of direct messages, sorted by their recipient.