메인 콘텐츠로 건너뛰기
다이렉트 메시지 작업용 클라이언트 이 클라이언트는 X API의 다이렉트 메시지 엔드포인트와 상호작용하기 위한 메서드를 제공합니다. 다이렉트 메시지 관련 모든 작업에 대해 인증, 요청 서식화, 응답 파싱을 처리합니다.

생성자

constructor

new DirectMessagesClient(client): DirectMessagesClient 새 다이렉트 메시지 클라이언트 인스턴스를 생성합니다

매개변수

이름타입설명
clientClient주요 X API 클라이언트 인스턴스

반환값

DirectMessagesClient

정의됨

direct_messages/client.ts:211

메서드

getEvents

getEvents(options?): Promise<Get2DmEventsResponse> DM 이벤트 가져오기 모든 대화에서 최근 다이렉트 메시지 이벤트의 목록을 조회합니다.

매개변수

이름타입
optionsGetEventsOptions

반환

Promise<Get2DmEventsResponse> API 응답으로 이행되는 Promise

정의됨

direct_messages/client.ts:224

getEventsByParticipantId

getEventsByParticipantId(participantId, options?): Promise<Get2DmConversationsWithParticipantIdDmEventsResponse> DM 대화의 DM 이벤트 가져오기 특정 대화의 다이렉트 메시지 이벤트를 가져옵니다.

매개변수

이름유형설명
participantIdstring일대일 DM 대화의 참여자 사용자 id입니다.
optionsGetEventsByParticipantIdOptions-

반환

Promise<Get2DmConversationsWithParticipantIdDmEventsResponse> API 응답으로 이행되는 Promise

정의됨

direct_messages/client.ts:311

createByConversationId

createByConversationId(dmConversationId, options?): Promise<CreateDmEventResponse> 대화 ID로 DM 메시지 생성 지정한 ID의 특정 대화에 새 다이렉트 메시지를 보냅니다.

매개변수

이름유형설명
dmConversationIdstringDM 대화 id.
optionsCreateByConversationIdOptions-

반환

Promise<CreateDmEventResponse> API 응답으로 이행되는 Promise

정의 위치

direct_messages/client.ts:406

createByParticipantId

createByParticipantId(participantId, options?): Promise<CreateDmEventResponse> 참가자 ID로 DM 메시지 생성 지정한 참가자의 ID로 새 다이렉트 메시지를 보냅니다.

매개변수

이름타입설명
participantIdstringDM을 받을 대상 사용자의 id입니다.
optionsCreateByParticipantIdOptions-

반환값

Promise<CreateDmEventResponse> API 응답으로 이행되는 Promise

정의됨

direct_messages/client.ts:457

getEventsByConversationId

getEventsByConversationId(id, options?): Promise<Get2DmConversationsIdDmEventsResponse> DM 대화의 DM 이벤트 가져오기 특정 대화의 다이렉트 메시지 이벤트를 조회합니다.

매개변수

이름유형설명
idstringDM 대화 id입니다.
optionsGetEventsByConversationIdOptions-

반환

Promise<Get2DmConversationsIdDmEventsResponse> API 응답으로 이행되는 Promise

정의 위치

direct_messages/client.ts:508

getEventsById

getEventsById(eventId, options?): Promise<Get2DmEventsEventIdResponse> ID로 DM 이벤트 가져오기 지정된 ID의 특정 다이렉트 메시지 이벤트 세부 정보를 조회합니다.

매개변수

이름타입설명
eventIdstringDM 이벤트 id.
optionsGetEventsByIdOptions-

반환

Promise<Get2DmEventsEventIdResponse> API 응답으로 해결되는 Promise

정의 위치

direct_messages/client.ts:600

deleteEvents

deleteEvents(eventId): Promise<DeleteDmResponse> DM 이벤트 삭제 인증된 사용자가 소유한 경우, 지정한 ID의 다이렉트 메시지 이벤트를 삭제합니다.

매개변수

이름유형설명
eventIdstring삭제할 다이렉트 메시지 이벤트의 id입니다.

반환

Promise<DeleteDmResponse> API 응답으로 해소되는 Promise

정의됨

direct_messages/client.ts:674

createConversation

createConversation(options?): Promise<CreateDmEventResponse> DM 대화 생성 지정된 참여자와 새 다이렉트 메시지 대화를 시작합니다.

매개변수

이름유형
optionsCreateConversationOptions

반환

Promise<CreateDmEventResponse> API 응답으로 해결되는 Promise

정의됨

direct_messages/client.ts:708