Skip to main content
Cliente para operaciones de direct messages This client provides methods for interacting with the direct messages endpoints of the X API. It handles authentication, request formatting, and response parsing for all direct messages related operations.

Constructores

constructor

new DirectMessagesClient(client): DirectMessagesClient Creates a new direct messages client instance

Parámetros

Devuelve

DirectMessagesClient

Definido en

direct_messages/client.ts:340

Métodos

createByConversationId

createByConversationId(dmConversationId, options): Promise<Response> Create DM message by conversation ID Sends a new direct message to a specific conversation by its ID.

Parámetros

Devuelve

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Definido en

direct_messages/client.ts:385 createByConversationId(dmConversationId, options?): Promise<CreateDmEventResponse>

Parámetros

Devuelve

Promise<CreateDmEventResponse>

Definido en

direct_messages/client.ts:398

getEventsByConversationId

getEventsByConversationId(id, options): Promise<Response> Get DM events for a DM conversation Retrieves direct message events for a specific conversation.

Parámetros

Devuelve

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Definido en

direct_messages/client.ts:506 getEventsByConversationId(id, options?): Promise<Get2DmConversationsIdDmEventsResponse>

Parámetros

Devuelve

Promise<Get2DmConversationsIdDmEventsResponse>

Definido en

direct_messages/client.ts:519

createConversation

createConversation(options): Promise<Response> Create DM conversation Initiates a new direct message conversation with specified participants.

Parámetros

Devuelve

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Definido en

direct_messages/client.ts:784 createConversation(options?): Promise<CreateDmEventResponse>

Parámetros

Devuelve

Promise<CreateDmEventResponse>

Definido en

direct_messages/client.ts:793

getEventsByParticipantId

getEventsByParticipantId(participantId, options): Promise<Response> Get DM events for a DM conversation Retrieves direct message events for a specific conversation.

Parámetros

Devuelve

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Definido en

direct_messages/client.ts:889 getEventsByParticipantId(participantId, options?): Promise<Get2DmConversationsWithParticipantIdDmEventsResponse>

Parámetros

Devuelve

Promise<Get2DmConversationsWithParticipantIdDmEventsResponse>

Definido en

direct_messages/client.ts:902

getEvents

getEvents(options): Promise<Response> Get DM events Retrieves a list of recent direct message events across all conversations.

Parámetros

Devuelve

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Definido en

direct_messages/client.ts:1167 getEvents(options?): Promise<Get2DmEventsResponse>

Parámetros

Devuelve

Promise<Get2DmEventsResponse>

Definido en

direct_messages/client.ts:1176

getEventsById

getEventsById(eventId, options): Promise<Response> Get DM event by ID Retrieves details of a specific direct message event by its ID.

Parámetros

Devuelve

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Definido en

direct_messages/client.ts:1433 getEventsById(eventId, options?): Promise<Get2DmEventsEventIdResponse>

Parámetros

Devuelve

Promise<Get2DmEventsEventIdResponse>

Definido en

direct_messages/client.ts:1446

deleteEvents

deleteEvents(eventId, options): Promise<Response> Delete DM event Deletes a specific direct message event by its ID, if owned by the authenticated user.

Parámetros

Devuelve

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Definido en

direct_messages/client.ts:1656 deleteEvents(eventId): Promise<DeleteDmResponse>

Parámetros

Devuelve

Promise<DeleteDmResponse>

Definido en

direct_messages/client.ts:1669

createByParticipantId

createByParticipantId(participantId, options): Promise<Response> Create DM message by participant ID Sends a new direct message to a specific participant by their ID.

Parámetros

Devuelve

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Definido en

direct_messages/client.ts:1760 createByParticipantId(participantId, options?): Promise<CreateDmEventResponse>

Parámetros

Devuelve

Promise<CreateDmEventResponse>

Definido en

direct_messages/client.ts:1773