Note: this implemention can stop working anytime.
v3 | (Recommended) Current |
---|---|
v2 | deprecated |
v1 | experimental. buggy |
Many functions that I may not know are disabled or tricked to keep this client simple.
let client = new TalkClient('TEST_CLIENT');
client.on('message', (chat: Chat) => {
let userInfo = chat.Channel.getUserInfo(chat.Sender);
if (!userInfo) return;
if (chat.Type === ChatType.Search) {
let attachment = chat.AttachmentList[0] as SharpAttachment;
chat.replyText(`${userInfo.Nickname}님이 샵 검색 전송 ${attachment.Question}. 리다이렉트 경로: ${attachment.RedirectURL}`);
}
if (chat.Text === '안녕하세요') {
chat.replyText('안녕하세요 ', new ChatMention(userInfo)); // Ex) 안녕하세요 @storycraft
//chat.Channel.sendTemplate(new AttachmentTemplate(ReplyAttachment.fromChat(chat), '안녕하세요')); // 답장형식
}
});
await client.login('123456789@email.com', '123456' /* nice password k*/, 'random base64 device id');
node-kakao is following MIT License.
hallazzang(pykakao)
ssut(pykakao)
Cai(0x90 :: Cai's Blog)