AudioChat
음성 메세지
확장
속성
| 속성 | 수정자 | 타입 | 설명 | 상속받은 타입: |
|---|---|---|---|---|
attachment | readonly | Attachment | 첨부 데이터. 첨부가 없으면 빈 객체 | MessageChat.attachment |
id | readonly | string | 메세지 로그 ID | MessageChat.id |
originType | readonly | number | type에서 삭제 표시(0x4000)를 뺀 메세지 타입 번호 1 일반, 2 사진, 3 동영상, 5 음성, 12·20·25 이모티콘, 17 프로필, 18 파일, 26 답장, 27 여러 장의 사진, 100 지도. 카카오맵 공유가 아닌 100과 모르는 번호는 MessageChat으로 받습니다. | MessageChat.originType |
raw | readonly | MessageChatRaw | 메세지 원본 데이터 | MessageChat.raw |
text | readonly | string | 메세지 내용 | MessageChat.text |
threadId | readonly | string | null | 스레드 ID. 스레드에 속하지 않으면 null | MessageChat.threadId |
type | readonly | number | 받은 메세지 타입 번호. 삭제된 메세지는 삭제 표시(0x4000)가 더해져 있습니다. | MessageChat.type |
user | readonly | User | null | 메세지를 보냈거나 피드와 관련된 유저. 정보가 없으면 null | UnknownFeedChat.user |
접근자
audio
get 시그니쳐
get audio(): AudioAttachment;음성 정보
반환값
command
get 시그니쳐
get command(): string;text에서 첫 번째 띄어쓰기 앞부분. 띄어쓰기가 없으면 메세지 전체
반환값
string
상속받은 타입:
mentions
get 시그니쳐
get mentions(): Promise<User[]>;중복 없이 모은 멘션 유저 목록. 멘션이 없으면 빈 배열
반환값
Promise<User[]>
상속받은 타입:
param
get 시그니쳐
get param(): string;text에서 첫 번째 띄어쓰기 뒤의 나머지. 띄어쓰기가 없으면 빈 문자열
반환값
string
상속받은 타입:
readMembers
get 시그니쳐
get readMembers(): Promise<User[]>;이 메세지를 읽은 유저 목록
반환값
Promise<User[]>
상속받은 타입:
unreadMembers
get 시그니쳐
get unreadMembers(): Promise<User[]>;이 메세지를 읽지 않은 유저 목록
반환값
Promise<User[]>
상속받은 타입:
메서드
getAttachment()
getAttachment<T>(): Partial<T>;첨부 데이터를 원하는 타입으로 가져옵니다. 데이터가 그 타입과 맞는지는 확인하지 않습니다.
타입 매개변수
| 타입 매개변수 | 기본 타입 |
|---|---|
T extends Attachment | Attachment |
반환값
Partial<T>
상속받은 타입:
getNextChat()
getNextChat(count?): Promise<MessageChat | null>;이 메세지보다 뒤의 메세지를 조회합니다. 없으면 null
매개변수
| 매개변수 | 타입 | 기본값 | 설명 |
|---|---|---|---|
count? | number | 1 | 뒤로 갈 개수. 소수점 아래는 버리고, 0이면 이 메세지를, 음수면 앞쪽 메세지를 돌려줍니다. |
반환값
Promise<MessageChat | null>
상속받은 타입:
getPrevChat()
getPrevChat(count?): Promise<MessageChat | null>;이 메세지보다 앞의 메세지를 조회합니다. 없으면 null
매개변수
| 매개변수 | 타입 | 기본값 | 설명 |
|---|---|---|---|
count? | number | 1 | 앞으로 갈 개수. 소수점 아래는 버리고, 0이면 이 메세지를, 음수면 뒤쪽 메세지를 돌려줍니다. |
반환값
Promise<MessageChat | null>
상속받은 타입:
getSource()
getSource(): Promise<MessageChat>;답장이나 스레드의 원본 메세지를 조회합니다. 답장은 첨부 데이터의 src_logId를, 그 밖에는 threadId를 씁니다.
반환값
Promise<MessageChat>
Throws
원본 메세지 ID가 없을 때
상속받은 타입:
isAudio()
isAudio(): this is AudioChat;음성 여부
반환값
this is AudioChat
오버라이드 대상:
isEmoticon()
isEmoticon(): this is EmoticonChat;이모티콘 여부
반환값
this is EmoticonChat
상속받은 타입:
isFeedChat()
isFeedChat(): this is FeedChat;피드 여부
반환값
this is FeedChat
상속받은 타입:
isFile()
isFile(): this is FileChat;파일 여부
반환값
this is FileChat
상속받은 타입:
isMap()
isMap(): this is MapChat;지도 여부
반환값
this is MapChat
상속받은 타입:
isMessageChat()
isMessageChat(): this is MessageChat;메세지 여부
반환값
this is MessageChat
상속받은 타입:
isMiniEmoticon()
isMiniEmoticon(): this is MiniEmoticonChat;미니 이모티콘이 들어 있는 메세지 여부
반환값
this is MiniEmoticonChat
상속받은 타입:
isMultiPhoto()
isMultiPhoto(): this is MultiPhotoChat;여러 장의 사진 여부
반환값
this is MultiPhotoChat
상속받은 타입:
isNormal()
isNormal(): this is NormalChat;일반 메세지 여부
반환값
this is NormalChat
상속받은 타입:
isPhoto()
isPhoto(): this is PhotoChat;사진 여부
반환값
this is PhotoChat
상속받은 타입:
isProfile()
isProfile(): this is ProfileChat;프로필 공유 여부
반환값
this is ProfileChat
상속받은 타입:
isReply()
isReply(): boolean;답장이거나 스레드에 속한 메세지 여부.
타입을 좁히지 않으므로 ReplyChat인지는 chat instanceof ReplyChat으로 확인하세요.
반환값
boolean
상속받은 타입:
isVideo()
isVideo(): this is VideoChat;동영상 여부
반환값
this is VideoChat