Skip to Content
Nazu

AudioChat

음성 메세지

확장

속성

속성수정자타입설명상속받은 타입:
attachmentreadonlyAttachment첨부 데이터. 첨부가 없으면 빈 객체MessageChat.attachment
idreadonlystring메세지 로그 IDMessageChat.id
originTypereadonlynumbertype에서 삭제 표시(0x4000)를 뺀 메세지 타입 번호 1 일반, 2 사진, 3 동영상, 5 음성, 12·20·25 이모티콘, 17 프로필, 18 파일, 26 답장, 27 여러 장의 사진, 100 지도. 카카오맵 공유가 아닌 100과 모르는 번호는 MessageChat으로 받습니다.MessageChat.originType
rawreadonlyMessageChatRaw메세지 원본 데이터MessageChat.raw
textreadonlystring메세지 내용MessageChat.text
threadIdreadonlystring | null스레드 ID. 스레드에 속하지 않으면 nullMessageChat.threadId
typereadonlynumber받은 메세지 타입 번호. 삭제된 메세지는 삭제 표시(0x4000)가 더해져 있습니다.MessageChat.type
userreadonlyUser | null메세지를 보냈거나 피드와 관련된 유저. 정보가 없으면 nullUnknownFeedChat.user

접근자

audio

get 시그니쳐

get audio(): AudioAttachment;

음성 정보

반환값

AudioAttachment

command

get 시그니쳐

get command(): string;

text에서 첫 번째 띄어쓰기 앞부분. 띄어쓰기가 없으면 메세지 전체

반환값

string

상속받은 타입:

MessageChat.command

mentions

get 시그니쳐

get mentions(): Promise<User[]>;

중복 없이 모은 멘션 유저 목록. 멘션이 없으면 빈 배열

반환값

Promise<User[]>

상속받은 타입:

MessageChat.mentions

param

get 시그니쳐

get param(): string;

text에서 첫 번째 띄어쓰기 뒤의 나머지. 띄어쓰기가 없으면 빈 문자열

반환값

string

상속받은 타입:

MessageChat.param

readMembers

get 시그니쳐

get readMembers(): Promise<User[]>;

이 메세지를 읽은 유저 목록

반환값

Promise<User[]>

상속받은 타입:

MessageChat.readMembers

unreadMembers

get 시그니쳐

get unreadMembers(): Promise<User[]>;

이 메세지를 읽지 않은 유저 목록

반환값

Promise<User[]>

상속받은 타입:

MessageChat.unreadMembers

메서드

getAttachment()

getAttachment<T>(): Partial<T>;

첨부 데이터를 원하는 타입으로 가져옵니다. 데이터가 그 타입과 맞는지는 확인하지 않습니다.

타입 매개변수

타입 매개변수기본 타입
T extends AttachmentAttachment

반환값

Partial<T>

상속받은 타입:

MessageChat.getAttachment

getNextChat()

getNextChat(count?): Promise<MessageChat | null>;

이 메세지보다 뒤의 메세지를 조회합니다. 없으면 null

매개변수

매개변수타입기본값설명
count?number1뒤로 갈 개수. 소수점 아래는 버리고, 0이면 이 메세지를, 음수면 앞쪽 메세지를 돌려줍니다.

반환값

Promise<MessageChat | null>

상속받은 타입:

MessageChat.getNextChat

getPrevChat()

getPrevChat(count?): Promise<MessageChat | null>;

이 메세지보다 앞의 메세지를 조회합니다. 없으면 null

매개변수

매개변수타입기본값설명
count?number1앞으로 갈 개수. 소수점 아래는 버리고, 0이면 이 메세지를, 음수면 뒤쪽 메세지를 돌려줍니다.

반환값

Promise<MessageChat | null>

상속받은 타입:

MessageChat.getPrevChat

getSource()

getSource(): Promise<MessageChat>;

답장이나 스레드의 원본 메세지를 조회합니다. 답장은 첨부 데이터의 src_logId를, 그 밖에는 threadId를 씁니다.

반환값

Promise<MessageChat>

Throws

원본 메세지 ID가 없을 때

상속받은 타입:

MessageChat.getSource

isAudio()

isAudio(): this is AudioChat;

음성 여부

반환값

this is AudioChat

오버라이드 대상:

MessageChat.isAudio

isEmoticon()

isEmoticon(): this is EmoticonChat;

이모티콘 여부

반환값

this is EmoticonChat

상속받은 타입:

MessageChat.isEmoticon

isFeedChat()

isFeedChat(): this is FeedChat;

피드 여부

반환값

this is FeedChat

상속받은 타입:

MessageChat.isFeedChat

isFile()

isFile(): this is FileChat;

파일 여부

반환값

this is FileChat

상속받은 타입:

MessageChat.isFile

isMap()

isMap(): this is MapChat;

지도 여부

반환값

this is MapChat

상속받은 타입:

MessageChat.isMap

isMessageChat()

isMessageChat(): this is MessageChat;

메세지 여부

반환값

this is MessageChat

상속받은 타입:

MessageChat.isMessageChat

isMiniEmoticon()

isMiniEmoticon(): this is MiniEmoticonChat;

미니 이모티콘이 들어 있는 메세지 여부

반환값

this is MiniEmoticonChat

상속받은 타입:

MessageChat.isMiniEmoticon

isMultiPhoto()

isMultiPhoto(): this is MultiPhotoChat;

여러 장의 사진 여부

반환값

this is MultiPhotoChat

상속받은 타입:

MessageChat.isMultiPhoto

isNormal()

isNormal(): this is NormalChat;

일반 메세지 여부

반환값

this is NormalChat

상속받은 타입:

MessageChat.isNormal

isPhoto()

isPhoto(): this is PhotoChat;

사진 여부

반환값

this is PhotoChat

상속받은 타입:

MessageChat.isPhoto

isProfile()

isProfile(): this is ProfileChat;

프로필 공유 여부

반환값

this is ProfileChat

상속받은 타입:

MessageChat.isProfile

isReply()

isReply(): boolean;

답장이거나 스레드에 속한 메세지 여부. 타입을 좁히지 않으므로 ReplyChat인지는 chat instanceof ReplyChat으로 확인하세요.

반환값

boolean

상속받은 타입:

MessageChat.isReply

isVideo()

isVideo(): this is VideoChat;

동영상 여부

반환값

this is VideoChat

상속받은 타입:

MessageChat.isVideo

On this page