Module egg_mode::direct[][src]

Expand description

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.

In some sense, DMs are simpler than Tweets, because there are fewer ways to interact with them and less metadata stored with them. However, there are also separate DM-specific capabilities that are available, to allow users to create a structured conversation for things like customer-service, interactive storytelling, etc. The extra DM-specific facilities are documented in their respective builder functions on DraftMessage.

Types

  • DirectMessage: The primary representation of a DM as retrieved from Twitter. Contains the types DMEntities/Cta/QuickReply as fields.
  • Timeline: Returned by list, this is how you load a user’s Direct Messages. Contains adapters to consume the collection as a Stream or to load it into a DMConversations collection.
  • DraftMessage: As DMs have many optional parameters when creating them, this builder struct allows you to build up a DM before sending it.

Functions

  • list: This creates a Timeline struct to load a user’s Direct Messages.
  • show: This allows you to load a single DM from its ID.
  • delete: This allows you to delete a DM from a user’s own views. Note that it will not delete it entirely from the system; the recipient will still have a copy of the message.
  • mark_read: This sends a read receipt for a given message to a given user. This also has the effect of clearing the message’s “unread” status for the authenticated user.
  • indicate_typing: This sends a typing indicator to a given user, to indicate that the authenticated user is typing or thinking of a response.

Structs

A “call to action” added as a button to a direct message.

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

Represents a single direct message.

Represents a direct message before it is sent.

A Quick Reply attached to a message to request structured input from a user.

Helper struct to navigate collections of direct messages by tracking the status of Twitter’s cursor references.

Functions

Delete the direct message with the given ID.

Displays a visual typing indicator for the recipient.

Load the list of direct messages sent and received by the authorized user.

Marks the given message as read in the sender’s interface.

Lookup a single DM by its numeric ID.

Type Definitions

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