000o0 / node-kakao

Loco protocol compatible library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NodeKakao - Loco protocol compatible library

Note: this implemention can stop working anytime.

Version Information

v3 (Recommended) Current
v2 deprecated
v1 experimental. buggy

Warning

Many functions that I may not know are disabled or tricked to keep this client simple.

Example code

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');

License

node-kakao is following MIT License.

Basic Reference

hallazzang(pykakao)
ssut(pykakao)
Cai(0x90 :: Cai's Blog)

About

Loco protocol compatible library

License:MIT License


Languages

Language:TypeScript 100.0%